/*
 * Kubernetes
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1.21.1
 *
 *
 * 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.kubernetes.autoscaling.models;

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.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;

/**
 * Describes the rules on how changes are applied to the pods. If not specified, all fields in the &#x60;PodUpdatePolicy&#x60; are set to their default values.
 */
@ApiModel(description = "Describes the rules on how changes are applied to the pods. If not specified, all fields in the `PodUpdatePolicy` are set to their default values.")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", date = "2022-10-02T17:31:04.907Z[Etc/UTC]")
public class V1beta2VerticalPodAutoscalerSpecUpdatePolicy {
  /**
   * Controls when autoscaler applies changes to the pod resources. The default is &#39;Auto&#39;.
   */
  @JsonAdapter(UpdateModeEnum.Adapter.class)
  public enum UpdateModeEnum {
    OFF("Off"),

    INITIAL("Initial"),

    RECREATE("Recreate"),

    AUTO("Auto");

    private final String value;

    UpdateModeEnum(String value) {
      this.value = value;
    }

    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    public static UpdateModeEnum fromValue(String value) {
      for (UpdateModeEnum b : UpdateModeEnum.values()) {
        if (b.value.equals(value)) {
          return b;
        }
      }
      throw new IllegalArgumentException("Unexpected value '" + value + "'");
    }

    public static class Adapter extends TypeAdapter<UpdateModeEnum> {
      @Override
      public void write(final JsonWriter jsonWriter, final UpdateModeEnum enumeration) throws IOException {
        jsonWriter.value(enumeration.getValue());
      }

      @Override
      public UpdateModeEnum read(final JsonReader jsonReader) throws IOException {
        String value =  jsonReader.nextString();
        return UpdateModeEnum.fromValue(value);
      }
    }
  }

  public static final String SERIALIZED_NAME_UPDATE_MODE = "updateMode";
  @SerializedName(SERIALIZED_NAME_UPDATE_MODE)
  private UpdateModeEnum updateMode;


  public V1beta2VerticalPodAutoscalerSpecUpdatePolicy updateMode(UpdateModeEnum updateMode) {

    this.updateMode = updateMode;
    return this;
  }

   /**
   * Controls when autoscaler applies changes to the pod resources. The default is &#39;Auto&#39;.
   * @return updateMode
  **/
  @javax.annotation.Nullable
  @ApiModelProperty(value = "Controls when autoscaler applies changes to the pod resources. The default is 'Auto'.")

  public UpdateModeEnum getUpdateMode() {
    return updateMode;
  }


  public void setUpdateMode(UpdateModeEnum updateMode) {
    this.updateMode = updateMode;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    V1beta2VerticalPodAutoscalerSpecUpdatePolicy v1beta2VerticalPodAutoscalerSpecUpdatePolicy = (V1beta2VerticalPodAutoscalerSpecUpdatePolicy) o;
    return Objects.equals(this.updateMode, v1beta2VerticalPodAutoscalerSpecUpdatePolicy.updateMode);
  }

  @Override
  public int hashCode() {
    return Objects.hash(updateMode);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class V1beta2VerticalPodAutoscalerSpecUpdatePolicy {\n");
    sb.append("    updateMode: ").append(toIndentedString(updateMode)).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) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

