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

  public class Preferences : ICloneable {
    public object Clone() {
      Preferences copy = new Preferences();
      copy.temperatureUnit = this.temperatureUnit;
      copy.lengthUnit = this.lengthUnit;
      copy.pressureUnit = this.pressureUnit;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["temperatureUnit"] = (int)this.temperatureUnit;
      json["lengthUnit"] = (int)this.lengthUnit;
      json["pressureUnit"] = (int)this.pressureUnit;
      return json;
    }

    public static Preferences Decode(LightJson.JsonObject json, Agent agent) {
      Preferences inst = new Preferences();
      inst.temperatureUnit = (Com.Raritan.Idl.usermgmt.TemperatureEnum)(int)json["temperatureUnit"];
      inst.lengthUnit = (Com.Raritan.Idl.usermgmt.LengthEnum)(int)json["lengthUnit"];
      inst.pressureUnit = (Com.Raritan.Idl.usermgmt.PressureEnum)(int)json["pressureUnit"];
      return inst;
    }

    public Com.Raritan.Idl.usermgmt.TemperatureEnum temperatureUnit = Com.Raritan.Idl.usermgmt.TemperatureEnum.DEG_C;
    public Com.Raritan.Idl.usermgmt.LengthEnum lengthUnit = Com.Raritan.Idl.usermgmt.LengthEnum.METER;
    public Com.Raritan.Idl.usermgmt.PressureEnum pressureUnit = Com.Raritan.Idl.usermgmt.PressureEnum.PASCAL;
  }
}
