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

    static public readonly new TypeInfo typeInfo = new TypeInfo("sensors.AccumulatingNumericSensor:2.0.7", Com.Raritan.Idl.sensors.NumericSensor_4_0_7.typeInfo);

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

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

    public class ResetEvent : Com.Raritan.Idl._event.UserEvent {
      static public readonly new TypeInfo typeInfo = new TypeInfo("sensors.AccumulatingNumericSensor_2_0_7.ResetEvent:1.0.0", Com.Raritan.Idl._event.UserEvent.typeInfo);

      public Com.Raritan.Idl.sensors.NumericSensor_4_0_7.Reading oldReading = new Com.Raritan.Idl.sensors.NumericSensor_4_0_7.Reading();
      public Com.Raritan.Idl.sensors.NumericSensor_4_0_7.Reading newReading = new Com.Raritan.Idl.sensors.NumericSensor_4_0_7.Reading();
    }

    public class ResetValueResult {
    }

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

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

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

  }
}
