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

  public class UsbDevice : ICloneable {
    public object Clone() {
      UsbDevice copy = new UsbDevice();
      copy.bus = this.bus;
      copy.device = this.device;
      copy.vendorId = this.vendorId;
      copy.productId = this.productId;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["bus"] = this.bus;
      json["device"] = this.device;
      json["vendorId"] = this.vendorId;
      json["productId"] = this.productId;
      return json;
    }

    public static UsbDevice Decode(LightJson.JsonObject json, Agent agent) {
      UsbDevice inst = new UsbDevice();
      inst.bus = (int)json["bus"];
      inst.device = (int)json["device"];
      inst.vendorId = (int)json["vendorId"];
      inst.productId = (int)json["productId"];
      return inst;
    }

    public int bus = 0;
    public int device = 0;
    public int vendorId = 0;
    public int productId = 0;
  }
}
