aws_sdk_dynamodb/operation/describe_limits/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_limits::_describe_limits_output::DescribeLimitsOutputBuilder;
3
4pub use crate::operation::describe_limits::_describe_limits_input::DescribeLimitsInputBuilder;
5
6impl crate::operation::describe_limits::builders::DescribeLimitsInputBuilder {
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::describe_limits::DescribeLimitsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_limits::DescribeLimitsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_limits();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeLimits`.
24///
25/// <p>Returns the current provisioned-capacity quotas for your Amazon Web Services account in a Region, both for the Region as a whole and for any one DynamoDB table that you create there.</p>
26/// <p>When you establish an Amazon Web Services account, the account has initial quotas on the maximum read capacity units and write capacity units that you can provision across all of your DynamoDB tables in a given Region. Also, there are per-table quotas that apply when you create a table there. For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html">Service, Account, and Table Quotas</a> page in the <i>Amazon DynamoDB Developer Guide</i>.</p>
27/// <p>Although you can increase these quotas by filing a case at <a href="https://console.aws.amazon.com/support/home#/">Amazon Web Services Support Center</a>, obtaining the increase is not instantaneous. The <code>DescribeLimits</code> action lets you write code to compare the capacity you are currently using to those quotas imposed by your account so that you have enough time to apply for an increase before you hit a quota.</p>
28/// <p>For example, you could use one of the Amazon Web Services SDKs to do the following:</p>
29/// <ol>
30/// <li>
31/// <p>Call <code>DescribeLimits</code> for a particular Region to obtain your current account quotas on provisioned capacity there.</p></li>
32/// <li>
33/// <p>Create a variable to hold the aggregate read capacity units provisioned for all your tables in that Region, and one to hold the aggregate write capacity units. Zero them both.</p></li>
34/// <li>
35/// <p>Call <code>ListTables</code> to obtain a list of all your DynamoDB tables.</p></li>
36/// <li>
37/// <p>For each table name listed by <code>ListTables</code>, do the following:</p>
38/// <ul>
39/// <li>
40/// <p>Call <code>DescribeTable</code> with the table name.</p></li>
41/// <li>
42/// <p>Use the data returned by <code>DescribeTable</code> to add the read capacity units and write capacity units provisioned for the table itself to your variables.</p></li>
43/// <li>
44/// <p>If the table has one or more global secondary indexes (GSIs), loop over these GSIs and add their provisioned capacity values to your variables as well.</p></li>
45/// </ul></li>
46/// <li>
47/// <p>Report the account quotas for that Region returned by <code>DescribeLimits</code>, along with the total current provisioned capacity levels you have calculated.</p></li>
48/// </ol>
49/// <p>This will let you see whether you are getting close to your account-level quotas.</p>
50/// <p>The per-table quotas apply only when you are creating a new table. They restrict the sum of the provisioned capacity of the new table itself and all its global secondary indexes.</p>
51/// <p>For existing tables and their GSIs, DynamoDB doesn't let you increase provisioned capacity extremely rapidly, but the only quota that applies is that the aggregate provisioned capacity over all your tables and GSIs cannot exceed either of the per-account quotas.</p><note>
52/// <p><code>DescribeLimits</code> should only be called periodically. You can expect throttling errors if you call it more than once in a minute.</p>
53/// </note>
54/// <p>The <code>DescribeLimits</code> Request element has no content.</p>
55#[derive(::std::clone::Clone, ::std::fmt::Debug)]
56pub struct DescribeLimitsFluentBuilder {
57    handle: ::std::sync::Arc<crate::client::Handle>,
58    inner: crate::operation::describe_limits::builders::DescribeLimitsInputBuilder,
59    config_override: ::std::option::Option<crate::config::Builder>,
60}
61impl
62    crate::client::customize::internal::CustomizableSend<
63        crate::operation::describe_limits::DescribeLimitsOutput,
64        crate::operation::describe_limits::DescribeLimitsError,
65    > for DescribeLimitsFluentBuilder
66{
67    fn send(
68        self,
69        config_override: crate::config::Builder,
70    ) -> crate::client::customize::internal::BoxFuture<
71        crate::client::customize::internal::SendResult<
72            crate::operation::describe_limits::DescribeLimitsOutput,
73            crate::operation::describe_limits::DescribeLimitsError,
74        >,
75    > {
76        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
77    }
78}
79impl DescribeLimitsFluentBuilder {
80    /// Creates a new `DescribeLimitsFluentBuilder`.
81    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
82        Self {
83            handle,
84            inner: ::std::default::Default::default(),
85            config_override: ::std::option::Option::None,
86        }
87    }
88    /// Access the DescribeLimits as a reference.
89    pub fn as_input(&self) -> &crate::operation::describe_limits::builders::DescribeLimitsInputBuilder {
90        &self.inner
91    }
92    /// Sends the request and returns the response.
93    ///
94    /// If an error occurs, an `SdkError` will be returned with additional details that
95    /// can be matched against.
96    ///
97    /// By default, any retryable failures will be retried twice. Retry behavior
98    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
99    /// set when configuring the client.
100    pub async fn send(
101        self,
102    ) -> ::std::result::Result<
103        crate::operation::describe_limits::DescribeLimitsOutput,
104        ::aws_smithy_runtime_api::client::result::SdkError<
105            crate::operation::describe_limits::DescribeLimitsError,
106            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
107        >,
108    > {
109        let input = self
110            .inner
111            .build()
112            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
113        let runtime_plugins = crate::operation::describe_limits::DescribeLimits::operation_runtime_plugins(
114            self.handle.runtime_plugins.clone(),
115            &self.handle.conf,
116            self.config_override,
117        );
118        crate::operation::describe_limits::DescribeLimits::orchestrate(&runtime_plugins, input).await
119    }
120
121    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
122    pub fn customize(
123        self,
124    ) -> crate::client::customize::CustomizableOperation<
125        crate::operation::describe_limits::DescribeLimitsOutput,
126        crate::operation::describe_limits::DescribeLimitsError,
127        Self,
128    > {
129        crate::client::customize::CustomizableOperation::new(self)
130    }
131    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
132        self.set_config_override(::std::option::Option::Some(config_override.into()));
133        self
134    }
135
136    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
137        self.config_override = config_override;
138        self
139    }
140}