// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2022 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 DnsSettings_2_0_0 : ICloneable {
    public object Clone() {
      DnsSettings_2_0_0 copy = new DnsSettings_2_0_0();
      copy.serverAddrs = this.serverAddrs;
      copy.searchSuffixes = this.searchSuffixes;
      copy.resolverPrefersIPv6 = this.resolverPrefersIPv6;
      return copy;
    }

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

    public static DnsSettings_2_0_0 Decode(LightJson.JsonObject json, Agent agent) {
      DnsSettings_2_0_0 inst = new DnsSettings_2_0_0();
      inst.serverAddrs = new System.Collections.Generic.List<string>(json["serverAddrs"].AsJsonArray.Select(
        _value => (string)_value));
      inst.searchSuffixes = new System.Collections.Generic.List<string>(json["searchSuffixes"].AsJsonArray.Select(
        _value => (string)_value));
      inst.resolverPrefersIPv6 = (bool)json["resolverPrefersIPv6"];
      return inst;
    }

    public System.Collections.Generic.IEnumerable<string> serverAddrs = new System.Collections.Generic.List<string>();
    public System.Collections.Generic.IEnumerable<string> searchSuffixes = new System.Collections.Generic.List<string>();
    public bool resolverPrefersIPv6 = false;
  }
}
