/*
 * 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.ApiHBaseReplicationArguments;
import com.cloudera.api.swagger.model.ApiHdfsCloudReplicationArguments;
import com.cloudera.api.swagger.model.ApiHdfsReplicationArguments;
import com.cloudera.api.swagger.model.ApiHive3ReplicationArguments;
import com.cloudera.api.swagger.model.ApiHiveCloudReplicationArguments;
import com.cloudera.api.swagger.model.ApiHiveReplicationArguments;
import com.cloudera.api.swagger.model.ApiOzoneReplicationArguments;
import com.cloudera.api.swagger.model.ApiReplicationCommand;
import com.cloudera.api.swagger.model.ApiSchedule;
import com.cloudera.api.swagger.model.ApiScheduleInterval;
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;

/**
 * A replication job schedule. &lt;p/&gt; Replication jobs have service-specific arguments. This object has methods to retrieve arguments for all supported types of replication, but only one argument type is allowed to be set; the backend will check that the provided argument matches the service type where the replication is being scheduled. &lt;p/&gt; The replication job&#39;s arguments should match the underlying service. Refer to each property&#39;s documentation to find out which properties correspond to which services.
 */
@ApiModel(description = "A replication job schedule. <p/> Replication jobs have service-specific arguments. This object has methods to retrieve arguments for all supported types of replication, but only one argument type is allowed to be set; the backend will check that the provided argument matches the service type where the replication is being scheduled. <p/> The replication job's arguments should match the underlying service. Refer to each property's documentation to find out which properties correspond to which services.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiReplicationSchedule {
  @SerializedName("id")
  private java.math.BigDecimal id = null;

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

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

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

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

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

  @SerializedName("intervalUnit")
  private ApiScheduleInterval intervalUnit = null;

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

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

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

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

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

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

  @SerializedName("hdfsArguments")
  private ApiHdfsReplicationArguments hdfsArguments = null;

  @SerializedName("hiveArguments")
  private ApiHiveReplicationArguments hiveArguments = null;

  @SerializedName("hdfsCloudArguments")
  private ApiHdfsCloudReplicationArguments hdfsCloudArguments = null;

  @SerializedName("ozoneReplicationArguments")
  private ApiOzoneReplicationArguments ozoneReplicationArguments = null;

  @SerializedName("history")
  private List<ApiReplicationCommand> history = null;

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

  @SerializedName("hiveCloudArguments")
  private ApiHiveCloudReplicationArguments hiveCloudArguments = null;

  @SerializedName("hbaseArguments")
  private ApiHBaseReplicationArguments hbaseArguments = null;

  @SerializedName("hive3Arguments")
  private ApiHive3ReplicationArguments hive3Arguments = null;

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

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

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

  public ApiReplicationSchedule displayName(String displayName) {
    this.displayName = displayName;
    return this;
  }

   /**
   * The schedule display name.
   * @return displayName
  **/
  @ApiModelProperty(value = "The schedule display name.")
  public String getDisplayName() {
    return displayName;
  }

  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }

  public ApiReplicationSchedule description(String description) {
    this.description = description;
    return this;
  }

   /**
   * The schedule description.
   * @return description
  **/
  @ApiModelProperty(value = "The schedule description.")
  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

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

   /**
   * The time at which the scheduled activity is triggered for the first time.
   * @return startTime
  **/
  @ApiModelProperty(value = "The time at which the scheduled activity is triggered for the first time.")
  public String getStartTime() {
    return startTime;
  }

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

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

   /**
   * The time after which the scheduled activity will no longer be triggered.
   * @return endTime
  **/
  @ApiModelProperty(value = "The time after which the scheduled activity will no longer be triggered.")
  public String getEndTime() {
    return endTime;
  }

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

  public ApiReplicationSchedule interval(java.math.BigDecimal interval) {
    this.interval = interval;
    return this;
  }

   /**
   * The duration between consecutive triggers of a scheduled activity. Defaults to 0.
   * @return interval
  **/
  @ApiModelProperty(value = "The duration between consecutive triggers of a scheduled activity. Defaults to 0.")
  public java.math.BigDecimal getInterval() {
    return interval;
  }

  public void setInterval(java.math.BigDecimal interval) {
    this.interval = interval;
  }

  public ApiReplicationSchedule intervalUnit(ApiScheduleInterval intervalUnit) {
    this.intervalUnit = intervalUnit;
    return this;
  }

   /**
   * The unit for the repeat interval.
   * @return intervalUnit
  **/
  @ApiModelProperty(value = "The unit for the repeat interval.")
  public ApiScheduleInterval getIntervalUnit() {
    return intervalUnit;
  }

  public void setIntervalUnit(ApiScheduleInterval intervalUnit) {
    this.intervalUnit = intervalUnit;
  }

  public ApiReplicationSchedule nextRun(String nextRun) {
    this.nextRun = nextRun;
    return this;
  }

   /**
   * Readonly. The time the scheduled command will run next.
   * @return nextRun
  **/
  @ApiModelProperty(value = "Readonly. The time the scheduled command will run next.")
  public String getNextRun() {
    return nextRun;
  }

  public void setNextRun(String nextRun) {
    this.nextRun = nextRun;
  }

  public ApiReplicationSchedule paused(Boolean paused) {
    this.paused = paused;
    return this;
  }

   /**
   * The paused state for the schedule. The scheduled activity will not be triggered as long as the scheduled is paused. Defaults to false.
   * @return paused
  **/
  @ApiModelProperty(value = "The paused state for the schedule. The scheduled activity will not be triggered as long as the scheduled is paused. Defaults to false.")
  public Boolean getPaused() {
    return paused;
  }

  public void setPaused(Boolean paused) {
    this.paused = paused;
  }

  public ApiReplicationSchedule alertOnStart(Boolean alertOnStart) {
    this.alertOnStart = alertOnStart;
    return this;
  }

   /**
   * Whether to alert on start of the scheduled activity. Defaults to false.
   * @return alertOnStart
  **/
  @ApiModelProperty(value = "Whether to alert on start of the scheduled activity. Defaults to false.")
  public Boolean getAlertOnStart() {
    return alertOnStart;
  }

  public void setAlertOnStart(Boolean alertOnStart) {
    this.alertOnStart = alertOnStart;
  }

  public ApiReplicationSchedule alertOnSuccess(Boolean alertOnSuccess) {
    this.alertOnSuccess = alertOnSuccess;
    return this;
  }

   /**
   * Whether to alert on successful completion of the scheduled activity. Defaults to false.
   * @return alertOnSuccess
  **/
  @ApiModelProperty(value = "Whether to alert on successful completion of the scheduled activity. Defaults to false.")
  public Boolean getAlertOnSuccess() {
    return alertOnSuccess;
  }

  public void setAlertOnSuccess(Boolean alertOnSuccess) {
    this.alertOnSuccess = alertOnSuccess;
  }

  public ApiReplicationSchedule alertOnFail(Boolean alertOnFail) {
    this.alertOnFail = alertOnFail;
    return this;
  }

   /**
   * Whether to alert on failure of the scheduled activity. Defaults to false.
   * @return alertOnFail
  **/
  @ApiModelProperty(value = "Whether to alert on failure of the scheduled activity. Defaults to false.")
  public Boolean getAlertOnFail() {
    return alertOnFail;
  }

  public void setAlertOnFail(Boolean alertOnFail) {
    this.alertOnFail = alertOnFail;
  }

  public ApiReplicationSchedule alertOnAbort(Boolean alertOnAbort) {
    this.alertOnAbort = alertOnAbort;
    return this;
  }

   /**
   * Whether to alert on abort of the scheduled activity. Defaults to false.
   * @return alertOnAbort
  **/
  @ApiModelProperty(value = "Whether to alert on abort of the scheduled activity. Defaults to false.")
  public Boolean getAlertOnAbort() {
    return alertOnAbort;
  }

  public void setAlertOnAbort(Boolean alertOnAbort) {
    this.alertOnAbort = alertOnAbort;
  }

  public ApiReplicationSchedule hdfsArguments(ApiHdfsReplicationArguments hdfsArguments) {
    this.hdfsArguments = hdfsArguments;
    return this;
  }

   /**
   * Optional arguments for HDFS replication commands.
   * @return hdfsArguments
  **/
  @ApiModelProperty(value = "Optional arguments for HDFS replication commands.")
  public ApiHdfsReplicationArguments getHdfsArguments() {
    return hdfsArguments;
  }

  public void setHdfsArguments(ApiHdfsReplicationArguments hdfsArguments) {
    this.hdfsArguments = hdfsArguments;
  }

  public ApiReplicationSchedule hiveArguments(ApiHiveReplicationArguments hiveArguments) {
    this.hiveArguments = hiveArguments;
    return this;
  }

   /**
   * Optional arguments for Hive replication commands.
   * @return hiveArguments
  **/
  @ApiModelProperty(value = "Optional arguments for Hive replication commands.")
  public ApiHiveReplicationArguments getHiveArguments() {
    return hiveArguments;
  }

  public void setHiveArguments(ApiHiveReplicationArguments hiveArguments) {
    this.hiveArguments = hiveArguments;
  }

  public ApiReplicationSchedule hdfsCloudArguments(ApiHdfsCloudReplicationArguments hdfsCloudArguments) {
    this.hdfsCloudArguments = hdfsCloudArguments;
    return this;
  }

   /**
   * Optional arguments for HDFS cloud replication commands.
   * @return hdfsCloudArguments
  **/
  @ApiModelProperty(value = "Optional arguments for HDFS cloud replication commands.")
  public ApiHdfsCloudReplicationArguments getHdfsCloudArguments() {
    return hdfsCloudArguments;
  }

  public void setHdfsCloudArguments(ApiHdfsCloudReplicationArguments hdfsCloudArguments) {
    this.hdfsCloudArguments = hdfsCloudArguments;
  }

  public ApiReplicationSchedule ozoneReplicationArguments(ApiOzoneReplicationArguments ozoneReplicationArguments) {
    this.ozoneReplicationArguments = ozoneReplicationArguments;
    return this;
  }

   /**
   * Optional arguments for HDFS cloud replication commands.
   * @return ozoneReplicationArguments
  **/
  @ApiModelProperty(value = "Optional arguments for HDFS cloud replication commands.")
  public ApiOzoneReplicationArguments getOzoneReplicationArguments() {
    return ozoneReplicationArguments;
  }

  public void setOzoneReplicationArguments(ApiOzoneReplicationArguments ozoneReplicationArguments) {
    this.ozoneReplicationArguments = ozoneReplicationArguments;
  }

  public ApiReplicationSchedule history(List<ApiReplicationCommand> history) {
    this.history = history;
    return this;
  }

  public ApiReplicationSchedule addHistoryItem(ApiReplicationCommand historyItem) {
    if (this.history == null) {
      this.history = new ArrayList<ApiReplicationCommand>();
    }
    this.history.add(historyItem);
    return this;
  }

   /**
   * List of active and/or finished commands for this schedule.
   * @return history
  **/
  @ApiModelProperty(value = "List of active and/or finished commands for this schedule.")
  public List<ApiReplicationCommand> getHistory() {
    return history;
  }

  public void setHistory(List<ApiReplicationCommand> history) {
    this.history = history;
  }

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

   /**
   * Read-only field that is true if this schedule is currently active, false if not. Available since API v11.
   * @return active
  **/
  @ApiModelProperty(value = "Read-only field that is true if this schedule is currently active, false if not. Available since API v11.")
  public Boolean getActive() {
    return active;
  }

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

  public ApiReplicationSchedule hiveCloudArguments(ApiHiveCloudReplicationArguments hiveCloudArguments) {
    this.hiveCloudArguments = hiveCloudArguments;
    return this;
  }

   /**
   * Optional arguments for Hive cloud replication commands.
   * @return hiveCloudArguments
  **/
  @ApiModelProperty(value = "Optional arguments for Hive cloud replication commands.")
  public ApiHiveCloudReplicationArguments getHiveCloudArguments() {
    return hiveCloudArguments;
  }

  public void setHiveCloudArguments(ApiHiveCloudReplicationArguments hiveCloudArguments) {
    this.hiveCloudArguments = hiveCloudArguments;
  }

  public ApiReplicationSchedule hbaseArguments(ApiHBaseReplicationArguments hbaseArguments) {
    this.hbaseArguments = hbaseArguments;
    return this;
  }

   /**
   * Optional arguments for HBase replication commands.
   * @return hbaseArguments
  **/
  @ApiModelProperty(value = "Optional arguments for HBase replication commands.")
  public ApiHBaseReplicationArguments getHbaseArguments() {
    return hbaseArguments;
  }

  public void setHbaseArguments(ApiHBaseReplicationArguments hbaseArguments) {
    this.hbaseArguments = hbaseArguments;
  }

  public ApiReplicationSchedule hive3Arguments(ApiHive3ReplicationArguments hive3Arguments) {
    this.hive3Arguments = hive3Arguments;
    return this;
  }

   /**
   * arguments for Hive3 schedules
   * @return hive3Arguments
  **/
  @ApiModelProperty(value = "arguments for Hive3 schedules")
  public ApiHive3ReplicationArguments getHive3Arguments() {
    return hive3Arguments;
  }

  public void setHive3Arguments(ApiHive3ReplicationArguments hive3Arguments) {
    this.hive3Arguments = hive3Arguments;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiReplicationSchedule apiReplicationSchedule = (ApiReplicationSchedule) o;
    return Objects.equals(this.id, apiReplicationSchedule.id) &&
        Objects.equals(this.displayName, apiReplicationSchedule.displayName) &&
        Objects.equals(this.description, apiReplicationSchedule.description) &&
        Objects.equals(this.startTime, apiReplicationSchedule.startTime) &&
        Objects.equals(this.endTime, apiReplicationSchedule.endTime) &&
        Objects.equals(this.interval, apiReplicationSchedule.interval) &&
        Objects.equals(this.intervalUnit, apiReplicationSchedule.intervalUnit) &&
        Objects.equals(this.nextRun, apiReplicationSchedule.nextRun) &&
        Objects.equals(this.paused, apiReplicationSchedule.paused) &&
        Objects.equals(this.alertOnStart, apiReplicationSchedule.alertOnStart) &&
        Objects.equals(this.alertOnSuccess, apiReplicationSchedule.alertOnSuccess) &&
        Objects.equals(this.alertOnFail, apiReplicationSchedule.alertOnFail) &&
        Objects.equals(this.alertOnAbort, apiReplicationSchedule.alertOnAbort) &&
        Objects.equals(this.hdfsArguments, apiReplicationSchedule.hdfsArguments) &&
        Objects.equals(this.hiveArguments, apiReplicationSchedule.hiveArguments) &&
        Objects.equals(this.hdfsCloudArguments, apiReplicationSchedule.hdfsCloudArguments) &&
        Objects.equals(this.ozoneReplicationArguments, apiReplicationSchedule.ozoneReplicationArguments) &&
        Objects.equals(this.history, apiReplicationSchedule.history) &&
        Objects.equals(this.active, apiReplicationSchedule.active) &&
        Objects.equals(this.hiveCloudArguments, apiReplicationSchedule.hiveCloudArguments) &&
        Objects.equals(this.hbaseArguments, apiReplicationSchedule.hbaseArguments) &&
        Objects.equals(this.hive3Arguments, apiReplicationSchedule.hive3Arguments);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, displayName, description, startTime, endTime, interval, intervalUnit, nextRun, paused, alertOnStart, alertOnSuccess, alertOnFail, alertOnAbort, hdfsArguments, hiveArguments, hdfsCloudArguments, ozoneReplicationArguments, history, active, hiveCloudArguments, hbaseArguments, hive3Arguments);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiReplicationSchedule {\n");
    
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    displayName: ").append(toIndentedString(displayName)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    startTime: ").append(toIndentedString(startTime)).append("\n");
    sb.append("    endTime: ").append(toIndentedString(endTime)).append("\n");
    sb.append("    interval: ").append(toIndentedString(interval)).append("\n");
    sb.append("    intervalUnit: ").append(toIndentedString(intervalUnit)).append("\n");
    sb.append("    nextRun: ").append(toIndentedString(nextRun)).append("\n");
    sb.append("    paused: ").append(toIndentedString(paused)).append("\n");
    sb.append("    alertOnStart: ").append(toIndentedString(alertOnStart)).append("\n");
    sb.append("    alertOnSuccess: ").append(toIndentedString(alertOnSuccess)).append("\n");
    sb.append("    alertOnFail: ").append(toIndentedString(alertOnFail)).append("\n");
    sb.append("    alertOnAbort: ").append(toIndentedString(alertOnAbort)).append("\n");
    sb.append("    hdfsArguments: ").append(toIndentedString(hdfsArguments)).append("\n");
    sb.append("    hiveArguments: ").append(toIndentedString(hiveArguments)).append("\n");
    sb.append("    hdfsCloudArguments: ").append(toIndentedString(hdfsCloudArguments)).append("\n");
    sb.append("    ozoneReplicationArguments: ").append(toIndentedString(ozoneReplicationArguments)).append("\n");
    sb.append("    history: ").append(toIndentedString(history)).append("\n");
    sb.append("    active: ").append(toIndentedString(active)).append("\n");
    sb.append("    hiveCloudArguments: ").append(toIndentedString(hiveCloudArguments)).append("\n");
    sb.append("    hbaseArguments: ").append(toIndentedString(hbaseArguments)).append("\n");
    sb.append("    hive3Arguments: ").append(toIndentedString(hive3Arguments)).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    ");
  }
  
}

