-- Copyright (c) 2025 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.
-- 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.

local ret = cjson.json_object_new_object()
ret['Description'] = Input[1]
ret['EventTypes'] = Input[2] and cjson.json_object_ordered_encode(Input[2])
ret['HttpHeaders'] = Input[3]
ret['Context'] = Input[4]
ret['Protocol'] = Input[5]
ret['MessageIds'] = Input[6] and cjson.json_object_ordered_encode(Input[6])
ret['OriginResources'] = Input[7]
ret['SendHeartbeat'] = Input[8] and 'true' or 'false'
ret['HeartbeatIntervalMinutes'] = tostring(Input[9])
ret['MetricReportDefinitions'] = Input[10] and cjson.json_object_ordered_encode(Input[10])
ret['DeliveryRetryPolicy'] = Input[11]
if Input[12] ~= nil and Input[12] ~= null then
    ret['Severities'] = Input[12] and cjson.json_object_ordered_encode(Input[12])
end

return ret