aws_sdk_dynamodb/operation/list_global_tables/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_global_tables::_list_global_tables_output::ListGlobalTablesOutputBuilder;
3
4pub use crate::operation::list_global_tables::_list_global_tables_input::ListGlobalTablesInputBuilder;
5
6impl crate::operation::list_global_tables::builders::ListGlobalTablesInputBuilder {
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::list_global_tables::ListGlobalTablesOutput,
10 ::aws_smithy_runtime_api::client::result::SdkError<
11 crate::operation::list_global_tables::ListGlobalTablesError,
12 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13 >
14 > {
15 let mut fluent_builder = client.list_global_tables();
16 fluent_builder.inner = self;
17 fluent_builder.send().await
18 }
19 }
20/// Fluent builder constructing a request to `ListGlobalTables`.
21///
22/// <p>Lists all global tables that have a replica in the specified Region.</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 ListGlobalTablesFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::list_global_tables::builders::ListGlobalTablesInputBuilder,
30config_override: ::std::option::Option<crate::config::Builder>,
31 }
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::list_global_tables::ListGlobalTablesOutput,
35 crate::operation::list_global_tables::ListGlobalTablesError,
36 > for ListGlobalTablesFluentBuilder
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::list_global_tables::ListGlobalTablesOutput,
44 crate::operation::list_global_tables::ListGlobalTablesError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49 }
50impl ListGlobalTablesFluentBuilder {
51 /// Creates a new `ListGlobalTablesFluentBuilder`.
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 ListGlobalTables as a reference.
60 pub fn as_input(&self) -> &crate::operation::list_global_tables::builders::ListGlobalTablesInputBuilder {
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::list_global_tables::ListGlobalTablesOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::list_global_tables::ListGlobalTablesError, ::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::list_global_tables::ListGlobalTables::operation_runtime_plugins(
74 self.handle.runtime_plugins.clone(),
75 &self.handle.conf,
76 self.config_override,
77 );
78 crate::operation::list_global_tables::ListGlobalTables::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::list_global_tables::ListGlobalTablesOutput, crate::operation::list_global_tables::ListGlobalTablesError, 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 first global table name that this operation will evaluate.</p>
103 pub fn exclusive_start_global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.inner = self.inner.exclusive_start_global_table_name(input.into());
105 self
106 }
107 /// <p>The first global table name that this operation will evaluate.</p>
108 pub fn set_exclusive_start_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.inner = self.inner.set_exclusive_start_global_table_name(input);
110 self
111 }
112 /// <p>The first global table name that this operation will evaluate.</p>
113 pub fn get_exclusive_start_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
114 self.inner.get_exclusive_start_global_table_name()
115 }
116 /// <p>The maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.</p>
117 /// <p>If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point, with a table name in the <code>LastEvaluatedGlobalTableName</code> to apply in a subsequent operation to the <code>ExclusiveStartGlobalTableName</code> parameter.</p>
118 pub fn limit(mut self, input: i32) -> Self {
119 self.inner = self.inner.limit(input);
120 self
121 }
122 /// <p>The maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.</p>
123 /// <p>If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point, with a table name in the <code>LastEvaluatedGlobalTableName</code> to apply in a subsequent operation to the <code>ExclusiveStartGlobalTableName</code> parameter.</p>
124 pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
125 self.inner = self.inner.set_limit(input);
126 self
127 }
128 /// <p>The maximum number of table names to return, if the parameter is not specified DynamoDB defaults to 100.</p>
129 /// <p>If the number of global tables DynamoDB finds reaches this limit, it stops the operation and returns the table names collected up to that point, with a table name in the <code>LastEvaluatedGlobalTableName</code> to apply in a subsequent operation to the <code>ExclusiveStartGlobalTableName</code> parameter.</p>
130 pub fn get_limit(&self) -> &::std::option::Option<i32> {
131 self.inner.get_limit()
132 }
133 /// <p>Lists the global tables in a specific Region.</p>
134 pub fn region_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.inner = self.inner.region_name(input.into());
136 self
137 }
138 /// <p>Lists the global tables in a specific Region.</p>
139 pub fn set_region_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.inner = self.inner.set_region_name(input);
141 self
142 }
143 /// <p>Lists the global tables in a specific Region.</p>
144 pub fn get_region_name(&self) -> &::std::option::Option<::std::string::String> {
145 self.inner.get_region_name()
146 }
147}
148