-- 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-7-25
-- 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 ObservabilityMetrics = {}

---@class ObservabilityMetrics.ActivatedMetrics
---@field ActivatedMetrics string[]
local TActivatedMetrics = {}
TActivatedMetrics.__index = TActivatedMetrics
TActivatedMetrics.group = {}

local function TActivatedMetrics_from_obj(obj)
    return setmetatable(obj, TActivatedMetrics)
end

function TActivatedMetrics.new(ActivatedMetrics)
    return TActivatedMetrics_from_obj({ActivatedMetrics = ActivatedMetrics})
end
---@param obj ObservabilityMetrics.ActivatedMetrics
function TActivatedMetrics:init_from_obj(obj)
    self.ActivatedMetrics = obj.ActivatedMetrics
end

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

TActivatedMetrics.from_obj = TActivatedMetrics_from_obj

TActivatedMetrics.proto_property = {'ActivatedMetrics'}

TActivatedMetrics.default = {{}}

TActivatedMetrics.struct = {{name = 'ActivatedMetrics', is_array = true, struct = nil}}

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

    validate.OptionalArray(prefix .. 'ActivatedMetrics', self.ActivatedMetrics, 'string', false, errs, need_convert)

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

function TActivatedMetrics:unpack(_)
    return self.ActivatedMetrics
end

ObservabilityMetrics.ActivatedMetrics = TActivatedMetrics

---@class ObservabilityMetrics.ExportIntervalSeconds
---@field ExportIntervalSeconds integer
local TExportIntervalSeconds = {}
TExportIntervalSeconds.__index = TExportIntervalSeconds
TExportIntervalSeconds.group = {}

local function TExportIntervalSeconds_from_obj(obj)
    return setmetatable(obj, TExportIntervalSeconds)
end

function TExportIntervalSeconds.new(ExportIntervalSeconds)
    return TExportIntervalSeconds_from_obj({ExportIntervalSeconds = ExportIntervalSeconds})
end
---@param obj ObservabilityMetrics.ExportIntervalSeconds
function TExportIntervalSeconds:init_from_obj(obj)
    self.ExportIntervalSeconds = obj.ExportIntervalSeconds
end

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

TExportIntervalSeconds.from_obj = TExportIntervalSeconds_from_obj

TExportIntervalSeconds.proto_property = {'ExportIntervalSeconds'}

TExportIntervalSeconds.default = {0}

TExportIntervalSeconds.struct = {{name = 'ExportIntervalSeconds', is_array = false, struct = nil}}

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

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

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

function TExportIntervalSeconds:unpack(_)
    return self.ExportIntervalSeconds
end

ObservabilityMetrics.ExportIntervalSeconds = TExportIntervalSeconds

ObservabilityMetrics.interface = mdb.register_interface('bmc.kepler.Dashboard.Observability.Metrics', {
    ExportIntervalSeconds = {'u', nil, false, nil, false},
    ActivatedMetrics = {'as', nil, false, nil, false}
}, {}, {})

return ObservabilityMetrics
