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.
71 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>> {
72 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
73 let runtime_plugins = crate::operation::update_global_table_settings::UpdateGlobalTableSettings::operation_runtime_plugins(
74 self.handle.runtime_plugins.clone(),
75 &self.handle.conf,
76 self.config_override,
77 );
78 crate::operation::update_global_table_settings::UpdateGlobalTableSettings::orchestrate(&runtime_plugins, input).await
79 }
80
81 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
82 pub fn customize(
83 self,
84 ) -> crate::client::customize::CustomizableOperation<crate::operation::update_global_table_settings::UpdateGlobalTableSettingsOutput, crate::operation::update_global_table_settings::UpdateGlobalTableSettingsError, Self> {
85 crate::client::customize::CustomizableOperation::new(self)
86 }
87 pub(crate) fn config_override(
88 mut self,
89 config_override: impl ::std::convert::Into<crate::config::Builder>,
90 ) -> Self {
91 self.set_config_override(::std::option::Option::Some(config_override.into()));
92 self
93 }
94
95 pub(crate) fn set_config_override(
96 &mut self,
97 config_override: ::std::option::Option<crate::config::Builder>,
98 ) -> &mut Self {
99 self.config_override = config_override;
100 self
101 }
102 /// <p>The name of the global table</p>
103 pub fn global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.inner = self.inner.global_table_name(input.into());
105 self
106 }
107 /// <p>The name of the global table</p>
108 pub fn set_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.inner = self.inner.set_global_table_name(input);
110 self
111 }
112 /// <p>The name of the global table</p>
113 pub fn get_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
114 self.inner.get_global_table_name()
115 }
116 /// <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>
117 /// <ul>
118 /// <li>
119 /// <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>
120 /// <li>
121 /// <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>
122 /// </ul>
123 pub fn global_table_billing_mode(mut self, input: crate::types::BillingMode) -> Self {
124 self.inner = self.inner.global_table_billing_mode(input);
125 self
126 }
127 /// <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>
128 /// <ul>
129 /// <li>
130 /// <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>
131 /// <li>
132 /// <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>
133 /// </ul>
134 pub fn set_global_table_billing_mode(mut self, input: ::std::option::Option<crate::types::BillingMode>) -> Self {
135 self.inner = self.inner.set_global_table_billing_mode(input);
136 self
137 }
138 /// <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>
139 /// <ul>
140 /// <li>
141 /// <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>
142 /// <li>
143 /// <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>
144 /// </ul>
145 pub fn get_global_table_billing_mode(&self) -> &::std::option::Option<crate::types::BillingMode> {
146 self.inner.get_global_table_billing_mode()
147 }
148 /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
149 pub fn global_table_provisioned_write_capacity_units(mut self, input: i64) -> Self {
150 self.inner = self.inner.global_table_provisioned_write_capacity_units(input);
151 self
152 }
153 /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
154 pub fn set_global_table_provisioned_write_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
155 self.inner = self.inner.set_global_table_provisioned_write_capacity_units(input);
156 self
157 }
158 /// <p>The maximum number of writes consumed per second before DynamoDB returns a <code>ThrottlingException.</code></p>
159 pub fn get_global_table_provisioned_write_capacity_units(&self) -> &::std::option::Option<i64> {
160 self.inner.get_global_table_provisioned_write_capacity_units()
161 }
162 /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
163 pub fn global_table_provisioned_write_capacity_auto_scaling_settings_update(mut self, input: crate::types::AutoScalingSettingsUpdate) -> Self {
164 self.inner = self.inner.global_table_provisioned_write_capacity_auto_scaling_settings_update(input);
165 self
166 }
167 /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
168 pub fn set_global_table_provisioned_write_capacity_auto_scaling_settings_update(mut self, input: ::std::option::Option<crate::types::AutoScalingSettingsUpdate>) -> Self {
169 self.inner = self.inner.set_global_table_provisioned_write_capacity_auto_scaling_settings_update(input);
170 self
171 }
172 /// <p>Auto scaling settings for managing provisioned write capacity for the global table.</p>
173 pub fn get_global_table_provisioned_write_capacity_auto_scaling_settings_update(&self) -> &::std::option::Option<crate::types::AutoScalingSettingsUpdate> {
174 self.inner.get_global_table_provisioned_write_capacity_auto_scaling_settings_update()
175 }
176 ///
177 /// Appends an item to `GlobalTableGlobalSecondaryIndexSettingsUpdate`.
178 ///
179 /// 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).
180 ///
181 /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
182 pub fn global_table_global_secondary_index_settings_update(mut self, input: crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate) -> Self {
183 self.inner = self.inner.global_table_global_secondary_index_settings_update(input);
184 self
185 }
186 /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
187 pub fn set_global_table_global_secondary_index_settings_update(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>>) -> Self {
188 self.inner = self.inner.set_global_table_global_secondary_index_settings_update(input);
189 self
190 }
191 /// <p>Represents the settings of a global secondary index for a global table that will be modified.</p>
192 pub fn get_global_table_global_secondary_index_settings_update(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::GlobalTableGlobalSecondaryIndexSettingsUpdate>> {
193 self.inner.get_global_table_global_secondary_index_settings_update()
194 }
195 ///
196 /// Appends an item to `ReplicaSettingsUpdate`.
197 ///
198 /// To override the contents of this collection use [`set_replica_settings_update`](Self::set_replica_settings_update).
199 ///
200 /// <p>Represents the settings for a global table in a Region that will be modified.</p>
201 pub fn replica_settings_update(mut self, input: crate::types::ReplicaSettingsUpdate) -> Self {
202 self.inner = self.inner.replica_settings_update(input);
203 self
204 }
205 /// <p>Represents the settings for a global table in a Region that will be modified.</p>
206 pub fn set_replica_settings_update(mut self, input: ::std::option::Option<::std::vec::Vec::<crate::types::ReplicaSettingsUpdate>>) -> Self {
207 self.inner = self.inner.set_replica_settings_update(input);
208 self
209 }
210 /// <p>Represents the settings for a global table in a Region that will be modified.</p>
211 pub fn get_replica_settings_update(&self) -> &::std::option::Option<::std::vec::Vec::<crate::types::ReplicaSettingsUpdate>> {
212 self.inner.get_replica_settings_update()
213 }
214}
215