aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::restore_branch::_restore_branch_input::RestoreBranchInputBuilder;

pub use crate::operation::restore_branch::_restore_branch_output::RestoreBranchOutputBuilder;

impl crate::operation::restore_branch::builders::RestoreBranchInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::restore_branch::RestoreBranchOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::restore_branch::RestoreBranchError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.restore_branch();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `RestoreBranch`.
///
/// <p>Restores the data of the production branch to a point in time in a new branch of the Production environment. The production branch isn't changed, and no deployment uses the new branch. The name of the new branch is production- followed by the restore time in seconds since the epoch. The restore runs asynchronously. To connect to the new branch, call GetBranch with the returned branch ARN until it returns a DatabaseConnection. When you no longer need the branch, delete it with DeleteBranch. A request to restore to the same time as an earlier request returns the branch that the earlier request created.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct RestoreBranchFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::restore_branch::builders::RestoreBranchInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::restore_branch::RestoreBranchOutput,
        crate::operation::restore_branch::RestoreBranchError,
    > for RestoreBranchFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::restore_branch::RestoreBranchOutput,
            crate::operation::restore_branch::RestoreBranchError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl RestoreBranchFluentBuilder {
    /// Creates a new `RestoreBranchFluentBuilder`.
    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 RestoreBranch as a reference.
    pub fn as_input(&self) -> &crate::operation::restore_branch::builders::RestoreBranchInputBuilder {
        &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::restore_branch::RestoreBranchOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::restore_branch::RestoreBranchError,
            ::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::restore_branch::RestoreBranch::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::restore_branch::RestoreBranch::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::restore_branch::RestoreBranchOutput,
        crate::operation::restore_branch::RestoreBranchError,
        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 Amazon Resource Name (ARN) of the production branch of the Production environment. Other branches can't be restored.</p>
    pub fn branch_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.branch_arn(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the production branch of the Production environment. Other branches can't be restored.</p>
    pub fn set_branch_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_branch_arn(input);
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the production branch of the Production environment. Other branches can't be restored.</p>
    pub fn get_branch_arn(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_branch_arn()
    }
    /// <p>The point in time to restore the production branch to. The time must be within the window that GetRestoreWindow returns and can't be in the future. Fractions of a second are ignored.</p>
    pub fn restore_to_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.restore_to_time(input);
        self
    }
    /// <p>The point in time to restore the production branch to. The time must be within the window that GetRestoreWindow returns and can't be in the future. Fractions of a second are ignored.</p>
    pub fn set_restore_to_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_restore_to_time(input);
        self
    }
    /// <p>The point in time to restore the production branch to. The time must be within the window that GetRestoreWindow returns and can't be in the future. Fractions of a second are ignored.</p>
    pub fn get_restore_to_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_restore_to_time()
    }
}