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(self, client: &crate::Client) -> ::std::result::Result<
9 crate::operation::create_backup::CreateBackupOutput,
10 ::aws_smithy_runtime_api::client::result::SdkError<
11 crate::operation::create_backup::CreateBackupError,
12 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13 >
14 > {
15 let mut fluent_builder = client.create_backup();
16 fluent_builder.inner = self;
17 fluent_builder.send().await
18 }
19 }
20/// Fluent builder constructing a request to `CreateBackup`.
21///
22/// <p>Creates a backup for an existing table.</p>
23/// <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>
24/// <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>
25/// <p>You can call <code>CreateBackup</code> at a maximum rate of 50 times per second.</p>
26/// <p>All backups in DynamoDB work without consuming any provisioned throughput on the table.</p>
27/// <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>
28/// <p>Along with data, the following are also included on the backups:</p>
29/// <ul>
30/// <li>
31/// <p>Global secondary indexes (GSIs)</p></li>
32/// <li>
33/// <p>Local secondary indexes (LSIs)</p></li>
34/// <li>
35/// <p>Streams</p></li>
36/// <li>
37/// <p>Provisioned read and write capacity</p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct CreateBackupFluentBuilder {
41 handle: ::std::sync::Arc<crate::client::Handle>,
42 inner: crate::operation::create_backup::builders::CreateBackupInputBuilder,
43config_override: ::std::option::Option<crate::config::Builder>,
44 }
45impl
46 crate::client::customize::internal::CustomizableSend<
47 crate::operation::create_backup::CreateBackupOutput,
48 crate::operation::create_backup::CreateBackupError,
49 > for CreateBackupFluentBuilder
50 {
51 fn send(
52 self,
53 config_override: crate::config::Builder,
54 ) -> crate::client::customize::internal::BoxFuture<
55 crate::client::customize::internal::SendResult<
56 crate::operation::create_backup::CreateBackupOutput,
57 crate::operation::create_backup::CreateBackupError,
58 >,
59 > {
60 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61 }
62 }
63impl CreateBackupFluentBuilder {
64 /// Creates a new `CreateBackupFluentBuilder`.
65 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66 Self {
67 handle,
68 inner: ::std::default::Default::default(),
69 config_override: ::std::option::Option::None,
70 }
71 }
72 /// Access the CreateBackup as a reference.
73 pub fn as_input(&self) -> &crate::operation::create_backup::builders::CreateBackupInputBuilder {
74 &self.inner
75 }
76 /// Sends the request and returns the response.
77 ///
78 /// If an error occurs, an `SdkError` will be returned with additional details that
79 /// can be matched against.
80 ///
81 /// By default, any retryable failures will be retried twice. Retry behavior
82 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83 /// set when configuring the client. Note: retries are enabled by default when using
84 /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
85 pub async fn send(self) -> ::std::result::Result<crate::operation::create_backup::CreateBackupOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::create_backup::CreateBackupError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
86 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::create_backup::CreateBackup::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::create_backup::CreateBackup::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<crate::operation::create_backup::CreateBackupOutput, crate::operation::create_backup::CreateBackupError, Self> {
99 crate::client::customize::CustomizableOperation::new(self)
100 }
101 pub(crate) fn config_override(
102 mut self,
103 config_override: impl ::std::convert::Into<crate::config::Builder>,
104 ) -> Self {
105 self.set_config_override(::std::option::Option::Some(config_override.into()));
106 self
107 }
108
109 pub(crate) fn set_config_override(
110 &mut self,
111 config_override: ::std::option::Option<crate::config::Builder>,
112 ) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
117 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.table_name(input.into());
119 self
120 }
121 /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
122 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_table_name(input);
124 self
125 }
126 /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
127 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_table_name()
129 }
130 /// <p>Specified name for the backup.</p>
131 pub fn backup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.inner = self.inner.backup_name(input.into());
133 self
134 }
135 /// <p>Specified name for the backup.</p>
136 pub fn set_backup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.inner = self.inner.set_backup_name(input);
138 self
139 }
140 /// <p>Specified name for the backup.</p>
141 pub fn get_backup_name(&self) -> &::std::option::Option<::std::string::String> {
142 self.inner.get_backup_name()
143 }
144}
145