-- 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 MRemoteGroup = {}

---@class MRemoteGroup.LoginInterfaceDB
---@field LoginInterfaceDB integer
local TLoginInterfaceDB = {}
TLoginInterfaceDB.__index = TLoginInterfaceDB
TLoginInterfaceDB.group = {}

local function TLoginInterfaceDB_from_obj(obj)
    return setmetatable(obj, TLoginInterfaceDB)
end

function TLoginInterfaceDB.new(LoginInterfaceDB)
    return TLoginInterfaceDB_from_obj({LoginInterfaceDB = LoginInterfaceDB})
end
---@param obj MRemoteGroup.LoginInterfaceDB
function TLoginInterfaceDB:init_from_obj(obj)
    self.LoginInterfaceDB = obj.LoginInterfaceDB
end

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

TLoginInterfaceDB.from_obj = TLoginInterfaceDB_from_obj

TLoginInterfaceDB.proto_property = {'LoginInterfaceDB'}

TLoginInterfaceDB.default = {0}

TLoginInterfaceDB.struct = {{name = 'LoginInterfaceDB', is_array = false, struct = nil}}

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

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

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

function TLoginInterfaceDB:unpack(_)
    return self.LoginInterfaceDB
end

MRemoteGroup.LoginInterfaceDB = TLoginInterfaceDB

---@class MRemoteGroup.PermitRuleIdsDB
---@field PermitRuleIdsDB integer
local TPermitRuleIdsDB = {}
TPermitRuleIdsDB.__index = TPermitRuleIdsDB
TPermitRuleIdsDB.group = {}

local function TPermitRuleIdsDB_from_obj(obj)
    return setmetatable(obj, TPermitRuleIdsDB)
end

function TPermitRuleIdsDB.new(PermitRuleIdsDB)
    return TPermitRuleIdsDB_from_obj({PermitRuleIdsDB = PermitRuleIdsDB})
end
---@param obj MRemoteGroup.PermitRuleIdsDB
function TPermitRuleIdsDB:init_from_obj(obj)
    self.PermitRuleIdsDB = obj.PermitRuleIdsDB
end

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

TPermitRuleIdsDB.from_obj = TPermitRuleIdsDB_from_obj

TPermitRuleIdsDB.proto_property = {'PermitRuleIdsDB'}

TPermitRuleIdsDB.default = {0}

TPermitRuleIdsDB.struct = {{name = 'PermitRuleIdsDB', is_array = false, struct = nil}}

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

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

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

function TPermitRuleIdsDB:unpack(_)
    return self.PermitRuleIdsDB
end

MRemoteGroup.PermitRuleIdsDB = TPermitRuleIdsDB

---@class MRemoteGroup.PrivilegeMask
---@field PrivilegeMask integer
local TPrivilegeMask = {}
TPrivilegeMask.__index = TPrivilegeMask
TPrivilegeMask.group = {}

local function TPrivilegeMask_from_obj(obj)
    return setmetatable(obj, TPrivilegeMask)
end

function TPrivilegeMask.new(PrivilegeMask)
    return TPrivilegeMask_from_obj({PrivilegeMask = PrivilegeMask})
end
---@param obj MRemoteGroup.PrivilegeMask
function TPrivilegeMask:init_from_obj(obj)
    self.PrivilegeMask = obj.PrivilegeMask
end

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

TPrivilegeMask.from_obj = TPrivilegeMask_from_obj

TPrivilegeMask.proto_property = {'PrivilegeMask'}

TPrivilegeMask.default = {0}

TPrivilegeMask.struct = {{name = 'PrivilegeMask', is_array = false, struct = nil}}

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

    validate.Optional(prefix .. 'PrivilegeMask', self.PrivilegeMask, 'uint32', false, errs, need_convert)

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

function TPrivilegeMask:unpack(_)
    return self.PrivilegeMask
end

MRemoteGroup.PrivilegeMask = TPrivilegeMask

---@class MRemoteGroup.Privilege
---@field Privilege integer
local TPrivilege = {}
TPrivilege.__index = TPrivilege
TPrivilege.group = {}

local function TPrivilege_from_obj(obj)
    return setmetatable(obj, TPrivilege)
end

function TPrivilege.new(Privilege)
    return TPrivilege_from_obj({Privilege = Privilege})
end
---@param obj MRemoteGroup.Privilege
function TPrivilege:init_from_obj(obj)
    self.Privilege = obj.Privilege
end

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

TPrivilege.from_obj = TPrivilege_from_obj

TPrivilege.proto_property = {'Privilege'}

TPrivilege.default = {0}

TPrivilege.struct = {{name = 'Privilege', is_array = false, struct = nil}}

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

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

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

function TPrivilege:unpack(_)
    return self.Privilege
end

MRemoteGroup.Privilege = TPrivilege

---@class MRemoteGroup.Domain
---@field Domain string
local TDomain = {}
TDomain.__index = TDomain
TDomain.group = {}

local function TDomain_from_obj(obj)
    return setmetatable(obj, TDomain)
end

function TDomain.new(Domain)
    return TDomain_from_obj({Domain = Domain})
end
---@param obj MRemoteGroup.Domain
function TDomain:init_from_obj(obj)
    self.Domain = obj.Domain
end

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

TDomain.from_obj = TDomain_from_obj

TDomain.proto_property = {'Domain'}

TDomain.default = {''}

TDomain.struct = {{name = 'Domain', is_array = false, struct = nil}}

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

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

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

function TDomain:unpack(_)
    return self.Domain
end

MRemoteGroup.Domain = TDomain

---@class MRemoteGroup.ControllerInnerId
---@field ControllerInnerId integer
local TControllerInnerId = {}
TControllerInnerId.__index = TControllerInnerId
TControllerInnerId.group = {}

local function TControllerInnerId_from_obj(obj)
    return setmetatable(obj, TControllerInnerId)
end

function TControllerInnerId.new(ControllerInnerId)
    return TControllerInnerId_from_obj({ControllerInnerId = ControllerInnerId})
end
---@param obj MRemoteGroup.ControllerInnerId
function TControllerInnerId:init_from_obj(obj)
    self.ControllerInnerId = obj.ControllerInnerId
end

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

TControllerInnerId.from_obj = TControllerInnerId_from_obj

TControllerInnerId.proto_property = {'ControllerInnerId'}

TControllerInnerId.default = {0}

TControllerInnerId.struct = {{name = 'ControllerInnerId', is_array = false, struct = nil}}

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

    validate.Required(prefix .. 'ControllerInnerId', self.ControllerInnerId, 'uint32', false, errs, need_convert)

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

function TControllerInnerId:unpack(_)
    return self.ControllerInnerId
end

MRemoteGroup.ControllerInnerId = TControllerInnerId

---@class MRemoteGroup.Id
---@field Id integer
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 MRemoteGroup.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 = {0}

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

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

    validate.Required(prefix .. 'Id', self.Id, 'uint32', 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

MRemoteGroup.Id = TId

return MRemoteGroup
