/*
 * 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.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;
import java.util.ArrayList;
import java.util.List;

/**
 * The ApiParcelState encapsulates the state of a parcel while it is in transition and reports any errors that may have occurred.. &lt;p&gt; The complete progress of a parcel is broken up into two different reporting indicators - progress and count. Progress is the primary indicator that reports the global state of transitions. For example, when downloading, progress and totalProgress will show the current number of bytes downloaded and the total number of bytes needed to be downloaded respectively. &lt;/p&gt; &lt;p&gt; The count and totalCount indicator is used when a state transition affects multiple hosts. The count and totalCount show the current number of hosts completed and the total number of hosts respectively. For example, during distribution, the progress and totalProgress will show how many bytes have been transferred to each host and the count will indicate how many hosts of of totalCount have had parcels unpacked. &lt;/p&gt; &lt;p&gt; Along with the two progress indicators, the ApiParcelState shows both errors and warnings that may have turned up during a state transition. &lt;/p&gt;
 */
@ApiModel(description = "The ApiParcelState encapsulates the state of a parcel while it is in transition and reports any errors that may have occurred.. <p> The complete progress of a parcel is broken up into two different reporting indicators - progress and count. Progress is the primary indicator that reports the global state of transitions. For example, when downloading, progress and totalProgress will show the current number of bytes downloaded and the total number of bytes needed to be downloaded respectively. </p> <p> The count and totalCount indicator is used when a state transition affects multiple hosts. The count and totalCount show the current number of hosts completed and the total number of hosts respectively. For example, during distribution, the progress and totalProgress will show how many bytes have been transferred to each host and the count will indicate how many hosts of of totalCount have had parcels unpacked. </p> <p> Along with the two progress indicators, the ApiParcelState shows both errors and warnings that may have turned up during a state transition. </p>")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiParcelState {
  @SerializedName("progress")
  private java.math.BigDecimal progress = null;

  @SerializedName("totalProgress")
  private java.math.BigDecimal totalProgress = null;

  @SerializedName("count")
  private java.math.BigDecimal count = null;

  @SerializedName("totalCount")
  private java.math.BigDecimal totalCount = null;

  @SerializedName("errors")
  private List<String> errors = null;

  @SerializedName("warnings")
  private List<String> warnings = null;

  public ApiParcelState progress(java.math.BigDecimal progress) {
    this.progress = progress;
    return this;
  }

   /**
   * The progress of the state transition.
   * @return progress
  **/
  @ApiModelProperty(value = "The progress of the state transition.")
  public java.math.BigDecimal getProgress() {
    return progress;
  }

  public void setProgress(java.math.BigDecimal progress) {
    this.progress = progress;
  }

  public ApiParcelState totalProgress(java.math.BigDecimal totalProgress) {
    this.totalProgress = totalProgress;
    return this;
  }

   /**
   * The total amount that #getProgress() needs to get to.
   * @return totalProgress
  **/
  @ApiModelProperty(value = "The total amount that #getProgress() needs to get to.")
  public java.math.BigDecimal getTotalProgress() {
    return totalProgress;
  }

  public void setTotalProgress(java.math.BigDecimal totalProgress) {
    this.totalProgress = totalProgress;
  }

  public ApiParcelState count(java.math.BigDecimal count) {
    this.count = count;
    return this;
  }

   /**
   * The current hosts that have completed.
   * @return count
  **/
  @ApiModelProperty(value = "The current hosts that have completed.")
  public java.math.BigDecimal getCount() {
    return count;
  }

  public void setCount(java.math.BigDecimal count) {
    this.count = count;
  }

  public ApiParcelState totalCount(java.math.BigDecimal totalCount) {
    this.totalCount = totalCount;
    return this;
  }

   /**
   * The total amount that #getCount() needs to get to.
   * @return totalCount
  **/
  @ApiModelProperty(value = "The total amount that #getCount() needs to get to.")
  public java.math.BigDecimal getTotalCount() {
    return totalCount;
  }

  public void setTotalCount(java.math.BigDecimal totalCount) {
    this.totalCount = totalCount;
  }

  public ApiParcelState errors(List<String> errors) {
    this.errors = errors;
    return this;
  }

  public ApiParcelState addErrorsItem(String errorsItem) {
    if (this.errors == null) {
      this.errors = new ArrayList<String>();
    }
    this.errors.add(errorsItem);
    return this;
  }

   /**
   * The errors that exist for this parcel.
   * @return errors
  **/
  @ApiModelProperty(value = "The errors that exist for this parcel.")
  public List<String> getErrors() {
    return errors;
  }

  public void setErrors(List<String> errors) {
    this.errors = errors;
  }

  public ApiParcelState warnings(List<String> warnings) {
    this.warnings = warnings;
    return this;
  }

  public ApiParcelState addWarningsItem(String warningsItem) {
    if (this.warnings == null) {
      this.warnings = new ArrayList<String>();
    }
    this.warnings.add(warningsItem);
    return this;
  }

   /**
   * The warnings that exist for this parcel.
   * @return warnings
  **/
  @ApiModelProperty(value = "The warnings that exist for this parcel.")
  public List<String> getWarnings() {
    return warnings;
  }

  public void setWarnings(List<String> warnings) {
    this.warnings = warnings;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiParcelState apiParcelState = (ApiParcelState) o;
    return Objects.equals(this.progress, apiParcelState.progress) &&
        Objects.equals(this.totalProgress, apiParcelState.totalProgress) &&
        Objects.equals(this.count, apiParcelState.count) &&
        Objects.equals(this.totalCount, apiParcelState.totalCount) &&
        Objects.equals(this.errors, apiParcelState.errors) &&
        Objects.equals(this.warnings, apiParcelState.warnings);
  }

  @Override
  public int hashCode() {
    return Objects.hash(progress, totalProgress, count, totalCount, errors, warnings);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiParcelState {\n");
    
    sb.append("    progress: ").append(toIndentedString(progress)).append("\n");
    sb.append("    totalProgress: ").append(toIndentedString(totalProgress)).append("\n");
    sb.append("    count: ").append(toIndentedString(count)).append("\n");
    sb.append("    totalCount: ").append(toIndentedString(totalCount)).append("\n");
    sb.append("    errors: ").append(toIndentedString(errors)).append("\n");
    sb.append("    warnings: ").append(toIndentedString(warnings)).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    ");
  }
  
}

