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(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_global_table_settings();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateGlobalTableSettings`.
24///
25/// <p>Updates settings for a global table.</p><important>
26/// <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>
27/// <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>
28/// </important>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct UpdateGlobalTableSettingsFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
38        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
39    > for UpdateGlobalTableSettingsFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
47            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl UpdateGlobalTableSettingsFluentBuilder {
54    /// Creates a new `UpdateGlobalTableSettingsFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the UpdateGlobalTableSettings as a reference.
63    pub fn as_input(&self) -> &crate::operation::update_global_table_settings::builders::UpdateGlobalTableSettingsInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::update_global_table_settings::UpdateGlobalTableSettings::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::update_global_table_settings::UpdateGlobalTableSettings::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<
99        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput,
100        crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name of the global table</p>
115    pub fn global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.global_table_name(input.into());
117        self
118    }
119    /// <p>The name of the global table</p>
120    pub fn set_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_global_table_name(input);
122        self
123    }
124    /// <p>The name of the global table</p>
125    pub fn get_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_global_table_name()
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 global_table_billing_mode(mut self, input: crate::types::BillingMode) -> Self {
136        self.inner = self.inner.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 set_global_table_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
147        self.inner = self.inner.set_global_table_billing_mode(input);
148        self
149    }
150    /// <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>
151    /// <ul>
152    /// <li>
153    /// <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>
154    /// <li>
155    /// <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>
156    /// </ul>
157    pub fn get_global_table_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
158        self.inner.get_global_table_billing_mode()
159    }
160    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
161    pub fn global_table_provisioned_write_capacity_units(mut self, input: i64) -> Self {
162        self.inner = self.inner.global_table_provisioned_write_capacity_units(input);
163        self
164    }
165    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
166    pub fn set_global_table_provisioned_write_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
167        self.inner = self.inner.set_global_table_provisioned_write_capacity_units(input);
168        self
169    }
170    /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
171    pub fn get_global_table_provisioned_write_capacity_units(&self) -> &::std::option::Option<i64> {
172        self.inner.get_global_table_provisioned_write_capacity_units()
173    }
174    /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
175    pub fn global_table_provisioned_write_capacity_auto_scaling_settings_update(mut self, input: crate::types::AutoScalingSettingsUpdate) -> Self {
176        self.inner = self.inner.global_table_provisioned_write_capacity_auto_scaling_settings_update(input);
177        self
178    }
179    /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
180    pub fn set_global_table_provisioned_write_capacity_auto_scaling_settings_update(
181        mut self,
182        input: ::std::option::Option<crate::types::AutoScalingSettingsUpdate>,
183    ) -> Self {
184        self.inner = self.inner.set_global_table_provisioned_write_capacity_auto_scaling_settings_update(input);
185        self
186    }
187    /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
188    pub fn get_global_table_provisioned_write_capacity_auto_scaling_settings_update(
189        &self,
190    ) -> &::std::option::Option<crate::types::AutoScalingSettingsUpdate> {
191        self.inner.get_global_table_provisioned_write_capacity_auto_scaling_settings_update()
192    }
193    ///
194    /// Appends an item to `GlobalTableGlobalSecondaryIndexSettingsUpdate`.
195    ///
196    /// 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).
197    ///
198    /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
199    pub fn global_table_global_secondary_index_settings_update(mut self, input: crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate) -> Self {
200        self.inner = self.inner.global_table_global_secondary_index_settings_update(input);
201        self
202    }
203    /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
204    pub fn set_global_table_global_secondary_index_settings_update(
205        mut self,
206        input: ::std::option::Option<::std::vec::Vec<crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>>,
207    ) -> Self {
208        self.inner = self.inner.set_global_table_global_secondary_index_settings_update(input);
209        self
210    }
211    /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
212    pub fn get_global_table_global_secondary_index_settings_update(
213        &self,
214    ) -> &::std::option::Option<::std::vec::Vec<crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>> {
215        self.inner.get_global_table_global_secondary_index_settings_update()
216    }
217    ///
218    /// Appends an item to `ReplicaSettingsUpdate`.
219    ///
220    /// To override the contents of this collection use [`set_replica_settings_update`](Self::set_replica_settings_update).
221    ///
222    /// <p>Represents the settings for a global table in a Region that will be modified.</p>
223    pub fn replica_settings_update(mut self, input: crate::types::ReplicaSettingsUpdate) -> Self {
224        self.inner = self.inner.replica_settings_update(input);
225        self
226    }
227    /// <p>Represents the settings for a global table in a Region that will be modified.</p>
228    pub fn set_replica_settings_update(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicaSettingsUpdate>>) -> Self {
229        self.inner = self.inner.set_replica_settings_update(input);
230        self
231    }
232    /// <p>Represents the settings for a global table in a Region that will be modified.</p>
233    pub fn get_replica_settings_update(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicaSettingsUpdate>> {
234        self.inner.get_replica_settings_update()
235    }
236}