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.
pub use crate::operation::promote_read_replica::_promote_read_replica_input::PromoteReadReplicaInputBuilder;

pub use crate::operation::promote_read_replica::_promote_read_replica_output::PromoteReadReplicaOutputBuilder;

impl crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::promote_read_replica::PromoteReadReplicaOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::promote_read_replica::PromoteReadReplicaError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.promote_read_replica();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PromoteReadReplica`.
///
/// <p>Promotes a read replica DB instance to a standalone DB instance.</p><note>
/// <ul>
/// <li>
/// <p>Backup duration is a function of the amount of changes to the database since the previous backup. If you plan to promote a read replica to a standalone instance, we recommend that you enable backups and complete at least one backup prior to promotion. In addition, a read replica cannot be promoted to a standalone instance when it is in the <code>backing-up</code> status. If you have enabled backups on your read replica, configure the automated backup window so that daily backups do not interfere with read replica promotion.</p></li>
/// <li>
/// <p>This command doesn't apply to Aurora MySQL, Aurora PostgreSQL, or RDS Custom.</p></li>
/// </ul>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PromoteReadReplicaFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::promote_read_replica::PromoteReadReplicaOutput,
        crate::operation::promote_read_replica::PromoteReadReplicaError,
    > for PromoteReadReplicaFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::promote_read_replica::PromoteReadReplicaOutput,
            crate::operation::promote_read_replica::PromoteReadReplicaError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PromoteReadReplicaFluentBuilder {
    /// Creates a new `PromoteReadReplicaFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the PromoteReadReplica as a reference.
    pub fn as_input(&self) -> &crate::operation::promote_read_replica::builders::PromoteReadReplicaInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::promote_read_replica::PromoteReadReplicaOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::promote_read_replica::PromoteReadReplicaError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::promote_read_replica::PromoteReadReplica::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::promote_read_replica::PromoteReadReplica::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::promote_read_replica::PromoteReadReplicaOutput,
        crate::operation::promote_read_replica::PromoteReadReplicaError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        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 db_instance_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.db_instance_identifier(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.inner = self.inner.set_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.inner.get_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.inner = self.inner.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 set_backup_retention_period(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_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.inner.get_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.inner = self.inner.preferred_backup_window(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.inner = self.inner.set_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.inner.get_preferred_backup_window()
    }
    ///
    /// Appends an item to `TagSpecifications`.
    ///
    /// 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 {
        self.inner = self.inner.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 set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
        self.inner = self.inner.set_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.inner.get_tag_specifications()
    }
}