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

  public class PasswordSettings : ICloneable {
    public object Clone() {
      PasswordSettings copy = new PasswordSettings();
      copy.enableAging = this.enableAging;
      copy.agingInterval = this.agingInterval;
      copy.enableStrongReq = this.enableStrongReq;
      copy.minPwLength = this.minPwLength;
      copy.maxPwLength = this.maxPwLength;
      copy.enforceLower = this.enforceLower;
      copy.enforceUpper = this.enforceUpper;
      copy.enforceNumeric = this.enforceNumeric;
      copy.enforceSpecial = this.enforceSpecial;
      copy.pwHistoryDepth = this.pwHistoryDepth;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["enableAging"] = this.enableAging;
      json["agingInterval"] = this.agingInterval;
      json["enableStrongReq"] = this.enableStrongReq;
      json["minPwLength"] = this.minPwLength;
      json["maxPwLength"] = this.maxPwLength;
      json["enforceLower"] = this.enforceLower;
      json["enforceUpper"] = this.enforceUpper;
      json["enforceNumeric"] = this.enforceNumeric;
      json["enforceSpecial"] = this.enforceSpecial;
      json["pwHistoryDepth"] = this.pwHistoryDepth;
      return json;
    }

    public static PasswordSettings Decode(LightJson.JsonObject json, Agent agent) {
      PasswordSettings inst = new PasswordSettings();
      inst.enableAging = (bool)json["enableAging"];
      inst.agingInterval = (int)json["agingInterval"];
      inst.enableStrongReq = (bool)json["enableStrongReq"];
      inst.minPwLength = (int)json["minPwLength"];
      inst.maxPwLength = (int)json["maxPwLength"];
      inst.enforceLower = (bool)json["enforceLower"];
      inst.enforceUpper = (bool)json["enforceUpper"];
      inst.enforceNumeric = (bool)json["enforceNumeric"];
      inst.enforceSpecial = (bool)json["enforceSpecial"];
      inst.pwHistoryDepth = (int)json["pwHistoryDepth"];
      return inst;
    }

    public bool enableAging = false;
    public int agingInterval = 0;
    public bool enableStrongReq = false;
    public int minPwLength = 0;
    public int maxPwLength = 0;
    public bool enforceLower = false;
    public bool enforceUpper = false;
    public bool enforceNumeric = false;
    public bool enforceSpecial = false;
    public int pwHistoryDepth = 0;
  }
}
