// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2023 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 InterfaceSettings : ICloneable {
    public object Clone() {
      InterfaceSettings copy = new InterfaceSettings();
      copy.enabled = this.enabled;
      copy.ipv4 = this.ipv4;
      copy.ipv6 = this.ipv6;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["enabled"] = this.enabled;
      json["ipv4"] = this.ipv4.Encode();
      json["ipv6"] = this.ipv6.Encode();
      return json;
    }

    public static InterfaceSettings Decode(LightJson.JsonObject json, Agent agent) {
      InterfaceSettings inst = new InterfaceSettings();
      inst.enabled = (bool)json["enabled"];
      inst.ipv4 = Com.Raritan.Idl.net.InterfaceIpSettings.Decode(json["ipv4"], agent);
      inst.ipv6 = Com.Raritan.Idl.net.InterfaceIpSettings.Decode(json["ipv6"], agent);
      return inst;
    }

    public bool enabled = false;
    public Com.Raritan.Idl.net.InterfaceIpSettings ipv4 = new Com.Raritan.Idl.net.InterfaceIpSettings();
    public Com.Raritan.Idl.net.InterfaceIpSettings ipv6 = new Com.Raritan.Idl.net.InterfaceIpSettings();
  }
}
