-- Copyright (c) 2024 Huawei Technologies Co., Ltd.
-- openUBMC is licensed under Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at:
--          http://license.coscl.org.cn/MulanPSL2
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
-- EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-- MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-- See the Mulan PSL v2 for more details.
local validate = require 'mc.validate'
local utils = require 'mc.utils'
local mdb = require 'mc.mdb'

local AirCoolingConfig = {}

---@class AirCoolingConfig.SpeedDeviationThresholdPercent
---@field SpeedDeviationThresholdPercent integer
local TSpeedDeviationThresholdPercent = {}
TSpeedDeviationThresholdPercent.__index = TSpeedDeviationThresholdPercent
TSpeedDeviationThresholdPercent.group = {}

local function TSpeedDeviationThresholdPercent_from_obj(obj)
    return setmetatable(obj, TSpeedDeviationThresholdPercent)
end

function TSpeedDeviationThresholdPercent.new(SpeedDeviationThresholdPercent)
    return TSpeedDeviationThresholdPercent_from_obj({
        SpeedDeviationThresholdPercent = SpeedDeviationThresholdPercent or 25
    })
end
---@param obj AirCoolingConfig.SpeedDeviationThresholdPercent
function TSpeedDeviationThresholdPercent:init_from_obj(obj)
    self.SpeedDeviationThresholdPercent = obj.SpeedDeviationThresholdPercent or 25
end

function TSpeedDeviationThresholdPercent:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSpeedDeviationThresholdPercent.group)
end

TSpeedDeviationThresholdPercent.from_obj = TSpeedDeviationThresholdPercent_from_obj

TSpeedDeviationThresholdPercent.proto_property = {'SpeedDeviationThresholdPercent'}

TSpeedDeviationThresholdPercent.default = {0}

TSpeedDeviationThresholdPercent.struct = {{name = 'SpeedDeviationThresholdPercent', is_array = false, struct = nil}}

function TSpeedDeviationThresholdPercent:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'SpeedDeviationThresholdPercent', self.SpeedDeviationThresholdPercent, 'uint8', false,
        errs, need_convert)

    if self.SpeedDeviationThresholdPercent ~= nil then
        validate.ranges(prefix .. 'SpeedDeviationThresholdPercent', self.SpeedDeviationThresholdPercent, 10, 100, errs,
            need_convert)
    end

    TSpeedDeviationThresholdPercent:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSpeedDeviationThresholdPercent.proto_property, errs, need_convert)
    return self
end

function TSpeedDeviationThresholdPercent:unpack(_)
    return self.SpeedDeviationThresholdPercent
end

AirCoolingConfig.SpeedDeviationThresholdPercent = TSpeedDeviationThresholdPercent

---@class AirCoolingConfig.ActiveAlgorithm
---@field ActiveAlgorithm string
local TActiveAlgorithm = {}
TActiveAlgorithm.__index = TActiveAlgorithm
TActiveAlgorithm.group = {}

local function TActiveAlgorithm_from_obj(obj)
    return setmetatable(obj, TActiveAlgorithm)
end

function TActiveAlgorithm.new(ActiveAlgorithm)
    return TActiveAlgorithm_from_obj({ActiveAlgorithm = ActiveAlgorithm or [=[N/A]=]})
end
---@param obj AirCoolingConfig.ActiveAlgorithm
function TActiveAlgorithm:init_from_obj(obj)
    self.ActiveAlgorithm = obj.ActiveAlgorithm or [=[N/A]=]
end

function TActiveAlgorithm:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TActiveAlgorithm.group)
end

TActiveAlgorithm.from_obj = TActiveAlgorithm_from_obj

TActiveAlgorithm.proto_property = {'ActiveAlgorithm'}

TActiveAlgorithm.default = {''}

TActiveAlgorithm.struct = {{name = 'ActiveAlgorithm', is_array = false, struct = nil}}

function TActiveAlgorithm:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ActiveAlgorithm', self.ActiveAlgorithm, 'string', true, errs, need_convert)

    TActiveAlgorithm:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TActiveAlgorithm.proto_property, errs, need_convert)
    return self
end

function TActiveAlgorithm:unpack(_)
    return self.ActiveAlgorithm
end

AirCoolingConfig.ActiveAlgorithm = TActiveAlgorithm

---@class AirCoolingConfig.InitialSpeedPercent
---@field InitialSpeedPercent integer
local TInitialSpeedPercent = {}
TInitialSpeedPercent.__index = TInitialSpeedPercent
TInitialSpeedPercent.group = {}

local function TInitialSpeedPercent_from_obj(obj)
    return setmetatable(obj, TInitialSpeedPercent)
end

function TInitialSpeedPercent.new(InitialSpeedPercent)
    return TInitialSpeedPercent_from_obj({InitialSpeedPercent = InitialSpeedPercent or 100})
end
---@param obj AirCoolingConfig.InitialSpeedPercent
function TInitialSpeedPercent:init_from_obj(obj)
    self.InitialSpeedPercent = obj.InitialSpeedPercent or 100
end

function TInitialSpeedPercent:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TInitialSpeedPercent.group)
end

TInitialSpeedPercent.from_obj = TInitialSpeedPercent_from_obj

TInitialSpeedPercent.proto_property = {'InitialSpeedPercent'}

TInitialSpeedPercent.default = {0}

TInitialSpeedPercent.struct = {{name = 'InitialSpeedPercent', is_array = false, struct = nil}}

function TInitialSpeedPercent:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'InitialSpeedPercent', self.InitialSpeedPercent, 'uint8', false, errs, need_convert)

    if self.InitialSpeedPercent ~= nil then
        validate.ranges(prefix .. 'InitialSpeedPercent', self.InitialSpeedPercent, 0, 100, errs, need_convert)
    end

    TInitialSpeedPercent:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TInitialSpeedPercent.proto_property, errs, need_convert)
    return self
end

function TInitialSpeedPercent:unpack(_)
    return self.InitialSpeedPercent
end

AirCoolingConfig.InitialSpeedPercent = TInitialSpeedPercent

---@class AirCoolingConfig.MinAllowedSpeedPercent
---@field MinAllowedSpeedPercent integer
local TMinAllowedSpeedPercent = {}
TMinAllowedSpeedPercent.__index = TMinAllowedSpeedPercent
TMinAllowedSpeedPercent.group = {}

local function TMinAllowedSpeedPercent_from_obj(obj)
    return setmetatable(obj, TMinAllowedSpeedPercent)
end

function TMinAllowedSpeedPercent.new(MinAllowedSpeedPercent)
    return TMinAllowedSpeedPercent_from_obj({MinAllowedSpeedPercent = MinAllowedSpeedPercent or 255})
end
---@param obj AirCoolingConfig.MinAllowedSpeedPercent
function TMinAllowedSpeedPercent:init_from_obj(obj)
    self.MinAllowedSpeedPercent = obj.MinAllowedSpeedPercent or 255
end

function TMinAllowedSpeedPercent:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TMinAllowedSpeedPercent.group)
end

TMinAllowedSpeedPercent.from_obj = TMinAllowedSpeedPercent_from_obj

TMinAllowedSpeedPercent.proto_property = {'MinAllowedSpeedPercent'}

TMinAllowedSpeedPercent.default = {0}

TMinAllowedSpeedPercent.struct = {{name = 'MinAllowedSpeedPercent', is_array = false, struct = nil}}

function TMinAllowedSpeedPercent:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'MinAllowedSpeedPercent', self.MinAllowedSpeedPercent, 'uint8', false, errs,
        need_convert)

    TMinAllowedSpeedPercent:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TMinAllowedSpeedPercent.proto_property, errs, need_convert)
    return self
end

function TMinAllowedSpeedPercent:unpack(_)
    return self.MinAllowedSpeedPercent
end

AirCoolingConfig.MinAllowedSpeedPercent = TMinAllowedSpeedPercent

---@class AirCoolingConfig.SpeedPercentRange
---@field SpeedPercentRange integer[]
local TSpeedPercentRange = {}
TSpeedPercentRange.__index = TSpeedPercentRange
TSpeedPercentRange.group = {}

local function TSpeedPercentRange_from_obj(obj)
    return setmetatable(obj, TSpeedPercentRange)
end

function TSpeedPercentRange.new(SpeedPercentRange)
    return TSpeedPercentRange_from_obj({SpeedPercentRange = SpeedPercentRange})
end
---@param obj AirCoolingConfig.SpeedPercentRange
function TSpeedPercentRange:init_from_obj(obj)
    self.SpeedPercentRange = obj.SpeedPercentRange
end

function TSpeedPercentRange:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSpeedPercentRange.group)
end

TSpeedPercentRange.from_obj = TSpeedPercentRange_from_obj

TSpeedPercentRange.proto_property = {'SpeedPercentRange'}

TSpeedPercentRange.default = {{}}

TSpeedPercentRange.struct = {{name = 'SpeedPercentRange', is_array = true, struct = nil}}

function TSpeedPercentRange:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.OptionalArray(prefix .. 'SpeedPercentRange', self.SpeedPercentRange, 'uint8', true, errs, need_convert)

    TSpeedPercentRange:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSpeedPercentRange.proto_property, errs, need_convert)
    return self
end

function TSpeedPercentRange:unpack(_)
    return self.SpeedPercentRange
end

AirCoolingConfig.SpeedPercentRange = TSpeedPercentRange

---@class AirCoolingConfig.ManualSpeedPercentPoweroffPersist
---@field ManualSpeedPercentPoweroffPersist integer
local TManualSpeedPercentPoweroffPersist = {}
TManualSpeedPercentPoweroffPersist.__index = TManualSpeedPercentPoweroffPersist
TManualSpeedPercentPoweroffPersist.group = {}

local function TManualSpeedPercentPoweroffPersist_from_obj(obj)
    return setmetatable(obj, TManualSpeedPercentPoweroffPersist)
end

function TManualSpeedPercentPoweroffPersist.new(ManualSpeedPercentPoweroffPersist)
    return TManualSpeedPercentPoweroffPersist_from_obj({
        ManualSpeedPercentPoweroffPersist = ManualSpeedPercentPoweroffPersist or 0
    })
end
---@param obj AirCoolingConfig.ManualSpeedPercentPoweroffPersist
function TManualSpeedPercentPoweroffPersist:init_from_obj(obj)
    self.ManualSpeedPercentPoweroffPersist = obj.ManualSpeedPercentPoweroffPersist or 0
end

function TManualSpeedPercentPoweroffPersist:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TManualSpeedPercentPoweroffPersist.group)
end

TManualSpeedPercentPoweroffPersist.from_obj = TManualSpeedPercentPoweroffPersist_from_obj

TManualSpeedPercentPoweroffPersist.proto_property = {'ManualSpeedPercentPoweroffPersist'}

TManualSpeedPercentPoweroffPersist.default = {0}

TManualSpeedPercentPoweroffPersist.struct = {
    {name = 'ManualSpeedPercentPoweroffPersist', is_array = false, struct = nil}
}

function TManualSpeedPercentPoweroffPersist:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ManualSpeedPercentPoweroffPersist', self.ManualSpeedPercentPoweroffPersist, 'uint8',
        true, errs, need_convert)

    if self.ManualSpeedPercentPoweroffPersist ~= nil then
        validate.ranges(prefix .. 'ManualSpeedPercentPoweroffPersist', self.ManualSpeedPercentPoweroffPersist, 0, 100,
            errs, need_convert)
    end

    TManualSpeedPercentPoweroffPersist:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TManualSpeedPercentPoweroffPersist.proto_property, errs, need_convert)
    return self
end

function TManualSpeedPercentPoweroffPersist:unpack(_)
    return self.ManualSpeedPercentPoweroffPersist
end

AirCoolingConfig.ManualSpeedPercentPoweroffPersist = TManualSpeedPercentPoweroffPersist

---@class AirCoolingConfig.ManualSpeedPercentResetPersist
---@field ManualSpeedPercentResetPersist integer
local TManualSpeedPercentResetPersist = {}
TManualSpeedPercentResetPersist.__index = TManualSpeedPercentResetPersist
TManualSpeedPercentResetPersist.group = {}

local function TManualSpeedPercentResetPersist_from_obj(obj)
    return setmetatable(obj, TManualSpeedPercentResetPersist)
end

function TManualSpeedPercentResetPersist.new(ManualSpeedPercentResetPersist)
    return TManualSpeedPercentResetPersist_from_obj({
        ManualSpeedPercentResetPersist = ManualSpeedPercentResetPersist or 0
    })
end
---@param obj AirCoolingConfig.ManualSpeedPercentResetPersist
function TManualSpeedPercentResetPersist:init_from_obj(obj)
    self.ManualSpeedPercentResetPersist = obj.ManualSpeedPercentResetPersist or 0
end

function TManualSpeedPercentResetPersist:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TManualSpeedPercentResetPersist.group)
end

TManualSpeedPercentResetPersist.from_obj = TManualSpeedPercentResetPersist_from_obj

TManualSpeedPercentResetPersist.proto_property = {'ManualSpeedPercentResetPersist'}

TManualSpeedPercentResetPersist.default = {0}

TManualSpeedPercentResetPersist.struct = {{name = 'ManualSpeedPercentResetPersist', is_array = false, struct = nil}}

function TManualSpeedPercentResetPersist:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ManualSpeedPercentResetPersist', self.ManualSpeedPercentResetPersist, 'uint8', true,
        errs, need_convert)

    if self.ManualSpeedPercentResetPersist ~= nil then
        validate.ranges(prefix .. 'ManualSpeedPercentResetPersist', self.ManualSpeedPercentResetPersist, 0, 100, errs,
            need_convert)
    end

    TManualSpeedPercentResetPersist:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TManualSpeedPercentResetPersist.proto_property, errs, need_convert)
    return self
end

function TManualSpeedPercentResetPersist:unpack(_)
    return self.ManualSpeedPercentResetPersist
end

AirCoolingConfig.ManualSpeedPercentResetPersist = TManualSpeedPercentResetPersist

---@class AirCoolingConfig.ManualSpeedPercent
---@field ManualSpeedPercent integer
local TManualSpeedPercent = {}
TManualSpeedPercent.__index = TManualSpeedPercent
TManualSpeedPercent.group = {}

local function TManualSpeedPercent_from_obj(obj)
    return setmetatable(obj, TManualSpeedPercent)
end

function TManualSpeedPercent.new(ManualSpeedPercent)
    return TManualSpeedPercent_from_obj({ManualSpeedPercent = ManualSpeedPercent or 10})
end
---@param obj AirCoolingConfig.ManualSpeedPercent
function TManualSpeedPercent:init_from_obj(obj)
    self.ManualSpeedPercent = obj.ManualSpeedPercent or 10
end

function TManualSpeedPercent:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TManualSpeedPercent.group)
end

TManualSpeedPercent.from_obj = TManualSpeedPercent_from_obj

TManualSpeedPercent.proto_property = {'ManualSpeedPercent'}

TManualSpeedPercent.default = {0}

TManualSpeedPercent.struct = {{name = 'ManualSpeedPercent', is_array = false, struct = nil}}

function TManualSpeedPercent:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'ManualSpeedPercent', self.ManualSpeedPercent, 'uint8', true, errs, need_convert)

    if self.ManualSpeedPercent ~= nil then
        validate.ranges(prefix .. 'ManualSpeedPercent', self.ManualSpeedPercent, 0, 100, errs, need_convert)
    end

    TManualSpeedPercent:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TManualSpeedPercent.proto_property, errs, need_convert)
    return self
end

function TManualSpeedPercent:unpack(_)
    return self.ManualSpeedPercent
end

AirCoolingConfig.ManualSpeedPercent = TManualSpeedPercent

---@class AirCoolingConfig.TimeOut
---@field TimeOut integer
local TTimeOut = {}
TTimeOut.__index = TTimeOut
TTimeOut.group = {}

local function TTimeOut_from_obj(obj)
    return setmetatable(obj, TTimeOut)
end

function TTimeOut.new(TimeOut)
    return TTimeOut_from_obj({TimeOut = TimeOut or 30})
end
---@param obj AirCoolingConfig.TimeOut
function TTimeOut:init_from_obj(obj)
    self.TimeOut = obj.TimeOut or 30
end

function TTimeOut:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TTimeOut.group)
end

TTimeOut.from_obj = TTimeOut_from_obj

TTimeOut.proto_property = {'TimeOut'}

TTimeOut.default = {0}

TTimeOut.struct = {{name = 'TimeOut', is_array = false, struct = nil}}

function TTimeOut:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'TimeOut', self.TimeOut, 'uint32', true, errs, need_convert)

    TTimeOut:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TTimeOut.proto_property, errs, need_convert)
    return self
end

function TTimeOut:unpack(_)
    return self.TimeOut
end

AirCoolingConfig.TimeOut = TTimeOut

---@class AirCoolingConfig.CtrlModePoweroffPersist
---@field CtrlModePoweroffPersist string
local TCtrlModePoweroffPersist = {}
TCtrlModePoweroffPersist.__index = TCtrlModePoweroffPersist
TCtrlModePoweroffPersist.group = {}

local function TCtrlModePoweroffPersist_from_obj(obj)
    return setmetatable(obj, TCtrlModePoweroffPersist)
end

function TCtrlModePoweroffPersist.new(CtrlModePoweroffPersist)
    return TCtrlModePoweroffPersist_from_obj({CtrlModePoweroffPersist = CtrlModePoweroffPersist or [=[Auto]=]})
end
---@param obj AirCoolingConfig.CtrlModePoweroffPersist
function TCtrlModePoweroffPersist:init_from_obj(obj)
    self.CtrlModePoweroffPersist = obj.CtrlModePoweroffPersist or [=[Auto]=]
end

function TCtrlModePoweroffPersist:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TCtrlModePoweroffPersist.group)
end

TCtrlModePoweroffPersist.from_obj = TCtrlModePoweroffPersist_from_obj

TCtrlModePoweroffPersist.proto_property = {'CtrlModePoweroffPersist'}

TCtrlModePoweroffPersist.default = {''}

TCtrlModePoweroffPersist.struct = {{name = 'CtrlModePoweroffPersist', is_array = false, struct = nil}}

function TCtrlModePoweroffPersist:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CtrlModePoweroffPersist', self.CtrlModePoweroffPersist, 'string', true, errs,
        need_convert)

    TCtrlModePoweroffPersist:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TCtrlModePoweroffPersist.proto_property, errs, need_convert)
    return self
end

function TCtrlModePoweroffPersist:unpack(_)
    return self.CtrlModePoweroffPersist
end

AirCoolingConfig.CtrlModePoweroffPersist = TCtrlModePoweroffPersist

---@class AirCoolingConfig.CtrlModeResetPersist
---@field CtrlModeResetPersist string
local TCtrlModeResetPersist = {}
TCtrlModeResetPersist.__index = TCtrlModeResetPersist
TCtrlModeResetPersist.group = {}

local function TCtrlModeResetPersist_from_obj(obj)
    return setmetatable(obj, TCtrlModeResetPersist)
end

function TCtrlModeResetPersist.new(CtrlModeResetPersist)
    return TCtrlModeResetPersist_from_obj({CtrlModeResetPersist = CtrlModeResetPersist or [=[Auto]=]})
end
---@param obj AirCoolingConfig.CtrlModeResetPersist
function TCtrlModeResetPersist:init_from_obj(obj)
    self.CtrlModeResetPersist = obj.CtrlModeResetPersist or [=[Auto]=]
end

function TCtrlModeResetPersist:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TCtrlModeResetPersist.group)
end

TCtrlModeResetPersist.from_obj = TCtrlModeResetPersist_from_obj

TCtrlModeResetPersist.proto_property = {'CtrlModeResetPersist'}

TCtrlModeResetPersist.default = {''}

TCtrlModeResetPersist.struct = {{name = 'CtrlModeResetPersist', is_array = false, struct = nil}}

function TCtrlModeResetPersist:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CtrlModeResetPersist', self.CtrlModeResetPersist, 'string', true, errs, need_convert)

    TCtrlModeResetPersist:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TCtrlModeResetPersist.proto_property, errs, need_convert)
    return self
end

function TCtrlModeResetPersist:unpack(_)
    return self.CtrlModeResetPersist
end

AirCoolingConfig.CtrlModeResetPersist = TCtrlModeResetPersist

---@class AirCoolingConfig.CtrlModePersistType
---@field CtrlModePersistType integer
local TCtrlModePersistType = {}
TCtrlModePersistType.__index = TCtrlModePersistType
TCtrlModePersistType.group = {}

local function TCtrlModePersistType_from_obj(obj)
    return setmetatable(obj, TCtrlModePersistType)
end

function TCtrlModePersistType.new(CtrlModePersistType)
    return TCtrlModePersistType_from_obj({CtrlModePersistType = CtrlModePersistType or 0})
end
---@param obj AirCoolingConfig.CtrlModePersistType
function TCtrlModePersistType:init_from_obj(obj)
    self.CtrlModePersistType = obj.CtrlModePersistType or 0
end

function TCtrlModePersistType:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TCtrlModePersistType.group)
end

TCtrlModePersistType.from_obj = TCtrlModePersistType_from_obj

TCtrlModePersistType.proto_property = {'CtrlModePersistType'}

TCtrlModePersistType.default = {0}

TCtrlModePersistType.struct = {{name = 'CtrlModePersistType', is_array = false, struct = nil}}

function TCtrlModePersistType:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CtrlModePersistType', self.CtrlModePersistType, 'uint8', true, errs, need_convert)

    TCtrlModePersistType:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TCtrlModePersistType.proto_property, errs, need_convert)
    return self
end

function TCtrlModePersistType:unpack(_)
    return self.CtrlModePersistType
end

AirCoolingConfig.CtrlModePersistType = TCtrlModePersistType

---@class AirCoolingConfig.CtrlMode
---@field CtrlMode string
local TCtrlMode = {}
TCtrlMode.__index = TCtrlMode
TCtrlMode.group = {}

local function TCtrlMode_from_obj(obj)
    return setmetatable(obj, TCtrlMode)
end

function TCtrlMode.new(CtrlMode)
    return TCtrlMode_from_obj({CtrlMode = CtrlMode or [=[Auto]=]})
end
---@param obj AirCoolingConfig.CtrlMode
function TCtrlMode:init_from_obj(obj)
    self.CtrlMode = obj.CtrlMode or [=[Auto]=]
end

function TCtrlMode:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TCtrlMode.group)
end

TCtrlMode.from_obj = TCtrlMode_from_obj

TCtrlMode.proto_property = {'CtrlMode'}

TCtrlMode.default = {''}

TCtrlMode.struct = {{name = 'CtrlMode', is_array = false, struct = nil}}

function TCtrlMode:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CtrlMode', self.CtrlMode, 'string', true, errs, need_convert)

    if self.CtrlMode ~= nil then
        validate.Enum(prefix .. 'CtrlMode', self.CtrlMode, '', {'Auto', 'Manual', 'Mixed'}, errs, need_convert)
    end

    TCtrlMode:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TCtrlMode.proto_property, errs, need_convert)
    return self
end

function TCtrlMode:unpack(_)
    return self.CtrlMode
end

AirCoolingConfig.CtrlMode = TCtrlMode

---@class AirCoolingConfig.SetManualSpeedPercentRsp
local TSetManualSpeedPercentRsp = {}
TSetManualSpeedPercentRsp.__index = TSetManualSpeedPercentRsp
TSetManualSpeedPercentRsp.group = {}

local function TSetManualSpeedPercentRsp_from_obj(obj)
    return setmetatable(obj, TSetManualSpeedPercentRsp)
end

function TSetManualSpeedPercentRsp.new()
    return TSetManualSpeedPercentRsp_from_obj({})
end
---@param obj AirCoolingConfig.SetManualSpeedPercentRsp
function TSetManualSpeedPercentRsp:init_from_obj(obj)

end

function TSetManualSpeedPercentRsp:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetManualSpeedPercentRsp.group)
end

TSetManualSpeedPercentRsp.from_obj = TSetManualSpeedPercentRsp_from_obj

TSetManualSpeedPercentRsp.proto_property = {}

TSetManualSpeedPercentRsp.default = {}

TSetManualSpeedPercentRsp.struct = {}

function TSetManualSpeedPercentRsp:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    TSetManualSpeedPercentRsp:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetManualSpeedPercentRsp.proto_property, errs, need_convert)
    return self
end

function TSetManualSpeedPercentRsp:unpack(_)
end

AirCoolingConfig.SetManualSpeedPercentRsp = TSetManualSpeedPercentRsp

---@class AirCoolingConfig.SetManualSpeedPercentReq
---@field FanId integer
---@field SpeedPercent integer
local TSetManualSpeedPercentReq = {}
TSetManualSpeedPercentReq.__index = TSetManualSpeedPercentReq
TSetManualSpeedPercentReq.group = {}

local function TSetManualSpeedPercentReq_from_obj(obj)
    return setmetatable(obj, TSetManualSpeedPercentReq)
end

function TSetManualSpeedPercentReq.new(FanId, SpeedPercent)
    return TSetManualSpeedPercentReq_from_obj({FanId = FanId, SpeedPercent = SpeedPercent})
end
---@param obj AirCoolingConfig.SetManualSpeedPercentReq
function TSetManualSpeedPercentReq:init_from_obj(obj)
    self.FanId = obj.FanId
    self.SpeedPercent = obj.SpeedPercent
end

function TSetManualSpeedPercentReq:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetManualSpeedPercentReq.group)
end

TSetManualSpeedPercentReq.from_obj = TSetManualSpeedPercentReq_from_obj

TSetManualSpeedPercentReq.proto_property = {'FanId', 'SpeedPercent'}

TSetManualSpeedPercentReq.default = {0, 0}

TSetManualSpeedPercentReq.struct = {
    {name = 'FanId', is_array = false, struct = nil}, {name = 'SpeedPercent', is_array = false, struct = nil}
}

function TSetManualSpeedPercentReq:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'FanId', self.FanId, 'uint8', false, errs, need_convert)
    validate.Optional(prefix .. 'SpeedPercent', self.SpeedPercent, 'uint8', false, errs, need_convert)

    TSetManualSpeedPercentReq:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetManualSpeedPercentReq.proto_property, errs, need_convert)
    return self
end

function TSetManualSpeedPercentReq:unpack(_)
    return self.FanId, self.SpeedPercent
end

AirCoolingConfig.SetManualSpeedPercentReq = TSetManualSpeedPercentReq

---@class AirCoolingConfig.SetCtrlModePersistRsp
local TSetCtrlModePersistRsp = {}
TSetCtrlModePersistRsp.__index = TSetCtrlModePersistRsp
TSetCtrlModePersistRsp.group = {}

local function TSetCtrlModePersistRsp_from_obj(obj)
    return setmetatable(obj, TSetCtrlModePersistRsp)
end

function TSetCtrlModePersistRsp.new()
    return TSetCtrlModePersistRsp_from_obj({})
end
---@param obj AirCoolingConfig.SetCtrlModePersistRsp
function TSetCtrlModePersistRsp:init_from_obj(obj)

end

function TSetCtrlModePersistRsp:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetCtrlModePersistRsp.group)
end

TSetCtrlModePersistRsp.from_obj = TSetCtrlModePersistRsp_from_obj

TSetCtrlModePersistRsp.proto_property = {}

TSetCtrlModePersistRsp.default = {}

TSetCtrlModePersistRsp.struct = {}

function TSetCtrlModePersistRsp:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    TSetCtrlModePersistRsp:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetCtrlModePersistRsp.proto_property, errs, need_convert)
    return self
end

function TSetCtrlModePersistRsp:unpack(_)
end

AirCoolingConfig.SetCtrlModePersistRsp = TSetCtrlModePersistRsp

---@class AirCoolingConfig.SetCtrlModePersistReq
---@field CtrlMode string
---@field CtrlModePersistType integer
---@field Timeout integer
local TSetCtrlModePersistReq = {}
TSetCtrlModePersistReq.__index = TSetCtrlModePersistReq
TSetCtrlModePersistReq.group = {}

local function TSetCtrlModePersistReq_from_obj(obj)
    return setmetatable(obj, TSetCtrlModePersistReq)
end

function TSetCtrlModePersistReq.new(CtrlMode, CtrlModePersistType, Timeout)
    return TSetCtrlModePersistReq_from_obj({
        CtrlMode = CtrlMode,
        CtrlModePersistType = CtrlModePersistType,
        Timeout = Timeout
    })
end
---@param obj AirCoolingConfig.SetCtrlModePersistReq
function TSetCtrlModePersistReq:init_from_obj(obj)
    self.CtrlMode = obj.CtrlMode
    self.CtrlModePersistType = obj.CtrlModePersistType
    self.Timeout = obj.Timeout
end

function TSetCtrlModePersistReq:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetCtrlModePersistReq.group)
end

TSetCtrlModePersistReq.from_obj = TSetCtrlModePersistReq_from_obj

TSetCtrlModePersistReq.proto_property = {'CtrlMode', 'CtrlModePersistType', 'Timeout'}

TSetCtrlModePersistReq.default = {'', 0, 0}

TSetCtrlModePersistReq.struct = {
    {name = 'CtrlMode', is_array = false, struct = nil}, {name = 'CtrlModePersistType', is_array = false, struct = nil},
    {name = 'Timeout', is_array = false, struct = nil}
}

function TSetCtrlModePersistReq:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CtrlMode', self.CtrlMode, 'string', false, errs, need_convert)
    validate.Optional(prefix .. 'CtrlModePersistType', self.CtrlModePersistType, 'uint8', false, errs, need_convert)
    validate.Optional(prefix .. 'Timeout', self.Timeout, 'uint32', false, errs, need_convert)

    if self.CtrlMode ~= nil then
        validate.Enum(prefix .. 'CtrlMode', self.CtrlMode, '', {'Auto', 'Manual', 'Mixed'}, errs, need_convert)
    end

    TSetCtrlModePersistReq:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetCtrlModePersistReq.proto_property, errs, need_convert)
    return self
end

function TSetCtrlModePersistReq:unpack(_)
    return self.CtrlMode, self.CtrlModePersistType, self.Timeout
end

AirCoolingConfig.SetCtrlModePersistReq = TSetCtrlModePersistReq

---@class AirCoolingConfig.SetCtrlModeRsp
local TSetCtrlModeRsp = {}
TSetCtrlModeRsp.__index = TSetCtrlModeRsp
TSetCtrlModeRsp.group = {}

local function TSetCtrlModeRsp_from_obj(obj)
    return setmetatable(obj, TSetCtrlModeRsp)
end

function TSetCtrlModeRsp.new()
    return TSetCtrlModeRsp_from_obj({})
end
---@param obj AirCoolingConfig.SetCtrlModeRsp
function TSetCtrlModeRsp:init_from_obj(obj)

end

function TSetCtrlModeRsp:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetCtrlModeRsp.group)
end

TSetCtrlModeRsp.from_obj = TSetCtrlModeRsp_from_obj

TSetCtrlModeRsp.proto_property = {}

TSetCtrlModeRsp.default = {}

TSetCtrlModeRsp.struct = {}

function TSetCtrlModeRsp:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    TSetCtrlModeRsp:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetCtrlModeRsp.proto_property, errs, need_convert)
    return self
end

function TSetCtrlModeRsp:unpack(_)
end

AirCoolingConfig.SetCtrlModeRsp = TSetCtrlModeRsp

---@class AirCoolingConfig.SetCtrlModeReq
---@field CtrlMode string
---@field Timeout integer
local TSetCtrlModeReq = {}
TSetCtrlModeReq.__index = TSetCtrlModeReq
TSetCtrlModeReq.group = {}

local function TSetCtrlModeReq_from_obj(obj)
    return setmetatable(obj, TSetCtrlModeReq)
end

function TSetCtrlModeReq.new(CtrlMode, Timeout)
    return TSetCtrlModeReq_from_obj({CtrlMode = CtrlMode, Timeout = Timeout})
end
---@param obj AirCoolingConfig.SetCtrlModeReq
function TSetCtrlModeReq:init_from_obj(obj)
    self.CtrlMode = obj.CtrlMode
    self.Timeout = obj.Timeout
end

function TSetCtrlModeReq:remove_error_props(errs, obj)
    utils.remove_obj_error_property(obj, errs, TSetCtrlModeReq.group)
end

TSetCtrlModeReq.from_obj = TSetCtrlModeReq_from_obj

TSetCtrlModeReq.proto_property = {'CtrlMode', 'Timeout'}

TSetCtrlModeReq.default = {'', 0}

TSetCtrlModeReq.struct = {
    {name = 'CtrlMode', is_array = false, struct = nil}, {name = 'Timeout', is_array = false, struct = nil}
}

function TSetCtrlModeReq:validate(prefix, errs, need_convert)
    prefix = prefix or ''

    validate.Optional(prefix .. 'CtrlMode', self.CtrlMode, 'string', false, errs, need_convert)
    validate.Optional(prefix .. 'Timeout', self.Timeout, 'uint32', false, errs, need_convert)

    if self.CtrlMode ~= nil then
        validate.Enum(prefix .. 'CtrlMode', self.CtrlMode, '', {'Auto', 'Manual', 'Mixed'}, errs, need_convert)
    end

    TSetCtrlModeReq:remove_error_props(errs, self)
    validate.CheckUnknowProperty(self, TSetCtrlModeReq.proto_property, errs, need_convert)
    return self
end

function TSetCtrlModeReq:unpack(_)
    return self.CtrlMode, self.Timeout
end

AirCoolingConfig.SetCtrlModeReq = TSetCtrlModeReq

AirCoolingConfig.interface = mdb.register_interface('bmc.kepler.Systems.AirCoolingConfig', {
    CtrlMode = {'s', {'EMIT_CHANGE'}, true, 'Auto'},
    CtrlModePersistType = {'y', {}, true, 0},
    CtrlModeResetPersist = {'s', {'EMIT_CHANGE'}, true, 'Auto'},
    CtrlModePoweroffPersist = {'s', {'EMIT_CHANGE'}, true, 'Auto'},
    TimeOut = {'u', {'VOLATILE'}, true, 30},
    ManualSpeedPercent = {'y', {'EMIT_CHANGE'}, true, 10},
    ManualSpeedPercentResetPersist = {'y', {'EMIT_CHANGE'}, true, 0},
    ManualSpeedPercentPoweroffPersist = {'y', {'EMIT_CHANGE'}, true, 0},
    SpeedPercentRange = {'ay', {'CONST'}, true, nil},
    MinAllowedSpeedPercent = {'y', {'EMIT_CHANGE'}, false, 255},
    InitialSpeedPercent = {'y', {}, false, 100},
    ActiveAlgorithm = {'s', {}, true, 'N/A'},
    SpeedDeviationThresholdPercent = {'y', {}, false, 25}
}, {
    SetCtrlMode = {'a{ss}su', '', TSetCtrlModeReq, TSetCtrlModeRsp},
    SetCtrlModePersist = {'a{ss}syu', '', TSetCtrlModePersistReq, TSetCtrlModePersistRsp},
    SetManualSpeedPercent = {'a{ss}yy', '', TSetManualSpeedPercentReq, TSetManualSpeedPercentRsp}
}, {})

return AirCoolingConfig
