// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2020 Raritan Inc. All rights reserved.
//
// This file was generated by IdlC from Net.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.net {

  public class IpRoutingSettings_2_0_0 : ICloneable {
    public object Clone() {
      IpRoutingSettings_2_0_0 copy = new IpRoutingSettings_2_0_0();
      copy.defaultGatewayAddr = this.defaultGatewayAddr;
      copy.staticRoutes = this.staticRoutes;
      return copy;
    }

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

    public static IpRoutingSettings_2_0_0 Decode(LightJson.JsonObject json, Agent agent) {
      IpRoutingSettings_2_0_0 inst = new IpRoutingSettings_2_0_0();
      inst.defaultGatewayAddr = (string)json["defaultGatewayAddr"];
      inst.staticRoutes = new System.Collections.Generic.List<Com.Raritan.Idl.net.IpRoute>(json["staticRoutes"].AsJsonArray.Select(
        _value => Com.Raritan.Idl.net.IpRoute.Decode(_value, agent)));
      return inst;
    }

    public string defaultGatewayAddr = "";
    public System.Collections.Generic.IEnumerable<Com.Raritan.Idl.net.IpRoute> staticRoutes = new System.Collections.Generic.List<Com.Raritan.Idl.net.IpRoute>();
  }
}
