// SPDX-License-Identifier: BSD-3-Clause
//
// Copyright 2026 Raritan Inc. All rights reserved.
//
// This file was generated by IdlC from ExternalSensorSlot.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 ExternalSensorData_3_0_0 : ICloneable {
    public object Clone() {
      ExternalSensorData_3_0_0 copy = new ExternalSensorData_3_0_0();
      copy.sensorClass = this.sensorClass;
      copy.id = this.id;
      copy.serial = this.serial;
      copy.type = this.type;
      copy.channel = this.channel;
      copy.port = this.port;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["sensorClass"] = this.sensorClass;
      json["id"] = this.id;
      json["serial"] = this.serial;
      json["type"] = this.type.Encode();
      json["channel"] = this.channel;
      json["port"] = this.port;
      return json;
    }

    public static ExternalSensorData_3_0_0 Decode(LightJson.JsonObject json, Agent agent) {
      ExternalSensorData_3_0_0 inst = new ExternalSensorData_3_0_0();
      inst.sensorClass = (string)json["sensorClass"];
      inst.id = (string)json["id"];
      inst.serial = (string)json["serial"];
      inst.type = Com.Raritan.Idl.sensors.Sensor_3_0_0.TypeSpec.Decode(json["type"], agent);
      inst.channel = (int)json["channel"];
      inst.port = (string)json["port"];
      return inst;
    }

    public string sensorClass = "";
    public string id = "";
    public string serial = "";
    public Com.Raritan.Idl.sensors.Sensor_3_0_0.TypeSpec type = new Com.Raritan.Idl.sensors.Sensor_3_0_0.TypeSpec();
    public int channel = 0;
    public string port = "";
  }
}
