-- 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 mdb = require 'mc.mdb'
local class = require 'mc.class'
local app_base = require 'mc.client_app_base'
local mdb_service = require 'mc.mdb.mdb_service'
local subscribe_signal = require 'mc.mdb.subscribe_signal'
local org_freedesktop_dbus = require 'sd_bus.org_freedesktop_dbus'

local match_rule = org_freedesktop_dbus.MatchRule
local get_non_virtual_interface_objects = mdb_service.get_non_virtual_interface_objects
local foreach_non_virtual_interface_objects = mdb_service.foreach_non_virtual_interface_objects

local EthDevice = require 'network_adapter.json_types.EthDevice'
local BlockIO = require 'network_adapter.json_types.BlockIO'
local PCIe = require 'network_adapter.json_types.PCIe'
local PCIeEndpoint = require 'network_adapter.json_types.PCIeEndpoint'
local PCIeTransport = require 'network_adapter.json_types.PCIeTransport'
local EthernetInterfaces = require 'network_adapter.json_types.EthernetInterfaces'
local MgmtPort = require 'network_adapter.json_types.MgmtPort'
local InnerNetwork = require 'network_adapter.json_types.InnerNetwork'
local LldpConfig = require 'network_adapter.json_types.LldpConfig'
local Frudata = require 'network_adapter.json_types.Frudata'
local NCSICapabilities = require 'network_adapter.json_types.NCSICapabilities'
local FruCtrl = require 'network_adapter.json_types.FruCtrl'
local Bios = require 'network_adapter.json_types.Bios'
local Accessor = require 'network_adapter.json_types.Accessor'
local DPUCard = require 'network_adapter.json_types.DPUCard'
local PCIeCard = require 'network_adapter.json_types.PCIeCard'
local SmsStatus = require 'network_adapter.json_types.SmsStatus'
local Sms = require 'network_adapter.json_types.Sms'
local NetworkBonding = require 'network_adapter.json_types.NetworkBonding'
local Events = require 'network_adapter.json_types.Events'
local Package = require 'network_adapter.json_types.Package'
local Pmu = require 'network_adapter.json_types.Pmu'
local SmBios = require 'network_adapter.json_types.SmBios'
local Component = require 'network_adapter.json_types.Component'
local PCIeSlot = require 'network_adapter.json_types.PCIeSlot'
local UpdateService = require 'network_adapter.json_types.UpdateService'
local FirmwareInventory = require 'network_adapter.json_types.FirmwareInventory'
local FirmwareInfo = require 'network_adapter.json_types.FirmwareInfo'
local File = require 'network_adapter.json_types.File'
local PowerOnLock = require 'network_adapter.json_types.PowerOnLock'
local FirmwareActive = require 'network_adapter.json_types.FirmwareActive'
local Driver = require 'network_adapter.json_types.Driver'
local Connector = require 'network_adapter.json_types.Connector'

---@class network_adapter_client: BasicClient
local network_adapter_client = class(app_base.Client)

function network_adapter_client:GetEthDeviceObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PCIeDevices.EthDevice', true)
end

function network_adapter_client:ForeachEthDeviceObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PCIeDevices.EthDevice', cb, true)
end

function network_adapter_client:GetBlockIOObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Chip.BlockIO', true)
end

function network_adapter_client:ForeachBlockIOObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Chip.BlockIO', cb, true)
end

function network_adapter_client:GetPCIeObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Mctp.MctpBinding.PCIe', true)
end

function network_adapter_client:ForeachPCIeObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Mctp.MctpBinding.PCIe', cb, true)
end

function network_adapter_client:GetPCIeEndpointObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Mctp.PCIeEndpoint', true)
end

function network_adapter_client:ForeachPCIeEndpointObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Mctp.PCIeEndpoint', cb, true)
end

function network_adapter_client:GetPCIeTransportObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Mctp.PCIeTransport', true)
end

function network_adapter_client:ForeachPCIeTransportObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Mctp.PCIeTransport', cb, true)
end

function network_adapter_client:GetEthernetInterfacesObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.EthernetInterfaces', true)
end

function network_adapter_client:ForeachEthernetInterfacesObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.EthernetInterfaces', cb, true)
end

function network_adapter_client:GetMgmtPortObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.EthernetInterfaces.MgmtPort', true)
end

function network_adapter_client:ForeachMgmtPortObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.EthernetInterfaces.MgmtPort', cb,
        true)
end

function network_adapter_client:GetInnerNetworkObjects()
    return
        get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.EthernetInterfaces.InnerNetwork', true)
end

function network_adapter_client:ForeachInnerNetworkObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.EthernetInterfaces.InnerNetwork',
        cb, true)
end

function network_adapter_client:GetLldpConfigObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.LldpConfig', true)
end

function network_adapter_client:ForeachLldpConfigObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.LldpConfig', cb, true)
end

function network_adapter_client:GetFrudataObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.FrudataService.Frudata', true)
end

function network_adapter_client:ForeachFrudataObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.FrudataService.Frudata', cb, true)
end

function network_adapter_client:GetNCSICapabilitiesObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.NCSICapabilities', true)
end

function network_adapter_client:ForeachNCSICapabilitiesObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.NCSICapabilities', cb, true)
end

function network_adapter_client:GetFruCtrlObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.FruCtrl', true)
end

function network_adapter_client:ForeachFruCtrlObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.FruCtrl', cb, true)
end

function network_adapter_client:GetAccessorObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Accessor', true)
end

function network_adapter_client:ForeachAccessorObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Accessor', cb, true)
end

function network_adapter_client:GetDPUCardObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.DPUCard', true)
end

function network_adapter_client:ForeachDPUCardObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.DPUCard', cb, true)
end

function network_adapter_client:GetPCIeCardObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PCIeDevices.PCIeCard', true)
end

function network_adapter_client:ForeachPCIeCardObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PCIeDevices.PCIeCard', cb, true)
end

function network_adapter_client:GetNetworkBondingObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.NetworkBonding', true)
end

function network_adapter_client:ForeachNetworkBondingObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.NetworkBonding', cb, true)
end

function network_adapter_client:GetEventsObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Events', true)
end

function network_adapter_client:ForeachEventsObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Events', cb, true)
end

function network_adapter_client:GetPmuObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Pmu', true)
end

function network_adapter_client:ForeachPmuObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Pmu', cb, true)
end

function network_adapter_client:GetSmBiosObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.SmBios', true)
end

function network_adapter_client:ForeachSmBiosObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.SmBios', cb, true)
end

function network_adapter_client:GetComponentObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Component', true)
end

function network_adapter_client:ForeachComponentObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Component', cb, true)
end

function network_adapter_client:GetPCIeSlotObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PCIeSlot', true)
end

function network_adapter_client:ForeachPCIeSlotObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PCIeSlot', cb, true)
end

function network_adapter_client:GetPowerOnLockObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PowerOnLock', true)
end

function network_adapter_client:ForeachPowerOnLockObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.PowerOnLock', cb, true)
end

function network_adapter_client:GetConnectorObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Connector', true)
end

function network_adapter_client:ForeachConnectorObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Connector', cb, true)
end

function network_adapter_client:OnEthDeviceInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeDevices.EthDevice')
end

function network_adapter_client:OnEthDeviceInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeDevices.EthDevice')
end

function network_adapter_client:OnBlockIOInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Chip.BlockIO')
end

function network_adapter_client:OnBlockIOInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Chip.BlockIO')
end

function network_adapter_client:OnPCIeInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Mctp.MctpBinding.PCIe')
end

function network_adapter_client:OnPCIeInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Mctp.MctpBinding.PCIe')
end

function network_adapter_client:OnPCIeEndpointInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Mctp.PCIeEndpoint')
end

function network_adapter_client:OnPCIeEndpointInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Mctp.PCIeEndpoint')
end

function network_adapter_client:OnPCIeTransportInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Mctp.PCIeTransport')
end

function network_adapter_client:OnPCIeTransportInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Mctp.PCIeTransport')
end

function network_adapter_client:OnEthernetInterfacesPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces', {'VLANId', 'VLANEnable'})
end

function network_adapter_client:OnEthernetInterfacesInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces')
end

function network_adapter_client:OnEthernetInterfacesInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces')
end

function network_adapter_client:OnMgmtPortInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces.MgmtPort')
end

function network_adapter_client:OnMgmtPortInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces.MgmtPort')
end

function network_adapter_client:OnInnerNetworkPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces.InnerNetwork', {'VLANId'})
end

function network_adapter_client:OnInnerNetworkInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces.InnerNetwork')
end

function network_adapter_client:OnInnerNetworkInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.EthernetInterfaces.InnerNetwork')
end

function network_adapter_client:OnLldpConfigInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.LldpConfig')
end

function network_adapter_client:OnLldpConfigInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Managers.LldpConfig')
end

function network_adapter_client:OnFrudataInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.FrudataService.Frudata')
end

function network_adapter_client:OnFrudataInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.FrudataService.Frudata')
end

function network_adapter_client:OnNCSICapabilitiesInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.NCSICapabilities')
end

function network_adapter_client:OnNCSICapabilitiesInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.NCSICapabilities')
end

function network_adapter_client:OnFruCtrlPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.FruCtrl', {'PowerState', 'SysResetDetected'})
end

function network_adapter_client:OnFruCtrlInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.FruCtrl')
end

function network_adapter_client:OnFruCtrlInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.FruCtrl')
end

function network_adapter_client:GetBiosBiosObject(path_params)
    return mdb.try_get_object(self:get_bus(), path_params and
        ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Bios') or '/bmc/kepler/Systems/:SystemId/Bios',
        'bmc.kepler.Systems.Bios')
end

function network_adapter_client:GetBiosObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Bios', true,
        {'/bmc/kepler/Systems/:SystemId/Bios'})
end

function network_adapter_client:ForeachBiosObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Bios', cb, true,
        {'/bmc/kepler/Systems/:SystemId/Bios'})
end

function network_adapter_client:OnBiosPropertiesChanged(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Bios') or
                               '/bmc/kepler/Systems/:SystemId/Bios'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Systems.Bios', {'SystemStartupState'})
end

function network_adapter_client:OnBiosInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Bios') or
                               '/bmc/kepler/Systems/:SystemId/Bios'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.Systems.Bios')
end

function network_adapter_client:OnBiosInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Bios') or
                               '/bmc/kepler/Systems/:SystemId/Bios'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Systems.Bios')
end

function network_adapter_client:OnAccessorInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Accessor')
end

function network_adapter_client:OnAccessorInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Accessor')
end

function network_adapter_client:OnDPUCardInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.DPUCard')
end

function network_adapter_client:OnDPUCardInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.DPUCard')
end

function network_adapter_client:OnPCIeCardInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeDevices.PCIeCard')
end

function network_adapter_client:OnPCIeCardInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeDevices.PCIeCard')
end

function network_adapter_client:GetSmsSmsStatusObject(path_params)
    return mdb.try_get_object(self:get_bus(), path_params and
        ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or '/bmc/kepler/Systems/${SystemId}/Sms',
        'bmc.kepler.Systems.Sms.SmsStatus')
end

function network_adapter_client:GetSmsStatusObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Sms.SmsStatus', true,
        {'/bmc/kepler/Systems/${SystemId}/Sms'})
end

function network_adapter_client:ForeachSmsStatusObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Sms.SmsStatus', cb, true,
        {'/bmc/kepler/Systems/${SystemId}/Sms'})
end

function network_adapter_client:OnSmsStatusPropertiesChanged(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or
                               '/bmc/kepler/Systems/${SystemId}/Sms'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Systems.Sms.SmsStatus', {'State'})
end

function network_adapter_client:OnSmsStatusInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or
                               '/bmc/kepler/Systems/${SystemId}/Sms'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.Systems.Sms.SmsStatus')
end

function network_adapter_client:OnSmsStatusInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or
                               '/bmc/kepler/Systems/${SystemId}/Sms'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Systems.Sms.SmsStatus')
end

function network_adapter_client:GetSmsSmsObject(path_params)
    return mdb.try_get_object(self:get_bus(), path_params and
        ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or '/bmc/kepler/Systems/${SystemId}/Sms',
        'bmc.kepler.Systems.Sms')
end

function network_adapter_client:GetSmsObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Sms', true,
        {'/bmc/kepler/Systems/${SystemId}/Sms'})
end

function network_adapter_client:ForeachSmsObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Systems.Sms', cb, true,
        {'/bmc/kepler/Systems/${SystemId}/Sms'})
end

function network_adapter_client:OnSmsInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or
                               '/bmc/kepler/Systems/${SystemId}/Sms'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.Systems.Sms')
end

function network_adapter_client:OnSmsInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Systems/' .. path_params['SystemId'] .. '/Sms') or
                               '/bmc/kepler/Systems/${SystemId}/Sms'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Systems.Sms')
end

function network_adapter_client:OnNetworkBondingInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.NetworkBonding')
end

function network_adapter_client:OnNetworkBondingInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.NetworkBonding')
end

function network_adapter_client:OnEventsInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Events')
end

function network_adapter_client:OnEventsInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Events')
end

function network_adapter_client:GetPackagePackageObject(path_params)
    return mdb.try_get_object(self:get_bus(),
        path_params and ('/bmc/kepler/Managers/' .. path_params['ManagerId'] .. '/Package') or
            '/bmc/kepler/Managers/${ManagerId}/Package', 'bmc.kepler.Managers.Package')
end

function network_adapter_client:GetPackageObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.Package', true,
        {'/bmc/kepler/Managers/${ManagerId}/Package'})
end

function network_adapter_client:ForeachPackageObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.Package', cb, true,
        {'/bmc/kepler/Managers/${ManagerId}/Package'})
end

function network_adapter_client:OnPackageInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Managers/' .. path_params['ManagerId'] .. '/Package') or
                               '/bmc/kepler/Managers/${ManagerId}/Package'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.Managers.Package')
end

function network_adapter_client:OnPackageInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Managers/' .. path_params['ManagerId'] .. '/Package') or
                               '/bmc/kepler/Managers/${ManagerId}/Package'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Managers.Package')
end

function network_adapter_client:OnPmuPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Pmu', {'Status', 'SFPMaxTemperature'})
end

function network_adapter_client:OnPmuInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Pmu')
end

function network_adapter_client:OnPmuInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Pmu')
end

function network_adapter_client:OnSmBiosPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.SmBios', {'SmBiosStatus'})
end

function network_adapter_client:OnSmBiosInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.SmBios')
end

function network_adapter_client:OnSmBiosInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.SmBios')
end

function network_adapter_client:OnComponentPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Component', {'Health'})
end

function network_adapter_client:OnComponentInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Component')
end

function network_adapter_client:OnComponentInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.Component')
end

function network_adapter_client:OnPCIeSlotPropertiesChanged(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_properties_changed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeSlot', {'PowerState'})
end

function network_adapter_client:OnPCIeSlotInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeSlot')
end

function network_adapter_client:OnPCIeSlotInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PCIeSlot')
end

function network_adapter_client:GetUpdateServiceUpdateServiceObject()
    return mdb.try_get_object(self:get_bus(), '/bmc/kepler/UpdateService', 'bmc.kepler.UpdateService')
end

function network_adapter_client:OnUpdateServiceInterfacesAdded(cb)
    local path_namespace = '/bmc/kepler/UpdateService'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.UpdateService')
end

function network_adapter_client:OnUpdateServiceInterfacesRemoved(cb)
    local path_namespace = '/bmc/kepler/UpdateService'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.UpdateService')
end

function network_adapter_client:GetFirmwareInventoryFirmwareInventoryObject()
    return mdb.try_get_object(self:get_bus(), '/bmc/kepler/UpdateService/FirmwareInventory',
        'bmc.kepler.UpdateService.FirmwareInventory')
end

function network_adapter_client:OnFirmwareInventoryInterfacesAdded(cb)
    local path_namespace = '/bmc/kepler/UpdateService/FirmwareInventory'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.UpdateService.FirmwareInventory')
end

function network_adapter_client:OnFirmwareInventoryInterfacesRemoved(cb)
    local path_namespace = '/bmc/kepler/UpdateService/FirmwareInventory'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.UpdateService.FirmwareInventory')
end

function network_adapter_client:GetFirmwareInfoFirmwareInfoObject(path_params)
    return mdb.try_get_object(self:get_bus(),
        path_params and ('/bmc/kepler/UpdateService/FirmwareInventory/' .. path_params['Id']) or
            '/bmc/kepler/UpdateService/FirmwareInventory/:Id', 'bmc.kepler.UpdateService.FirmwareInfo')
end

function network_adapter_client:GetFirmwareInfoObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.UpdateService.FirmwareInfo', true,
        {'/bmc/kepler/UpdateService/FirmwareInventory/:Id'})
end

function network_adapter_client:ForeachFirmwareInfoObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.UpdateService.FirmwareInfo', cb, true,
        {'/bmc/kepler/UpdateService/FirmwareInventory/:Id'})
end

function network_adapter_client:OnFirmwareInfoInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/UpdateService/FirmwareInventory/' .. path_params['Id']) or
                               '/bmc/kepler/UpdateService/FirmwareInventory/:Id'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.UpdateService.FirmwareInfo')
end

function network_adapter_client:OnFirmwareInfoInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/UpdateService/FirmwareInventory/' .. path_params['Id']) or
                               '/bmc/kepler/UpdateService/FirmwareInventory/:Id'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.UpdateService.FirmwareInfo')
end

function network_adapter_client:GetFileFileObject(path_params)
    return mdb.try_get_object(self:get_bus(),
        path_params and ('/bmc/kepler/Managers/' .. path_params['Id'] .. '/Security/File') or
            '/bmc/kepler/Managers/:Id/Security/File', 'bmc.kepler.Managers.Security.File')
end

function network_adapter_client:GetFileObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.Security.File', true,
        {'/bmc/kepler/Managers/:Id/Security/File'})
end

function network_adapter_client:ForeachFileObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.Security.File', cb, true,
        {'/bmc/kepler/Managers/:Id/Security/File'})
end

function network_adapter_client:OnFileInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Managers/' .. path_params['Id'] .. '/Security/File') or
                               '/bmc/kepler/Managers/:Id/Security/File'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.Managers.Security.File')
end

function network_adapter_client:OnFileInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Managers/' .. path_params['Id'] .. '/Security/File') or
                               '/bmc/kepler/Managers/:Id/Security/File'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Managers.Security.File')
end

function network_adapter_client:OnPowerOnLockInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PowerOnLock')
end

function network_adapter_client:OnPowerOnLockInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Systems.PowerOnLock')
end

function network_adapter_client:GetFirmwareActiveFirmwareActiveObject()
    return mdb.try_get_object(self:get_bus(), '/bmc/kepler/UpdateService/FirmwareActive',
        'bmc.kepler.UpdateService.FirmwareActive')
end

function network_adapter_client:OnFirmwareActiveInterfacesAdded(cb)
    local path_namespace = '/bmc/kepler/UpdateService/FirmwareActive'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.UpdateService.FirmwareActive')
end

function network_adapter_client:OnFirmwareActiveInterfacesRemoved(cb)
    local path_namespace = '/bmc/kepler/UpdateService/FirmwareActive'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.UpdateService.FirmwareActive')
end

function network_adapter_client:GetProxyDriverObject(path_params)
    return mdb.try_get_object(self:get_bus(),
        path_params and ('/bmc/kepler/Managers/' .. path_params['Id'] .. '/Security/Proxy') or
            '/bmc/kepler/Managers/:Id/Security/Proxy', 'bmc.kepler.Managers.Security.Proxy.Driver')
end

function network_adapter_client:GetDriverObjects()
    return get_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.Security.Proxy.Driver', true,
        {'/bmc/kepler/Managers/:Id/Security/Proxy'})
end

function network_adapter_client:ForeachDriverObjects(cb)
    return foreach_non_virtual_interface_objects(self:get_bus(), 'bmc.kepler.Managers.Security.Proxy.Driver', cb, true,
        {'/bmc/kepler/Managers/:Id/Security/Proxy'})
end

function network_adapter_client:OnDriverInterfacesAdded(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Managers/' .. path_params['Id'] .. '/Security/Proxy') or
                               '/bmc/kepler/Managers/:Id/Security/Proxy'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), path_namespace, cb,
        'bmc.kepler.Managers.Security.Proxy.Driver')
end

function network_adapter_client:OnDriverInterfacesRemoved(cb, path_params)
    local path_namespace = path_params and ('/bmc/kepler/Managers/' .. path_params['Id'] .. '/Security/Proxy') or
                               '/bmc/kepler/Managers/:Id/Security/Proxy'
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), path_namespace,
        cb, 'bmc.kepler.Managers.Security.Proxy.Driver')
end

function network_adapter_client:OnConnectorInterfacesAdded(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_added(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Connector')
end

function network_adapter_client:OnConnectorInterfacesRemoved(cb)
    self.signal_slots[#self.signal_slots + 1] = subscribe_signal.on_interfaces_removed(self:get_bus(), '/bmc', cb,
        'bmc.kepler.Connector')
end

---@return Bios.ClearCmosRsp
function network_adapter_client:BiosBiosClearCmos(ctx, path_params)
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.ClearCmosRsp.new(obj:ClearCmos(ctx))
end

function network_adapter_client:PBiosBiosClearCmos(ctx, path_params)
    return pcall(function()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.ClearCmosRsp.new(obj:ClearCmos(ctx))
    end)
end

---@param Mode integer
---@return Bios.SetBiosConfigActiveModeRsp
function network_adapter_client:BiosBiosSetBiosConfigActiveMode(ctx, path_params, Mode)
    local req = Bios.SetBiosConfigActiveModeReq.new(Mode):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.SetBiosConfigActiveModeRsp.new(obj:SetBiosConfigActiveMode(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosSetBiosConfigActiveMode(ctx, path_params, Mode)
    return pcall(function()
        local req = Bios.SetBiosConfigActiveModeReq.new(Mode):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.SetBiosConfigActiveModeRsp.new(obj:SetBiosConfigActiveMode(ctx, req:unpack(true)))
    end)
end

---@return Bios.ResetSetupConfigRsp
function network_adapter_client:BiosBiosResetSetupConfig(ctx, path_params)
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.ResetSetupConfigRsp.new(obj:ResetSetupConfig(ctx))
end

function network_adapter_client:PBiosBiosResetSetupConfig(ctx, path_params)
    return pcall(function()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.ResetSetupConfigRsp.new(obj:ResetSetupConfig(ctx))
    end)
end

---@param PasswordType string
---@param OldPassword string
---@param NewPassword string
---@return Bios.ChangePasswordRsp
function network_adapter_client:BiosBiosChangePassword(ctx, path_params, PasswordType, OldPassword, NewPassword)
    local req = Bios.ChangePasswordReq.new(PasswordType, OldPassword, NewPassword):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.ChangePasswordRsp.new(obj:ChangePassword(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosChangePassword(ctx, path_params, PasswordType, OldPassword, NewPassword)
    return pcall(function()
        local req = Bios.ChangePasswordReq.new(PasswordType, OldPassword, NewPassword):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.ChangePasswordRsp.new(obj:ChangePassword(ctx, req:unpack(true)))
    end)
end

---@param BiosLogPrintEnabled integer
---@return Bios.SetBiosLogEnabledRsp
function network_adapter_client:BiosBiosSetBiosLogEnabled(ctx, path_params, BiosLogPrintEnabled)
    local req = Bios.SetBiosLogEnabledReq.new(BiosLogPrintEnabled):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.SetBiosLogEnabledRsp.new(obj:SetBiosLogEnabled(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosSetBiosLogEnabled(ctx, path_params, BiosLogPrintEnabled)
    return pcall(function()
        local req = Bios.SetBiosLogEnabledReq.new(BiosLogPrintEnabled):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.SetBiosLogEnabledRsp.new(obj:SetBiosLogEnabled(ctx, req:unpack(true)))
    end)
end

---@param FileType string
---@return Bios.ExportBiosSetupRsp
function network_adapter_client:BiosBiosExportBiosSetup(ctx, path_params, FileType)
    local req = Bios.ExportBiosSetupReq.new(FileType):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.ExportBiosSetupRsp.new(obj:ExportBiosSetup(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosExportBiosSetup(ctx, path_params, FileType)
    return pcall(function()
        local req = Bios.ExportBiosSetupReq.new(FileType):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.ExportBiosSetupRsp.new(obj:ExportBiosSetup(ctx, req:unpack(true)))
    end)
end

---@param FileType string
---@param Content string
---@return Bios.ImportBiosSetupRsp
function network_adapter_client:BiosBiosImportBiosSetup(ctx, path_params, FileType, Content)
    local req = Bios.ImportBiosSetupReq.new(FileType, Content):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.ImportBiosSetupRsp.new(obj:ImportBiosSetup(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosImportBiosSetup(ctx, path_params, FileType, Content)
    return pcall(function()
        local req = Bios.ImportBiosSetupReq.new(FileType, Content):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.ImportBiosSetupRsp.new(obj:ImportBiosSetup(ctx, req:unpack(true)))
    end)
end

---@param ReqKey string
---@return Bios.GetCurrentValueSettingRsp
function network_adapter_client:BiosBiosGetCurrentValueSetting(ctx, path_params, ReqKey)
    local req = Bios.GetCurrentValueSettingReq.new(ReqKey):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.GetCurrentValueSettingRsp.new(obj:GetCurrentValueSetting(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosGetCurrentValueSetting(ctx, path_params, ReqKey)
    return pcall(function()
        local req = Bios.GetCurrentValueSettingReq.new(ReqKey):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.GetCurrentValueSettingRsp.new(obj:GetCurrentValueSetting(ctx, req:unpack(true)))
    end)
end

---@return Bios.RemoveCachedSettingsRsp
function network_adapter_client:BiosBiosRemoveCachedSettings(ctx, path_params)
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.RemoveCachedSettingsRsp.new(obj:RemoveCachedSettings(ctx))
end

function network_adapter_client:PBiosBiosRemoveCachedSettings(ctx, path_params)
    return pcall(function()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.RemoveCachedSettingsRsp.new(obj:RemoveCachedSettings(ctx))
    end)
end

---@param OutputFilePath string
---@return Bios.ExportFirmwareRsp
function network_adapter_client:BiosBiosExportFirmware(ctx, path_params, OutputFilePath)
    local req = Bios.ExportFirmwareReq.new(OutputFilePath):validate()
    local obj = self:GetBiosBiosObject(path_params)

    return Bios.ExportFirmwareRsp.new(obj:ExportFirmware(ctx, req:unpack(true)))
end

function network_adapter_client:PBiosBiosExportFirmware(ctx, path_params, OutputFilePath)
    return pcall(function()
        local req = Bios.ExportFirmwareReq.new(OutputFilePath):validate()
        local obj = self:GetBiosBiosObject(path_params)

        return Bios.ExportFirmwareRsp.new(obj:ExportFirmware(ctx, req:unpack(true)))
    end)
end

---@param Request string
---@return Sms.SetForwardWhiteListRsp
function network_adapter_client:SmsSmsSetForwardWhiteList(ctx, path_params, Request)
    local req = Sms.SetForwardWhiteListReq.new(Request):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.SetForwardWhiteListRsp.new(obj:SetForwardWhiteList(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsSetForwardWhiteList(ctx, path_params, Request)
    return pcall(function()
        local req = Sms.SetForwardWhiteListReq.new(Request):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.SetForwardWhiteListRsp.new(obj:SetForwardWhiteList(ctx, req:unpack(true)))
    end)
end

---@param Request string
---@param RetryTimes integer
---@return Sms.ForwardRequestRsp
function network_adapter_client:SmsSmsForwardRequest(ctx, path_params, Request, RetryTimes)
    local req = Sms.ForwardRequestReq.new(Request, RetryTimes):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.ForwardRequestRsp.new(obj:ForwardRequest(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsForwardRequest(ctx, path_params, Request, RetryTimes)
    return pcall(function()
        local req = Sms.ForwardRequestReq.new(Request, RetryTimes):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.ForwardRequestRsp.new(obj:ForwardRequest(ctx, req:unpack(true)))
    end)
end

---@param RequestMethod string
---@param RequestToken string
---@param RequestBody string
---@return Sms.ForwardEventRsp
function network_adapter_client:SmsSmsForwardEvent(ctx, path_params, RequestMethod, RequestToken, RequestBody)
    local req = Sms.ForwardEventReq.new(RequestMethod, RequestToken, RequestBody):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.ForwardEventRsp.new(obj:ForwardEvent(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsForwardEvent(ctx, path_params, RequestMethod, RequestToken, RequestBody)
    return pcall(function()
        local req = Sms.ForwardEventReq.new(RequestMethod, RequestToken, RequestBody):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.ForwardEventRsp.new(obj:ForwardEvent(ctx, req:unpack(true)))
    end)
end

---@param ResourceType string
---@return Sms.UpdateSpecificResourceRsp
function network_adapter_client:SmsSmsUpdateSpecificResource(ctx, path_params, ResourceType)
    local req = Sms.UpdateSpecificResourceReq.new(ResourceType):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.UpdateSpecificResourceRsp.new(obj:UpdateSpecificResource(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsUpdateSpecificResource(ctx, path_params, ResourceType)
    return pcall(function()
        local req = Sms.UpdateSpecificResourceReq.new(ResourceType):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.UpdateSpecificResourceRsp.new(obj:UpdateSpecificResource(ctx, req:unpack(true)))
    end)
end

---@param ChannelType integer
---@param IsPowerOffPer boolean
---@return Sms.SetChannelTypeRsp
function network_adapter_client:SmsSmsSetChannelType(ctx, path_params, ChannelType, IsPowerOffPer)
    local req = Sms.SetChannelTypeReq.new(ChannelType, IsPowerOffPer):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.SetChannelTypeRsp.new(obj:SetChannelType(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsSetChannelType(ctx, path_params, ChannelType, IsPowerOffPer)
    return pcall(function()
        local req = Sms.SetChannelTypeReq.new(ChannelType, IsPowerOffPer):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.SetChannelTypeRsp.new(obj:SetChannelType(ctx, req:unpack(true)))
    end)
end

---@param IsPowerOffPer boolean
---@return Sms.GetChannelTypeRsp
function network_adapter_client:SmsSmsGetChannelType(ctx, path_params, IsPowerOffPer)
    local req = Sms.GetChannelTypeReq.new(IsPowerOffPer):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.GetChannelTypeRsp.new(obj:GetChannelType(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsGetChannelType(ctx, path_params, IsPowerOffPer)
    return pcall(function()
        local req = Sms.GetChannelTypeReq.new(IsPowerOffPer):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.GetChannelTypeRsp.new(obj:GetChannelType(ctx, req:unpack(true)))
    end)
end

---@param Enabled boolean
---@return Sms.SetCdevChannelEnabledRsp
function network_adapter_client:SmsSmsSetCdevChannelEnabled(ctx, path_params, Enabled)
    local req = Sms.SetCdevChannelEnabledReq.new(Enabled):validate()
    local obj = self:GetSmsSmsObject(path_params)

    return Sms.SetCdevChannelEnabledRsp.new(obj:SetCdevChannelEnabled(ctx, req:unpack(true)))
end

function network_adapter_client:PSmsSmsSetCdevChannelEnabled(ctx, path_params, Enabled)
    return pcall(function()
        local req = Sms.SetCdevChannelEnabledReq.new(Enabled):validate()
        local obj = self:GetSmsSmsObject(path_params)

        return Sms.SetCdevChannelEnabledRsp.new(obj:SetCdevChannelEnabled(ctx, req:unpack(true)))
    end)
end

---@param FilePath string
---@param AdditionalOptions UpdateService.Object
---@return UpdateService.StartUpgradeRsp
function network_adapter_client:UpdateServiceUpdateServiceStartUpgrade(ctx, FilePath, AdditionalOptions)
    local req = UpdateService.StartUpgradeReq.new(FilePath, AdditionalOptions):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.StartUpgradeRsp.new(obj:StartUpgrade(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceStartUpgrade(ctx, FilePath, AdditionalOptions)
    return pcall(function()
        local req = UpdateService.StartUpgradeReq.new(FilePath, AdditionalOptions):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.StartUpgradeRsp.new(obj:StartUpgrade(ctx, req:unpack(true)))
    end)
end

---@param UpgradeOptions UpdateService.Object
---@param Packages UpdateService.ParallelUpgradePackages[]
---@return UpdateService.ParallelUpdateRsp
function network_adapter_client:UpdateServiceUpdateServiceParallelUpdate(ctx, UpgradeOptions, Packages)
    local req = UpdateService.ParallelUpdateReq.new(UpgradeOptions, Packages):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.ParallelUpdateRsp.new(obj:ParallelUpdate(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceParallelUpdate(ctx, UpgradeOptions, Packages)
    return pcall(function()
        local req = UpdateService.ParallelUpdateReq.new(UpgradeOptions, Packages):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.ParallelUpdateRsp.new(obj:ParallelUpdate(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param FirmwareType string
---@param VersionStr string
---@param PrepareResult integer
---@param AdditionalOptions UpdateService.Object
---@return UpdateService.PrepareReplyRsp
function network_adapter_client:UpdateServiceUpdateServicePrepareReply(ctx, SystemId, FirmwareType, VersionStr,
    PrepareResult, AdditionalOptions)
    local req =
        UpdateService.PrepareReplyReq.new(SystemId, FirmwareType, VersionStr, PrepareResult, AdditionalOptions):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.PrepareReplyRsp.new(obj:PrepareReply(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServicePrepareReply(ctx, SystemId, FirmwareType, VersionStr,
    PrepareResult, AdditionalOptions)
    return pcall(function()
        local req = UpdateService.PrepareReplyReq.new(SystemId, FirmwareType, VersionStr, PrepareResult,
            AdditionalOptions):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.PrepareReplyRsp.new(obj:PrepareReply(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param FirmwareType string
---@param ProcessResult integer
---@param AdditionalOptions UpdateService.Object
---@return UpdateService.ProcessReplyRsp
function network_adapter_client:UpdateServiceUpdateServiceProcessReply(ctx, SystemId, FirmwareType, ProcessResult,
    AdditionalOptions)
    local req = UpdateService.ProcessReplyReq.new(SystemId, FirmwareType, ProcessResult, AdditionalOptions):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.ProcessReplyRsp.new(obj:ProcessReply(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceProcessReply(ctx, SystemId, FirmwareType, ProcessResult,
    AdditionalOptions)
    return pcall(function()
        local req =
            UpdateService.ProcessReplyReq.new(SystemId, FirmwareType, ProcessResult, AdditionalOptions):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.ProcessReplyRsp.new(obj:ProcessReply(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param FirmwareType string
---@param FinishResult integer
---@param AdditionalOptions UpdateService.Object
---@return UpdateService.FinishReplyRsp
function network_adapter_client:UpdateServiceUpdateServiceFinishReply(ctx, SystemId, FirmwareType, FinishResult,
    AdditionalOptions)
    local req = UpdateService.FinishReplyReq.new(SystemId, FirmwareType, FinishResult, AdditionalOptions):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.FinishReplyRsp.new(obj:FinishReply(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceFinishReply(ctx, SystemId, FirmwareType, FinishResult,
    AdditionalOptions)
    return pcall(function()
        local req = UpdateService.FinishReplyReq.new(SystemId, FirmwareType, FinishResult, AdditionalOptions):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.FinishReplyRsp.new(obj:FinishReply(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param FirmwareType string
---@param ResultCode integer
---@param Progress integer
---@param ResultDetail string
---@param AdditionalOptions UpdateService.Object
---@return UpdateService.UpdateUpgradeStatusRsp
function network_adapter_client:UpdateServiceUpdateServiceUpdateUpgradeStatus(ctx, SystemId, FirmwareType, ResultCode,
    Progress, ResultDetail, AdditionalOptions)
    local req = UpdateService.UpdateUpgradeStatusReq.new(SystemId, FirmwareType, ResultCode, Progress, ResultDetail,
        AdditionalOptions):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.UpdateUpgradeStatusRsp.new(obj:UpdateUpgradeStatus(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceUpdateUpgradeStatus(ctx, SystemId, FirmwareType, ResultCode,
    Progress, ResultDetail, AdditionalOptions)
    return pcall(function()
        local req = UpdateService.UpdateUpgradeStatusReq.new(SystemId, FirmwareType, ResultCode, Progress, ResultDetail,
            AdditionalOptions):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.UpdateUpgradeStatusRsp.new(obj:UpdateUpgradeStatus(ctx, req:unpack(true)))
    end)
end

---@param TaskId integer
---@return UpdateService.GetUpgradeStatusRsp
function network_adapter_client:UpdateServiceUpdateServiceGetUpgradeStatus(ctx, TaskId)
    local req = UpdateService.GetUpgradeStatusReq.new(TaskId):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.GetUpgradeStatusRsp.new(obj:GetUpgradeStatus(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceGetUpgradeStatus(ctx, TaskId)
    return pcall(function()
        local req = UpdateService.GetUpgradeStatusReq.new(TaskId):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.GetUpgradeStatusRsp.new(obj:GetUpgradeStatus(ctx, req:unpack(true)))
    end)
end

---@return UpdateService.GetUpdateProgressRsp
function network_adapter_client:UpdateServiceUpdateServiceGetUpdateProgress(ctx)
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.GetUpdateProgressRsp.new(obj:GetUpdateProgress(ctx))
end

function network_adapter_client:PUpdateServiceUpdateServiceGetUpdateProgress(ctx)
    return pcall(function()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.GetUpdateProgressRsp.new(obj:GetUpdateProgress(ctx))
    end)
end

---@return UpdateService.GetPendingFirmwareListRsp
function network_adapter_client:UpdateServiceUpdateServiceGetPendingFirmwareList(ctx)
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.GetPendingFirmwareListRsp.new(obj:GetPendingFirmwareList(ctx))
end

function network_adapter_client:PUpdateServiceUpdateServiceGetPendingFirmwareList(ctx)
    return pcall(function()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.GetPendingFirmwareListRsp.new(obj:GetPendingFirmwareList(ctx))
    end)
end

---@param SystemId integer
---@param Id string
---@return UpdateService.RollbackRsp
function network_adapter_client:UpdateServiceUpdateServiceRollback(ctx, SystemId, Id)
    local req = UpdateService.RollbackReq.new(SystemId, Id):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.RollbackRsp.new(obj:Rollback(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceRollback(ctx, SystemId, Id)
    return pcall(function()
        local req = UpdateService.RollbackReq.new(SystemId, Id):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.RollbackRsp.new(obj:Rollback(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param Id string
---@return UpdateService.ExportRsp
function network_adapter_client:UpdateServiceUpdateServiceExport(ctx, SystemId, Id)
    local req = UpdateService.ExportReq.new(SystemId, Id):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.ExportRsp.new(obj:Export(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceExport(ctx, SystemId, Id)
    return pcall(function()
        local req = UpdateService.ExportReq.new(SystemId, Id):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.ExportRsp.new(obj:Export(ctx, req:unpack(true)))
    end)
end

---@param FilePath string
---@param FirmwareType string
---@return UpdateService.CheckFirmwareTypeRsp
function network_adapter_client:UpdateServiceUpdateServiceCheckFirmwareType(ctx, FilePath, FirmwareType)
    local req = UpdateService.CheckFirmwareTypeReq.new(FilePath, FirmwareType):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.CheckFirmwareTypeRsp.new(obj:CheckFirmwareType(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceCheckFirmwareType(ctx, FilePath, FirmwareType)
    return pcall(function()
        local req = UpdateService.CheckFirmwareTypeReq.new(FilePath, FirmwareType):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.CheckFirmwareTypeRsp.new(obj:CheckFirmwareType(ctx, req:unpack(true)))
    end)
end

---@param FilePath string
---@return UpdateService.ParseFirmwarePackageRsp
function network_adapter_client:UpdateServiceUpdateServiceParseFirmwarePackage(ctx, FilePath)
    local req = UpdateService.ParseFirmwarePackageReq.new(FilePath):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.ParseFirmwarePackageRsp.new(obj:ParseFirmwarePackage(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceParseFirmwarePackage(ctx, FilePath)
    return pcall(function()
        local req = UpdateService.ParseFirmwarePackageReq.new(FilePath):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.ParseFirmwarePackageRsp.new(obj:ParseFirmwarePackage(ctx, req:unpack(true)))
    end)
end

---@param FirmwareIds string[]
---@return UpdateService.ActiveStagedFirmwaresRsp
function network_adapter_client:UpdateServiceUpdateServiceActiveStagedFirmwares(ctx, FirmwareIds)
    local req = UpdateService.ActiveStagedFirmwaresReq.new(FirmwareIds):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.ActiveStagedFirmwaresRsp.new(obj:ActiveStagedFirmwares(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceActiveStagedFirmwares(ctx, FirmwareIds)
    return pcall(function()
        local req = UpdateService.ActiveStagedFirmwaresReq.new(FirmwareIds):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.ActiveStagedFirmwaresRsp.new(obj:ActiveStagedFirmwares(ctx, req:unpack(true)))
    end)
end

---@param FirmwareIds string[]
---@return UpdateService.DiscardStagedFirmwaresRsp
function network_adapter_client:UpdateServiceUpdateServiceDiscardStagedFirmwares(ctx, FirmwareIds)
    local req = UpdateService.DiscardStagedFirmwaresReq.new(FirmwareIds):validate()
    local obj = self:GetUpdateServiceUpdateServiceObject()

    return UpdateService.DiscardStagedFirmwaresRsp.new(obj:DiscardStagedFirmwares(ctx, req:unpack(true)))
end

function network_adapter_client:PUpdateServiceUpdateServiceDiscardStagedFirmwares(ctx, FirmwareIds)
    return pcall(function()
        local req = UpdateService.DiscardStagedFirmwaresReq.new(FirmwareIds):validate()
        local obj = self:GetUpdateServiceUpdateServiceObject()

        return UpdateService.DiscardStagedFirmwaresRsp.new(obj:DiscardStagedFirmwares(ctx, req:unpack(true)))
    end)
end

---@param FirmwareInfoTable FirmwareInventory.Object
---@param Updateable boolean
---@param Capability integer
---@param MaxPackageSizeMiB integer
---@return FirmwareInventory.AddRsp
function network_adapter_client:FirmwareInventoryFirmwareInventoryAdd(ctx, FirmwareInfoTable, Updateable, Capability,
    MaxPackageSizeMiB)
    local req = FirmwareInventory.AddReq.new(FirmwareInfoTable, Updateable, Capability, MaxPackageSizeMiB):validate()
    local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

    return FirmwareInventory.AddRsp.new(obj:Add(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareInventoryFirmwareInventoryAdd(ctx, FirmwareInfoTable, Updateable, Capability,
    MaxPackageSizeMiB)
    return pcall(function()
        local req =
            FirmwareInventory.AddReq.new(FirmwareInfoTable, Updateable, Capability, MaxPackageSizeMiB):validate()
        local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

        return FirmwareInventory.AddRsp.new(obj:Add(ctx, req:unpack(true)))
    end)
end

---@param Id string
---@return FirmwareInventory.DeleteRsp
function network_adapter_client:FirmwareInventoryFirmwareInventoryDelete(ctx, Id)
    local req = FirmwareInventory.DeleteReq.new(Id):validate()
    local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

    return FirmwareInventory.DeleteRsp.new(obj:Delete(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareInventoryFirmwareInventoryDelete(ctx, Id)
    return pcall(function()
        local req = FirmwareInventory.DeleteReq.new(Id):validate()
        local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

        return FirmwareInventory.DeleteRsp.new(obj:Delete(ctx, req:unpack(true)))
    end)
end

---@return FirmwareInventory.GetAllFirmwareInfoRsp
function network_adapter_client:FirmwareInventoryFirmwareInventoryGetAllFirmwareInfo(ctx)
    local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

    return FirmwareInventory.GetAllFirmwareInfoRsp.new(obj:GetAllFirmwareInfo(ctx))
end

function network_adapter_client:PFirmwareInventoryFirmwareInventoryGetAllFirmwareInfo(ctx)
    return pcall(function()
        local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

        return FirmwareInventory.GetAllFirmwareInfoRsp.new(obj:GetAllFirmwareInfo(ctx))
    end)
end

---@param Options FirmwareInventory.Object
---@return FirmwareInventory.GetFirmwareListRsp
function network_adapter_client:FirmwareInventoryFirmwareInventoryGetFirmwareList(ctx, Options)
    local req = FirmwareInventory.GetFirmwareListReq.new(Options):validate()
    local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

    return FirmwareInventory.GetFirmwareListRsp.new(obj:GetFirmwareList(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareInventoryFirmwareInventoryGetFirmwareList(ctx, Options)
    return pcall(function()
        local req = FirmwareInventory.GetFirmwareListReq.new(Options):validate()
        local obj = self:GetFirmwareInventoryFirmwareInventoryObject()

        return FirmwareInventory.GetFirmwareListRsp.new(obj:GetFirmwareList(ctx, req:unpack(true)))
    end)
end

---@param SrcFile string
---@param DstFile string
---@param Uid integer
---@param Gid integer
---@return File.CopyRsp
function network_adapter_client:FileFileCopy(ctx, path_params, SrcFile, DstFile, Uid, Gid)
    local req = File.CopyReq.new(SrcFile, DstFile, Uid, Gid):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.CopyRsp.new(obj:Copy(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileCopy(ctx, path_params, SrcFile, DstFile, Uid, Gid)
    return pcall(function()
        local req = File.CopyReq.new(SrcFile, DstFile, Uid, Gid):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.CopyRsp.new(obj:Copy(ctx, req:unpack(true)))
    end)
end

---@param SrcFile string
---@param DstFile string
---@param Uid integer
---@param Gid integer
---@return File.MoveRsp
function network_adapter_client:FileFileMove(ctx, path_params, SrcFile, DstFile, Uid, Gid)
    local req = File.MoveReq.new(SrcFile, DstFile, Uid, Gid):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.MoveRsp.new(obj:Move(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileMove(ctx, path_params, SrcFile, DstFile, Uid, Gid)
    return pcall(function()
        local req = File.MoveReq.new(SrcFile, DstFile, Uid, Gid):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.MoveRsp.new(obj:Move(ctx, req:unpack(true)))
    end)
end

---@param DstFile string
---@param FileMode integer
---@return File.ChmodRsp
function network_adapter_client:FileFileChmod(ctx, path_params, DstFile, FileMode)
    local req = File.ChmodReq.new(DstFile, FileMode):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.ChmodRsp.new(obj:Chmod(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileChmod(ctx, path_params, DstFile, FileMode)
    return pcall(function()
        local req = File.ChmodReq.new(DstFile, FileMode):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.ChmodRsp.new(obj:Chmod(ctx, req:unpack(true)))
    end)
end

---@param DstFile string
---@param Uid integer
---@param Gid integer
---@return File.ChownRsp
function network_adapter_client:FileFileChown(ctx, path_params, DstFile, Uid, Gid)
    local req = File.ChownReq.new(DstFile, Uid, Gid):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.ChownRsp.new(obj:Chown(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileChown(ctx, path_params, DstFile, Uid, Gid)
    return pcall(function()
        local req = File.ChownReq.new(DstFile, Uid, Gid):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.ChownRsp.new(obj:Chown(ctx, req:unpack(true)))
    end)
end

---@param DstFile string
---@return File.DeleteRsp
function network_adapter_client:FileFileDelete(ctx, path_params, DstFile)
    local req = File.DeleteReq.new(DstFile):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.DeleteRsp.new(obj:Delete(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileDelete(ctx, path_params, DstFile)
    return pcall(function()
        local req = File.DeleteReq.new(DstFile):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.DeleteRsp.new(obj:Delete(ctx, req:unpack(true)))
    end)
end

---@param DstFile string
---@param OpenMode string
---@param FileMode integer
---@param Uid integer
---@param Gid integer
---@return File.CreateRsp
function network_adapter_client:FileFileCreate(ctx, path_params, DstFile, OpenMode, FileMode, Uid, Gid)
    local req = File.CreateReq.new(DstFile, OpenMode, FileMode, Uid, Gid):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.CreateRsp.new(obj:Create(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileCreate(ctx, path_params, DstFile, OpenMode, FileMode, Uid, Gid)
    return pcall(function()
        local req = File.CreateReq.new(DstFile, OpenMode, FileMode, Uid, Gid):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.CreateRsp.new(obj:Create(ctx, req:unpack(true)))
    end)
end

---@param DstFile string
---@return File.ChangeOwnerRsp
function network_adapter_client:FileFileChangeOwner(ctx, path_params, DstFile)
    local req = File.ChangeOwnerReq.new(DstFile):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.ChangeOwnerRsp.new(obj:ChangeOwner(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileChangeOwner(ctx, path_params, DstFile)
    return pcall(function()
        local req = File.ChangeOwnerReq.new(DstFile):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.ChangeOwnerRsp.new(obj:ChangeOwner(ctx, req:unpack(true)))
    end)
end

---@param DstFile string
---@param Permission string
---@return File.IsPermittedRsp
function network_adapter_client:FileFileIsPermitted(ctx, path_params, DstFile, Permission)
    local req = File.IsPermittedReq.new(DstFile, Permission):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.IsPermittedRsp.new(obj:IsPermitted(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileIsPermitted(ctx, path_params, DstFile, Permission)
    return pcall(function()
        local req = File.IsPermittedReq.new(DstFile, Permission):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.IsPermittedRsp.new(obj:IsPermitted(ctx, req:unpack(true)))
    end)
end

---@param Path string
---@param Mode integer
---@return File.AccessRsp
function network_adapter_client:FileFileAccess(ctx, path_params, Path, Mode)
    local req = File.AccessReq.new(Path, Mode):validate()
    local obj = self:GetFileFileObject(path_params)

    return File.AccessRsp.new(obj:Access(ctx, req:unpack(true)))
end

function network_adapter_client:PFileFileAccess(ctx, path_params, Path, Mode)
    return pcall(function()
        local req = File.AccessReq.new(Path, Mode):validate()
        local obj = self:GetFileFileObject(path_params)

        return File.AccessRsp.new(obj:Access(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@return FirmwareActive.StartActiveRsp
function network_adapter_client:FirmwareActiveFirmwareActiveStartActive(ctx, SystemId)
    local req = FirmwareActive.StartActiveReq.new(SystemId):validate()
    local obj = self:GetFirmwareActiveFirmwareActiveObject()

    return FirmwareActive.StartActiveRsp.new(obj:StartActive(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareActiveFirmwareActiveStartActive(ctx, SystemId)
    return pcall(function()
        local req = FirmwareActive.StartActiveReq.new(SystemId):validate()
        local obj = self:GetFirmwareActiveFirmwareActiveObject()

        return FirmwareActive.StartActiveRsp.new(obj:StartActive(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param AdditionalOptions FirmwareActive.Object
---@return FirmwareActive.StartActiveWithPolicyRsp
function network_adapter_client:FirmwareActiveFirmwareActiveStartActiveWithPolicy(ctx, SystemId, AdditionalOptions)
    local req = FirmwareActive.StartActiveWithPolicyReq.new(SystemId, AdditionalOptions):validate()
    local obj = self:GetFirmwareActiveFirmwareActiveObject()

    return FirmwareActive.StartActiveWithPolicyRsp.new(obj:StartActiveWithPolicy(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareActiveFirmwareActiveStartActiveWithPolicy(ctx, SystemId, AdditionalOptions)
    return pcall(function()
        local req = FirmwareActive.StartActiveWithPolicyReq.new(SystemId, AdditionalOptions):validate()
        local obj = self:GetFirmwareActiveFirmwareActiveObject()

        return FirmwareActive.StartActiveWithPolicyRsp.new(obj:StartActiveWithPolicy(ctx, req:unpack(true)))
    end)
end

---@param ActiveAction FirmwareActive.KeyValueTable[]
---@return FirmwareActive.RegisterActiveActionRsp
function network_adapter_client:FirmwareActiveFirmwareActiveRegisterActiveAction(ctx, ActiveAction)
    local req = FirmwareActive.RegisterActiveActionReq.new(ActiveAction):validate()
    local obj = self:GetFirmwareActiveFirmwareActiveObject()

    return FirmwareActive.RegisterActiveActionRsp.new(obj:RegisterActiveAction(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareActiveFirmwareActiveRegisterActiveAction(ctx, ActiveAction)
    return pcall(function()
        local req = FirmwareActive.RegisterActiveActionReq.new(ActiveAction):validate()
        local obj = self:GetFirmwareActiveFirmwareActiveObject()

        return FirmwareActive.RegisterActiveActionRsp.new(obj:RegisterActiveAction(ctx, req:unpack(true)))
    end)
end

---@param ActiveStatus FirmwareActive.KeyValueTable[]
---@return FirmwareActive.UpdateActiveStatusRsp
function network_adapter_client:FirmwareActiveFirmwareActiveUpdateActiveStatus(ctx, ActiveStatus)
    local req = FirmwareActive.UpdateActiveStatusReq.new(ActiveStatus):validate()
    local obj = self:GetFirmwareActiveFirmwareActiveObject()

    return FirmwareActive.UpdateActiveStatusRsp.new(obj:UpdateActiveStatus(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareActiveFirmwareActiveUpdateActiveStatus(ctx, ActiveStatus)
    return pcall(function()
        local req = FirmwareActive.UpdateActiveStatusReq.new(ActiveStatus):validate()
        local obj = self:GetFirmwareActiveFirmwareActiveObject()

        return FirmwareActive.UpdateActiveStatusRsp.new(obj:UpdateActiveStatus(ctx, req:unpack(true)))
    end)
end

---@param SystemId integer
---@param FirmwareType string
---@param ProcessResult integer
---@return FirmwareActive.ActiveProcessReplyRsp
function network_adapter_client:FirmwareActiveFirmwareActiveActiveProcessReply(ctx, SystemId, FirmwareType,
    ProcessResult)
    local req = FirmwareActive.ActiveProcessReplyReq.new(SystemId, FirmwareType, ProcessResult):validate()
    local obj = self:GetFirmwareActiveFirmwareActiveObject()

    return FirmwareActive.ActiveProcessReplyRsp.new(obj:ActiveProcessReply(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareActiveFirmwareActiveActiveProcessReply(ctx, SystemId, FirmwareType,
    ProcessResult)
    return pcall(function()
        local req = FirmwareActive.ActiveProcessReplyReq.new(SystemId, FirmwareType, ProcessResult):validate()
        local obj = self:GetFirmwareActiveFirmwareActiveObject()

        return FirmwareActive.ActiveProcessReplyRsp.new(obj:ActiveProcessReply(ctx, req:unpack(true)))
    end)
end

---@param FirmwareIds string[]
---@return FirmwareActive.DeleteActiveActionRsp
function network_adapter_client:FirmwareActiveFirmwareActiveDeleteActiveAction(ctx, FirmwareIds)
    local req = FirmwareActive.DeleteActiveActionReq.new(FirmwareIds):validate()
    local obj = self:GetFirmwareActiveFirmwareActiveObject()

    return FirmwareActive.DeleteActiveActionRsp.new(obj:DeleteActiveAction(ctx, req:unpack(true)))
end

function network_adapter_client:PFirmwareActiveFirmwareActiveDeleteActiveAction(ctx, FirmwareIds)
    return pcall(function()
        local req = FirmwareActive.DeleteActiveActionReq.new(FirmwareIds):validate()
        local obj = self:GetFirmwareActiveFirmwareActiveObject()

        return FirmwareActive.DeleteActiveActionRsp.new(obj:DeleteActiveAction(ctx, req:unpack(true)))
    end)
end

---@param ModulePath string
---@param ExtendParams Driver.ExtendParams
---@return Driver.InsmodRsp
function network_adapter_client:ProxyDriverInsmod(ctx, path_params, ModulePath, ExtendParams)
    local req = Driver.InsmodReq.new(ModulePath, ExtendParams):validate()
    local obj = self:GetProxyDriverObject(path_params)

    return Driver.InsmodRsp.new(obj:Insmod(ctx, req:unpack(true)))
end

function network_adapter_client:PProxyDriverInsmod(ctx, path_params, ModulePath, ExtendParams)
    return pcall(function()
        local req = Driver.InsmodReq.new(ModulePath, ExtendParams):validate()
        local obj = self:GetProxyDriverObject(path_params)

        return Driver.InsmodRsp.new(obj:Insmod(ctx, req:unpack(true)))
    end)
end

---@param ModulePath string
---@param ExtendParams Driver.ExtendParams
---@return Driver.RmmodRsp
function network_adapter_client:ProxyDriverRmmod(ctx, path_params, ModulePath, ExtendParams)
    local req = Driver.RmmodReq.new(ModulePath, ExtendParams):validate()
    local obj = self:GetProxyDriverObject(path_params)

    return Driver.RmmodRsp.new(obj:Rmmod(ctx, req:unpack(true)))
end

function network_adapter_client:PProxyDriverRmmod(ctx, path_params, ModulePath, ExtendParams)
    return pcall(function()
        local req = Driver.RmmodReq.new(ModulePath, ExtendParams):validate()
        local obj = self:GetProxyDriverObject(path_params)

        return Driver.RmmodRsp.new(obj:Rmmod(ctx, req:unpack(true)))
    end)
end

function network_adapter_client:SubscribePCIeEndpointOnMessage(cb)
    local sig = match_rule.signal('OnMessage', 'bmc.kepler.Systems.Mctp.PCIeEndpoint')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribePCIeEndpointMessageReceived(cb)
    local sig = match_rule.signal('MessageReceived', 'bmc.kepler.Systems.Mctp.PCIeEndpoint')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeEthernetInterfacesActivePortChangedSignal(cb)
    local sig = match_rule.signal('ActivePortChangedSignal', 'bmc.kepler.Managers.EthernetInterfaces')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeEthernetInterfacesNCSIInfoChangedSignal(cb)
    local sig = match_rule.signal('NCSIInfoChangedSignal', 'bmc.kepler.Managers.EthernetInterfaces')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeEthernetInterfacesEthMacChangedSignal(cb)
    local sig = match_rule.signal('EthMacChangedSignal', 'bmc.kepler.Managers.EthernetInterfaces')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeLldpConfigLLDPOverNCSIStateChanged(cb)
    local sig = match_rule.signal('LLDPOverNCSIStateChanged', 'bmc.kepler.Managers.LldpConfig')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeFruCtrlBeforePowerOnSignal(cb)
    local sig = match_rule.signal('BeforePowerOnSignal', 'bmc.kepler.Systems.FruCtrl')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeUpdateServiceUpdateServiceUpgradePrepareSignal(cb)
    local sig = match_rule.signal('UpgradePrepareSignal', 'bmc.kepler.UpdateService'):with_path(
        '/bmc/kepler/UpdateService')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeUpdateServiceUpdateServiceUpgradeProcessSignal(cb)
    local sig = match_rule.signal('UpgradeProcessSignal', 'bmc.kepler.UpdateService'):with_path(
        '/bmc/kepler/UpdateService')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeUpdateServiceUpdateServiceUpgradeFinishSignal(cb)
    local sig = match_rule.signal('UpgradeFinishSignal', 'bmc.kepler.UpdateService'):with_path(
        '/bmc/kepler/UpdateService')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeUpdateServiceUpdateServiceRollbackSignal(cb)
    local sig = match_rule.signal('RollbackSignal', 'bmc.kepler.UpdateService'):with_path('/bmc/kepler/UpdateService')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeUpdateServiceUpdateServiceExportSignal(cb)
    local sig = match_rule.signal('ExportSignal', 'bmc.kepler.UpdateService'):with_path('/bmc/kepler/UpdateService')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:SubscribeFirmwareActiveFirmwareActiveActiveProcessSignal(cb)
    local sig = match_rule.signal('ActiveProcessSignal', 'bmc.kepler.UpdateService.FirmwareActive'):with_path(
        '/bmc/kepler/UpdateService/FirmwareActive')
    self.signal_slots[#self.signal_slots + 1] = self:get_bus():match(sig, function(msg)
        cb(msg:read())
    end)
end

function network_adapter_client:ctor()
    self.signal_slots = {}
end

---@type network_adapter_client
return network_adapter_client.new('network_adapter')
