aws_sdk_dynamodb/operation/update_global_table/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_global_table::_update_global_table_output::UpdateGlobalTableOutputBuilder;
3
4pub use crate::operation::update_global_table::_update_global_table_input::UpdateGlobalTableInputBuilder;
5
6impl crate::operation::update_global_table::builders::UpdateGlobalTableInputBuilder {
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::update_global_table::UpdateGlobalTableOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::update_global_table::UpdateGlobalTableError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.update_global_table();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `UpdateGlobalTable`.
21/// 
22/// <p>Adds or removes replicas in the specified global table. The global table must already exist to be able to use this operation. Any replica to be added must be empty, have the same name as the global table, have the same key schema, have DynamoDB Streams enabled, and have the same provisioned and maximum write capacity units.</p><important>
23/// <p>This documentation is for version 2017.11.29 (Legacy) of global tables, which should be avoided for new global tables. Customers should use <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html">Global Tables version 2019.11.21 (Current)</a> when possible, because it provides greater flexibility, higher efficiency, and consumes less write capacity than 2017.11.29 (Legacy).</p>
24/// <p>To determine which version you're using, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.DetermineVersion.html">Determining the global table version you are using</a>. To update existing global tables from version 2017.11.29 (Legacy) to version 2019.11.21 (Current), see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/V2globaltables_upgrade.html">Upgrading global tables</a>.</p>
25/// </important> <note>
26/// <p>If you are using global tables <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html">Version 2019.11.21</a> (Current) you can use <a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateTable.html">UpdateTable</a> instead.</p>
27/// <p>Although you can use <code>UpdateGlobalTable</code> to add replicas and remove replicas in a single request, for simplicity we recommend that you issue separate requests for adding or removing replicas.</p>
28/// </note>
29/// <p>If global secondary indexes are specified, then the following conditions must also be met:</p>
30/// <ul>
31/// <li>
32/// <p>The global secondary indexes must have the same name.</p></li>
33/// <li>
34/// <p>The global secondary indexes must have the same hash key and sort key (if present).</p></li>
35/// <li>
36/// <p>The global secondary indexes must have the same provisioned and maximum write capacity units.</p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct UpdateGlobalTableFluentBuilder {
40                handle: ::std::sync::Arc<crate::client::Handle>,
41                inner: crate::operation::update_global_table::builders::UpdateGlobalTableInputBuilder,
42config_override: ::std::option::Option<crate::config::Builder>,
43            }
44impl
45                crate::client::customize::internal::CustomizableSend<
46                    crate::operation::update_global_table::UpdateGlobalTableOutput,
47                    crate::operation::update_global_table::UpdateGlobalTableError,
48                > for UpdateGlobalTableFluentBuilder
49            {
50                fn send(
51                    self,
52                    config_override: crate::config::Builder,
53                ) -> crate::client::customize::internal::BoxFuture<
54                    crate::client::customize::internal::SendResult<
55                        crate::operation::update_global_table::UpdateGlobalTableOutput,
56                        crate::operation::update_global_table::UpdateGlobalTableError,
57                    >,
58                > {
59                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60                }
61            }
62impl UpdateGlobalTableFluentBuilder {
63    /// Creates a new `UpdateGlobalTableFluentBuilder`.
64                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65                        Self {
66                            handle,
67                            inner: ::std::default::Default::default(),
68    config_override: ::std::option::Option::None,
69                        }
70                    }
71    /// Access the UpdateGlobalTable as a reference.
72                    pub fn as_input(&self) -> &crate::operation::update_global_table::builders::UpdateGlobalTableInputBuilder {
73                        &self.inner
74                    }
75    /// Sends the request and returns the response.
76                    ///
77                    /// If an error occurs, an `SdkError` will be returned with additional details that
78                    /// can be matched against.
79                    ///
80                    /// By default, any retryable failures will be retried twice. Retry behavior
81                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82                    /// set when configuring the client. Note: retries are enabled by default when using
83                    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
84                    pub async fn send(self) -> ::std::result::Result<crate::operation::update_global_table::UpdateGlobalTableOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_global_table::UpdateGlobalTableError, ::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::update_global_table::UpdateGlobalTable::operation_runtime_plugins(
87                            self.handle.runtime_plugins.clone(),
88                            &self.handle.conf,
89                            self.config_override,
90                        );
91                        crate::operation::update_global_table::UpdateGlobalTable::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::update_global_table::UpdateGlobalTableOutput, crate::operation::update_global_table::UpdateGlobalTableError, 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 global table name.</p>
116    pub fn global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117                    self.inner = self.inner.global_table_name(input.into());
118                    self
119                }
120    /// <p>The global table name.</p>
121    pub fn set_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122                    self.inner = self.inner.set_global_table_name(input);
123                    self
124                }
125    /// <p>The global table name.</p>
126    pub fn get_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
127                    self.inner.get_global_table_name()
128                }
129    /// 
130    /// Appends an item to `ReplicaUpdates`.
131    /// 
132    /// To override the contents of this collection use [`set_replica_updates`](Self::set_replica_updates).
133    /// 
134    /// <p>A list of Regions that should be added or removed from the global table.</p>
135    pub fn replica_updates(mut self, input: crate::types::ReplicaUpdate) -> Self {
136                        self.inner = self.inner.replica_updates(input);
137                        self
138                    }
139    /// <p>A list of Regions that should be added or removed from the global table.</p>
140    pub fn set_replica_updates(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ReplicaUpdate>>) -> Self {
141                    self.inner = self.inner.set_replica_updates(input);
142                    self
143                }
144    /// <p>A list of Regions that should be added or removed from the global table.</p>
145    pub fn get_replica_updates(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ReplicaUpdate>> {
146                    self.inner.get_replica_updates()
147                }
148}
149