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

  public class Environment : ICloneable {
    public object Clone() {
      Environment copy = new Environment();
      copy.maxMemoryPerScript = this.maxMemoryPerScript;
      copy.maxAmountOfScripts = this.maxAmountOfScripts;
      copy.amountOfScripts = this.amountOfScripts;
      copy.maxScriptSize = this.maxScriptSize;
      copy.maxAllScriptSize = this.maxAllScriptSize;
      copy.allScriptSize = this.allScriptSize;
      copy.outputBufferSize = this.outputBufferSize;
      copy.restartInterval = this.restartInterval;
      copy.autoStartDelay = this.autoStartDelay;
      return copy;
    }

    public LightJson.JsonObject Encode() {
      LightJson.JsonObject json = new LightJson.JsonObject();
      json["maxMemoryPerScript"] = this.maxMemoryPerScript;
      json["maxAmountOfScripts"] = this.maxAmountOfScripts;
      json["amountOfScripts"] = this.amountOfScripts;
      json["maxScriptSize"] = this.maxScriptSize;
      json["maxAllScriptSize"] = this.maxAllScriptSize;
      json["allScriptSize"] = this.allScriptSize;
      json["outputBufferSize"] = this.outputBufferSize;
      json["restartInterval"] = this.restartInterval;
      json["autoStartDelay"] = this.autoStartDelay;
      return json;
    }

    public static Environment Decode(LightJson.JsonObject json, Agent agent) {
      Environment inst = new Environment();
      inst.maxMemoryPerScript = (int)json["maxMemoryPerScript"];
      inst.maxAmountOfScripts = (int)json["maxAmountOfScripts"];
      inst.amountOfScripts = (int)json["amountOfScripts"];
      inst.maxScriptSize = (int)json["maxScriptSize"];
      inst.maxAllScriptSize = (int)json["maxAllScriptSize"];
      inst.allScriptSize = (int)json["allScriptSize"];
      inst.outputBufferSize = (int)json["outputBufferSize"];
      inst.restartInterval = (int)json["restartInterval"];
      inst.autoStartDelay = (int)json["autoStartDelay"];
      return inst;
    }

    public int maxMemoryPerScript = 0;
    public int maxAmountOfScripts = 0;
    public int amountOfScripts = 0;
    public int maxScriptSize = 0;
    public int maxAllScriptSize = 0;
    public int allScriptSize = 0;
    public int outputBufferSize = 0;
    public int restartInterval = 0;
    public int autoStartDelay = 0;
  }
}
