-- Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
--
-- this file licensed under the 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.
--
-- Author: auto generate
-- Create: 2026-2-26
-- Description: DO NOT EDIT; Code generated by "message.lua.mako"
local validate = require 'mc.validate'
local utils = require 'mc.utils'

local MInterChassisWhitelist = {}

---@class MInterChassisWhitelist.Item
---@field Item string
local TItem = {}
TItem.__index = TItem
TItem.group = {}

local function TItem_from_obj(obj)
    return setmetatable(obj, TItem)
end

function TItem.new(Item)
    return TItem_from_obj({Item = Item})
end
---@param obj MInterChassisWhitelist.Item
function TItem:init_from_obj(obj)
    self.Item = obj.Item
end

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

TItem.from_obj = TItem_from_obj

TItem.proto_property = {'Item'}

TItem.default = {''}

TItem.struct = {{name = 'Item', is_array = false, struct = nil}}

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

    validate.Optional(prefix .. 'Item', self.Item, 'string', false, errs, need_convert)

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

function TItem:unpack(_)
    return self.Item
end

MInterChassisWhitelist.Item = TItem

---@class MInterChassisWhitelist.Id
---@field Id string
local TId = {}
TId.__index = TId
TId.group = {}

local function TId_from_obj(obj)
    return setmetatable(obj, TId)
end

function TId.new(Id)
    return TId_from_obj({Id = Id})
end
---@param obj MInterChassisWhitelist.Id
function TId:init_from_obj(obj)
    self.Id = obj.Id
end

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

TId.from_obj = TId_from_obj

TId.proto_property = {'Id'}

TId.default = {''}

TId.struct = {{name = 'Id', is_array = false, struct = nil}}

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

    validate.Optional(prefix .. 'Id', self.Id, 'string', false, errs, need_convert)

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

function TId:unpack(_)
    return self.Id
end

MInterChassisWhitelist.Id = TId

---@class MInterChassisWhitelist.Type
---@field Type string
local TType = {}
TType.__index = TType
TType.group = {}

local function TType_from_obj(obj)
    return setmetatable(obj, TType)
end

function TType.new(Type)
    return TType_from_obj({Type = Type})
end
---@param obj MInterChassisWhitelist.Type
function TType:init_from_obj(obj)
    self.Type = obj.Type
end

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

TType.from_obj = TType_from_obj

TType.proto_property = {'Type'}

TType.default = {''}

TType.struct = {{name = 'Type', is_array = false, struct = nil}}

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

    validate.Optional(prefix .. 'Type', self.Type, 'string', false, errs, need_convert)

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

function TType:unpack(_)
    return self.Type
end

MInterChassisWhitelist.Type = TType

return MInterChassisWhitelist
