/*
 * 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.ApiHBaseSnapshotPolicyArguments;
import com.cloudera.api.swagger.model.ApiHdfsSnapshotPolicyArguments;
import com.cloudera.api.swagger.model.ApiSnapshotCommand;
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 snapshot policy. &lt;p/&gt; Snapshot policies have service specific arguments. This object has methods to retrieve arguments for all supported types of snapshots, but only one argument type is allowed to be set; the backend will check that the provided argument matches the type of the service with which the snapshot policy is associated.
 */
@ApiModel(description = "A snapshot policy. <p/> Snapshot policies have service specific arguments. This object has methods to retrieve arguments for all supported types of snapshots, but only one argument type is allowed to be set; the backend will check that the provided argument matches the type of the service with which the snapshot policy is associated.")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2022-11-17T16:38:34.097Z")
public class ApiSnapshotPolicy {
  @SerializedName("name")
  private String name = null;

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

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

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

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

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

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

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

  @SerializedName("hoursForHourlySnapshots")
  private List<java.math.BigDecimal> hoursForHourlySnapshots = null;

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

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

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

  @SerializedName("monthOfYear")
  private java.math.BigDecimal monthOfYear = 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("hbaseArguments")
  private ApiHBaseSnapshotPolicyArguments hbaseArguments = null;

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

  @SerializedName("lastCommand")
  private ApiSnapshotCommand lastCommand = null;

  @SerializedName("lastSuccessfulCommand")
  private ApiSnapshotCommand lastSuccessfulCommand = null;

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

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

   /**
   * Name of the snapshot policy.
   * @return name
  **/
  @ApiModelProperty(value = "Name of the snapshot policy.")
  public String getName() {
    return name;
  }

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

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

   /**
   * Description of the snapshot policy.
   * @return description
  **/
  @ApiModelProperty(value = "Description of the snapshot policy.")
  public String getDescription() {
    return description;
  }

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

  public ApiSnapshotPolicy hourlySnapshots(java.math.BigDecimal hourlySnapshots) {
    this.hourlySnapshots = hourlySnapshots;
    return this;
  }

   /**
   * Number of hourly snapshots to be retained. Defaults to 0
   * @return hourlySnapshots
  **/
  @ApiModelProperty(value = "Number of hourly snapshots to be retained. Defaults to 0")
  public java.math.BigDecimal getHourlySnapshots() {
    return hourlySnapshots;
  }

  public void setHourlySnapshots(java.math.BigDecimal hourlySnapshots) {
    this.hourlySnapshots = hourlySnapshots;
  }

  public ApiSnapshotPolicy dailySnapshots(java.math.BigDecimal dailySnapshots) {
    this.dailySnapshots = dailySnapshots;
    return this;
  }

   /**
   * Number of daily snapshots to be retained. Defaults to 0
   * @return dailySnapshots
  **/
  @ApiModelProperty(value = "Number of daily snapshots to be retained. Defaults to 0")
  public java.math.BigDecimal getDailySnapshots() {
    return dailySnapshots;
  }

  public void setDailySnapshots(java.math.BigDecimal dailySnapshots) {
    this.dailySnapshots = dailySnapshots;
  }

  public ApiSnapshotPolicy weeklySnapshots(java.math.BigDecimal weeklySnapshots) {
    this.weeklySnapshots = weeklySnapshots;
    return this;
  }

   /**
   * Number of weekly snapshots to be retained. Defaults to 0
   * @return weeklySnapshots
  **/
  @ApiModelProperty(value = "Number of weekly snapshots to be retained. Defaults to 0")
  public java.math.BigDecimal getWeeklySnapshots() {
    return weeklySnapshots;
  }

  public void setWeeklySnapshots(java.math.BigDecimal weeklySnapshots) {
    this.weeklySnapshots = weeklySnapshots;
  }

  public ApiSnapshotPolicy monthlySnapshots(java.math.BigDecimal monthlySnapshots) {
    this.monthlySnapshots = monthlySnapshots;
    return this;
  }

   /**
   * Number of monthly snapshots to be retained. Defaults to 0
   * @return monthlySnapshots
  **/
  @ApiModelProperty(value = "Number of monthly snapshots to be retained. Defaults to 0")
  public java.math.BigDecimal getMonthlySnapshots() {
    return monthlySnapshots;
  }

  public void setMonthlySnapshots(java.math.BigDecimal monthlySnapshots) {
    this.monthlySnapshots = monthlySnapshots;
  }

  public ApiSnapshotPolicy yearlySnapshots(java.math.BigDecimal yearlySnapshots) {
    this.yearlySnapshots = yearlySnapshots;
    return this;
  }

   /**
   * Number of yearly snapshots to be retained. Defaults to 0
   * @return yearlySnapshots
  **/
  @ApiModelProperty(value = "Number of yearly snapshots to be retained. Defaults to 0")
  public java.math.BigDecimal getYearlySnapshots() {
    return yearlySnapshots;
  }

  public void setYearlySnapshots(java.math.BigDecimal yearlySnapshots) {
    this.yearlySnapshots = yearlySnapshots;
  }

  public ApiSnapshotPolicy minuteOfHour(java.math.BigDecimal minuteOfHour) {
    this.minuteOfHour = minuteOfHour;
    return this;
  }

   /**
   * Minute in the hour that hourly, daily, weekly, monthly and yearly snapshots should be created. Valid values are 0 to 59. Default value is 0.
   * @return minuteOfHour
  **/
  @ApiModelProperty(value = "Minute in the hour that hourly, daily, weekly, monthly and yearly snapshots should be created. Valid values are 0 to 59. Default value is 0.")
  public java.math.BigDecimal getMinuteOfHour() {
    return minuteOfHour;
  }

  public void setMinuteOfHour(java.math.BigDecimal minuteOfHour) {
    this.minuteOfHour = minuteOfHour;
  }

  public ApiSnapshotPolicy hoursForHourlySnapshots(List<java.math.BigDecimal> hoursForHourlySnapshots) {
    this.hoursForHourlySnapshots = hoursForHourlySnapshots;
    return this;
  }

  public ApiSnapshotPolicy addHoursForHourlySnapshotsItem(java.math.BigDecimal hoursForHourlySnapshotsItem) {
    if (this.hoursForHourlySnapshots == null) {
      this.hoursForHourlySnapshots = new ArrayList<java.math.BigDecimal>();
    }
    this.hoursForHourlySnapshots.add(hoursForHourlySnapshotsItem);
    return this;
  }

   /**
   * Hours of the day that hourly snapshots should be created. Valid values are 0 to 23. If this list is null or empty, then hourly snapshots are created for every hour.
   * @return hoursForHourlySnapshots
  **/
  @ApiModelProperty(value = "Hours of the day that hourly snapshots should be created. Valid values are 0 to 23. If this list is null or empty, then hourly snapshots are created for every hour.")
  public List<java.math.BigDecimal> getHoursForHourlySnapshots() {
    return hoursForHourlySnapshots;
  }

  public void setHoursForHourlySnapshots(List<java.math.BigDecimal> hoursForHourlySnapshots) {
    this.hoursForHourlySnapshots = hoursForHourlySnapshots;
  }

  public ApiSnapshotPolicy hourOfDay(java.math.BigDecimal hourOfDay) {
    this.hourOfDay = hourOfDay;
    return this;
  }

   /**
   * Hour in the day that daily, weekly, monthly and yearly snapshots should be created. Valid values are 0 to 23. Default value is 0.
   * @return hourOfDay
  **/
  @ApiModelProperty(value = "Hour in the day that daily, weekly, monthly and yearly snapshots should be created. Valid values are 0 to 23. Default value is 0.")
  public java.math.BigDecimal getHourOfDay() {
    return hourOfDay;
  }

  public void setHourOfDay(java.math.BigDecimal hourOfDay) {
    this.hourOfDay = hourOfDay;
  }

  public ApiSnapshotPolicy dayOfWeek(java.math.BigDecimal dayOfWeek) {
    this.dayOfWeek = dayOfWeek;
    return this;
  }

   /**
   * Day of the week that weekly snapshots should be created. Valid values are 1 to 7, 1 representing Sunday. Default value is 1.
   * @return dayOfWeek
  **/
  @ApiModelProperty(value = "Day of the week that weekly snapshots should be created. Valid values are 1 to 7, 1 representing Sunday. Default value is 1.")
  public java.math.BigDecimal getDayOfWeek() {
    return dayOfWeek;
  }

  public void setDayOfWeek(java.math.BigDecimal dayOfWeek) {
    this.dayOfWeek = dayOfWeek;
  }

  public ApiSnapshotPolicy dayOfMonth(java.math.BigDecimal dayOfMonth) {
    this.dayOfMonth = dayOfMonth;
    return this;
  }

   /**
   * Day of the month that monthly and yearly snapshots should be created. Values from 1 to 31 are allowed. Additionally 0 to -30 can be used to specify offsets from the last day of the month. Default value is 1. &lt;p/&gt; If this value is invalid for any month for which snapshots are required, the backend will throw an exception.
   * @return dayOfMonth
  **/
  @ApiModelProperty(value = "Day of the month that monthly and yearly snapshots should be created. Values from 1 to 31 are allowed. Additionally 0 to -30 can be used to specify offsets from the last day of the month. Default value is 1. <p/> If this value is invalid for any month for which snapshots are required, the backend will throw an exception.")
  public java.math.BigDecimal getDayOfMonth() {
    return dayOfMonth;
  }

  public void setDayOfMonth(java.math.BigDecimal dayOfMonth) {
    this.dayOfMonth = dayOfMonth;
  }

  public ApiSnapshotPolicy monthOfYear(java.math.BigDecimal monthOfYear) {
    this.monthOfYear = monthOfYear;
    return this;
  }

   /**
   * Month of the year that yearly snapshots should be created. Valid values are 1 to 12, 1 representing January. Default value is 1.
   * @return monthOfYear
  **/
  @ApiModelProperty(value = "Month of the year that yearly snapshots should be created. Valid values are 1 to 12, 1 representing January. Default value is 1.")
  public java.math.BigDecimal getMonthOfYear() {
    return monthOfYear;
  }

  public void setMonthOfYear(java.math.BigDecimal monthOfYear) {
    this.monthOfYear = monthOfYear;
  }

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

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

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

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

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

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

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

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

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

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

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

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

  public ApiSnapshotPolicy hbaseArguments(ApiHBaseSnapshotPolicyArguments hbaseArguments) {
    this.hbaseArguments = hbaseArguments;
    return this;
  }

   /**
   * Arguments specific to HBase snapshot policies.
   * @return hbaseArguments
  **/
  @ApiModelProperty(value = "Arguments specific to HBase snapshot policies.")
  public ApiHBaseSnapshotPolicyArguments getHbaseArguments() {
    return hbaseArguments;
  }

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

  public ApiSnapshotPolicy hdfsArguments(ApiHdfsSnapshotPolicyArguments hdfsArguments) {
    this.hdfsArguments = hdfsArguments;
    return this;
  }

   /**
   * Arguments specific to Hdfs snapshot policies.
   * @return hdfsArguments
  **/
  @ApiModelProperty(value = "Arguments specific to Hdfs snapshot policies.")
  public ApiHdfsSnapshotPolicyArguments getHdfsArguments() {
    return hdfsArguments;
  }

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

  public ApiSnapshotPolicy lastCommand(ApiSnapshotCommand lastCommand) {
    this.lastCommand = lastCommand;
    return this;
  }

   /**
   * Latest command of this policy. The command might still be active.
   * @return lastCommand
  **/
  @ApiModelProperty(value = "Latest command of this policy. The command might still be active.")
  public ApiSnapshotCommand getLastCommand() {
    return lastCommand;
  }

  public void setLastCommand(ApiSnapshotCommand lastCommand) {
    this.lastCommand = lastCommand;
  }

  public ApiSnapshotPolicy lastSuccessfulCommand(ApiSnapshotCommand lastSuccessfulCommand) {
    this.lastSuccessfulCommand = lastSuccessfulCommand;
    return this;
  }

   /**
   * Last successful command of this policy. Returns null if there has been no successful command.
   * @return lastSuccessfulCommand
  **/
  @ApiModelProperty(value = "Last successful command of this policy. Returns null if there has been no successful command.")
  public ApiSnapshotCommand getLastSuccessfulCommand() {
    return lastSuccessfulCommand;
  }

  public void setLastSuccessfulCommand(ApiSnapshotCommand lastSuccessfulCommand) {
    this.lastSuccessfulCommand = lastSuccessfulCommand;
  }

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

   /**
   * Whether to pause a snapshot policy, available since V11.
   * @return paused
  **/
  @ApiModelProperty(value = "Whether to pause a snapshot policy, available since V11.")
  public Boolean getPaused() {
    return paused;
  }

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


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    ApiSnapshotPolicy apiSnapshotPolicy = (ApiSnapshotPolicy) o;
    return Objects.equals(this.name, apiSnapshotPolicy.name) &&
        Objects.equals(this.description, apiSnapshotPolicy.description) &&
        Objects.equals(this.hourlySnapshots, apiSnapshotPolicy.hourlySnapshots) &&
        Objects.equals(this.dailySnapshots, apiSnapshotPolicy.dailySnapshots) &&
        Objects.equals(this.weeklySnapshots, apiSnapshotPolicy.weeklySnapshots) &&
        Objects.equals(this.monthlySnapshots, apiSnapshotPolicy.monthlySnapshots) &&
        Objects.equals(this.yearlySnapshots, apiSnapshotPolicy.yearlySnapshots) &&
        Objects.equals(this.minuteOfHour, apiSnapshotPolicy.minuteOfHour) &&
        Objects.equals(this.hoursForHourlySnapshots, apiSnapshotPolicy.hoursForHourlySnapshots) &&
        Objects.equals(this.hourOfDay, apiSnapshotPolicy.hourOfDay) &&
        Objects.equals(this.dayOfWeek, apiSnapshotPolicy.dayOfWeek) &&
        Objects.equals(this.dayOfMonth, apiSnapshotPolicy.dayOfMonth) &&
        Objects.equals(this.monthOfYear, apiSnapshotPolicy.monthOfYear) &&
        Objects.equals(this.alertOnStart, apiSnapshotPolicy.alertOnStart) &&
        Objects.equals(this.alertOnSuccess, apiSnapshotPolicy.alertOnSuccess) &&
        Objects.equals(this.alertOnFail, apiSnapshotPolicy.alertOnFail) &&
        Objects.equals(this.alertOnAbort, apiSnapshotPolicy.alertOnAbort) &&
        Objects.equals(this.hbaseArguments, apiSnapshotPolicy.hbaseArguments) &&
        Objects.equals(this.hdfsArguments, apiSnapshotPolicy.hdfsArguments) &&
        Objects.equals(this.lastCommand, apiSnapshotPolicy.lastCommand) &&
        Objects.equals(this.lastSuccessfulCommand, apiSnapshotPolicy.lastSuccessfulCommand) &&
        Objects.equals(this.paused, apiSnapshotPolicy.paused);
  }

  @Override
  public int hashCode() {
    return Objects.hash(name, description, hourlySnapshots, dailySnapshots, weeklySnapshots, monthlySnapshots, yearlySnapshots, minuteOfHour, hoursForHourlySnapshots, hourOfDay, dayOfWeek, dayOfMonth, monthOfYear, alertOnStart, alertOnSuccess, alertOnFail, alertOnAbort, hbaseArguments, hdfsArguments, lastCommand, lastSuccessfulCommand, paused);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class ApiSnapshotPolicy {\n");
    
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    hourlySnapshots: ").append(toIndentedString(hourlySnapshots)).append("\n");
    sb.append("    dailySnapshots: ").append(toIndentedString(dailySnapshots)).append("\n");
    sb.append("    weeklySnapshots: ").append(toIndentedString(weeklySnapshots)).append("\n");
    sb.append("    monthlySnapshots: ").append(toIndentedString(monthlySnapshots)).append("\n");
    sb.append("    yearlySnapshots: ").append(toIndentedString(yearlySnapshots)).append("\n");
    sb.append("    minuteOfHour: ").append(toIndentedString(minuteOfHour)).append("\n");
    sb.append("    hoursForHourlySnapshots: ").append(toIndentedString(hoursForHourlySnapshots)).append("\n");
    sb.append("    hourOfDay: ").append(toIndentedString(hourOfDay)).append("\n");
    sb.append("    dayOfWeek: ").append(toIndentedString(dayOfWeek)).append("\n");
    sb.append("    dayOfMonth: ").append(toIndentedString(dayOfMonth)).append("\n");
    sb.append("    monthOfYear: ").append(toIndentedString(monthOfYear)).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("    hbaseArguments: ").append(toIndentedString(hbaseArguments)).append("\n");
    sb.append("    hdfsArguments: ").append(toIndentedString(hdfsArguments)).append("\n");
    sb.append("    lastCommand: ").append(toIndentedString(lastCommand)).append("\n");
    sb.append("    lastSuccessfulCommand: ").append(toIndentedString(lastSuccessfulCommand)).append("\n");
    sb.append("    paused: ").append(toIndentedString(paused)).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    ");
  }
  
}

