aws_sdk_dynamodb/operation/update_global_table_settings/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_global_table_settings::_update_global_table_settings_output::UpdateGlobalTableSettingsOutputBuilder;
3
4pub use crate::operation::update_global_table_settings::_update_global_table_settings_input::UpdateGlobalTableSettingsInputBuilder;
5
6impl crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder {
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_settings::UpdateGlobalTableSettingsOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.update_global_table_settings();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `UpdateGlobalTableSettings`.
21/// 
22/// <p>Updates settings for a global table.</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>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateGlobalTableSettingsFluentBuilder {
28                handle: ::std::sync::Arc<crate::client::Handle>,
29                inner: crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder,
30config_override: ::std::option::Option<crate::config::Builder>,
31            }
32impl
33                crate::client::customize::internal::CustomizableSend<
34                    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
35                    crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
36                > for UpdateGlobalTableSettingsFluentBuilder
37            {
38                fn send(
39                    self,
40                    config_override: crate::config::Builder,
41                ) -> crate::client::customize::internal::BoxFuture<
42                    crate::client::customize::internal::SendResult<
43                        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
44                        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
45                    >,
46                > {
47                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48                }
49            }
50impl UpdateGlobalTableSettingsFluentBuilder {
51    /// Creates a new `UpdateGlobalTableSettingsFluentBuilder`.
52                    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53                        Self {
54                            handle,
55                            inner: ::std::default::Default::default(),
56    config_override: ::std::option::Option::None,
57                        }
58                    }
59    /// Access the UpdateGlobalTableSettings as a reference.
60                    pub fn as_input(&self) -> &crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder {
61                        &self.inner
62                    }
63    /// Sends the request and returns the response.
64                    ///
65                    /// If an error occurs, an `SdkError` will be returned with additional details that
66                    /// can be matched against.
67                    ///
68                    /// By default, any retryable failures will be retried twice. Retry behavior
69                    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70                    /// set when configuring the client. Note: retries are enabled by default when using
71                    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
72                    pub async fn send(self) -> ::std::result::Result<crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
73                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
74                        let runtime_plugins = crate::operation::update_global_table_settings::UpdateGlobalTableSettings::operation_runtime_plugins(
75                            self.handle.runtime_plugins.clone(),
76                            &self.handle.conf,
77                            self.config_override,
78                        );
79                        crate::operation::update_global_table_settings::UpdateGlobalTableSettings::orchestrate(&runtime_plugins, input).await
80                    }
81    
82                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
83                    pub fn customize(
84                        self,
85                    ) -> crate::client::customize::CustomizableOperation<crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput, crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError, Self> {
86                        crate::client::customize::CustomizableOperation::new(self)
87                    }
88    pub(crate) fn config_override(
89                            mut self,
90                            config_override: impl ::std::convert::Into<crate::config::Builder>,
91                        ) -> Self {
92                            self.set_config_override(::std::option::Option::Some(config_override.into()));
93                            self
94                        }
95    
96                        pub(crate) fn set_config_override(
97                            &mut self,
98                            config_override: ::std::option::Option<crate::config::Builder>,
99                        ) -> &mut Self {
100                            self.config_override = config_override;
101                            self
102                        }
103    /// <p>The name of the global table</p>
104    pub fn global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105                    self.inner = self.inner.global_table_name(input.into());
106                    self
107                }
108    /// <p>The name of the global table</p>
109    pub fn set_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110                    self.inner = self.inner.set_global_table_name(input);
111                    self
112                }
113    /// <p>The name of the global table</p>
114    pub fn get_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
115                    self.inner.get_global_table_name()
116                }
117    /// <p>The billing mode of the global table. If <code>GlobalTableBillingMode</code> is not specified, the global table defaults to <code>PROVISIONED</code> capacity billing mode.</p>
118    /// <ul>
119    /// <li>
120    /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
121    /// <li>
122    /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
123    /// </ul>
124    pub fn global_table_billing_mode(mut self, input: crate::types::BillingMode) -> Self {
125                    self.inner = self.inner.global_table_billing_mode(input);
126                    self
127                }
128    /// <p>The billing mode of the global table. If <code>GlobalTableBillingMode</code> is not specified, the global table defaults to <code>PROVISIONED</code> capacity billing mode.</p>
129    /// <ul>
130    /// <li>
131    /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
132    /// <li>
133    /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
134    /// </ul>
135    pub fn set_global_table_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
136                    self.inner = self.inner.set_global_table_billing_mode(input);
137                    self
138                }
139    /// <p>The billing mode of the global table. If <code>GlobalTableBillingMode</code> is not specified, the global table defaults to <code>PROVISIONED</code> capacity billing mode.</p>
140    /// <ul>
141    /// <li>
142    /// <p><code>PROVISIONED</code> - We recommend using <code>PROVISIONED</code> for predictable workloads. <code>PROVISIONED</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/provisioned-capacity-mode.html">Provisioned capacity mode</a>.</p></li>
143    /// <li>
144    /// <p><code>PAY_PER_REQUEST</code> - We recommend using <code>PAY_PER_REQUEST</code> for unpredictable workloads. <code>PAY_PER_REQUEST</code> sets the billing mode to <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/on-demand-capacity-mode.html">On-demand capacity mode</a>.</p></li>
145    /// </ul>
146    pub fn get_global_table_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
147                    self.inner.get_global_table_billing_mode()
148                }
149    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
150    pub fn global_table_provisioned_write_capacity_units(mut self, input: i64) -> Self {
151                    self.inner = self.inner.global_table_provisioned_write_capacity_units(input);
152                    self
153                }
154    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
155    pub fn set_global_table_provisioned_write_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
156                    self.inner = self.inner.set_global_table_provisioned_write_capacity_units(input);
157                    self
158                }
159    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
160    pub fn get_global_table_provisioned_write_capacity_units(&self) -> &::std::option::Option<i64> {
161                    self.inner.get_global_table_provisioned_write_capacity_units()
162                }
163    /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
164    pub fn global_table_provisioned_write_capacity_auto_scaling_settings_update(mut self, input: crate::types::AutoScalingSettingsUpdate) -> Self {
165                    self.inner = self.inner.global_table_provisioned_write_capacity_auto_scaling_settings_update(input);
166                    self
167                }
168    /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
169    pub fn set_global_table_provisioned_write_capacity_auto_scaling_settings_update(mut self, input: ::std::option::Option<crate::types::AutoScalingSettingsUpdate>) -> Self {
170                    self.inner = self.inner.set_global_table_provisioned_write_capacity_auto_scaling_settings_update(input);
171                    self
172                }
173    /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
174    pub fn get_global_table_provisioned_write_capacity_auto_scaling_settings_update(&self) -> &::std::option::Option<crate::types::AutoScalingSettingsUpdate> {
175                    self.inner.get_global_table_provisioned_write_capacity_auto_scaling_settings_update()
176                }
177    /// 
178    /// Appends an item to `GlobalTableGlobalSecondaryIndexSettingsUpdate`.
179    /// 
180    /// To override the contents of this collection use [`set_global_table_global_secondary_index_settings_update`](Self::set_global_table_global_secondary_index_settings_update).
181    /// 
182    /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
183    pub fn global_table_global_secondary_index_settings_update(mut self, input: crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate) -> Self {
184                        self.inner = self.inner.global_table_global_secondary_index_settings_update(input);
185                        self
186                    }
187    /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
188    pub fn set_global_table_global_secondary_index_settings_update(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>>) -> Self {
189                    self.inner = self.inner.set_global_table_global_secondary_index_settings_update(input);
190                    self
191                }
192    /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
193    pub fn get_global_table_global_secondary_index_settings_update(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>> {
194                    self.inner.get_global_table_global_secondary_index_settings_update()
195                }
196    /// 
197    /// Appends an item to `ReplicaSettingsUpdate`.
198    /// 
199    /// To override the contents of this collection use [`set_replica_settings_update`](Self::set_replica_settings_update).
200    /// 
201    /// <p>Represents the settings for a global table in a Region that will be modified.</p>
202    pub fn replica_settings_update(mut self, input: crate::types::ReplicaSettingsUpdate) -> Self {
203                        self.inner = self.inner.replica_settings_update(input);
204                        self
205                    }
206    /// <p>Represents the settings for a global table in a Region that will be modified.</p>
207    pub fn set_replica_settings_update(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ReplicaSettingsUpdate>>) -> Self {
208                    self.inner = self.inner.set_replica_settings_update(input);
209                    self
210                }
211    /// <p>Represents the settings for a global table in a Region that will be modified.</p>
212    pub fn get_replica_settings_update(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ReplicaSettingsUpdate>> {
213                    self.inner.get_replica_settings_update()
214                }
215}
216