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

  public class Policy : ICloneable {
    public object Clone() {
      Policy copy = new Policy();
      copy.type = this.type;
      copy.useLocalIfRemoteFailed = this.useLocalIfRemoteFailed;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["type"] = (int)this.type;
      json["useLocalIfRemoteFailed"] = this.useLocalIfRemoteFailed;
      return json;
    }

    public static Policy Decode(LightJson.JsonObject json, Agent agent) {
      Policy inst = new Policy();
      inst.type = (Com.Raritan.Idl.auth.Type)(int)json["type"];
      inst.useLocalIfRemoteFailed = (bool)json["useLocalIfRemoteFailed"];
      return inst;
    }

    public Com.Raritan.Idl.auth.Type type = Com.Raritan.Idl.auth.Type.LOCAL;
    public bool useLocalIfRemoteFailed = false;
  }
}
