/*
 * Daytona
 * Daytona AI platform API Docs
 *
 * The version of the OpenAPI document: 1.0
 * Contact: support@daytona.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


package io.daytona.api.client.model;

import java.util.Objects;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import io.daytona.api.client.model.RegionType;
import io.daytona.api.client.model.RunnerClass;
import io.daytona.api.client.model.RunnerState;
import io.daytona.api.client.model.SandboxClass;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.Arrays;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapterFactory;
import com.google.gson.reflect.TypeToken;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;

import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import io.daytona.api.client.JSON;

/**
 * RunnerFull
 */
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.21.0")
public class RunnerFull {
  public static final String SERIALIZED_NAME_ID = "id";
  @SerializedName(SERIALIZED_NAME_ID)
  @javax.annotation.Nonnull
  private String id;

  public static final String SERIALIZED_NAME_DOMAIN = "domain";
  @SerializedName(SERIALIZED_NAME_DOMAIN)
  @javax.annotation.Nullable
  private String domain;

  public static final String SERIALIZED_NAME_API_URL = "apiUrl";
  @SerializedName(SERIALIZED_NAME_API_URL)
  @javax.annotation.Nullable
  private String apiUrl;

  public static final String SERIALIZED_NAME_PROXY_URL = "proxyUrl";
  @SerializedName(SERIALIZED_NAME_PROXY_URL)
  @javax.annotation.Nullable
  private String proxyUrl;

  public static final String SERIALIZED_NAME_CPU = "cpu";
  @SerializedName(SERIALIZED_NAME_CPU)
  @javax.annotation.Nonnull
  private BigDecimal cpu;

  public static final String SERIALIZED_NAME_MEMORY = "memory";
  @SerializedName(SERIALIZED_NAME_MEMORY)
  @javax.annotation.Nonnull
  private BigDecimal memory;

  public static final String SERIALIZED_NAME_DISK = "disk";
  @SerializedName(SERIALIZED_NAME_DISK)
  @javax.annotation.Nonnull
  private BigDecimal disk;

  public static final String SERIALIZED_NAME_GPU = "gpu";
  @SerializedName(SERIALIZED_NAME_GPU)
  @javax.annotation.Nullable
  private BigDecimal gpu;

  public static final String SERIALIZED_NAME_GPU_TYPE = "gpuType";
  @SerializedName(SERIALIZED_NAME_GPU_TYPE)
  @javax.annotation.Nullable
  private String gpuType;

  public static final String SERIALIZED_NAME_PROPERTY_CLASS = "class";
  @SerializedName(SERIALIZED_NAME_PROPERTY_CLASS)
  @javax.annotation.Nonnull
  private SandboxClass propertyClass;

  public static final String SERIALIZED_NAME_CURRENT_CPU_USAGE_PERCENTAGE = "currentCpuUsagePercentage";
  @SerializedName(SERIALIZED_NAME_CURRENT_CPU_USAGE_PERCENTAGE)
  @javax.annotation.Nullable
  private BigDecimal currentCpuUsagePercentage;

  public static final String SERIALIZED_NAME_CURRENT_MEMORY_USAGE_PERCENTAGE = "currentMemoryUsagePercentage";
  @SerializedName(SERIALIZED_NAME_CURRENT_MEMORY_USAGE_PERCENTAGE)
  @javax.annotation.Nullable
  private BigDecimal currentMemoryUsagePercentage;

  public static final String SERIALIZED_NAME_CURRENT_DISK_USAGE_PERCENTAGE = "currentDiskUsagePercentage";
  @SerializedName(SERIALIZED_NAME_CURRENT_DISK_USAGE_PERCENTAGE)
  @javax.annotation.Nullable
  private BigDecimal currentDiskUsagePercentage;

  public static final String SERIALIZED_NAME_CURRENT_ALLOCATED_CPU = "currentAllocatedCpu";
  @SerializedName(SERIALIZED_NAME_CURRENT_ALLOCATED_CPU)
  @javax.annotation.Nullable
  private BigDecimal currentAllocatedCpu;

  public static final String SERIALIZED_NAME_CURRENT_ALLOCATED_MEMORY_GI_B = "currentAllocatedMemoryGiB";
  @SerializedName(SERIALIZED_NAME_CURRENT_ALLOCATED_MEMORY_GI_B)
  @javax.annotation.Nullable
  private BigDecimal currentAllocatedMemoryGiB;

  public static final String SERIALIZED_NAME_CURRENT_ALLOCATED_DISK_GI_B = "currentAllocatedDiskGiB";
  @SerializedName(SERIALIZED_NAME_CURRENT_ALLOCATED_DISK_GI_B)
  @javax.annotation.Nullable
  private BigDecimal currentAllocatedDiskGiB;

  public static final String SERIALIZED_NAME_CURRENT_SNAPSHOT_COUNT = "currentSnapshotCount";
  @SerializedName(SERIALIZED_NAME_CURRENT_SNAPSHOT_COUNT)
  @javax.annotation.Nullable
  private BigDecimal currentSnapshotCount;

  public static final String SERIALIZED_NAME_CURRENT_STARTED_SANDBOXES = "currentStartedSandboxes";
  @SerializedName(SERIALIZED_NAME_CURRENT_STARTED_SANDBOXES)
  @javax.annotation.Nullable
  private BigDecimal currentStartedSandboxes;

  public static final String SERIALIZED_NAME_AVAILABILITY_SCORE = "availabilityScore";
  @SerializedName(SERIALIZED_NAME_AVAILABILITY_SCORE)
  @javax.annotation.Nullable
  private BigDecimal availabilityScore;

  public static final String SERIALIZED_NAME_REGION = "region";
  @SerializedName(SERIALIZED_NAME_REGION)
  @javax.annotation.Nonnull
  private String region;

  public static final String SERIALIZED_NAME_NAME = "name";
  @SerializedName(SERIALIZED_NAME_NAME)
  @javax.annotation.Nonnull
  private String name;

  public static final String SERIALIZED_NAME_STATE = "state";
  @SerializedName(SERIALIZED_NAME_STATE)
  @javax.annotation.Nonnull
  private RunnerState state;

  public static final String SERIALIZED_NAME_LAST_CHECKED = "lastChecked";
  @SerializedName(SERIALIZED_NAME_LAST_CHECKED)
  @javax.annotation.Nullable
  private String lastChecked;

  public static final String SERIALIZED_NAME_UNSCHEDULABLE = "unschedulable";
  @SerializedName(SERIALIZED_NAME_UNSCHEDULABLE)
  @javax.annotation.Nonnull
  private Boolean unschedulable;

  public static final String SERIALIZED_NAME_CREATED_AT = "createdAt";
  @SerializedName(SERIALIZED_NAME_CREATED_AT)
  @javax.annotation.Nonnull
  private String createdAt;

  public static final String SERIALIZED_NAME_UPDATED_AT = "updatedAt";
  @SerializedName(SERIALIZED_NAME_UPDATED_AT)
  @javax.annotation.Nonnull
  private String updatedAt;

  public static final String SERIALIZED_NAME_VERSION = "version";
  @Deprecated
  @SerializedName(SERIALIZED_NAME_VERSION)
  @javax.annotation.Nonnull
  private String version;

  public static final String SERIALIZED_NAME_API_VERSION = "apiVersion";
  @Deprecated
  @SerializedName(SERIALIZED_NAME_API_VERSION)
  @javax.annotation.Nonnull
  private String apiVersion;

  public static final String SERIALIZED_NAME_RUNNER_CLASS = "runnerClass";
  @SerializedName(SERIALIZED_NAME_RUNNER_CLASS)
  @javax.annotation.Nonnull
  private RunnerClass runnerClass;

  public static final String SERIALIZED_NAME_APP_VERSION = "appVersion";
  @Deprecated
  @SerializedName(SERIALIZED_NAME_APP_VERSION)
  @javax.annotation.Nullable
  private String appVersion;

  public static final String SERIALIZED_NAME_API_KEY = "apiKey";
  @SerializedName(SERIALIZED_NAME_API_KEY)
  @javax.annotation.Nonnull
  private String apiKey;

  public static final String SERIALIZED_NAME_REGION_TYPE = "regionType";
  @SerializedName(SERIALIZED_NAME_REGION_TYPE)
  @javax.annotation.Nullable
  private RegionType regionType;

  public RunnerFull() {
  }

  public RunnerFull id(@javax.annotation.Nonnull String id) {
    this.id = id;
    return this;
  }

  /**
   * The ID of the runner
   * @return id
   */
  @javax.annotation.Nonnull
  public String getId() {
    return id;
  }

  public void setId(@javax.annotation.Nonnull String id) {
    this.id = id;
  }


  public RunnerFull domain(@javax.annotation.Nullable String domain) {
    this.domain = domain;
    return this;
  }

  /**
   * The domain of the runner
   * @return domain
   */
  @javax.annotation.Nullable
  public String getDomain() {
    return domain;
  }

  public void setDomain(@javax.annotation.Nullable String domain) {
    this.domain = domain;
  }


  public RunnerFull apiUrl(@javax.annotation.Nullable String apiUrl) {
    this.apiUrl = apiUrl;
    return this;
  }

  /**
   * The API URL of the runner
   * @return apiUrl
   */
  @javax.annotation.Nullable
  public String getApiUrl() {
    return apiUrl;
  }

  public void setApiUrl(@javax.annotation.Nullable String apiUrl) {
    this.apiUrl = apiUrl;
  }


  public RunnerFull proxyUrl(@javax.annotation.Nullable String proxyUrl) {
    this.proxyUrl = proxyUrl;
    return this;
  }

  /**
   * The proxy URL of the runner
   * @return proxyUrl
   */
  @javax.annotation.Nullable
  public String getProxyUrl() {
    return proxyUrl;
  }

  public void setProxyUrl(@javax.annotation.Nullable String proxyUrl) {
    this.proxyUrl = proxyUrl;
  }


  public RunnerFull cpu(@javax.annotation.Nonnull BigDecimal cpu) {
    this.cpu = cpu;
    return this;
  }

  /**
   * The CPU capacity of the runner
   * @return cpu
   */
  @javax.annotation.Nonnull
  public BigDecimal getCpu() {
    return cpu;
  }

  public void setCpu(@javax.annotation.Nonnull BigDecimal cpu) {
    this.cpu = cpu;
  }


  public RunnerFull memory(@javax.annotation.Nonnull BigDecimal memory) {
    this.memory = memory;
    return this;
  }

  /**
   * The memory capacity of the runner in GiB
   * @return memory
   */
  @javax.annotation.Nonnull
  public BigDecimal getMemory() {
    return memory;
  }

  public void setMemory(@javax.annotation.Nonnull BigDecimal memory) {
    this.memory = memory;
  }


  public RunnerFull disk(@javax.annotation.Nonnull BigDecimal disk) {
    this.disk = disk;
    return this;
  }

  /**
   * The disk capacity of the runner in GiB
   * @return disk
   */
  @javax.annotation.Nonnull
  public BigDecimal getDisk() {
    return disk;
  }

  public void setDisk(@javax.annotation.Nonnull BigDecimal disk) {
    this.disk = disk;
  }


  public RunnerFull gpu(@javax.annotation.Nullable BigDecimal gpu) {
    this.gpu = gpu;
    return this;
  }

  /**
   * The GPU capacity of the runner
   * @return gpu
   */
  @javax.annotation.Nullable
  public BigDecimal getGpu() {
    return gpu;
  }

  public void setGpu(@javax.annotation.Nullable BigDecimal gpu) {
    this.gpu = gpu;
  }


  public RunnerFull gpuType(@javax.annotation.Nullable String gpuType) {
    this.gpuType = gpuType;
    return this;
  }

  /**
   * The type of GPU
   * @return gpuType
   */
  @javax.annotation.Nullable
  public String getGpuType() {
    return gpuType;
  }

  public void setGpuType(@javax.annotation.Nullable String gpuType) {
    this.gpuType = gpuType;
  }


  public RunnerFull propertyClass(@javax.annotation.Nonnull SandboxClass propertyClass) {
    this.propertyClass = propertyClass;
    return this;
  }

  /**
   * The class of the runner
   * @return propertyClass
   */
  @javax.annotation.Nonnull
  public SandboxClass getPropertyClass() {
    return propertyClass;
  }

  public void setPropertyClass(@javax.annotation.Nonnull SandboxClass propertyClass) {
    this.propertyClass = propertyClass;
  }


  public RunnerFull currentCpuUsagePercentage(@javax.annotation.Nullable BigDecimal currentCpuUsagePercentage) {
    this.currentCpuUsagePercentage = currentCpuUsagePercentage;
    return this;
  }

  /**
   * Current CPU usage percentage
   * @return currentCpuUsagePercentage
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentCpuUsagePercentage() {
    return currentCpuUsagePercentage;
  }

  public void setCurrentCpuUsagePercentage(@javax.annotation.Nullable BigDecimal currentCpuUsagePercentage) {
    this.currentCpuUsagePercentage = currentCpuUsagePercentage;
  }


  public RunnerFull currentMemoryUsagePercentage(@javax.annotation.Nullable BigDecimal currentMemoryUsagePercentage) {
    this.currentMemoryUsagePercentage = currentMemoryUsagePercentage;
    return this;
  }

  /**
   * Current RAM usage percentage
   * @return currentMemoryUsagePercentage
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentMemoryUsagePercentage() {
    return currentMemoryUsagePercentage;
  }

  public void setCurrentMemoryUsagePercentage(@javax.annotation.Nullable BigDecimal currentMemoryUsagePercentage) {
    this.currentMemoryUsagePercentage = currentMemoryUsagePercentage;
  }


  public RunnerFull currentDiskUsagePercentage(@javax.annotation.Nullable BigDecimal currentDiskUsagePercentage) {
    this.currentDiskUsagePercentage = currentDiskUsagePercentage;
    return this;
  }

  /**
   * Current disk usage percentage
   * @return currentDiskUsagePercentage
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentDiskUsagePercentage() {
    return currentDiskUsagePercentage;
  }

  public void setCurrentDiskUsagePercentage(@javax.annotation.Nullable BigDecimal currentDiskUsagePercentage) {
    this.currentDiskUsagePercentage = currentDiskUsagePercentage;
  }


  public RunnerFull currentAllocatedCpu(@javax.annotation.Nullable BigDecimal currentAllocatedCpu) {
    this.currentAllocatedCpu = currentAllocatedCpu;
    return this;
  }

  /**
   * Current allocated CPU
   * @return currentAllocatedCpu
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentAllocatedCpu() {
    return currentAllocatedCpu;
  }

  public void setCurrentAllocatedCpu(@javax.annotation.Nullable BigDecimal currentAllocatedCpu) {
    this.currentAllocatedCpu = currentAllocatedCpu;
  }


  public RunnerFull currentAllocatedMemoryGiB(@javax.annotation.Nullable BigDecimal currentAllocatedMemoryGiB) {
    this.currentAllocatedMemoryGiB = currentAllocatedMemoryGiB;
    return this;
  }

  /**
   * Current allocated memory in GiB
   * @return currentAllocatedMemoryGiB
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentAllocatedMemoryGiB() {
    return currentAllocatedMemoryGiB;
  }

  public void setCurrentAllocatedMemoryGiB(@javax.annotation.Nullable BigDecimal currentAllocatedMemoryGiB) {
    this.currentAllocatedMemoryGiB = currentAllocatedMemoryGiB;
  }


  public RunnerFull currentAllocatedDiskGiB(@javax.annotation.Nullable BigDecimal currentAllocatedDiskGiB) {
    this.currentAllocatedDiskGiB = currentAllocatedDiskGiB;
    return this;
  }

  /**
   * Current allocated disk in GiB
   * @return currentAllocatedDiskGiB
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentAllocatedDiskGiB() {
    return currentAllocatedDiskGiB;
  }

  public void setCurrentAllocatedDiskGiB(@javax.annotation.Nullable BigDecimal currentAllocatedDiskGiB) {
    this.currentAllocatedDiskGiB = currentAllocatedDiskGiB;
  }


  public RunnerFull currentSnapshotCount(@javax.annotation.Nullable BigDecimal currentSnapshotCount) {
    this.currentSnapshotCount = currentSnapshotCount;
    return this;
  }

  /**
   * Current snapshot count
   * @return currentSnapshotCount
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentSnapshotCount() {
    return currentSnapshotCount;
  }

  public void setCurrentSnapshotCount(@javax.annotation.Nullable BigDecimal currentSnapshotCount) {
    this.currentSnapshotCount = currentSnapshotCount;
  }


  public RunnerFull currentStartedSandboxes(@javax.annotation.Nullable BigDecimal currentStartedSandboxes) {
    this.currentStartedSandboxes = currentStartedSandboxes;
    return this;
  }

  /**
   * Current number of started sandboxes
   * @return currentStartedSandboxes
   */
  @javax.annotation.Nullable
  public BigDecimal getCurrentStartedSandboxes() {
    return currentStartedSandboxes;
  }

  public void setCurrentStartedSandboxes(@javax.annotation.Nullable BigDecimal currentStartedSandboxes) {
    this.currentStartedSandboxes = currentStartedSandboxes;
  }


  public RunnerFull availabilityScore(@javax.annotation.Nullable BigDecimal availabilityScore) {
    this.availabilityScore = availabilityScore;
    return this;
  }

  /**
   * Runner availability score
   * @return availabilityScore
   */
  @javax.annotation.Nullable
  public BigDecimal getAvailabilityScore() {
    return availabilityScore;
  }

  public void setAvailabilityScore(@javax.annotation.Nullable BigDecimal availabilityScore) {
    this.availabilityScore = availabilityScore;
  }


  public RunnerFull region(@javax.annotation.Nonnull String region) {
    this.region = region;
    return this;
  }

  /**
   * The region of the runner
   * @return region
   */
  @javax.annotation.Nonnull
  public String getRegion() {
    return region;
  }

  public void setRegion(@javax.annotation.Nonnull String region) {
    this.region = region;
  }


  public RunnerFull name(@javax.annotation.Nonnull String name) {
    this.name = name;
    return this;
  }

  /**
   * The name of the runner
   * @return name
   */
  @javax.annotation.Nonnull
  public String getName() {
    return name;
  }

  public void setName(@javax.annotation.Nonnull String name) {
    this.name = name;
  }


  public RunnerFull state(@javax.annotation.Nonnull RunnerState state) {
    this.state = state;
    return this;
  }

  /**
   * The state of the runner
   * @return state
   */
  @javax.annotation.Nonnull
  public RunnerState getState() {
    return state;
  }

  public void setState(@javax.annotation.Nonnull RunnerState state) {
    this.state = state;
  }


  public RunnerFull lastChecked(@javax.annotation.Nullable String lastChecked) {
    this.lastChecked = lastChecked;
    return this;
  }

  /**
   * The last time the runner was checked
   * @return lastChecked
   */
  @javax.annotation.Nullable
  public String getLastChecked() {
    return lastChecked;
  }

  public void setLastChecked(@javax.annotation.Nullable String lastChecked) {
    this.lastChecked = lastChecked;
  }


  public RunnerFull unschedulable(@javax.annotation.Nonnull Boolean unschedulable) {
    this.unschedulable = unschedulable;
    return this;
  }

  /**
   * Whether the runner is unschedulable
   * @return unschedulable
   */
  @javax.annotation.Nonnull
  public Boolean getUnschedulable() {
    return unschedulable;
  }

  public void setUnschedulable(@javax.annotation.Nonnull Boolean unschedulable) {
    this.unschedulable = unschedulable;
  }


  public RunnerFull createdAt(@javax.annotation.Nonnull String createdAt) {
    this.createdAt = createdAt;
    return this;
  }

  /**
   * The creation timestamp of the runner
   * @return createdAt
   */
  @javax.annotation.Nonnull
  public String getCreatedAt() {
    return createdAt;
  }

  public void setCreatedAt(@javax.annotation.Nonnull String createdAt) {
    this.createdAt = createdAt;
  }


  public RunnerFull updatedAt(@javax.annotation.Nonnull String updatedAt) {
    this.updatedAt = updatedAt;
    return this;
  }

  /**
   * The last update timestamp of the runner
   * @return updatedAt
   */
  @javax.annotation.Nonnull
  public String getUpdatedAt() {
    return updatedAt;
  }

  public void setUpdatedAt(@javax.annotation.Nonnull String updatedAt) {
    this.updatedAt = updatedAt;
  }


  @Deprecated
  public RunnerFull version(@javax.annotation.Nonnull String version) {
    this.version = version;
    return this;
  }

  /**
   * The version of the runner (deprecated in favor of apiVersion)
   * @return version
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nonnull
  public String getVersion() {
    return version;
  }

  @Deprecated
  public void setVersion(@javax.annotation.Nonnull String version) {
    this.version = version;
  }


  @Deprecated
  public RunnerFull apiVersion(@javax.annotation.Nonnull String apiVersion) {
    this.apiVersion = apiVersion;
    return this;
  }

  /**
   * The api version of the runner
   * @return apiVersion
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nonnull
  public String getApiVersion() {
    return apiVersion;
  }

  @Deprecated
  public void setApiVersion(@javax.annotation.Nonnull String apiVersion) {
    this.apiVersion = apiVersion;
  }


  public RunnerFull runnerClass(@javax.annotation.Nonnull RunnerClass runnerClass) {
    this.runnerClass = runnerClass;
    return this;
  }

  /**
   * The class of the runner
   * @return runnerClass
   */
  @javax.annotation.Nonnull
  public RunnerClass getRunnerClass() {
    return runnerClass;
  }

  public void setRunnerClass(@javax.annotation.Nonnull RunnerClass runnerClass) {
    this.runnerClass = runnerClass;
  }


  @Deprecated
  public RunnerFull appVersion(@javax.annotation.Nullable String appVersion) {
    this.appVersion = appVersion;
    return this;
  }

  /**
   * The app version of the runner
   * @return appVersion
   * @deprecated
   */
  @Deprecated
  @javax.annotation.Nullable
  public String getAppVersion() {
    return appVersion;
  }

  @Deprecated
  public void setAppVersion(@javax.annotation.Nullable String appVersion) {
    this.appVersion = appVersion;
  }


  public RunnerFull apiKey(@javax.annotation.Nonnull String apiKey) {
    this.apiKey = apiKey;
    return this;
  }

  /**
   * The API key for the runner
   * @return apiKey
   */
  @javax.annotation.Nonnull
  public String getApiKey() {
    return apiKey;
  }

  public void setApiKey(@javax.annotation.Nonnull String apiKey) {
    this.apiKey = apiKey;
  }


  public RunnerFull regionType(@javax.annotation.Nullable RegionType regionType) {
    this.regionType = regionType;
    return this;
  }

  /**
   * The region type of the runner
   * @return regionType
   */
  @javax.annotation.Nullable
  public RegionType getRegionType() {
    return regionType;
  }

  public void setRegionType(@javax.annotation.Nullable RegionType regionType) {
    this.regionType = regionType;
  }

  /**
   * A container for additional, undeclared properties.
   * This is a holder for any undeclared properties as specified with
   * the 'additionalProperties' keyword in the OAS document.
   */
  private Map<String, Object> additionalProperties;

  /**
   * Set the additional (undeclared) property with the specified name and value.
   * If the property does not already exist, create it otherwise replace it.
   *
   * @param key name of the property
   * @param value value of the property
   * @return the RunnerFull instance itself
   */
  public RunnerFull putAdditionalProperty(String key, Object value) {
    if (this.additionalProperties == null) {
        this.additionalProperties = new HashMap<String, Object>();
    }
    this.additionalProperties.put(key, value);
    return this;
  }

  /**
   * Return the additional (undeclared) property.
   *
   * @return a map of objects
   */
  public Map<String, Object> getAdditionalProperties() {
    return additionalProperties;
  }

  /**
   * Return the additional (undeclared) property with the specified name.
   *
   * @param key name of the property
   * @return an object
   */
  public Object getAdditionalProperty(String key) {
    if (this.additionalProperties == null) {
        return null;
    }
    return this.additionalProperties.get(key);
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    RunnerFull runnerFull = (RunnerFull) o;
    return Objects.equals(this.id, runnerFull.id) &&
        Objects.equals(this.domain, runnerFull.domain) &&
        Objects.equals(this.apiUrl, runnerFull.apiUrl) &&
        Objects.equals(this.proxyUrl, runnerFull.proxyUrl) &&
        Objects.equals(this.cpu, runnerFull.cpu) &&
        Objects.equals(this.memory, runnerFull.memory) &&
        Objects.equals(this.disk, runnerFull.disk) &&
        Objects.equals(this.gpu, runnerFull.gpu) &&
        Objects.equals(this.gpuType, runnerFull.gpuType) &&
        Objects.equals(this.propertyClass, runnerFull.propertyClass) &&
        Objects.equals(this.currentCpuUsagePercentage, runnerFull.currentCpuUsagePercentage) &&
        Objects.equals(this.currentMemoryUsagePercentage, runnerFull.currentMemoryUsagePercentage) &&
        Objects.equals(this.currentDiskUsagePercentage, runnerFull.currentDiskUsagePercentage) &&
        Objects.equals(this.currentAllocatedCpu, runnerFull.currentAllocatedCpu) &&
        Objects.equals(this.currentAllocatedMemoryGiB, runnerFull.currentAllocatedMemoryGiB) &&
        Objects.equals(this.currentAllocatedDiskGiB, runnerFull.currentAllocatedDiskGiB) &&
        Objects.equals(this.currentSnapshotCount, runnerFull.currentSnapshotCount) &&
        Objects.equals(this.currentStartedSandboxes, runnerFull.currentStartedSandboxes) &&
        Objects.equals(this.availabilityScore, runnerFull.availabilityScore) &&
        Objects.equals(this.region, runnerFull.region) &&
        Objects.equals(this.name, runnerFull.name) &&
        Objects.equals(this.state, runnerFull.state) &&
        Objects.equals(this.lastChecked, runnerFull.lastChecked) &&
        Objects.equals(this.unschedulable, runnerFull.unschedulable) &&
        Objects.equals(this.createdAt, runnerFull.createdAt) &&
        Objects.equals(this.updatedAt, runnerFull.updatedAt) &&
        Objects.equals(this.version, runnerFull.version) &&
        Objects.equals(this.apiVersion, runnerFull.apiVersion) &&
        Objects.equals(this.runnerClass, runnerFull.runnerClass) &&
        Objects.equals(this.appVersion, runnerFull.appVersion) &&
        Objects.equals(this.apiKey, runnerFull.apiKey) &&
        Objects.equals(this.regionType, runnerFull.regionType)&&
        Objects.equals(this.additionalProperties, runnerFull.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, domain, apiUrl, proxyUrl, cpu, memory, disk, gpu, gpuType, propertyClass, currentCpuUsagePercentage, currentMemoryUsagePercentage, currentDiskUsagePercentage, currentAllocatedCpu, currentAllocatedMemoryGiB, currentAllocatedDiskGiB, currentSnapshotCount, currentStartedSandboxes, availabilityScore, region, name, state, lastChecked, unschedulable, createdAt, updatedAt, version, apiVersion, runnerClass, appVersion, apiKey, regionType, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class RunnerFull {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    domain: ").append(toIndentedString(domain)).append("\n");
    sb.append("    apiUrl: ").append(toIndentedString(apiUrl)).append("\n");
    sb.append("    proxyUrl: ").append(toIndentedString(proxyUrl)).append("\n");
    sb.append("    cpu: ").append(toIndentedString(cpu)).append("\n");
    sb.append("    memory: ").append(toIndentedString(memory)).append("\n");
    sb.append("    disk: ").append(toIndentedString(disk)).append("\n");
    sb.append("    gpu: ").append(toIndentedString(gpu)).append("\n");
    sb.append("    gpuType: ").append(toIndentedString(gpuType)).append("\n");
    sb.append("    propertyClass: ").append(toIndentedString(propertyClass)).append("\n");
    sb.append("    currentCpuUsagePercentage: ").append(toIndentedString(currentCpuUsagePercentage)).append("\n");
    sb.append("    currentMemoryUsagePercentage: ").append(toIndentedString(currentMemoryUsagePercentage)).append("\n");
    sb.append("    currentDiskUsagePercentage: ").append(toIndentedString(currentDiskUsagePercentage)).append("\n");
    sb.append("    currentAllocatedCpu: ").append(toIndentedString(currentAllocatedCpu)).append("\n");
    sb.append("    currentAllocatedMemoryGiB: ").append(toIndentedString(currentAllocatedMemoryGiB)).append("\n");
    sb.append("    currentAllocatedDiskGiB: ").append(toIndentedString(currentAllocatedDiskGiB)).append("\n");
    sb.append("    currentSnapshotCount: ").append(toIndentedString(currentSnapshotCount)).append("\n");
    sb.append("    currentStartedSandboxes: ").append(toIndentedString(currentStartedSandboxes)).append("\n");
    sb.append("    availabilityScore: ").append(toIndentedString(availabilityScore)).append("\n");
    sb.append("    region: ").append(toIndentedString(region)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    state: ").append(toIndentedString(state)).append("\n");
    sb.append("    lastChecked: ").append(toIndentedString(lastChecked)).append("\n");
    sb.append("    unschedulable: ").append(toIndentedString(unschedulable)).append("\n");
    sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
    sb.append("    updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
    sb.append("    version: ").append(toIndentedString(version)).append("\n");
    sb.append("    apiVersion: ").append(toIndentedString(apiVersion)).append("\n");
    sb.append("    runnerClass: ").append(toIndentedString(runnerClass)).append("\n");
    sb.append("    appVersion: ").append(toIndentedString(appVersion)).append("\n");
    sb.append("    apiKey: ").append(toIndentedString(apiKey)).append("\n");
    sb.append("    regionType: ").append(toIndentedString(regionType)).append("\n");
    sb.append("    additionalProperties: ").append(toIndentedString(additionalProperties)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    return o == null ? "null" : o.toString().replace("\n", "\n    ");
  }


  public static HashSet<String> openapiFields;
  public static HashSet<String> openapiRequiredFields;

  static {
    // a set of all properties/fields (JSON key names)
    openapiFields = new HashSet<String>(Arrays.asList("id", "domain", "apiUrl", "proxyUrl", "cpu", "memory", "disk", "gpu", "gpuType", "class", "currentCpuUsagePercentage", "currentMemoryUsagePercentage", "currentDiskUsagePercentage", "currentAllocatedCpu", "currentAllocatedMemoryGiB", "currentAllocatedDiskGiB", "currentSnapshotCount", "currentStartedSandboxes", "availabilityScore", "region", "name", "state", "lastChecked", "unschedulable", "createdAt", "updatedAt", "version", "apiVersion", "runnerClass", "appVersion", "apiKey", "regionType"));

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet<String>(Arrays.asList("id", "cpu", "memory", "disk", "class", "region", "name", "state", "unschedulable", "createdAt", "updatedAt", "version", "apiVersion", "runnerClass", "apiKey"));
  }

  /**
   * Validates the JSON Element and throws an exception if issues found
   *
   * @param jsonElement JSON Element
   * @throws IOException if the JSON Element is invalid with respect to RunnerFull
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!RunnerFull.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null
          throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field(s) %s in RunnerFull is not found in the empty JSON string", RunnerFull.openapiRequiredFields.toString()));
        }
      }

      // check to make sure all required properties/fields are present in the JSON string
      for (String requiredField : RunnerFull.openapiRequiredFields) {
        if (jsonElement.getAsJsonObject().get(requiredField) == null) {
          throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The required field `%s` is not found in the JSON string: %s", requiredField, jsonElement.toString()));
        }
      }
        JsonObject jsonObj = jsonElement.getAsJsonObject();
      if (!jsonObj.get("id").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id").toString()));
      }
      if ((jsonObj.get("domain") != null && !jsonObj.get("domain").isJsonNull()) && !jsonObj.get("domain").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("domain").toString()));
      }
      if ((jsonObj.get("apiUrl") != null && !jsonObj.get("apiUrl").isJsonNull()) && !jsonObj.get("apiUrl").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `apiUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiUrl").toString()));
      }
      if ((jsonObj.get("proxyUrl") != null && !jsonObj.get("proxyUrl").isJsonNull()) && !jsonObj.get("proxyUrl").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `proxyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("proxyUrl").toString()));
      }
      if ((jsonObj.get("gpuType") != null && !jsonObj.get("gpuType").isJsonNull()) && !jsonObj.get("gpuType").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `gpuType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gpuType").toString()));
      }
      // validate the required field `class`
      SandboxClass.validateJsonElement(jsonObj.get("class"));
      if (!jsonObj.get("region").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("region").toString()));
      }
      if (!jsonObj.get("name").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("name").toString()));
      }
      // validate the required field `state`
      RunnerState.validateJsonElement(jsonObj.get("state"));
      if ((jsonObj.get("lastChecked") != null && !jsonObj.get("lastChecked").isJsonNull()) && !jsonObj.get("lastChecked").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `lastChecked` to be a primitive type in the JSON string but got `%s`", jsonObj.get("lastChecked").toString()));
      }
      if (!jsonObj.get("createdAt").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `createdAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdAt").toString()));
      }
      if (!jsonObj.get("updatedAt").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `updatedAt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("updatedAt").toString()));
      }
      if (!jsonObj.get("version").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("version").toString()));
      }
      if (!jsonObj.get("apiVersion").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `apiVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiVersion").toString()));
      }
      // validate the required field `runnerClass`
      RunnerClass.validateJsonElement(jsonObj.get("runnerClass"));
      if ((jsonObj.get("appVersion") != null && !jsonObj.get("appVersion").isJsonNull()) && !jsonObj.get("appVersion").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `appVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appVersion").toString()));
      }
      if (!jsonObj.get("apiKey").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `apiKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("apiKey").toString()));
      }
      // validate the optional field `regionType`
      if (jsonObj.get("regionType") != null && !jsonObj.get("regionType").isJsonNull()) {
        RegionType.validateJsonElement(jsonObj.get("regionType"));
      }
  }

  public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
    @SuppressWarnings("unchecked")
    @Override
    public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) {
       if (!RunnerFull.class.isAssignableFrom(type.getRawType())) {
         return null; // this class only serializes 'RunnerFull' and its subtypes
       }
       final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class);
       final TypeAdapter<RunnerFull> thisAdapter
                        = gson.getDelegateAdapter(this, TypeToken.get(RunnerFull.class));

       return (TypeAdapter<T>) new TypeAdapter<RunnerFull>() {
           @Override
           public void write(JsonWriter out, RunnerFull value) throws IOException {
             JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject();
             obj.remove("additionalProperties");
             // serialize additional properties
             if (value.getAdditionalProperties() != null) {
               for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) {
                 if (entry.getValue() instanceof String)
                   obj.addProperty(entry.getKey(), (String) entry.getValue());
                 else if (entry.getValue() instanceof Number)
                   obj.addProperty(entry.getKey(), (Number) entry.getValue());
                 else if (entry.getValue() instanceof Boolean)
                   obj.addProperty(entry.getKey(), (Boolean) entry.getValue());
                 else if (entry.getValue() instanceof Character)
                   obj.addProperty(entry.getKey(), (Character) entry.getValue());
                 else {
                   JsonElement jsonElement = gson.toJsonTree(entry.getValue());
                   if (jsonElement.isJsonArray()) {
                     obj.add(entry.getKey(), jsonElement.getAsJsonArray());
                   } else {
                     obj.add(entry.getKey(), jsonElement.getAsJsonObject());
                   }
                 }
               }
             }
             elementAdapter.write(out, obj);
           }

           @Override
           public RunnerFull read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             validateJsonElement(jsonElement);
             JsonObject jsonObj = jsonElement.getAsJsonObject();
             // store additional fields in the deserialized instance
             RunnerFull instance = thisAdapter.fromJsonTree(jsonObj);
             for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) {
               if (!openapiFields.contains(entry.getKey())) {
                 if (entry.getValue().isJsonPrimitive()) { // primitive type
                   if (entry.getValue().getAsJsonPrimitive().isString())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString());
                   else if (entry.getValue().getAsJsonPrimitive().isNumber())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber());
                   else if (entry.getValue().getAsJsonPrimitive().isBoolean())
                     instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean());
                   else
                     throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString()));
                 } else if (entry.getValue().isJsonArray()) {
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class));
                 } else { // JSON object
                     instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class));
                 }
               }
             }
             return instance;
           }

       }.nullSafe();
    }
  }

  /**
   * Create an instance of RunnerFull given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of RunnerFull
   * @throws IOException if the JSON string is invalid with respect to RunnerFull
   */
  public static RunnerFull fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, RunnerFull.class);
  }

  /**
   * Convert an instance of RunnerFull to an JSON string
   *
   * @return JSON string
   */
  public String toJson() {
    return JSON.getGson().toJson(this);
  }
}

