/* * Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with * the License. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions * and limitations under the License. */ package com.amazonaws.services.rds.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.AmazonWebServiceRequest; /** * <p/> * * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/PromoteReadReplica" target="_top">AWS API * Documentation</a> */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class PromoteReadReplicaRequest extends com.amazonaws.AmazonWebServiceRequest implements Serializable, Cloneable { /** * <p> * The DB instance identifier. This value is stored as a lowercase string. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> * </p> */ private String dBInstanceIdentifier; /** * <p> * The number of days to retain automated backups. Setting this parameter to a positive number enables backups. * Setting this parameter to 0 disables automated backups. * </p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> * </ul> */ private Integer backupRetentionPeriod; /** * <p> * The daily time range during which automated backups are created if automated backups are enabled, using the * <code>BackupRetentionPeriod</code> parameter. * </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks * available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the * Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> * </ul> */ private String preferredBackupWindow; /** * <p> * The DB instance identifier. This value is stored as a lowercase string. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> * </p> * * @param dBInstanceIdentifier * The DB instance identifier. This value is stored as a lowercase string.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> */ public void setDBInstanceIdentifier(String dBInstanceIdentifier) { this.dBInstanceIdentifier = dBInstanceIdentifier; } /** * <p> * The DB instance identifier. This value is stored as a lowercase string. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> * </p> * * @return The DB instance identifier. This value is stored as a lowercase string.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> */ public String getDBInstanceIdentifier() { return this.dBInstanceIdentifier; } /** * <p> * The DB instance identifier. This value is stored as a lowercase string. * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> * </p> * * @param dBInstanceIdentifier * The DB instance identifier. This value is stored as a lowercase string.</p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be the identifier for an existing Read Replica DB instance * </p> * </li> * <li> * <p> * Must contain from 1 to 63 alphanumeric characters or hyphens * </p> * </li> * <li> * <p> * First character must be a letter * </p> * </li> * <li> * <p> * Cannot end with a hyphen or contain two consecutive hyphens * </p> * </li> * </ul> * <p> * Example: <code>mydbinstance</code> * @return Returns a reference to this object so that method calls can be chained together. */ public PromoteReadReplicaRequest withDBInstanceIdentifier(String dBInstanceIdentifier) { setDBInstanceIdentifier(dBInstanceIdentifier); return this; } /** * <p> * The number of days to retain automated backups. Setting this parameter to a positive number enables backups. * Setting this parameter to 0 disables automated backups. * </p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> * </ul> * * @param backupRetentionPeriod * The number of days to retain automated backups. Setting this parameter to a positive number enables * backups. Setting this parameter to 0 disables automated backups.</p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> */ public void setBackupRetentionPeriod(Integer backupRetentionPeriod) { this.backupRetentionPeriod = backupRetentionPeriod; } /** * <p> * The number of days to retain automated backups. Setting this parameter to a positive number enables backups. * Setting this parameter to 0 disables automated backups. * </p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> * </ul> * * @return The number of days to retain automated backups. Setting this parameter to a positive number enables * backups. Setting this parameter to 0 disables automated backups.</p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> */ public Integer getBackupRetentionPeriod() { return this.backupRetentionPeriod; } /** * <p> * The number of days to retain automated backups. Setting this parameter to a positive number enables backups. * Setting this parameter to 0 disables automated backups. * </p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> * </ul> * * @param backupRetentionPeriod * The number of days to retain automated backups. Setting this parameter to a positive number enables * backups. Setting this parameter to 0 disables automated backups.</p> * <p> * Default: 1 * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be a value from 0 to 8 * </p> * </li> * @return Returns a reference to this object so that method calls can be chained together. */ public PromoteReadReplicaRequest withBackupRetentionPeriod(Integer backupRetentionPeriod) { setBackupRetentionPeriod(backupRetentionPeriod); return this; } /** * <p> * The daily time range during which automated backups are created if automated backups are enabled, using the * <code>BackupRetentionPeriod</code> parameter. * </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks * available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the * Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> * </ul> * * @param preferredBackupWindow * The daily time range during which automated backups are created if automated backups are enabled, using * the <code>BackupRetentionPeriod</code> parameter. </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time * blocks available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting * the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> */ public void setPreferredBackupWindow(String preferredBackupWindow) { this.preferredBackupWindow = preferredBackupWindow; } /** * <p> * The daily time range during which automated backups are created if automated backups are enabled, using the * <code>BackupRetentionPeriod</code> parameter. * </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks * available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the * Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> * </ul> * * @return The daily time range during which automated backups are created if automated backups are enabled, using * the <code>BackupRetentionPeriod</code> parameter. </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time * blocks available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> * Adjusting the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> */ public String getPreferredBackupWindow() { return this.preferredBackupWindow; } /** * <p> * The daily time range during which automated backups are created if automated backups are enabled, using the * <code>BackupRetentionPeriod</code> parameter. * </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time blocks * available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting the * Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> * </ul> * * @param preferredBackupWindow * The daily time range during which automated backups are created if automated backups are enabled, using * the <code>BackupRetentionPeriod</code> parameter. </p> * <p> * Default: A 30-minute window selected at random from an 8-hour block of time per region. To see the time * blocks available, see <a * href="http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/AdjustingTheMaintenanceWindow.html"> Adjusting * the Preferred Maintenance Window</a> in the <i>Amazon RDS User Guide.</i> * </p> * <p> * Constraints: * </p> * <ul> * <li> * <p> * Must be in the format <code>hh24:mi-hh24:mi</code>. * </p> * </li> * <li> * <p> * Times should be in Universal Coordinated Time (UTC). * </p> * </li> * <li> * <p> * Must not conflict with the preferred maintenance window. * </p> * </li> * <li> * <p> * Must be at least 30 minutes. * </p> * </li> * @return Returns a reference to this object so that method calls can be chained together. */ public PromoteReadReplicaRequest withPreferredBackupWindow(String preferredBackupWindow) { setPreferredBackupWindow(preferredBackupWindow); return this; } /** * Returns a string representation of this object; useful for testing and debugging. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDBInstanceIdentifier() != null) sb.append("DBInstanceIdentifier: ").append(getDBInstanceIdentifier()).append(","); if (getBackupRetentionPeriod() != null) sb.append("BackupRetentionPeriod: ").append(getBackupRetentionPeriod()).append(","); if (getPreferredBackupWindow() != null) sb.append("PreferredBackupWindow: ").append(getPreferredBackupWindow()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PromoteReadReplicaRequest == false) return false; PromoteReadReplicaRequest other = (PromoteReadReplicaRequest) obj; if (other.getDBInstanceIdentifier() == null ^ this.getDBInstanceIdentifier() == null) return false; if (other.getDBInstanceIdentifier() != null && other.getDBInstanceIdentifier().equals(this.getDBInstanceIdentifier()) == false) return false; if (other.getBackupRetentionPeriod() == null ^ this.getBackupRetentionPeriod() == null) return false; if (other.getBackupRetentionPeriod() != null && other.getBackupRetentionPeriod().equals(this.getBackupRetentionPeriod()) == false) return false; if (other.getPreferredBackupWindow() == null ^ this.getPreferredBackupWindow() == null) return false; if (other.getPreferredBackupWindow() != null && other.getPreferredBackupWindow().equals(this.getPreferredBackupWindow()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDBInstanceIdentifier() == null) ? 0 : getDBInstanceIdentifier().hashCode()); hashCode = prime * hashCode + ((getBackupRetentionPeriod() == null) ? 0 : getBackupRetentionPeriod().hashCode()); hashCode = prime * hashCode + ((getPreferredBackupWindow() == null) ? 0 : getPreferredBackupWindow().hashCode()); return hashCode; } @Override public PromoteReadReplicaRequest clone() { return (PromoteReadReplicaRequest) super.clone(); } }