content: /*
   * Copyright (c) 2020-2025 Airbyte, Inc., all rights reserved.
   */
  
  package io.airbyte.config;
  
  import com.fasterxml.jackson.annotation.JsonAnyGetter;
  import com.fasterxml.jackson.annotation.JsonAnySetter;
  import com.fasterxml.jackson.annotation.JsonCreator;
  import com.fasterxml.jackson.annotation.JsonIgnore;
  import com.fasterxml.jackson.annotation.JsonInclude;
  import com.fasterxml.jackson.annotation.JsonProperty;
  import com.fasterxml.jackson.annotation.JsonPropertyDescription;
  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
  import com.fasterxml.jackson.annotation.JsonValue;
  import jakarta.annotation.Generated;
  import java.io.Serializable;
  import java.util.HashMap;
  import java.util.Map;
  
  /**
   * sets resource requirements for a specific job type for an actor or actor definition. these values
   * override the default, if both are set.
   *
   */
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonPropertyOrder({
    "jobType",
    "resourceRequirements"
  })
  @Generated(value = "Generated by jsonSchema2Pojo")
  public class JobTypeResourceLimit implements Serializable {
  
    /**
     * JobType
     * <p>
     * enum that describes the different types of jobs that the platform runs. (Required)
     *
     */
    @JsonProperty("jobType")
    @JsonPropertyDescription("enum that describes the different types of jobs that the platform runs.")
    private JobType jobType;
    /**
     * ResourceRequirements
     * <p>
     * generic configuration for pod source requirements (Required)
     *
     */
    @JsonProperty("resourceRequirements")
    @JsonPropertyDescription("generic configuration for pod source requirements")
    private ResourceRequirements resourceRequirements;
    @JsonIgnore
    private Map<String, Object> additionalProperties = new HashMap<String, Object>();
    private final static long serialVersionUID = -7339120943410847765L;
  
    /**
     * JobType
     * <p>
     * enum that describes the different types of jobs that the platform runs. (Required)
     *
     */
    @JsonProperty("jobType")
    public JobType getJobType() {
      return jobType;
    }
  
    /**
     * JobType
     * <p>
     * enum that describes the different types of jobs that the platform runs. (Required)
     *
     */
    @JsonProperty("jobType")
    public void setJobType(JobType jobType) {
      this.jobType = jobType;
    }
  
    public JobTypeResourceLimit withJobType(JobType jobType) {
      this.jobType = jobType;
      return this;
    }
  
    /**
     * ResourceRequirements
     * <p>
     * generic configuration for pod source requirements (Required)
     *
     */
    @JsonProperty("resourceRequirements")
    public ResourceRequirements getResourceRequirements() {
      return resourceRequirements;
    }
  
    /**
     * ResourceRequirements
     * <p>
     * generic configuration for pod source requirements (Required)
     *
     */
    @JsonProperty("resourceRequirements")
    public void setResourceRequirements(ResourceRequirements resourceRequirements) {
      this.resourceRequirements = resourceRequirements;
    }
  
    public JobTypeResourceLimit withResourceRequirements(ResourceRequirements resourceRequirements) {
      this.resourceRequirements = resourceRequirements;
      return this;
    }
  
    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
      return this.additionalProperties;
    }
  
    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
      this.additionalProperties.put(name, value);
    }
  
    public JobTypeResourceLimit withAdditionalProperty(String name, Object value) {
      this.additionalProperties.put(name, value);
      return this;
    }
  
    @Override
    public String toString() {
      StringBuilder sb = new StringBuilder();
      sb.append(JobTypeResourceLimit.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
      sb.append("jobType");
      sb.append('=');
      sb.append(((this.jobType == null) ? "<null>" : this.jobType));
      sb.append(',');
      sb.append("resourceRequirements");
      sb.append('=');
      sb.append(((this.resourceRequirements == null) ? "<null>" : this.resourceRequirements));
      sb.append(',');
      sb.append("additionalProperties");
      sb.append('=');
      sb.append(((this.additionalProperties == null) ? "<null>" : this.additionalProperties));
      sb.append(',');
      if (sb.charAt((sb.length() - 1)) == ',') {
        sb.setCharAt((sb.length() - 1), ']');
      } else {
        sb.append(']');
      }
      return sb.toString();
    }
  
    @Override
    public int hashCode() {
      int result = 1;
      result = ((result * 31) + ((this.jobType == null) ? 0 : this.jobType.hashCode()));
      result = ((result * 31) + ((this.resourceRequirements == null) ? 0 : this.resourceRequirements.hashCode()));
      result = ((result * 31) + ((this.additionalProperties == null) ? 0 : this.additionalProperties.hashCode()));
      return result;
    }
  
    @Override
    public boolean equals(Object other) {
      if (other == this) {
        return true;
      }
      if ((other instanceof JobTypeResourceLimit) == false) {
        return false;
      }
      JobTypeResourceLimit rhs = ((JobTypeResourceLimit) other);
      return ((((this.jobType == rhs.jobType) || ((this.jobType != null) && this.jobType.equals(rhs.jobType)))
          && ((this.resourceRequirements == rhs.resourceRequirements)
              || ((this.resourceRequirements != null) && this.resourceRequirements.equals(rhs.resourceRequirements))))
          && ((this.additionalProperties == rhs.additionalProperties)
              || ((this.additionalProperties != null) && this.additionalProperties.equals(rhs.additionalProperties))));
    }
  
    /**
     * JobType
     * <p>
     * enum that describes the different types of jobs that the platform runs.
     *
     */
    public enum JobType {
  
      GET_SPEC("get_spec"),
      CHECK_CONNECTION("check_connection"),
      DISCOVER_SCHEMA("discover_schema"),
      SYNC("sync"),
      RESET_CONNECTION("reset_connection"),
      CONNECTION_UPDATER("connection_updater"),
      REPLICATE("replicate"),
      REFRESH("refresh");
  
      private final String value;
      private final static Map<String, JobType> CONSTANTS = new HashMap<String, JobType>();
  
      static {
        for (JobType c : values()) {
          CONSTANTS.put(c.value, c);
        }
      }
  
      private JobType(String value) {
        this.value = value;
      }
  
      @Override
      public String toString() {
        return this.value;
      }
  
      @JsonValue
      public String value() {
        return this.value;
      }
  
      @JsonCreator
      public static JobType fromValue(String value) {
        JobType constant = CONSTANTS.get(value);
        if (constant == null) {
          throw new IllegalArgumentException(value);
        } else {
          return constant;
        }
      }
  
    }
  
  }
  