/*
 * Cloudera Manager API
 * <h1>Cloudera Manager API v50</h1>       <p>Introduced in Cloudera Manager 7.8.1</p>       <p><a href=\"http://www.cloudera.com/documentation.html\">Cloudera Product Documentation</a></p>
 *
 * OpenAPI spec version: 7.8.1
 * 
 *
 * 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 com.cloudera.api.swagger.model;

import java.util.Objects;
import com.cloudera.api.swagger.model.ApiClusterRef;
import com.cloudera.api.swagger.model.ApiCommand;
import com.cloudera.api.swagger.model.ApiCommandList;
import com.cloudera.api.swagger.model.ApiHBaseSnapshotResult;
import com.cloudera.api.swagger.model.ApiHdfsSnapshotResult;
import com.cloudera.api.swagger.model.ApiHostRef;
import com.cloudera.api.swagger.model.ApiRoleRef;
import com.cloudera.api.swagger.model.ApiServiceRef;
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;

/**
 * Information about snapshot commands. &lt;p/&gt; This object holds all the information a regular ApiCommand object provides, and adds specific information about the results of a snapshot command. &lt;p/&gt; Depending on the type of the service where the snapshot command was run, a different result property will be populated.
 */
@ApiModel(description = "Information about snapshot commands. <p/> This object holds all the information a regular ApiCommand object provides, and adds specific information about the results of a snapshot command. <p/> Depending on the type of the service where the snapshot command was run, a different result property will be populated.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiSnapshotCommand {
  @SerializedName("id")
  private java.math.BigDecimal id = null;

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

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

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

  @SerializedName("active")
  private Boolean active = null;

  @SerializedName("success")
  private Boolean success = null;

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

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

  @SerializedName("clusterRef")
  private ApiClusterRef clusterRef = null;

  @SerializedName("serviceRef")
  private ApiServiceRef serviceRef = null;

  @SerializedName("roleRef")
  private ApiRoleRef roleRef = null;

  @SerializedName("hostRef")
  private ApiHostRef hostRef = null;

  @SerializedName("parent")
  private ApiCommand parent = null;

  @SerializedName("children")
  private ApiCommandList children = null;

  @SerializedName("canRetry")
  private Boolean canRetry = null;

  @SerializedName("hbaseResult")
  private ApiHBaseSnapshotResult hbaseResult = null;

  @SerializedName("hdfsResult")
  private ApiHdfsSnapshotResult hdfsResult = null;

  public ApiSnapshotCommand id(java.math.BigDecimal id) {
    this.id = id;
    return this;
  }

   /**
   * The command ID.
   * @return id
  **/
  @ApiModelProperty(value = "The command ID.")
  public java.math.BigDecimal getId() {
    return id;
  }

  public void setId(java.math.BigDecimal id) {
    this.id = id;
  }

  public ApiSnapshotCommand name(String name) {
    this.name = name;
    return this;
  }

   /**
   * The command name.
   * @return name
  **/
  @ApiModelProperty(value = "The command name.")
  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public ApiSnapshotCommand startTime(String startTime) {
    this.startTime = startTime;
    return this;
  }

   /**
   * The start time.
   * @return startTime
  **/
  @ApiModelProperty(value = "The start time.")
  public String getStartTime() {
    return startTime;
  }

  public void setStartTime(String startTime) {
    this.startTime = startTime;
  }

  public ApiSnapshotCommand endTime(String endTime) {
    this.endTime = endTime;
    return this;
  }

   /**
   * The end time, if the command is finished.
   * @return endTime
  **/
  @ApiModelProperty(value = "The end time, if the command is finished.")
  public String getEndTime() {
    return endTime;
  }

  public void setEndTime(String endTime) {
    this.endTime = endTime;
  }

  public ApiSnapshotCommand active(Boolean active) {
    this.active = active;
    return this;
  }

   /**
   * Whether the command is currently active.
   * @return active
  **/
  @ApiModelProperty(value = "Whether the command is currently active.")
  public Boolean getActive() {
    return active;
  }

  public void setActive(Boolean active) {
    this.active = active;
  }

  public ApiSnapshotCommand success(Boolean success) {
    this.success = success;
    return this;
  }

   /**
   * If the command is finished, whether it was successful.
   * @return success
  **/
  @ApiModelProperty(value = "If the command is finished, whether it was successful.")
  public Boolean getSuccess() {
    return success;
  }

  public void setSuccess(Boolean success) {
    this.success = success;
  }

  public ApiSnapshotCommand resultMessage(String resultMessage) {
    this.resultMessage = resultMessage;
    return this;
  }

   /**
   * If the command is finished, the result message.
   * @return resultMessage
  **/
  @ApiModelProperty(value = "If the command is finished, the result message.")
  public String getResultMessage() {
    return resultMessage;
  }

  public void setResultMessage(String resultMessage) {
    this.resultMessage = resultMessage;
  }

  public ApiSnapshotCommand resultDataUrl(String resultDataUrl) {
    this.resultDataUrl = resultDataUrl;
    return this;
  }

   /**
   * URL to the command&#39;s downloadable result data, if any exists.
   * @return resultDataUrl
  **/
  @ApiModelProperty(value = "URL to the command's downloadable result data, if any exists.")
  public String getResultDataUrl() {
    return resultDataUrl;
  }

  public void setResultDataUrl(String resultDataUrl) {
    this.resultDataUrl = resultDataUrl;
  }

  public ApiSnapshotCommand clusterRef(ApiClusterRef clusterRef) {
    this.clusterRef = clusterRef;
    return this;
  }

   /**
   * Reference to the cluster (for cluster commands only).
   * @return clusterRef
  **/
  @ApiModelProperty(value = "Reference to the cluster (for cluster commands only).")
  public ApiClusterRef getClusterRef() {
    return clusterRef;
  }

  public void setClusterRef(ApiClusterRef clusterRef) {
    this.clusterRef = clusterRef;
  }

  public ApiSnapshotCommand serviceRef(ApiServiceRef serviceRef) {
    this.serviceRef = serviceRef;
    return this;
  }

   /**
   * Reference to the service (for service commands only).
   * @return serviceRef
  **/
  @ApiModelProperty(value = "Reference to the service (for service commands only).")
  public ApiServiceRef getServiceRef() {
    return serviceRef;
  }

  public void setServiceRef(ApiServiceRef serviceRef) {
    this.serviceRef = serviceRef;
  }

  public ApiSnapshotCommand roleRef(ApiRoleRef roleRef) {
    this.roleRef = roleRef;
    return this;
  }

   /**
   * Reference to the role (for role commands only).
   * @return roleRef
  **/
  @ApiModelProperty(value = "Reference to the role (for role commands only).")
  public ApiRoleRef getRoleRef() {
    return roleRef;
  }

  public void setRoleRef(ApiRoleRef roleRef) {
    this.roleRef = roleRef;
  }

  public ApiSnapshotCommand hostRef(ApiHostRef hostRef) {
    this.hostRef = hostRef;
    return this;
  }

   /**
   * Reference to the host (for host commands only).
   * @return hostRef
  **/
  @ApiModelProperty(value = "Reference to the host (for host commands only).")
  public ApiHostRef getHostRef() {
    return hostRef;
  }

  public void setHostRef(ApiHostRef hostRef) {
    this.hostRef = hostRef;
  }

  public ApiSnapshotCommand parent(ApiCommand parent) {
    this.parent = parent;
    return this;
  }

   /**
   * Reference to the parent command, if any.
   * @return parent
  **/
  @ApiModelProperty(value = "Reference to the parent command, if any.")
  public ApiCommand getParent() {
    return parent;
  }

  public void setParent(ApiCommand parent) {
    this.parent = parent;
  }

  public ApiSnapshotCommand children(ApiCommandList children) {
    this.children = children;
    return this;
  }

   /**
   * List of child commands. Only available in the full view. &lt;p&gt; The list contains only the summary view of the children.
   * @return children
  **/
  @ApiModelProperty(value = "List of child commands. Only available in the full view. <p> The list contains only the summary view of the children.")
  public ApiCommandList getChildren() {
    return children;
  }

  public void setChildren(ApiCommandList children) {
    this.children = children;
  }

  public ApiSnapshotCommand canRetry(Boolean canRetry) {
    this.canRetry = canRetry;
    return this;
  }

   /**
   * If the command can be retried. Available since V11
   * @return canRetry
  **/
  @ApiModelProperty(value = "If the command can be retried. Available since V11")
  public Boolean getCanRetry() {
    return canRetry;
  }

  public void setCanRetry(Boolean canRetry) {
    this.canRetry = canRetry;
  }

  public ApiSnapshotCommand hbaseResult(ApiHBaseSnapshotResult hbaseResult) {
    this.hbaseResult = hbaseResult;
    return this;
  }

   /**
   * Results for snapshot commands on HBase services.
   * @return hbaseResult
  **/
  @ApiModelProperty(value = "Results for snapshot commands on HBase services.")
  public ApiHBaseSnapshotResult getHbaseResult() {
    return hbaseResult;
  }

  public void setHbaseResult(ApiHBaseSnapshotResult hbaseResult) {
    this.hbaseResult = hbaseResult;
  }

  public ApiSnapshotCommand hdfsResult(ApiHdfsSnapshotResult hdfsResult) {
    this.hdfsResult = hdfsResult;
    return this;
  }

   /**
   * Results for snapshot commands on Hdfs services.
   * @return hdfsResult
  **/
  @ApiModelProperty(value = "Results for snapshot commands on Hdfs services.")
  public ApiHdfsSnapshotResult getHdfsResult() {
    return hdfsResult;
  }

  public void setHdfsResult(ApiHdfsSnapshotResult hdfsResult) {
    this.hdfsResult = hdfsResult;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiSnapshotCommand apiSnapshotCommand = (ApiSnapshotCommand) o;
    return Objects.equals(this.id, apiSnapshotCommand.id) &&
        Objects.equals(this.name, apiSnapshotCommand.name) &&
        Objects.equals(this.startTime, apiSnapshotCommand.startTime) &&
        Objects.equals(this.endTime, apiSnapshotCommand.endTime) &&
        Objects.equals(this.active, apiSnapshotCommand.active) &&
        Objects.equals(this.success, apiSnapshotCommand.success) &&
        Objects.equals(this.resultMessage, apiSnapshotCommand.resultMessage) &&
        Objects.equals(this.resultDataUrl, apiSnapshotCommand.resultDataUrl) &&
        Objects.equals(this.clusterRef, apiSnapshotCommand.clusterRef) &&
        Objects.equals(this.serviceRef, apiSnapshotCommand.serviceRef) &&
        Objects.equals(this.roleRef, apiSnapshotCommand.roleRef) &&
        Objects.equals(this.hostRef, apiSnapshotCommand.hostRef) &&
        Objects.equals(this.parent, apiSnapshotCommand.parent) &&
        Objects.equals(this.children, apiSnapshotCommand.children) &&
        Objects.equals(this.canRetry, apiSnapshotCommand.canRetry) &&
        Objects.equals(this.hbaseResult, apiSnapshotCommand.hbaseResult) &&
        Objects.equals(this.hdfsResult, apiSnapshotCommand.hdfsResult);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, startTime, endTime, active, success, resultMessage, resultDataUrl, clusterRef, serviceRef, roleRef, hostRef, parent, children, canRetry, hbaseResult, hdfsResult);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiSnapshotCommand {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    startTime: ").append(toIndentedString(startTime)).append("\n");
    sb.append("    endTime: ").append(toIndentedString(endTime)).append("\n");
    sb.append("    active: ").append(toIndentedString(active)).append("\n");
    sb.append("    success: ").append(toIndentedString(success)).append("\n");
    sb.append("    resultMessage: ").append(toIndentedString(resultMessage)).append("\n");
    sb.append("    resultDataUrl: ").append(toIndentedString(resultDataUrl)).append("\n");
    sb.append("    clusterRef: ").append(toIndentedString(clusterRef)).append("\n");
    sb.append("    serviceRef: ").append(toIndentedString(serviceRef)).append("\n");
    sb.append("    roleRef: ").append(toIndentedString(roleRef)).append("\n");
    sb.append("    hostRef: ").append(toIndentedString(hostRef)).append("\n");
    sb.append("    parent: ").append(toIndentedString(parent)).append("\n");
    sb.append("    children: ").append(toIndentedString(children)).append("\n");
    sb.append("    canRetry: ").append(toIndentedString(canRetry)).append("\n");
    sb.append("    hbaseResult: ").append(toIndentedString(hbaseResult)).append("\n");
    sb.append("    hdfsResult: ").append(toIndentedString(hdfsResult)).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    ");
  }
  
}

