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.
84                    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>> {
85                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86                        let runtime_plugins = crate::operation::create_backup::CreateBackup::operation_runtime_plugins(
87                            self.handle.runtime_plugins.clone(),
88                            &self.handle.conf,
89                            self.config_override,
90                        );
91                        crate::operation::create_backup::CreateBackup::orchestrate(&runtime_plugins, input).await
92                    }
93    
94                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95                    pub fn customize(
96                        self,
97                    ) -> crate::client::customize::CustomizableOperation<crate::operation::create_backup::CreateBackupOutput, crate::operation::create_backup::CreateBackupError, Self> {
98                        crate::client::customize::CustomizableOperation::new(self)
99                    }
100    pub(crate) fn config_override(
101                            mut self,
102                            config_override: impl ::std::convert::Into<crate::config::Builder>,
103                        ) -> Self {
104                            self.set_config_override(::std::option::Option::Some(config_override.into()));
105                            self
106                        }
107    
108                        pub(crate) fn set_config_override(
109                            &mut self,
110                            config_override: ::std::option::Option<crate::config::Builder>,
111                        ) -> &mut Self {
112                            self.config_override = config_override;
113                            self
114                        }
115    /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
116    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117                    self.inner = self.inner.table_name(input.into());
118                    self
119                }
120    /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
121    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122                    self.inner = self.inner.set_table_name(input);
123                    self
124                }
125    /// <p>The name of the table. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
126    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
127                    self.inner.get_table_name()
128                }
129    /// <p>Specified name for the backup.</p>
130    pub fn backup_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131                    self.inner = self.inner.backup_name(input.into());
132                    self
133                }
134    /// <p>Specified name for the backup.</p>
135    pub fn set_backup_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136                    self.inner = self.inner.set_backup_name(input);
137                    self
138                }
139    /// <p>Specified name for the backup.</p>
140    pub fn get_backup_name(&self) -> &::std::option::Option<::std::string::String> {
141                    self.inner.get_backup_name()
142                }
143}
144