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

  public class Device : ICloneable {
    public object Clone() {
      Device copy = new Device();
      copy.type = this.type;
      copy.label = this.label;
      copy.line = this.line;
      return copy;
    }

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

    public static Device Decode(LightJson.JsonObject json, Agent agent) {
      Device inst = new Device();
      inst.type = (Com.Raritan.Idl.datapush.DeviceType)(int)json["type"];
      inst.label = (string)json["label"];
      inst.line = (Com.Raritan.Idl.datapush.PowerLine)(int)json["line"];
      return inst;
    }

    public Com.Raritan.Idl.datapush.DeviceType type = Com.Raritan.Idl.datapush.DeviceType.INLET;
    public string label = "";
    public Com.Raritan.Idl.datapush.PowerLine line = Com.Raritan.Idl.datapush.PowerLine.L1;
  }
}
