/*
 * Internal Utility API
 * This API allows you to access internal data.
 *
 * OpenAPI spec version: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */


package org.wso2.am.integration.clients.internal.api.dto;

import java.util.Objects;
import java.util.Arrays;
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;

/**
 * GatewayDeploymentStatusAcknowledgmentDTO
 */

public class GatewayDeploymentStatusAcknowledgmentDTO {
  @SerializedName("gatewayId")
  private String gatewayId = null;

  @SerializedName("apiId")
  private String apiId = null;

  @SerializedName("tenantDomain")
  private String tenantDomain = null;

  /**
   * The final status of the deployment action.
   */
  @JsonAdapter(DeploymentStatusEnum.Adapter.class)
  public enum DeploymentStatusEnum {
    SUCCESS("SUCCESS"),
    
    FAILURE("FAILURE");

    private String value;

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

    public String getValue() {
      return value;
    }

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

    public static DeploymentStatusEnum fromValue(String text) {
      for (DeploymentStatusEnum b : DeploymentStatusEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

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

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

  @SerializedName("deploymentStatus")
  private DeploymentStatusEnum deploymentStatus = null;

  @SerializedName("timeStamp")
  private Long timeStamp = null;

  /**
   * The action performed by the gateway.
   */
  @JsonAdapter(ActionEnum.Adapter.class)
  public enum ActionEnum {
    DEPLOY("DEPLOY"),
    
    UNDEPLOY("UNDEPLOY");

    private String value;

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

    public String getValue() {
      return value;
    }

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

    public static ActionEnum fromValue(String text) {
      for (ActionEnum b : ActionEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }

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

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

  @SerializedName("action")
  private ActionEnum action = null;

  @SerializedName("revisionId")
  private String revisionId = null;

  @SerializedName("errorCode")
  private Integer errorCode = null;

  @SerializedName("errorMessage")
  private String errorMessage = null;

  public GatewayDeploymentStatusAcknowledgmentDTO gatewayId(String gatewayId) {
    this.gatewayId = gatewayId;
    return this;
  }

   /**
   * The unique identifier assigned to the newly registered gateway.
   * @return gatewayId
  **/
  @ApiModelProperty(required = true, value = "The unique identifier assigned to the newly registered gateway.")
  public String getGatewayId() {
    return gatewayId;
  }

  public void setGatewayId(String gatewayId) {
    this.gatewayId = gatewayId;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO apiId(String apiId) {
    this.apiId = apiId;
    return this;
  }

   /**
   * Unique identifier of the deployed API.
   * @return apiId
  **/
  @ApiModelProperty(example = "3c2240f2-33f1-4c6d-936e-74172ea864ab", required = true, value = "Unique identifier of the deployed API.")
  public String getApiId() {
    return apiId;
  }

  public void setApiId(String apiId) {
    this.apiId = apiId;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO tenantDomain(String tenantDomain) {
    this.tenantDomain = tenantDomain;
    return this;
  }

   /**
   * Get tenantDomain
   * @return tenantDomain
  **/
  @ApiModelProperty(required = true, value = "")
  public String getTenantDomain() {
    return tenantDomain;
  }

  public void setTenantDomain(String tenantDomain) {
    this.tenantDomain = tenantDomain;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO deploymentStatus(DeploymentStatusEnum deploymentStatus) {
    this.deploymentStatus = deploymentStatus;
    return this;
  }

   /**
   * The final status of the deployment action.
   * @return deploymentStatus
  **/
  @ApiModelProperty(required = true, value = "The final status of the deployment action.")
  public DeploymentStatusEnum getDeploymentStatus() {
    return deploymentStatus;
  }

  public void setDeploymentStatus(DeploymentStatusEnum deploymentStatus) {
    this.deploymentStatus = deploymentStatus;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO timeStamp(Long timeStamp) {
    this.timeStamp = timeStamp;
    return this;
  }

   /**
   * The timestamp when the heartbeat was generated.
   * @return timeStamp
  **/
  @ApiModelProperty(required = true, value = "The timestamp when the heartbeat was generated.")
  public Long getTimeStamp() {
    return timeStamp;
  }

  public void setTimeStamp(Long timeStamp) {
    this.timeStamp = timeStamp;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO action(ActionEnum action) {
    this.action = action;
    return this;
  }

   /**
   * The action performed by the gateway.
   * @return action
  **/
  @ApiModelProperty(value = "The action performed by the gateway.")
  public ActionEnum getAction() {
    return action;
  }

  public void setAction(ActionEnum action) {
    this.action = action;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO revisionId(String revisionId) {
    this.revisionId = revisionId;
    return this;
  }

   /**
   * Unique identifier of the API revision that was deployed or undeployed.
   * @return revisionId
  **/
  @ApiModelProperty(example = "f46c7962-cd36-4aa6-b804-8d66ad6a0dc4", value = "Unique identifier of the API revision that was deployed or undeployed.")
  public String getRevisionId() {
    return revisionId;
  }

  public void setRevisionId(String revisionId) {
    this.revisionId = revisionId;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO errorCode(Integer errorCode) {
    this.errorCode = errorCode;
    return this;
  }

   /**
   * A unique code identifying the error, present only if deploymentStatus is &#39;FAILURE&#39;.
   * @return errorCode
  **/
  @ApiModelProperty(value = "A unique code identifying the error, present only if deploymentStatus is 'FAILURE'.")
  public Integer getErrorCode() {
    return errorCode;
  }

  public void setErrorCode(Integer errorCode) {
    this.errorCode = errorCode;
  }

  public GatewayDeploymentStatusAcknowledgmentDTO errorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
    return this;
  }

   /**
   * A descriptive error message, present only if deploymentStatus is &#39;FAILURE&#39;.
   * @return errorMessage
  **/
  @ApiModelProperty(value = "A descriptive error message, present only if deploymentStatus is 'FAILURE'.")
  public String getErrorMessage() {
    return errorMessage;
  }

  public void setErrorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    GatewayDeploymentStatusAcknowledgmentDTO gatewayDeploymentStatusAcknowledgment = (GatewayDeploymentStatusAcknowledgmentDTO) o;
    return Objects.equals(this.gatewayId, gatewayDeploymentStatusAcknowledgment.gatewayId) &&
        Objects.equals(this.apiId, gatewayDeploymentStatusAcknowledgment.apiId) &&
        Objects.equals(this.tenantDomain, gatewayDeploymentStatusAcknowledgment.tenantDomain) &&
        Objects.equals(this.deploymentStatus, gatewayDeploymentStatusAcknowledgment.deploymentStatus) &&
        Objects.equals(this.timeStamp, gatewayDeploymentStatusAcknowledgment.timeStamp) &&
        Objects.equals(this.action, gatewayDeploymentStatusAcknowledgment.action) &&
        Objects.equals(this.revisionId, gatewayDeploymentStatusAcknowledgment.revisionId) &&
        Objects.equals(this.errorCode, gatewayDeploymentStatusAcknowledgment.errorCode) &&
        Objects.equals(this.errorMessage, gatewayDeploymentStatusAcknowledgment.errorMessage);
  }

  @Override
  public int hashCode() {
    return Objects.hash(gatewayId, apiId, tenantDomain, deploymentStatus, timeStamp, action, revisionId, errorCode, errorMessage);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class GatewayDeploymentStatusAcknowledgmentDTO {\n");
    
    sb.append("    gatewayId: ").append(toIndentedString(gatewayId)).append("\n");
    sb.append("    apiId: ").append(toIndentedString(apiId)).append("\n");
    sb.append("    tenantDomain: ").append(toIndentedString(tenantDomain)).append("\n");
    sb.append("    deploymentStatus: ").append(toIndentedString(deploymentStatus)).append("\n");
    sb.append("    timeStamp: ").append(toIndentedString(timeStamp)).append("\n");
    sb.append("    action: ").append(toIndentedString(action)).append("\n");
    sb.append("    revisionId: ").append(toIndentedString(revisionId)).append("\n");
    sb.append("    errorCode: ").append(toIndentedString(errorCode)).append("\n");
    sb.append("    errorMessage: ").append(toIndentedString(errorMessage)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

