-- 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: 2025-8-21
-- Description: DO NOT EDIT; Code generated by "message.lua.mako"
local validate = require 'mc.validate'
local utils = require 'mc.utils'
local mdb = require 'mc.mdb'

local LLDPReceive = {}

---@class LLDPReceive.ManagementAddressMAC
---@field ManagementAddressMAC string
local TManagementAddressMAC = {}
TManagementAddressMAC.__index = TManagementAddressMAC
TManagementAddressMAC.group = {}

local function TManagementAddressMAC_from_obj(obj)
    return setmetatable(obj, TManagementAddressMAC)
end

function TManagementAddressMAC.new(ManagementAddressMAC)
    return TManagementAddressMAC_from_obj({ManagementAddressMAC = ManagementAddressMAC or [=[]=]})
end
---@param obj LLDPReceive.ManagementAddressMAC
function TManagementAddressMAC:init_from_obj(obj)
    self.ManagementAddressMAC = obj.ManagementAddressMAC or [=[]=]
end

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

TManagementAddressMAC.from_obj = TManagementAddressMAC_from_obj

TManagementAddressMAC.proto_property = {'ManagementAddressMAC'}

TManagementAddressMAC.default = {''}

TManagementAddressMAC.struct = {{name = 'ManagementAddressMAC', is_array = false, struct = nil}}

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

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

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

function TManagementAddressMAC:unpack(_)
    return self.ManagementAddressMAC
end

LLDPReceive.ManagementAddressMAC = TManagementAddressMAC

---@class LLDPReceive.ManagementAddressIPv6
---@field ManagementAddressIPv6 string
local TManagementAddressIPv6 = {}
TManagementAddressIPv6.__index = TManagementAddressIPv6
TManagementAddressIPv6.group = {}

local function TManagementAddressIPv6_from_obj(obj)
    return setmetatable(obj, TManagementAddressIPv6)
end

function TManagementAddressIPv6.new(ManagementAddressIPv6)
    return TManagementAddressIPv6_from_obj({ManagementAddressIPv6 = ManagementAddressIPv6 or [=[]=]})
end
---@param obj LLDPReceive.ManagementAddressIPv6
function TManagementAddressIPv6:init_from_obj(obj)
    self.ManagementAddressIPv6 = obj.ManagementAddressIPv6 or [=[]=]
end

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

TManagementAddressIPv6.from_obj = TManagementAddressIPv6_from_obj

TManagementAddressIPv6.proto_property = {'ManagementAddressIPv6'}

TManagementAddressIPv6.default = {''}

TManagementAddressIPv6.struct = {{name = 'ManagementAddressIPv6', is_array = false, struct = nil}}

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

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

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

function TManagementAddressIPv6:unpack(_)
    return self.ManagementAddressIPv6
end

LLDPReceive.ManagementAddressIPv6 = TManagementAddressIPv6

---@class LLDPReceive.ManagementAddressIPv4
---@field ManagementAddressIPv4 string
local TManagementAddressIPv4 = {}
TManagementAddressIPv4.__index = TManagementAddressIPv4
TManagementAddressIPv4.group = {}

local function TManagementAddressIPv4_from_obj(obj)
    return setmetatable(obj, TManagementAddressIPv4)
end

function TManagementAddressIPv4.new(ManagementAddressIPv4)
    return TManagementAddressIPv4_from_obj({ManagementAddressIPv4 = ManagementAddressIPv4 or [=[]=]})
end
---@param obj LLDPReceive.ManagementAddressIPv4
function TManagementAddressIPv4:init_from_obj(obj)
    self.ManagementAddressIPv4 = obj.ManagementAddressIPv4 or [=[]=]
end

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

TManagementAddressIPv4.from_obj = TManagementAddressIPv4_from_obj

TManagementAddressIPv4.proto_property = {'ManagementAddressIPv4'}

TManagementAddressIPv4.default = {''}

TManagementAddressIPv4.struct = {{name = 'ManagementAddressIPv4', is_array = false, struct = nil}}

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

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

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

function TManagementAddressIPv4:unpack(_)
    return self.ManagementAddressIPv4
end

LLDPReceive.ManagementAddressIPv4 = TManagementAddressIPv4

---@class LLDPReceive.CustomData
---@field CustomData string
local TCustomData = {}
TCustomData.__index = TCustomData
TCustomData.group = {}

local function TCustomData_from_obj(obj)
    return setmetatable(obj, TCustomData)
end

function TCustomData.new(CustomData)
    return TCustomData_from_obj({CustomData = CustomData or [=[]=]})
end
---@param obj LLDPReceive.CustomData
function TCustomData:init_from_obj(obj)
    self.CustomData = obj.CustomData or [=[]=]
end

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

TCustomData.from_obj = TCustomData_from_obj

TCustomData.proto_property = {'CustomData'}

TCustomData.default = {''}

TCustomData.struct = {{name = 'CustomData', is_array = false, struct = nil}}

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

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

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

function TCustomData:unpack(_)
    return self.CustomData
end

LLDPReceive.CustomData = TCustomData

---@class LLDPReceive.SystemDescription
---@field SystemDescription string
local TSystemDescription = {}
TSystemDescription.__index = TSystemDescription
TSystemDescription.group = {}

local function TSystemDescription_from_obj(obj)
    return setmetatable(obj, TSystemDescription)
end

function TSystemDescription.new(SystemDescription)
    return TSystemDescription_from_obj({SystemDescription = SystemDescription or [=[]=]})
end
---@param obj LLDPReceive.SystemDescription
function TSystemDescription:init_from_obj(obj)
    self.SystemDescription = obj.SystemDescription or [=[]=]
end

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

TSystemDescription.from_obj = TSystemDescription_from_obj

TSystemDescription.proto_property = {'SystemDescription'}

TSystemDescription.default = {''}

TSystemDescription.struct = {{name = 'SystemDescription', is_array = false, struct = nil}}

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

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

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

function TSystemDescription:unpack(_)
    return self.SystemDescription
end

LLDPReceive.SystemDescription = TSystemDescription

---@class LLDPReceive.PortDescription
---@field PortDescription string
local TPortDescription = {}
TPortDescription.__index = TPortDescription
TPortDescription.group = {}

local function TPortDescription_from_obj(obj)
    return setmetatable(obj, TPortDescription)
end

function TPortDescription.new(PortDescription)
    return TPortDescription_from_obj({PortDescription = PortDescription or [=[]=]})
end
---@param obj LLDPReceive.PortDescription
function TPortDescription:init_from_obj(obj)
    self.PortDescription = obj.PortDescription or [=[]=]
end

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

TPortDescription.from_obj = TPortDescription_from_obj

TPortDescription.proto_property = {'PortDescription'}

TPortDescription.default = {''}

TPortDescription.struct = {{name = 'PortDescription', is_array = false, struct = nil}}

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

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

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

function TPortDescription:unpack(_)
    return self.PortDescription
end

LLDPReceive.PortDescription = TPortDescription

---@class LLDPReceive.PortId
---@field PortId string
local TPortId = {}
TPortId.__index = TPortId
TPortId.group = {}

local function TPortId_from_obj(obj)
    return setmetatable(obj, TPortId)
end

function TPortId.new(PortId)
    return TPortId_from_obj({PortId = PortId or [=[]=]})
end
---@param obj LLDPReceive.PortId
function TPortId:init_from_obj(obj)
    self.PortId = obj.PortId or [=[]=]
end

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

TPortId.from_obj = TPortId_from_obj

TPortId.proto_property = {'PortId'}

TPortId.default = {''}

TPortId.struct = {{name = 'PortId', is_array = false, struct = nil}}

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

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

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

function TPortId:unpack(_)
    return self.PortId
end

LLDPReceive.PortId = TPortId

LLDPReceive.interface = mdb.register_interface('bmc.kepler.Managers.LLDPReceive', {
    PortId = {'s', {}, true, '', false},
    PortDescription = {'s', {}, true, '', false},
    SystemDescription = {'s', {}, true, '', false},
    CustomData = {'s', {}, true, '', false},
    ManagementAddressIPv4 = {'s', {}, true, '', false},
    ManagementAddressIPv6 = {'s', {}, true, '', false},
    ManagementAddressMAC = {'s', {}, true, '', false}
}, {}, {})

return LLDPReceive
