aws-sdk-rds 1.131.0

AWS SDK for Amazon Relational Database Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PromoteReadReplicaInput {
    /// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing read replica DB instance.</p></li>
    /// </ul>
    /// <p>Example: <code>mydbinstance</code></p>
    pub db_instance_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The number of days for which automated backups are retained. 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 35.</p></li>
    /// <li>
    /// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
    /// </ul>
    pub backup_retention_period: ::std::option::Option<i32>,
    /// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://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>Must 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>
    pub preferred_backup_window: ::std::option::Option<::std::string::String>,
    /// <p>Tags to assign to resources associated with the DB instance.</p>
    /// <p>Valid Values:</p>
    /// <ul>
    /// <li>
    /// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
    /// </ul>
    pub tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
}
impl PromoteReadReplicaInput {
    /// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing read replica DB instance.</p></li>
    /// </ul>
    /// <p>Example: <code>mydbinstance</code></p>
    pub fn db_instance_identifier(&self) -> ::std::option::Option<&str> {
        self.db_instance_identifier.as_deref()
    }
    /// <p>The number of days for which automated backups are retained. 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 35.</p></li>
    /// <li>
    /// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
    /// </ul>
    pub fn backup_retention_period(&self) -> ::std::option::Option<i32> {
        self.backup_retention_period
    }
    /// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://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>Must 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>
    pub fn preferred_backup_window(&self) -> ::std::option::Option<&str> {
        self.preferred_backup_window.as_deref()
    }
    /// <p>Tags to assign to resources associated with the DB instance.</p>
    /// <p>Valid Values:</p>
    /// <ul>
    /// <li>
    /// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
    /// </ul>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_specifications.is_none()`.
    pub fn tag_specifications(&self) -> &[crate::types::TagSpecification] {
        self.tag_specifications.as_deref().unwrap_or_default()
    }
}
impl PromoteReadReplicaInput {
    /// Creates a new builder-style object to manufacture [`PromoteReadReplicaInput`](crate::operation::promote_read_replica::PromoteReadReplicaInput).
    pub fn builder() -> crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder {
        crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder::default()
    }
}

/// A builder for [`PromoteReadReplicaInput`](crate::operation::promote_read_replica::PromoteReadReplicaInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PromoteReadReplicaInputBuilder {
    pub(crate) db_instance_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) backup_retention_period: ::std::option::Option<i32>,
    pub(crate) preferred_backup_window: ::std::option::Option<::std::string::String>,
    pub(crate) tag_specifications: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>,
}
impl PromoteReadReplicaInputBuilder {
    /// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing read replica DB instance.</p></li>
    /// </ul>
    /// <p>Example: <code>mydbinstance</code></p>
    /// This field is required.
    pub fn db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.db_instance_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing read replica DB instance.</p></li>
    /// </ul>
    /// <p>Example: <code>mydbinstance</code></p>
    pub fn set_db_instance_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.db_instance_identifier = input;
        self
    }
    /// <p>The DB instance identifier. This value is stored as a lowercase string.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must match the identifier of an existing read replica DB instance.</p></li>
    /// </ul>
    /// <p>Example: <code>mydbinstance</code></p>
    pub fn get_db_instance_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.db_instance_identifier
    }
    /// <p>The number of days for which automated backups are retained. 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 35.</p></li>
    /// <li>
    /// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
    /// </ul>
    pub fn backup_retention_period(mut self, input: i32) -> Self {
        self.backup_retention_period = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of days for which automated backups are retained. 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 35.</p></li>
    /// <li>
    /// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
    /// </ul>
    pub fn set_backup_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.backup_retention_period = input;
        self
    }
    /// <p>The number of days for which automated backups are retained. 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 35.</p></li>
    /// <li>
    /// <p>Can't be set to 0 if the DB instance is a source to read replicas.</p></li>
    /// </ul>
    pub fn get_backup_retention_period(&self) -> &::std::option::Option<i32> {
        &self.backup_retention_period
    }
    /// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://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>Must 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>
    pub fn preferred_backup_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.preferred_backup_window = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://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>Must 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>
    pub fn set_preferred_backup_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.preferred_backup_window = input;
        self
    }
    /// <p>The daily time range during which automated backups are created if automated backups are enabled, using the <code>BackupRetentionPeriod</code> parameter.</p>
    /// <p>The default is a 30-minute window selected at random from an 8-hour block of time for each Amazon Web Services Region. To see the time blocks available, see <a href="https://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>Must 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>
    pub fn get_preferred_backup_window(&self) -> &::std::option::Option<::std::string::String> {
        &self.preferred_backup_window
    }
    /// Appends an item to `tag_specifications`.
    ///
    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
    ///
    /// <p>Tags to assign to resources associated with the DB instance.</p>
    /// <p>Valid Values:</p>
    /// <ul>
    /// <li>
    /// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
    /// </ul>
    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
        let mut v = self.tag_specifications.unwrap_or_default();
        v.push(input);
        self.tag_specifications = ::std::option::Option::Some(v);
        self
    }
    /// <p>Tags to assign to resources associated with the DB instance.</p>
    /// <p>Valid Values:</p>
    /// <ul>
    /// <li>
    /// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
    /// </ul>
    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
        self.tag_specifications = input;
        self
    }
    /// <p>Tags to assign to resources associated with the DB instance.</p>
    /// <p>Valid Values:</p>
    /// <ul>
    /// <li>
    /// <p><code>auto-backup</code> - The DB instance's automated backup.</p></li>
    /// </ul>
    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
        &self.tag_specifications
    }
    /// Consumes the builder and constructs a [`PromoteReadReplicaInput`](crate::operation::promote_read_replica::PromoteReadReplicaInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::promote_read_replica::PromoteReadReplicaInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::promote_read_replica::PromoteReadReplicaInput {
            db_instance_identifier: self.db_instance_identifier,
            backup_retention_period: self.backup_retention_period,
            preferred_backup_window: self.preferred_backup_window,
            tag_specifications: self.tag_specifications,
        })
    }
}