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

  public class Entry : ICloneable {
    public object Clone() {
      Entry copy = new Entry();
      copy.type = this.type;
      copy.name = this.name;
      copy.value = this.value;
      return copy;
    }

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

    public static Entry Decode(LightJson.JsonObject json, Agent agent) {
      Entry inst = new Entry();
      inst.type = (Com.Raritan.Idl.res_mon.Entry.Type)(int)json["type"];
      inst.name = (string)json["name"];
      inst.value = (long)json["value"];
      return inst;
    }


    public enum Type {
      GLOBAL_CPU_USAGE,
      GLOBAL_FREE_MEM,
      GLOBAL_PROC_COUNT,
      FS_FREE_SPACE,
      FS_FREE_INODES,
      PROC_CPU_USAGE,
      PROC_VM_SIZE,
      PROC_FREE_FILE_DESC,
      PROC_LIFE_TIME,
      PROC_COUNT,
    }
    public Com.Raritan.Idl.res_mon.Entry.Type type = Com.Raritan.Idl.res_mon.Entry.Type.GLOBAL_CPU_USAGE;
    public string name = "";
    public long value = 0;
  }
}
