// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Raritan Inc. All rights reserved.
//
// This file was generated by IdlC from assetmgrpush.idl.

using System;
using System.Linq;
using LightJson;
using Com.Raritan.Idl;
using Com.Raritan.JsonRpc;
using Com.Raritan.Util;

#pragma warning disable 0108, 0219, 0414, 1591

namespace Com.Raritan.Idl.datapush {

  public class AssetLogPushMessage : ICloneable {
    public object Clone() {
      AssetLogPushMessage copy = new AssetLogPushMessage();
      copy.records = this.records;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["records"] = new JsonArray(this.records.Select(
        _value => (JsonValue)(_value.Encode())));
      return json;
    }

    public static AssetLogPushMessage Decode(LightJson.JsonObject json, Agent agent) {
      AssetLogPushMessage inst = new AssetLogPushMessage();
      inst.records = new System.Collections.Generic.List<Com.Raritan.Idl.assetmgrmodel.AssetStripLogger_1_0_6.Record>(json["records"].AsJsonArray.Select(
        _value => Com.Raritan.Idl.assetmgrmodel.AssetStripLogger_1_0_6.Record.Decode(_value, agent)));
      return inst;
    }

    public System.Collections.Generic.IEnumerable<Com.Raritan.Idl.assetmgrmodel.AssetStripLogger_1_0_6.Record> records = new System.Collections.Generic.List<Com.Raritan.Idl.assetmgrmodel.AssetStripLogger_1_0_6.Record>();
  }
}
