// 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 EapAuthSettings_3_0_0 : ICloneable {
    public object Clone() {
      EapAuthSettings_3_0_0 copy = new EapAuthSettings_3_0_0();
      copy.identity = this.identity;
      copy.password = this.password;
      copy.clearPassword = this.clearPassword;
      copy.clientCertChain = this.clientCertChain;
      copy.clientPrivKey = this.clientPrivKey;
      copy.clearClientPrivKey = this.clearClientPrivKey;
      copy.clientPrivKeyPassword = this.clientPrivKeyPassword;
      copy.outerMethod = this.outerMethod;
      copy.innerMethod = this.innerMethod;
      copy.caCertChain = this.caCertChain;
      copy.forceTrustedCert = this.forceTrustedCert;
      copy.allowOffTimeRangeCerts = this.allowOffTimeRangeCerts;
      copy.allowNotYetValidCertsIfTimeBeforeBuild = this.allowNotYetValidCertsIfTimeBeforeBuild;
      copy.authServerName = this.authServerName;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["identity"] = this.identity;
      json["password"] = this.password;
      json["clearPassword"] = this.clearPassword;
      json["clientCertChain"] = this.clientCertChain;
      json["clientPrivKey"] = this.clientPrivKey;
      json["clearClientPrivKey"] = this.clearClientPrivKey;
      json["clientPrivKeyPassword"] = this.clientPrivKeyPassword;
      json["outerMethod"] = (int)this.outerMethod;
      json["innerMethod"] = (int)this.innerMethod;
      json["caCertChain"] = this.caCertChain;
      json["forceTrustedCert"] = this.forceTrustedCert;
      json["allowOffTimeRangeCerts"] = this.allowOffTimeRangeCerts;
      json["allowNotYetValidCertsIfTimeBeforeBuild"] = this.allowNotYetValidCertsIfTimeBeforeBuild;
      json["authServerName"] = this.authServerName;
      return json;
    }

    public static EapAuthSettings_3_0_0 Decode(LightJson.JsonObject json, Agent agent) {
      EapAuthSettings_3_0_0 inst = new EapAuthSettings_3_0_0();
      inst.identity = (string)json["identity"];
      inst.password = (string)json["password"];
      inst.clearPassword = (bool)json["clearPassword"];
      inst.clientCertChain = (string)json["clientCertChain"];
      inst.clientPrivKey = (string)json["clientPrivKey"];
      inst.clearClientPrivKey = (bool)json["clearClientPrivKey"];
      inst.clientPrivKeyPassword = (string)json["clientPrivKeyPassword"];
      inst.outerMethod = (Com.Raritan.Idl.net.EapOuterAuthMethod_2_0_0)(int)json["outerMethod"];
      inst.innerMethod = (Com.Raritan.Idl.net.EapInnerAuthMethod_2_0_0)(int)json["innerMethod"];
      inst.caCertChain = (string)json["caCertChain"];
      inst.forceTrustedCert = (bool)json["forceTrustedCert"];
      inst.allowOffTimeRangeCerts = (bool)json["allowOffTimeRangeCerts"];
      inst.allowNotYetValidCertsIfTimeBeforeBuild = (bool)json["allowNotYetValidCertsIfTimeBeforeBuild"];
      inst.authServerName = (string)json["authServerName"];
      return inst;
    }

    public string identity = "";
    public string password = "";
    public bool clearPassword = false;
    public string clientCertChain = "";
    public string clientPrivKey = "";
    public bool clearClientPrivKey = false;
    public string clientPrivKeyPassword = "";
    public Com.Raritan.Idl.net.EapOuterAuthMethod_2_0_0 outerMethod = Com.Raritan.Idl.net.EapOuterAuthMethod_2_0_0.EAP_PEAP;
    public Com.Raritan.Idl.net.EapInnerAuthMethod_2_0_0 innerMethod = Com.Raritan.Idl.net.EapInnerAuthMethod_2_0_0.INNER_EAP_MSCHAPv2;
    public string caCertChain = "";
    public bool forceTrustedCert = false;
    public bool allowOffTimeRangeCerts = false;
    public bool allowNotYetValidCertsIfTimeBeforeBuild = false;
    public string authServerName = "";
  }
}
