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

---@class Session.BrowserType
---@field BrowserType integer
local TBrowserType = {}
TBrowserType.__index = TBrowserType
TBrowserType.group = {}

local function TBrowserType_from_obj(obj)
    return setmetatable(obj, TBrowserType)
end

function TBrowserType.new(BrowserType)
    return TBrowserType_from_obj({BrowserType = BrowserType})
end
---@param obj Session.BrowserType
function TBrowserType:init_from_obj(obj)
    self.BrowserType = obj.BrowserType
end

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

TBrowserType.from_obj = TBrowserType_from_obj

TBrowserType.proto_property = {'BrowserType'}

TBrowserType.default = {0}

TBrowserType.struct = {{name = 'BrowserType', is_array = false, struct = nil}}

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

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

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

function TBrowserType:unpack(_)
    return self.BrowserType
end

Session.BrowserType = TBrowserType

---@class Session.AccountId
---@field AccountId string
local TAccountId = {}
TAccountId.__index = TAccountId
TAccountId.group = {}

local function TAccountId_from_obj(obj)
    return setmetatable(obj, TAccountId)
end

function TAccountId.new(AccountId)
    return TAccountId_from_obj({AccountId = AccountId})
end
---@param obj Session.AccountId
function TAccountId:init_from_obj(obj)
    self.AccountId = obj.AccountId
end

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

TAccountId.from_obj = TAccountId_from_obj

TAccountId.proto_property = {'AccountId'}

TAccountId.default = {''}

TAccountId.struct = {{name = 'AccountId', is_array = false, struct = nil}}

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

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

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

function TAccountId:unpack(_)
    return self.AccountId
end

Session.AccountId = TAccountId

---@class Session.Privileges
---@field Privileges string[]
local TPrivileges = {}
TPrivileges.__index = TPrivileges
TPrivileges.group = {}

local function TPrivileges_from_obj(obj)
    return setmetatable(obj, TPrivileges)
end

function TPrivileges.new(Privileges)
    return TPrivileges_from_obj({Privileges = Privileges})
end
---@param obj Session.Privileges
function TPrivileges:init_from_obj(obj)
    self.Privileges = obj.Privileges
end

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

TPrivileges.from_obj = TPrivileges_from_obj

TPrivileges.proto_property = {'Privileges'}

TPrivileges.default = {{}}

TPrivileges.struct = {{name = 'Privileges', is_array = true, struct = nil}}

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

    validate.OptionalArray(prefix .. 'Privileges', self.Privileges, 'string', true, errs, need_convert)

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

function TPrivileges:unpack(_)
    return self.Privileges
end

Session.Privileges = TPrivileges

---@class Session.Role
---@field Role string[]
local TRole = {}
TRole.__index = TRole
TRole.group = {}

local function TRole_from_obj(obj)
    return setmetatable(obj, TRole)
end

function TRole.new(Role)
    return TRole_from_obj({Role = Role})
end
---@param obj Session.Role
function TRole:init_from_obj(obj)
    self.Role = obj.Role
end

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

TRole.from_obj = TRole_from_obj

TRole.proto_property = {'Role'}

TRole.default = {{}}

TRole.struct = {{name = 'Role', is_array = true, struct = nil}}

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

    validate.OptionalArray(prefix .. 'Role', self.Role, 'string', true, errs, need_convert)

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

function TRole:unpack(_)
    return self.Role
end

Session.Role = TRole

---@class Session.AuthType
---@field AuthType integer
local TAuthType = {}
TAuthType.__index = TAuthType
TAuthType.group = {}

local function TAuthType_from_obj(obj)
    return setmetatable(obj, TAuthType)
end

function TAuthType.new(AuthType)
    return TAuthType_from_obj({AuthType = AuthType})
end
---@param obj Session.AuthType
function TAuthType:init_from_obj(obj)
    self.AuthType = obj.AuthType
end

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

TAuthType.from_obj = TAuthType_from_obj

TAuthType.proto_property = {'AuthType'}

TAuthType.default = {0}

TAuthType.struct = {{name = 'AuthType', is_array = false, struct = nil}}

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

    validate.Optional(prefix .. 'AuthType', self.AuthType, 'int8', true, errs, need_convert)

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

function TAuthType:unpack(_)
    return self.AuthType
end

Session.AuthType = TAuthType

---@class Session.LastLoginTime
---@field LastLoginTime string
local TLastLoginTime = {}
TLastLoginTime.__index = TLastLoginTime
TLastLoginTime.group = {}

local function TLastLoginTime_from_obj(obj)
    return setmetatable(obj, TLastLoginTime)
end

function TLastLoginTime.new(LastLoginTime)
    return TLastLoginTime_from_obj({LastLoginTime = LastLoginTime})
end
---@param obj Session.LastLoginTime
function TLastLoginTime:init_from_obj(obj)
    self.LastLoginTime = obj.LastLoginTime
end

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

TLastLoginTime.from_obj = TLastLoginTime_from_obj

TLastLoginTime.proto_property = {'LastLoginTime'}

TLastLoginTime.default = {''}

TLastLoginTime.struct = {{name = 'LastLoginTime', is_array = false, struct = nil}}

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

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

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

function TLastLoginTime:unpack(_)
    return self.LastLoginTime
end

Session.LastLoginTime = TLastLoginTime

---@class Session.LastLoginIp
---@field LastLoginIp string
local TLastLoginIp = {}
TLastLoginIp.__index = TLastLoginIp
TLastLoginIp.group = {}

local function TLastLoginIp_from_obj(obj)
    return setmetatable(obj, TLastLoginIp)
end

function TLastLoginIp.new(LastLoginIp)
    return TLastLoginIp_from_obj({LastLoginIp = LastLoginIp})
end
---@param obj Session.LastLoginIp
function TLastLoginIp:init_from_obj(obj)
    self.LastLoginIp = obj.LastLoginIp
end

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

TLastLoginIp.from_obj = TLastLoginIp_from_obj

TLastLoginIp.proto_property = {'LastLoginIp'}

TLastLoginIp.default = {''}

TLastLoginIp.struct = {{name = 'LastLoginIp', is_array = false, struct = nil}}

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

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

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

function TLastLoginIp:unpack(_)
    return self.LastLoginIp
end

Session.LastLoginIp = TLastLoginIp

---@class Session.UserName
---@field UserName string
local TUserName = {}
TUserName.__index = TUserName
TUserName.group = {}

local function TUserName_from_obj(obj)
    return setmetatable(obj, TUserName)
end

function TUserName.new(UserName)
    return TUserName_from_obj({UserName = UserName})
end
---@param obj Session.UserName
function TUserName:init_from_obj(obj)
    self.UserName = obj.UserName
end

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

TUserName.from_obj = TUserName_from_obj

TUserName.proto_property = {'UserName'}

TUserName.default = {''}

TUserName.struct = {{name = 'UserName', is_array = false, struct = nil}}

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

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

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

function TUserName:unpack(_)
    return self.UserName
end

Session.UserName = TUserName

---@class Session.SessionType
---@field SessionType string
local TSessionType = {}
TSessionType.__index = TSessionType
TSessionType.group = {}

local function TSessionType_from_obj(obj)
    return setmetatable(obj, TSessionType)
end

function TSessionType.new(SessionType)
    return TSessionType_from_obj({SessionType = SessionType})
end
---@param obj Session.SessionType
function TSessionType:init_from_obj(obj)
    self.SessionType = obj.SessionType
end

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

TSessionType.from_obj = TSessionType_from_obj

TSessionType.proto_property = {'SessionType'}

TSessionType.default = {''}

TSessionType.struct = {{name = 'SessionType', is_array = false, struct = nil}}

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

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

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

function TSessionType:unpack(_)
    return self.SessionType
end

Session.SessionType = TSessionType

---@class Session.AccountPassword
---@field AccountPassword string
local TAccountPassword = {}
TAccountPassword.__index = TAccountPassword
TAccountPassword.group = {}

local function TAccountPassword_from_obj(obj)
    return setmetatable(obj, TAccountPassword)
end

function TAccountPassword.new(AccountPassword)
    return TAccountPassword_from_obj({AccountPassword = AccountPassword})
end
---@param obj Session.AccountPassword
function TAccountPassword:init_from_obj(obj)
    self.AccountPassword = obj.AccountPassword
end

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

TAccountPassword.from_obj = TAccountPassword_from_obj

TAccountPassword.proto_property = {'AccountPassword'}

TAccountPassword.default = {''}

TAccountPassword.struct = {{name = 'AccountPassword', is_array = false, struct = nil}}

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

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

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

function TAccountPassword:unpack(_)
    return self.AccountPassword
end

Session.AccountPassword = TAccountPassword

---@class Session.OemSessionType
---@field OemSessionType integer
local TOemSessionType = {}
TOemSessionType.__index = TOemSessionType
TOemSessionType.group = {}

local function TOemSessionType_from_obj(obj)
    return setmetatable(obj, TOemSessionType)
end

function TOemSessionType.new(OemSessionType)
    return TOemSessionType_from_obj({OemSessionType = OemSessionType})
end
---@param obj Session.OemSessionType
function TOemSessionType:init_from_obj(obj)
    self.OemSessionType = obj.OemSessionType
end

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

TOemSessionType.from_obj = TOemSessionType_from_obj

TOemSessionType.proto_property = {'OemSessionType'}

TOemSessionType.default = {0}

TOemSessionType.struct = {{name = 'OemSessionType', is_array = false, struct = nil}}

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

    validate.Optional(prefix .. 'OemSessionType', self.OemSessionType, 'int8', true, errs, need_convert)

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

function TOemSessionType:unpack(_)
    return self.OemSessionType
end

Session.OemSessionType = TOemSessionType

---@class Session.SessionId
---@field SessionId string
local TSessionId = {}
TSessionId.__index = TSessionId
TSessionId.group = {}

local function TSessionId_from_obj(obj)
    return setmetatable(obj, TSessionId)
end

function TSessionId.new(SessionId)
    return TSessionId_from_obj({SessionId = SessionId})
end
---@param obj Session.SessionId
function TSessionId:init_from_obj(obj)
    self.SessionId = obj.SessionId
end

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

TSessionId.from_obj = TSessionId_from_obj

TSessionId.proto_property = {'SessionId'}

TSessionId.default = {''}

TSessionId.struct = {{name = 'SessionId', is_array = false, struct = nil}}

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

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

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

function TSessionId:unpack(_)
    return self.SessionId
end

Session.SessionId = TSessionId

---@class Session.CreatedTime
---@field CreatedTime string
local TCreatedTime = {}
TCreatedTime.__index = TCreatedTime
TCreatedTime.group = {}

local function TCreatedTime_from_obj(obj)
    return setmetatable(obj, TCreatedTime)
end

function TCreatedTime.new(CreatedTime)
    return TCreatedTime_from_obj({CreatedTime = CreatedTime})
end
---@param obj Session.CreatedTime
function TCreatedTime:init_from_obj(obj)
    self.CreatedTime = obj.CreatedTime
end

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

TCreatedTime.from_obj = TCreatedTime_from_obj

TCreatedTime.proto_property = {'CreatedTime'}

TCreatedTime.default = {''}

TCreatedTime.struct = {{name = 'CreatedTime', is_array = false, struct = nil}}

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

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

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

function TCreatedTime:unpack(_)
    return self.CreatedTime
end

Session.CreatedTime = TCreatedTime

---@class Session.ClientOriginIPAddress
---@field ClientOriginIPAddress string
local TClientOriginIPAddress = {}
TClientOriginIPAddress.__index = TClientOriginIPAddress
TClientOriginIPAddress.group = {}

local function TClientOriginIPAddress_from_obj(obj)
    return setmetatable(obj, TClientOriginIPAddress)
end

function TClientOriginIPAddress.new(ClientOriginIPAddress)
    return TClientOriginIPAddress_from_obj({ClientOriginIPAddress = ClientOriginIPAddress})
end
---@param obj Session.ClientOriginIPAddress
function TClientOriginIPAddress:init_from_obj(obj)
    self.ClientOriginIPAddress = obj.ClientOriginIPAddress
end

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

TClientOriginIPAddress.from_obj = TClientOriginIPAddress_from_obj

TClientOriginIPAddress.proto_property = {'ClientOriginIPAddress'}

TClientOriginIPAddress.default = {''}

TClientOriginIPAddress.struct = {{name = 'ClientOriginIPAddress', is_array = false, struct = nil}}

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

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

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

function TClientOriginIPAddress:unpack(_)
    return self.ClientOriginIPAddress
end

Session.ClientOriginIPAddress = TClientOriginIPAddress

---@class Session.SessionDeleteRsp
local TSessionDeleteRsp = {}
TSessionDeleteRsp.__index = TSessionDeleteRsp
TSessionDeleteRsp.group = {}

local function TSessionDeleteRsp_from_obj(obj)
    return setmetatable(obj, TSessionDeleteRsp)
end

function TSessionDeleteRsp.new()
    return TSessionDeleteRsp_from_obj({})
end
---@param obj Session.SessionDeleteRsp
function TSessionDeleteRsp:init_from_obj(obj)

end

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

TSessionDeleteRsp.from_obj = TSessionDeleteRsp_from_obj

TSessionDeleteRsp.proto_property = {}

TSessionDeleteRsp.default = {}

TSessionDeleteRsp.struct = {}

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

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

function TSessionDeleteRsp:unpack(_)
end

Session.SessionDeleteRsp = TSessionDeleteRsp

---@class Session.SessionDeleteReq
---@field LogoutType integer
local TSessionDeleteReq = {}
TSessionDeleteReq.__index = TSessionDeleteReq
TSessionDeleteReq.group = {}

local function TSessionDeleteReq_from_obj(obj)
    return setmetatable(obj, TSessionDeleteReq)
end

function TSessionDeleteReq.new(LogoutType)
    return TSessionDeleteReq_from_obj({LogoutType = LogoutType})
end
---@param obj Session.SessionDeleteReq
function TSessionDeleteReq:init_from_obj(obj)
    self.LogoutType = obj.LogoutType
end

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

TSessionDeleteReq.from_obj = TSessionDeleteReq_from_obj

TSessionDeleteReq.proto_property = {'LogoutType'}

TSessionDeleteReq.default = {0}

TSessionDeleteReq.struct = {{name = 'LogoutType', is_array = false, struct = nil}}

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

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

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

function TSessionDeleteReq:unpack(_)
    return self.LogoutType
end

Session.SessionDeleteReq = TSessionDeleteReq

Session.interface = mdb.register_interface('bmc.kepler.SessionService.Session', {
    ClientOriginIPAddress = {'s', nil, true, nil, false},
    CreatedTime = {'s', nil, true, nil, false},
    SessionId = {'s', nil, true, nil, false},
    OemSessionType = {'y', nil, true, nil, false},
    AccountPassword = {'s', nil, true, nil, false},
    SessionType = {'s', nil, true, nil, false},
    UserName = {'s', nil, true, nil, false},
    LastLoginIp = {'s', nil, true, nil, false},
    LastLoginTime = {'s', nil, true, nil, false},
    AuthType = {'y', nil, true, nil, false},
    Role = {'as', nil, true, nil, false},
    Privileges = {'as', nil, true, nil, false},
    AccountId = {'s', nil, true, nil, false},
    BrowserType = {'y', nil, true, nil, false}
}, {SessionDelete = {'a{ss}y', '', TSessionDeleteReq, TSessionDeleteRsp}}, {})

return Session
