aws_sdk_dynamodb/operation/describe_limits/
_describe_limits_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Represents the output of a <code>DescribeLimits</code> operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeLimitsOutput  {
7    /// <p>The maximum total read capacity units that your account allows you to provision across all of your tables in this Region.</p>
8    pub account_max_read_capacity_units: ::std::option::Option<i64>,
9    /// <p>The maximum total write capacity units that your account allows you to provision across all of your tables in this Region.</p>
10    pub account_max_write_capacity_units: ::std::option::Option<i64>,
11    /// <p>The maximum read capacity units that your account allows you to provision for a new table that you are creating in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).</p>
12    pub table_max_read_capacity_units: ::std::option::Option<i64>,
13    /// <p>The maximum write capacity units that your account allows you to provision for a new table that you are creating in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).</p>
14    pub table_max_write_capacity_units: ::std::option::Option<i64>,
15    _request_id: Option<String>,
16}
17impl  DescribeLimitsOutput  {
18    /// <p>The maximum total read capacity units that your account allows you to provision across all of your tables in this Region.</p>
19    pub fn account_max_read_capacity_units(&self) -> ::std::option::Option<i64> {
20        self.account_max_read_capacity_units
21    }
22    /// <p>The maximum total write capacity units that your account allows you to provision across all of your tables in this Region.</p>
23    pub fn account_max_write_capacity_units(&self) -> ::std::option::Option<i64> {
24        self.account_max_write_capacity_units
25    }
26    /// <p>The maximum read capacity units that your account allows you to provision for a new table that you are creating in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).</p>
27    pub fn table_max_read_capacity_units(&self) -> ::std::option::Option<i64> {
28        self.table_max_read_capacity_units
29    }
30    /// <p>The maximum write capacity units that your account allows you to provision for a new table that you are creating in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).</p>
31    pub fn table_max_write_capacity_units(&self) -> ::std::option::Option<i64> {
32        self.table_max_write_capacity_units
33    }
34}
35static DESCRIBELIMITSOUTPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.dynamodb.synthetic#DescribeLimitsOutput", "com.amazonaws.dynamodb.synthetic", "DescribeLimitsOutput");
36static DESCRIBELIMITSOUTPUT_MEMBER_ACCOUNT_MAX_READ_CAPACITY_UNITS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
37                            ::aws_smithy_schema::ShapeId::from_static(
38                                "com.amazonaws.dynamodb.synthetic#DescribeLimitsOutput$AccountMaxReadCapacityUnits",
39                                "com.amazonaws.dynamodb.synthetic",
40                                "DescribeLimitsOutput",
41                            ),
42                            ::aws_smithy_schema::ShapeType::Long,
43                            "AccountMaxReadCapacityUnits",
44                            0,
45                        );
46static DESCRIBELIMITSOUTPUT_MEMBER_ACCOUNT_MAX_WRITE_CAPACITY_UNITS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
47                            ::aws_smithy_schema::ShapeId::from_static(
48                                "com.amazonaws.dynamodb.synthetic#DescribeLimitsOutput$AccountMaxWriteCapacityUnits",
49                                "com.amazonaws.dynamodb.synthetic",
50                                "DescribeLimitsOutput",
51                            ),
52                            ::aws_smithy_schema::ShapeType::Long,
53                            "AccountMaxWriteCapacityUnits",
54                            1,
55                        );
56static DESCRIBELIMITSOUTPUT_MEMBER_TABLE_MAX_READ_CAPACITY_UNITS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
57                            ::aws_smithy_schema::ShapeId::from_static(
58                                "com.amazonaws.dynamodb.synthetic#DescribeLimitsOutput$TableMaxReadCapacityUnits",
59                                "com.amazonaws.dynamodb.synthetic",
60                                "DescribeLimitsOutput",
61                            ),
62                            ::aws_smithy_schema::ShapeType::Long,
63                            "TableMaxReadCapacityUnits",
64                            2,
65                        );
66static DESCRIBELIMITSOUTPUT_MEMBER_TABLE_MAX_WRITE_CAPACITY_UNITS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
67                            ::aws_smithy_schema::ShapeId::from_static(
68                                "com.amazonaws.dynamodb.synthetic#DescribeLimitsOutput$TableMaxWriteCapacityUnits",
69                                "com.amazonaws.dynamodb.synthetic",
70                                "DescribeLimitsOutput",
71                            ),
72                            ::aws_smithy_schema::ShapeType::Long,
73                            "TableMaxWriteCapacityUnits",
74                            3,
75                        );
76static DESCRIBELIMITSOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
77                            ::aws_smithy_schema::ShapeId::from_static(
78                                "synthetic#request_id",
79                                "synthetic",
80                                "request_id",
81                            ),
82                            ::aws_smithy_schema::ShapeType::String,
83                            "request_id",
84                            4,
85                        ).with_http_header("x-amzn-requestid");
86static DESCRIBELIMITSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
87                            DESCRIBELIMITSOUTPUT_SCHEMA_ID,
88                            ::aws_smithy_schema::ShapeType::Structure,
89                            &[&DESCRIBELIMITSOUTPUT_MEMBER_ACCOUNT_MAX_READ_CAPACITY_UNITS, &DESCRIBELIMITSOUTPUT_MEMBER_ACCOUNT_MAX_WRITE_CAPACITY_UNITS, &DESCRIBELIMITSOUTPUT_MEMBER_TABLE_MAX_READ_CAPACITY_UNITS, &DESCRIBELIMITSOUTPUT_MEMBER_TABLE_MAX_WRITE_CAPACITY_UNITS, &DESCRIBELIMITSOUTPUT_MEMBER__REQUEST_ID],
90                        );
91impl DescribeLimitsOutput {
92                /// The schema for this shape.
93                pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DESCRIBELIMITSOUTPUT_SCHEMA;
94            }
95impl ::aws_smithy_schema::serde::SerializableStruct for DescribeLimitsOutput {
96                #[allow(unused_variables, clippy::diverging_sub_expression)]
97                fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
98                    if let Some(ref val) = self.account_max_read_capacity_units {
99                                ser.write_long(&DESCRIBELIMITSOUTPUT_MEMBER_ACCOUNT_MAX_READ_CAPACITY_UNITS, *val)?;
100                            }
101if let Some(ref val) = self.account_max_write_capacity_units {
102                                ser.write_long(&DESCRIBELIMITSOUTPUT_MEMBER_ACCOUNT_MAX_WRITE_CAPACITY_UNITS, *val)?;
103                            }
104if let Some(ref val) = self.table_max_read_capacity_units {
105                                ser.write_long(&DESCRIBELIMITSOUTPUT_MEMBER_TABLE_MAX_READ_CAPACITY_UNITS, *val)?;
106                            }
107if let Some(ref val) = self.table_max_write_capacity_units {
108                                ser.write_long(&DESCRIBELIMITSOUTPUT_MEMBER_TABLE_MAX_WRITE_CAPACITY_UNITS, *val)?;
109                            }
110                    Ok(())
111                }
112            }
113impl DescribeLimitsOutput {
114                /// Deserializes this structure from a [`ShapeDeserializer`].
115                pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
116                    #[allow(unused_variables, unused_mut)]
117                    let mut builder = Self::builder();
118                    #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
119                    deserializer.read_struct(&DESCRIBELIMITSOUTPUT_SCHEMA, &mut |member, deser| {
120                        match member.member_index() {
121                            Some(0) => {
122                                    builder.account_max_read_capacity_units = Some(deser.read_long(member)?);
123                                }
124Some(1) => {
125                                    builder.account_max_write_capacity_units = Some(deser.read_long(member)?);
126                                }
127Some(2) => {
128                                    builder.table_max_read_capacity_units = Some(deser.read_long(member)?);
129                                }
130Some(3) => {
131                                    builder.table_max_write_capacity_units = Some(deser.read_long(member)?);
132                                }
133Some(4) => {
134                                builder._request_id = Some(deser.read_string(member)?);
135                            }
136                            _ => {}
137                        }
138                        Ok(())
139                    })?;
140                    Ok(builder.build())
141                }
142            }
143impl DescribeLimitsOutput {
144                /// Deserializes this structure from a body deserializer and HTTP response headers.
145                /// Header-bound members are read directly from headers, avoiding runtime
146                /// member iteration overhead. Body members are read via the deserializer.
147                pub fn deserialize_with_response(
148                    deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
149                    headers: &::aws_smithy_runtime_api::http::Headers,
150                    _status: u16,
151                    _body: &[u8],
152                ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
153                    #[allow(unused_variables, unused_mut)]
154                    let mut builder = Self::builder();
155if let Some(val) = headers.get("x-amzn-requestid") {
156                    builder._request_id = Some(val.to_string());
157                }
158#[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
159                    deserializer.read_struct(&DESCRIBELIMITSOUTPUT_SCHEMA, &mut |member, deser| {
160                        match member.member_index() {
161                            Some(0) => { builder.account_max_read_capacity_units = Some(deser.read_long(member)?); }
162Some(1) => { builder.account_max_write_capacity_units = Some(deser.read_long(member)?); }
163Some(2) => { builder.table_max_read_capacity_units = Some(deser.read_long(member)?); }
164Some(3) => { builder.table_max_write_capacity_units = Some(deser.read_long(member)?); }
165                            _ => {}
166                        }
167                        Ok(())
168                    })?;
169                    Ok(builder.build())
170                    }
171                    }
172impl ::aws_types::request_id::RequestId for DescribeLimitsOutput {
173                                    fn request_id(&self) -> Option<&str> {
174                                        self._request_id.as_deref()
175                                    }
176                                }
177impl DescribeLimitsOutput {
178    /// Creates a new builder-style object to manufacture [`DescribeLimitsOutput`](crate::operation::describe_limits::DescribeLimitsOutput).
179    pub fn builder() -> crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder {
180        crate::operation::describe_limits::builders::DescribeLimitsOutputBuilder::default()
181    }
182}
183
184/// A builder for [`DescribeLimitsOutput`](crate::operation::describe_limits::DescribeLimitsOutput).
185#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
186#[non_exhaustive]
187pub struct DescribeLimitsOutputBuilder {
188    pub(crate) account_max_read_capacity_units: ::std::option::Option<i64>,
189    pub(crate) account_max_write_capacity_units: ::std::option::Option<i64>,
190    pub(crate) table_max_read_capacity_units: ::std::option::Option<i64>,
191    pub(crate) table_max_write_capacity_units: ::std::option::Option<i64>,
192    _request_id: Option<String>,
193}
194impl DescribeLimitsOutputBuilder {
195    /// <p>The maximum total read capacity units that your account allows you to provision across all of your tables in this Region.</p>
196    pub fn account_max_read_capacity_units(mut self, input: i64) -> Self {
197        self.account_max_read_capacity_units = ::std::option::Option::Some(input);
198        self
199    }
200    /// <p>The maximum total read capacity units that your account allows you to provision across all of your tables in this Region.</p>
201    pub fn set_account_max_read_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
202        self.account_max_read_capacity_units = input; self
203    }
204    /// <p>The maximum total read capacity units that your account allows you to provision across all of your tables in this Region.</p>
205    pub fn get_account_max_read_capacity_units(&self) -> &::std::option::Option<i64> {
206        &self.account_max_read_capacity_units
207    }
208    /// <p>The maximum total write capacity units that your account allows you to provision across all of your tables in this Region.</p>
209    pub fn account_max_write_capacity_units(mut self, input: i64) -> Self {
210        self.account_max_write_capacity_units = ::std::option::Option::Some(input);
211        self
212    }
213    /// <p>The maximum total write capacity units that your account allows you to provision across all of your tables in this Region.</p>
214    pub fn set_account_max_write_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
215        self.account_max_write_capacity_units = input; self
216    }
217    /// <p>The maximum total write capacity units that your account allows you to provision across all of your tables in this Region.</p>
218    pub fn get_account_max_write_capacity_units(&self) -> &::std::option::Option<i64> {
219        &self.account_max_write_capacity_units
220    }
221    /// <p>The maximum read capacity units that your account allows you to provision for a new table that you are creating in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).</p>
222    pub fn table_max_read_capacity_units(mut self, input: i64) -> Self {
223        self.table_max_read_capacity_units = ::std::option::Option::Some(input);
224        self
225    }
226    /// <p>The maximum read capacity units that your account allows you to provision for a new table that you are creating in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).</p>
227    pub fn set_table_max_read_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
228        self.table_max_read_capacity_units = input; self
229    }
230    /// <p>The maximum read capacity units that your account allows you to provision for a new table that you are creating in this Region, including the read capacity units provisioned for its global secondary indexes (GSIs).</p>
231    pub fn get_table_max_read_capacity_units(&self) -> &::std::option::Option<i64> {
232        &self.table_max_read_capacity_units
233    }
234    /// <p>The maximum write capacity units that your account allows you to provision for a new table that you are creating in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).</p>
235    pub fn table_max_write_capacity_units(mut self, input: i64) -> Self {
236        self.table_max_write_capacity_units = ::std::option::Option::Some(input);
237        self
238    }
239    /// <p>The maximum write capacity units that your account allows you to provision for a new table that you are creating in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).</p>
240    pub fn set_table_max_write_capacity_units(mut self, input: ::std::option::Option<i64>) -> Self {
241        self.table_max_write_capacity_units = input; self
242    }
243    /// <p>The maximum write capacity units that your account allows you to provision for a new table that you are creating in this Region, including the write capacity units provisioned for its global secondary indexes (GSIs).</p>
244    pub fn get_table_max_write_capacity_units(&self) -> &::std::option::Option<i64> {
245        &self.table_max_write_capacity_units
246    }
247    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
248                                        self._request_id = Some(request_id.into());
249                                        self
250                                    }
251    
252                                    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
253                                        self._request_id = request_id;
254                                        self
255                                    }
256    /// Consumes the builder and constructs a [`DescribeLimitsOutput`](crate::operation::describe_limits::DescribeLimitsOutput).
257    pub fn build(self) -> crate::operation::describe_limits::DescribeLimitsOutput {
258        crate::operation::describe_limits::DescribeLimitsOutput {
259            account_max_read_capacity_units: self.account_max_read_capacity_units
260            ,
261            account_max_write_capacity_units: self.account_max_write_capacity_units
262            ,
263            table_max_read_capacity_units: self.table_max_read_capacity_units
264            ,
265            table_max_write_capacity_units: self.table_max_write_capacity_units
266            ,
267            _request_id: self._request_id,
268        }
269    }
270}
271