aws_sdk_dynamodb/operation/create_backup/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_backup::_create_backup_output::CreateBackupOutputBuilder;
3
4pub use crate::operation::create_backup::_create_backup_input::CreateBackupInputBuilder;
5
6impl crate::operation::create_backup::builders::CreateBackupInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_backup::CreateBackupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_backup::CreateBackupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_backup();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateBackup`.
24///
25/// <p>Creates a backup for an existing table.</p>
26/// <p>Each time you create an on-demand backup, the entire table data is backed up. There is no limit to the number of on-demand backups that can be taken.</p>
27/// <p>When you create an on-demand backup, a time marker of the request is cataloged, and the backup is created asynchronously, by applying all changes until the time of the request to the last full table snapshot. Backup requests are processed instantaneously and become available for restore within minutes.</p>
28/// <p>You can call <code>CreateBackup</code> at a maximum rate of 50 times per second.</p>
29/// <p>All backups in DynamoDB work without consuming any provisioned throughput on the table.</p>
30/// <p>If you submit a backup request on 2018-12-14 at 14:25:00, the backup is guaranteed to contain all data committed to the table up to 14:24:00, and data committed after 14:26:00 will not be. The backup might contain data modifications made between 14:24:00 and 14:26:00. On-demand backup does not support causal consistency.</p>
31/// <p>Along with data, the following are also included on the backups:</p>
32/// <ul>
33/// <li>
34/// <p>Global secondary indexes (GSIs)</p></li>
35/// <li>
36/// <p>Local secondary indexes (LSIs)</p></li>
37/// <li>
38/// <p>Streams</p></li>
39/// <li>
40/// <p>Provisioned read and write capacity</p></li>
41/// </ul>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct CreateBackupFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::create_backup::builders::CreateBackupInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::create_backup::CreateBackupOutput,
51        crate::operation::create_backup::CreateBackupError,
52    > for CreateBackupFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::create_backup::CreateBackupOutput,
60            crate::operation::create_backup::CreateBackupError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl CreateBackupFluentBuilder {
67    /// Creates a new `CreateBackupFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the CreateBackup as a reference.
76    pub fn as_input(&self) -> &crate::operation::create_backup::builders::CreateBackupInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::create_backup::CreateBackupOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::create_backup::CreateBackupError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::create_backup::CreateBackup::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::create_backup::CreateBackup::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::create_backup::CreateBackupOutput,
113        crate::operation::create_backup::CreateBackupError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
128    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.table_name(input.into());
130        self
131    }
132    /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
133    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_table_name(input);
135        self
136    }
137    /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
138    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_table_name()
140    }
141    /// <p>Specified name for the backup.</p>
142    pub fn backup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.backup_name(input.into());
144        self
145    }
146    /// <p>Specified name for the backup.</p>
147    pub fn set_backup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_backup_name(input);
149        self
150    }
151    /// <p>Specified name for the backup.</p>
152    pub fn get_backup_name(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_backup_name()
154    }
155}