// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2024 Raritan Inc. All rights reserved.
//
// This file was generated by IdlC from TransferSwitchBypassStateSensor.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.pdumodel {
  public class TransferSwitchBypassStateSensor : Com.Raritan.Idl.sensors.StateSensor_4_0_7 {

    static public readonly new TypeInfo typeInfo = new TypeInfo("pdumodel.TransferSwitchBypassStateSensor:1.0.0", Com.Raritan.Idl.sensors.StateSensor_4_0_7.typeInfo);

    public TransferSwitchBypassStateSensor(Agent agent, string rid, TypeInfo ti) : base(agent, rid, ti) {}
    public TransferSwitchBypassStateSensor(Agent agent, string rid) : this(agent, rid, typeInfo) {}

    public static new TransferSwitchBypassStateSensor StaticCast(ObjectProxy proxy) {
      return proxy == null ? null : new TransferSwitchBypassStateSensor(proxy.Agent, proxy.Rid, proxy.StaticTypeInfo);
    }

    public const int STATE_SELECTED_INLET_MASK = 0x7;

    public const int STATE_SELECTED_INLET_IS_ACTIVE = 0x8;

    public const int STATE_FAULT = 0x10;

    public class AcknowledgeFaultResult {
    }

    public AcknowledgeFaultResult acknowledgeFault() {
      JsonObject _parameters = null;
      var _result = RpcCall("acknowledgeFault", _parameters);
      var _ret = new AcknowledgeFaultResult();
      return _ret;
    }

    public AsyncRequest acknowledgeFault(AsyncRpcResponse<AcknowledgeFaultResult>.SuccessHandler rsp, AsyncRpcResponse.FailureHandler fail) {
      return acknowledgeFault(rsp, fail, RpcCtrl.Default);
    }

    public AsyncRequest acknowledgeFault(AsyncRpcResponse<AcknowledgeFaultResult>.SuccessHandler rsp, AsyncRpcResponse.FailureHandler fail, RpcCtrl rpcCtrl) {
      JsonObject _parameters = null;
      return RpcCall("acknowledgeFault", _parameters,
        _result => {
          try {
            var _ret = new AcknowledgeFaultResult();
            rsp(_ret);
          } catch (Exception e) {
            if (fail != null) fail(e);
          }
        }, fail, rpcCtrl);
    }

  }
}
