--[[-- Copyright (c) 2026 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 SetSuperPodLabelInfoExpansion = {}

---@class ChassisIpmiCmds.SetSuperPodLabelInfoExpansionReq
---@field ManufactureId integer
---@field Reserved integer
---@field Length integer
---@field Data integer[]
local TSetSuperPodLabelInfoExpansionReq = {}
TSetSuperPodLabelInfoExpansionReq.__index = TSetSuperPodLabelInfoExpansionReq
TSetSuperPodLabelInfoExpansionReq.group = {}

local function TSetSuperPodLabelInfoExpansionReq_from_obj(obj)
    return setmetatable(obj, TSetSuperPodLabelInfoExpansionReq)
end

function TSetSuperPodLabelInfoExpansionReq.new(ManufactureId, Reserved, Length, Data)
    return TSetSuperPodLabelInfoExpansionReq_from_obj({
        ManufactureId = ManufactureId,
        Reserved = Reserved,
        Length = Length,
        Data = Data
    })
end
---@param obj ChassisIpmiCmds.SetSuperPodLabelInfoExpansionReq
function TSetSuperPodLabelInfoExpansionReq:init_from_obj(obj)
    self.ManufactureId = obj.ManufactureId
    self.Reserved = obj.Reserved
    self.Length = obj.Length
    self.Data = obj.Data
end

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

TSetSuperPodLabelInfoExpansionReq.from_obj = TSetSuperPodLabelInfoExpansionReq_from_obj

TSetSuperPodLabelInfoExpansionReq.proto_property = {'ManufactureId', 'Reserved', 'Length', 'Data'}

TSetSuperPodLabelInfoExpansionReq.default = {0, 0, 0, {}}

TSetSuperPodLabelInfoExpansionReq.struct = {
    {name = 'ManufactureId', is_array = false, struct = nil}, {name = 'Reserved', is_array = false, struct = nil},
    {name = 'Length', is_array = false, struct = nil}, {name = 'Data', is_array = true, struct = nil}
}

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

    validate.Optional(prefix .. 'ManufactureId', self.ManufactureId, 'uint32', false, errs, need_convert)
    validate.Optional(prefix .. 'Reserved', self.Reserved, 'uint8', false, errs, need_convert)
    validate.Optional(prefix .. 'Length', self.Length, 'uint8', false, errs, need_convert)
    validate.OptionalArray(prefix .. 'Data', self.Data, 'uint8', false, errs, need_convert)

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

function TSetSuperPodLabelInfoExpansionReq:unpack(_)
    return self.ManufactureId, self.Reserved, self.Length, self.Data
end

SetSuperPodLabelInfoExpansion.SetSuperPodLabelInfoExpansionReq = TSetSuperPodLabelInfoExpansionReq

---@class ChassisIpmiCmds.SetSuperPodLabelInfoExpansionRsp
---@field CompletionCode integer
---@field ManufactureId integer
local TSetSuperPodLabelInfoExpansionRsp = {}
TSetSuperPodLabelInfoExpansionRsp.__index = TSetSuperPodLabelInfoExpansionRsp
TSetSuperPodLabelInfoExpansionRsp.group = {}

local function TSetSuperPodLabelInfoExpansionRsp_from_obj(obj)
    return setmetatable(obj, TSetSuperPodLabelInfoExpansionRsp)
end

function TSetSuperPodLabelInfoExpansionRsp.new(CompletionCode, ManufactureId)
    return TSetSuperPodLabelInfoExpansionRsp_from_obj({CompletionCode = CompletionCode, ManufactureId = ManufactureId})
end
---@param obj ChassisIpmiCmds.SetSuperPodLabelInfoExpansionRsp
function TSetSuperPodLabelInfoExpansionRsp:init_from_obj(obj)
    self.CompletionCode = obj.CompletionCode
    self.ManufactureId = obj.ManufactureId
end

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

TSetSuperPodLabelInfoExpansionRsp.from_obj = TSetSuperPodLabelInfoExpansionRsp_from_obj

TSetSuperPodLabelInfoExpansionRsp.proto_property = {'CompletionCode', 'ManufactureId'}

TSetSuperPodLabelInfoExpansionRsp.default = {0, 0}

TSetSuperPodLabelInfoExpansionRsp.struct = {
    {name = 'CompletionCode', is_array = false, struct = nil}, {name = 'ManufactureId', is_array = false, struct = nil}
}

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

    validate.Optional(prefix .. 'CompletionCode', self.CompletionCode, 'uint8', false, errs, need_convert)
    validate.Optional(prefix .. 'ManufactureId', self.ManufactureId, 'uint32', false, errs, need_convert)

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

function TSetSuperPodLabelInfoExpansionRsp:unpack(_)
    return self.CompletionCode, self.ManufactureId
end

SetSuperPodLabelInfoExpansion.SetSuperPodLabelInfoExpansionRsp = TSetSuperPodLabelInfoExpansionRsp

return SetSuperPodLabelInfoExpansion
