/*
 * 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.OtelConfig;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
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;

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

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

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

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

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

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

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

  public static final String SERIALIZED_NAME_SUSPENDED_AT = "suspendedAt";
  @SerializedName(SERIALIZED_NAME_SUSPENDED_AT)
  @javax.annotation.Nonnull
  private OffsetDateTime suspendedAt;

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

  public static final String SERIALIZED_NAME_SUSPENDED_UNTIL = "suspendedUntil";
  @SerializedName(SERIALIZED_NAME_SUSPENDED_UNTIL)
  @javax.annotation.Nonnull
  private OffsetDateTime suspendedUntil;

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

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

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

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

  public static final String SERIALIZED_NAME_SNAPSHOT_DEACTIVATION_TIMEOUT_MINUTES = "snapshotDeactivationTimeoutMinutes";
  @SerializedName(SERIALIZED_NAME_SNAPSHOT_DEACTIVATION_TIMEOUT_MINUTES)
  @javax.annotation.Nonnull
  private BigDecimal snapshotDeactivationTimeoutMinutes = new BigDecimal("20160");

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

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

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

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

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

  public static final String SERIALIZED_NAME_EXPERIMENTAL_CONFIG = "experimentalConfig";
  @SerializedName(SERIALIZED_NAME_EXPERIMENTAL_CONFIG)
  @javax.annotation.Nonnull
  private Object experimentalConfig;

  public static final String SERIALIZED_NAME_OTEL_CONFIG = "otelConfig";
  @SerializedName(SERIALIZED_NAME_OTEL_CONFIG)
  @javax.annotation.Nullable
  private OtelConfig otelConfig;

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

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

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

  public Organization() {
  }

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

  /**
   * Organization ID
   * @return id
   */
  @javax.annotation.Nonnull
  public String getId() {
    return id;
  }

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


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

  /**
   * Organization name
   * @return name
   */
  @javax.annotation.Nonnull
  public String getName() {
    return name;
  }

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


  public Organization createdBy(@javax.annotation.Nonnull String createdBy) {
    this.createdBy = createdBy;
    return this;
  }

  /**
   * User ID of the organization creator
   * @return createdBy
   */
  @javax.annotation.Nonnull
  public String getCreatedBy() {
    return createdBy;
  }

  public void setCreatedBy(@javax.annotation.Nonnull String createdBy) {
    this.createdBy = createdBy;
  }


  public Organization personal(@javax.annotation.Nonnull Boolean personal) {
    this.personal = personal;
    return this;
  }

  /**
   * Personal organization flag
   * @return personal
   */
  @javax.annotation.Nonnull
  public Boolean getPersonal() {
    return personal;
  }

  public void setPersonal(@javax.annotation.Nonnull Boolean personal) {
    this.personal = personal;
  }


  public Organization createdAt(@javax.annotation.Nonnull OffsetDateTime createdAt) {
    this.createdAt = createdAt;
    return this;
  }

  /**
   * Creation timestamp
   * @return createdAt
   */
  @javax.annotation.Nonnull
  public OffsetDateTime getCreatedAt() {
    return createdAt;
  }

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


  public Organization updatedAt(@javax.annotation.Nonnull OffsetDateTime updatedAt) {
    this.updatedAt = updatedAt;
    return this;
  }

  /**
   * Last update timestamp
   * @return updatedAt
   */
  @javax.annotation.Nonnull
  public OffsetDateTime getUpdatedAt() {
    return updatedAt;
  }

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


  public Organization suspended(@javax.annotation.Nonnull Boolean suspended) {
    this.suspended = suspended;
    return this;
  }

  /**
   * Suspended flag
   * @return suspended
   */
  @javax.annotation.Nonnull
  public Boolean getSuspended() {
    return suspended;
  }

  public void setSuspended(@javax.annotation.Nonnull Boolean suspended) {
    this.suspended = suspended;
  }


  public Organization suspendedAt(@javax.annotation.Nonnull OffsetDateTime suspendedAt) {
    this.suspendedAt = suspendedAt;
    return this;
  }

  /**
   * Suspended at
   * @return suspendedAt
   */
  @javax.annotation.Nonnull
  public OffsetDateTime getSuspendedAt() {
    return suspendedAt;
  }

  public void setSuspendedAt(@javax.annotation.Nonnull OffsetDateTime suspendedAt) {
    this.suspendedAt = suspendedAt;
  }


  public Organization suspensionReason(@javax.annotation.Nonnull String suspensionReason) {
    this.suspensionReason = suspensionReason;
    return this;
  }

  /**
   * Suspended reason
   * @return suspensionReason
   */
  @javax.annotation.Nonnull
  public String getSuspensionReason() {
    return suspensionReason;
  }

  public void setSuspensionReason(@javax.annotation.Nonnull String suspensionReason) {
    this.suspensionReason = suspensionReason;
  }


  public Organization suspendedUntil(@javax.annotation.Nonnull OffsetDateTime suspendedUntil) {
    this.suspendedUntil = suspendedUntil;
    return this;
  }

  /**
   * Suspended until
   * @return suspendedUntil
   */
  @javax.annotation.Nonnull
  public OffsetDateTime getSuspendedUntil() {
    return suspendedUntil;
  }

  public void setSuspendedUntil(@javax.annotation.Nonnull OffsetDateTime suspendedUntil) {
    this.suspendedUntil = suspendedUntil;
  }


  public Organization suspensionCleanupGracePeriodHours(@javax.annotation.Nonnull BigDecimal suspensionCleanupGracePeriodHours) {
    this.suspensionCleanupGracePeriodHours = suspensionCleanupGracePeriodHours;
    return this;
  }

  /**
   * Suspension cleanup grace period hours
   * @return suspensionCleanupGracePeriodHours
   */
  @javax.annotation.Nonnull
  public BigDecimal getSuspensionCleanupGracePeriodHours() {
    return suspensionCleanupGracePeriodHours;
  }

  public void setSuspensionCleanupGracePeriodHours(@javax.annotation.Nonnull BigDecimal suspensionCleanupGracePeriodHours) {
    this.suspensionCleanupGracePeriodHours = suspensionCleanupGracePeriodHours;
  }


  public Organization maxCpuPerSandbox(@javax.annotation.Nonnull BigDecimal maxCpuPerSandbox) {
    this.maxCpuPerSandbox = maxCpuPerSandbox;
    return this;
  }

  /**
   * Max CPU per sandbox
   * @return maxCpuPerSandbox
   */
  @javax.annotation.Nonnull
  public BigDecimal getMaxCpuPerSandbox() {
    return maxCpuPerSandbox;
  }

  public void setMaxCpuPerSandbox(@javax.annotation.Nonnull BigDecimal maxCpuPerSandbox) {
    this.maxCpuPerSandbox = maxCpuPerSandbox;
  }


  public Organization maxMemoryPerSandbox(@javax.annotation.Nonnull BigDecimal maxMemoryPerSandbox) {
    this.maxMemoryPerSandbox = maxMemoryPerSandbox;
    return this;
  }

  /**
   * Max memory per sandbox
   * @return maxMemoryPerSandbox
   */
  @javax.annotation.Nonnull
  public BigDecimal getMaxMemoryPerSandbox() {
    return maxMemoryPerSandbox;
  }

  public void setMaxMemoryPerSandbox(@javax.annotation.Nonnull BigDecimal maxMemoryPerSandbox) {
    this.maxMemoryPerSandbox = maxMemoryPerSandbox;
  }


  public Organization maxDiskPerSandbox(@javax.annotation.Nonnull BigDecimal maxDiskPerSandbox) {
    this.maxDiskPerSandbox = maxDiskPerSandbox;
    return this;
  }

  /**
   * Max disk per sandbox
   * @return maxDiskPerSandbox
   */
  @javax.annotation.Nonnull
  public BigDecimal getMaxDiskPerSandbox() {
    return maxDiskPerSandbox;
  }

  public void setMaxDiskPerSandbox(@javax.annotation.Nonnull BigDecimal maxDiskPerSandbox) {
    this.maxDiskPerSandbox = maxDiskPerSandbox;
  }


  public Organization snapshotDeactivationTimeoutMinutes(@javax.annotation.Nonnull BigDecimal snapshotDeactivationTimeoutMinutes) {
    this.snapshotDeactivationTimeoutMinutes = snapshotDeactivationTimeoutMinutes;
    return this;
  }

  /**
   * Time in minutes before an unused snapshot is deactivated
   * @return snapshotDeactivationTimeoutMinutes
   */
  @javax.annotation.Nonnull
  public BigDecimal getSnapshotDeactivationTimeoutMinutes() {
    return snapshotDeactivationTimeoutMinutes;
  }

  public void setSnapshotDeactivationTimeoutMinutes(@javax.annotation.Nonnull BigDecimal snapshotDeactivationTimeoutMinutes) {
    this.snapshotDeactivationTimeoutMinutes = snapshotDeactivationTimeoutMinutes;
  }


  public Organization sandboxLimitedNetworkEgress(@javax.annotation.Nonnull Boolean sandboxLimitedNetworkEgress) {
    this.sandboxLimitedNetworkEgress = sandboxLimitedNetworkEgress;
    return this;
  }

  /**
   * Sandbox default network block all
   * @return sandboxLimitedNetworkEgress
   */
  @javax.annotation.Nonnull
  public Boolean getSandboxLimitedNetworkEgress() {
    return sandboxLimitedNetworkEgress;
  }

  public void setSandboxLimitedNetworkEgress(@javax.annotation.Nonnull Boolean sandboxLimitedNetworkEgress) {
    this.sandboxLimitedNetworkEgress = sandboxLimitedNetworkEgress;
  }


  public Organization defaultRegionId(@javax.annotation.Nullable String defaultRegionId) {
    this.defaultRegionId = defaultRegionId;
    return this;
  }

  /**
   * Default region ID
   * @return defaultRegionId
   */
  @javax.annotation.Nullable
  public String getDefaultRegionId() {
    return defaultRegionId;
  }

  public void setDefaultRegionId(@javax.annotation.Nullable String defaultRegionId) {
    this.defaultRegionId = defaultRegionId;
  }


  public Organization authenticatedRateLimit(@javax.annotation.Nullable BigDecimal authenticatedRateLimit) {
    this.authenticatedRateLimit = authenticatedRateLimit;
    return this;
  }

  /**
   * Authenticated rate limit per minute
   * @return authenticatedRateLimit
   */
  @javax.annotation.Nullable
  public BigDecimal getAuthenticatedRateLimit() {
    return authenticatedRateLimit;
  }

  public void setAuthenticatedRateLimit(@javax.annotation.Nullable BigDecimal authenticatedRateLimit) {
    this.authenticatedRateLimit = authenticatedRateLimit;
  }


  public Organization sandboxCreateRateLimit(@javax.annotation.Nullable BigDecimal sandboxCreateRateLimit) {
    this.sandboxCreateRateLimit = sandboxCreateRateLimit;
    return this;
  }

  /**
   * Sandbox create rate limit per minute
   * @return sandboxCreateRateLimit
   */
  @javax.annotation.Nullable
  public BigDecimal getSandboxCreateRateLimit() {
    return sandboxCreateRateLimit;
  }

  public void setSandboxCreateRateLimit(@javax.annotation.Nullable BigDecimal sandboxCreateRateLimit) {
    this.sandboxCreateRateLimit = sandboxCreateRateLimit;
  }


  public Organization sandboxLifecycleRateLimit(@javax.annotation.Nullable BigDecimal sandboxLifecycleRateLimit) {
    this.sandboxLifecycleRateLimit = sandboxLifecycleRateLimit;
    return this;
  }

  /**
   * Sandbox lifecycle rate limit per minute
   * @return sandboxLifecycleRateLimit
   */
  @javax.annotation.Nullable
  public BigDecimal getSandboxLifecycleRateLimit() {
    return sandboxLifecycleRateLimit;
  }

  public void setSandboxLifecycleRateLimit(@javax.annotation.Nullable BigDecimal sandboxLifecycleRateLimit) {
    this.sandboxLifecycleRateLimit = sandboxLifecycleRateLimit;
  }


  public Organization experimentalConfig(@javax.annotation.Nonnull Object experimentalConfig) {
    this.experimentalConfig = experimentalConfig;
    return this;
  }

  /**
   * Experimental configuration
   * @return experimentalConfig
   */
  @javax.annotation.Nonnull
  public Object getExperimentalConfig() {
    return experimentalConfig;
  }

  public void setExperimentalConfig(@javax.annotation.Nonnull Object experimentalConfig) {
    this.experimentalConfig = experimentalConfig;
  }


  public Organization otelConfig(@javax.annotation.Nullable OtelConfig otelConfig) {
    this.otelConfig = otelConfig;
    return this;
  }

  /**
   * OpenTelemetry collection configuration
   * @return otelConfig
   */
  @javax.annotation.Nullable
  public OtelConfig getOtelConfig() {
    return otelConfig;
  }

  public void setOtelConfig(@javax.annotation.Nullable OtelConfig otelConfig) {
    this.otelConfig = otelConfig;
  }


  public Organization authenticatedRateLimitTtlSeconds(@javax.annotation.Nullable BigDecimal authenticatedRateLimitTtlSeconds) {
    this.authenticatedRateLimitTtlSeconds = authenticatedRateLimitTtlSeconds;
    return this;
  }

  /**
   * Authenticated rate limit TTL in seconds
   * @return authenticatedRateLimitTtlSeconds
   */
  @javax.annotation.Nullable
  public BigDecimal getAuthenticatedRateLimitTtlSeconds() {
    return authenticatedRateLimitTtlSeconds;
  }

  public void setAuthenticatedRateLimitTtlSeconds(@javax.annotation.Nullable BigDecimal authenticatedRateLimitTtlSeconds) {
    this.authenticatedRateLimitTtlSeconds = authenticatedRateLimitTtlSeconds;
  }


  public Organization sandboxCreateRateLimitTtlSeconds(@javax.annotation.Nullable BigDecimal sandboxCreateRateLimitTtlSeconds) {
    this.sandboxCreateRateLimitTtlSeconds = sandboxCreateRateLimitTtlSeconds;
    return this;
  }

  /**
   * Sandbox create rate limit TTL in seconds
   * @return sandboxCreateRateLimitTtlSeconds
   */
  @javax.annotation.Nullable
  public BigDecimal getSandboxCreateRateLimitTtlSeconds() {
    return sandboxCreateRateLimitTtlSeconds;
  }

  public void setSandboxCreateRateLimitTtlSeconds(@javax.annotation.Nullable BigDecimal sandboxCreateRateLimitTtlSeconds) {
    this.sandboxCreateRateLimitTtlSeconds = sandboxCreateRateLimitTtlSeconds;
  }


  public Organization sandboxLifecycleRateLimitTtlSeconds(@javax.annotation.Nullable BigDecimal sandboxLifecycleRateLimitTtlSeconds) {
    this.sandboxLifecycleRateLimitTtlSeconds = sandboxLifecycleRateLimitTtlSeconds;
    return this;
  }

  /**
   * Sandbox lifecycle rate limit TTL in seconds
   * @return sandboxLifecycleRateLimitTtlSeconds
   */
  @javax.annotation.Nullable
  public BigDecimal getSandboxLifecycleRateLimitTtlSeconds() {
    return sandboxLifecycleRateLimitTtlSeconds;
  }

  public void setSandboxLifecycleRateLimitTtlSeconds(@javax.annotation.Nullable BigDecimal sandboxLifecycleRateLimitTtlSeconds) {
    this.sandboxLifecycleRateLimitTtlSeconds = sandboxLifecycleRateLimitTtlSeconds;
  }

  /**
   * 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 Organization instance itself
   */
  public Organization 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;
    }
    Organization organization = (Organization) o;
    return Objects.equals(this.id, organization.id) &&
        Objects.equals(this.name, organization.name) &&
        Objects.equals(this.createdBy, organization.createdBy) &&
        Objects.equals(this.personal, organization.personal) &&
        Objects.equals(this.createdAt, organization.createdAt) &&
        Objects.equals(this.updatedAt, organization.updatedAt) &&
        Objects.equals(this.suspended, organization.suspended) &&
        Objects.equals(this.suspendedAt, organization.suspendedAt) &&
        Objects.equals(this.suspensionReason, organization.suspensionReason) &&
        Objects.equals(this.suspendedUntil, organization.suspendedUntil) &&
        Objects.equals(this.suspensionCleanupGracePeriodHours, organization.suspensionCleanupGracePeriodHours) &&
        Objects.equals(this.maxCpuPerSandbox, organization.maxCpuPerSandbox) &&
        Objects.equals(this.maxMemoryPerSandbox, organization.maxMemoryPerSandbox) &&
        Objects.equals(this.maxDiskPerSandbox, organization.maxDiskPerSandbox) &&
        Objects.equals(this.snapshotDeactivationTimeoutMinutes, organization.snapshotDeactivationTimeoutMinutes) &&
        Objects.equals(this.sandboxLimitedNetworkEgress, organization.sandboxLimitedNetworkEgress) &&
        Objects.equals(this.defaultRegionId, organization.defaultRegionId) &&
        Objects.equals(this.authenticatedRateLimit, organization.authenticatedRateLimit) &&
        Objects.equals(this.sandboxCreateRateLimit, organization.sandboxCreateRateLimit) &&
        Objects.equals(this.sandboxLifecycleRateLimit, organization.sandboxLifecycleRateLimit) &&
        Objects.equals(this.experimentalConfig, organization.experimentalConfig) &&
        Objects.equals(this.otelConfig, organization.otelConfig) &&
        Objects.equals(this.authenticatedRateLimitTtlSeconds, organization.authenticatedRateLimitTtlSeconds) &&
        Objects.equals(this.sandboxCreateRateLimitTtlSeconds, organization.sandboxCreateRateLimitTtlSeconds) &&
        Objects.equals(this.sandboxLifecycleRateLimitTtlSeconds, organization.sandboxLifecycleRateLimitTtlSeconds)&&
        Objects.equals(this.additionalProperties, organization.additionalProperties);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, createdBy, personal, createdAt, updatedAt, suspended, suspendedAt, suspensionReason, suspendedUntil, suspensionCleanupGracePeriodHours, maxCpuPerSandbox, maxMemoryPerSandbox, maxDiskPerSandbox, snapshotDeactivationTimeoutMinutes, sandboxLimitedNetworkEgress, defaultRegionId, authenticatedRateLimit, sandboxCreateRateLimit, sandboxLifecycleRateLimit, experimentalConfig, otelConfig, authenticatedRateLimitTtlSeconds, sandboxCreateRateLimitTtlSeconds, sandboxLifecycleRateLimitTtlSeconds, additionalProperties);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Organization {\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    createdBy: ").append(toIndentedString(createdBy)).append("\n");
    sb.append("    personal: ").append(toIndentedString(personal)).append("\n");
    sb.append("    createdAt: ").append(toIndentedString(createdAt)).append("\n");
    sb.append("    updatedAt: ").append(toIndentedString(updatedAt)).append("\n");
    sb.append("    suspended: ").append(toIndentedString(suspended)).append("\n");
    sb.append("    suspendedAt: ").append(toIndentedString(suspendedAt)).append("\n");
    sb.append("    suspensionReason: ").append(toIndentedString(suspensionReason)).append("\n");
    sb.append("    suspendedUntil: ").append(toIndentedString(suspendedUntil)).append("\n");
    sb.append("    suspensionCleanupGracePeriodHours: ").append(toIndentedString(suspensionCleanupGracePeriodHours)).append("\n");
    sb.append("    maxCpuPerSandbox: ").append(toIndentedString(maxCpuPerSandbox)).append("\n");
    sb.append("    maxMemoryPerSandbox: ").append(toIndentedString(maxMemoryPerSandbox)).append("\n");
    sb.append("    maxDiskPerSandbox: ").append(toIndentedString(maxDiskPerSandbox)).append("\n");
    sb.append("    snapshotDeactivationTimeoutMinutes: ").append(toIndentedString(snapshotDeactivationTimeoutMinutes)).append("\n");
    sb.append("    sandboxLimitedNetworkEgress: ").append(toIndentedString(sandboxLimitedNetworkEgress)).append("\n");
    sb.append("    defaultRegionId: ").append(toIndentedString(defaultRegionId)).append("\n");
    sb.append("    authenticatedRateLimit: ").append(toIndentedString(authenticatedRateLimit)).append("\n");
    sb.append("    sandboxCreateRateLimit: ").append(toIndentedString(sandboxCreateRateLimit)).append("\n");
    sb.append("    sandboxLifecycleRateLimit: ").append(toIndentedString(sandboxLifecycleRateLimit)).append("\n");
    sb.append("    experimentalConfig: ").append(toIndentedString(experimentalConfig)).append("\n");
    sb.append("    otelConfig: ").append(toIndentedString(otelConfig)).append("\n");
    sb.append("    authenticatedRateLimitTtlSeconds: ").append(toIndentedString(authenticatedRateLimitTtlSeconds)).append("\n");
    sb.append("    sandboxCreateRateLimitTtlSeconds: ").append(toIndentedString(sandboxCreateRateLimitTtlSeconds)).append("\n");
    sb.append("    sandboxLifecycleRateLimitTtlSeconds: ").append(toIndentedString(sandboxLifecycleRateLimitTtlSeconds)).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", "name", "createdBy", "personal", "createdAt", "updatedAt", "suspended", "suspendedAt", "suspensionReason", "suspendedUntil", "suspensionCleanupGracePeriodHours", "maxCpuPerSandbox", "maxMemoryPerSandbox", "maxDiskPerSandbox", "snapshotDeactivationTimeoutMinutes", "sandboxLimitedNetworkEgress", "defaultRegionId", "authenticatedRateLimit", "sandboxCreateRateLimit", "sandboxLifecycleRateLimit", "experimentalConfig", "otelConfig", "authenticatedRateLimitTtlSeconds", "sandboxCreateRateLimitTtlSeconds", "sandboxLifecycleRateLimitTtlSeconds"));

    // a set of required properties/fields (JSON key names)
    openapiRequiredFields = new HashSet<String>(Arrays.asList("id", "name", "createdBy", "personal", "createdAt", "updatedAt", "suspended", "suspendedAt", "suspensionReason", "suspendedUntil", "suspensionCleanupGracePeriodHours", "maxCpuPerSandbox", "maxMemoryPerSandbox", "maxDiskPerSandbox", "snapshotDeactivationTimeoutMinutes", "sandboxLimitedNetworkEgress", "authenticatedRateLimit", "sandboxCreateRateLimit", "sandboxLifecycleRateLimit", "experimentalConfig", "otelConfig", "authenticatedRateLimitTtlSeconds", "sandboxCreateRateLimitTtlSeconds", "sandboxLifecycleRateLimitTtlSeconds"));
  }

  /**
   * 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 Organization
   */
  public static void validateJsonElement(JsonElement jsonElement) throws IOException {
      if (jsonElement == null) {
        if (!Organization.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 Organization is not found in the empty JSON string", Organization.openapiRequiredFields.toString()));
        }
      }

      // check to make sure all required properties/fields are present in the JSON string
      for (String requiredField : Organization.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("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()));
      }
      if (!jsonObj.get("createdBy").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `createdBy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("createdBy").toString()));
      }
      if (!jsonObj.get("suspensionReason").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `suspensionReason` to be a primitive type in the JSON string but got `%s`", jsonObj.get("suspensionReason").toString()));
      }
      if ((jsonObj.get("defaultRegionId") != null && !jsonObj.get("defaultRegionId").isJsonNull()) && !jsonObj.get("defaultRegionId").isJsonPrimitive()) {
        throw new IllegalArgumentException(String.format(java.util.Locale.ROOT, "Expected the field `defaultRegionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultRegionId").toString()));
      }
      if (jsonObj.get("otelConfig") != null && !jsonObj.get("otelConfig").isJsonNull()) {
      // validate the required field `otelConfig`
      OtelConfig.validateJsonElement(jsonObj.get("otelConfig"));
      }
  }

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

       return (TypeAdapter<T>) new TypeAdapter<Organization>() {
           @Override
           public void write(JsonWriter out, Organization 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 Organization read(JsonReader in) throws IOException {
             JsonElement jsonElement = elementAdapter.read(in);
             validateJsonElement(jsonElement);
             JsonObject jsonObj = jsonElement.getAsJsonObject();
             // store additional fields in the deserialized instance
             Organization 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 Organization given an JSON string
   *
   * @param jsonString JSON string
   * @return An instance of Organization
   * @throws IOException if the JSON string is invalid with respect to Organization
   */
  public static Organization fromJson(String jsonString) throws IOException {
    return JSON.getGson().fromJson(jsonString, Organization.class);
  }

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

