1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_table_description<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::TableDescription>, ::aws_smithy_json::deserialize::error::DeserializeError>
|
6 - | where
|
7 - | I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
|
8 - | {
|
9 - | match tokens.next().transpose()? {
|
10 - | Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None),
|
11 - | Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => {
|
12 - | #[allow(unused_mut)]
|
13 - | let mut builder = crate::types::builders::TableDescriptionBuilder::default();
|
14 - | loop {
|
15 - | match tokens.next().transpose()? {
|
16 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
17 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
18 - | "AttributeDefinitions" => {
|
19 - | builder = builder.set_attribute_definitions(
|
20 - | crate::protocol_serde::shape_attribute_definitions::de_attribute_definitions(tokens, _value)?,
|
21 - | );
|
22 - | }
|
23 - | "TableName" => {
|
24 - | builder = builder.set_table_name(
|
25 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
26 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
27 - | .transpose()?,
|
28 - | );
|
29 - | }
|
30 - | "KeySchema" => {
|
31 - | builder = builder.set_key_schema(crate::protocol_serde::shape_key_schema::de_key_schema(tokens, _value)?);
|
32 - | }
|
33 - | "TableStatus" => {
|
34 - | builder = builder.set_table_status(
|
35 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
36 - | .map(|s| s.to_unescaped().map(|u| crate::types::TableStatus::from(u.as_ref())))
|
37 - | .transpose()?,
|
38 - | );
|
39 - | }
|
40 - | "CreationDateTime" => {
|
41 - | builder = builder.set_creation_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
42 - | tokens.next(),
|
43 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
44 - | )?);
|
45 - | }
|
46 - | "ProvisionedThroughput" => {
|
47 - | builder = builder.set_provisioned_throughput(
|
48 - | crate::protocol_serde::shape_provisioned_throughput_description::de_provisioned_throughput_description(
|
49 - | tokens, _value,
|
50 - | )?,
|
51 - | );
|
52 - | }
|
53 - | "TableSizeBytes" => {
|
54 - | builder = builder.set_table_size_bytes(
|
55 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
56 - | .map(i64::try_from)
|
57 - | .transpose()?,
|
58 - | );
|
59 - | }
|
60 - | "ItemCount" => {
|
61 - | builder = builder.set_item_count(
|
62 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
63 - | .map(i64::try_from)
|
64 - | .transpose()?,
|
65 - | );
|
66 - | }
|
67 - | "TableArn" => {
|
68 - | builder = builder.set_table_arn(
|
69 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
70 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
71 - | .transpose()?,
|
72 - | );
|
73 - | }
|
74 - | "TableId" => {
|
75 - | builder = builder.set_table_id(
|
76 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
77 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
78 - | .transpose()?,
|
79 - | );
|
80 - | }
|
81 - | "BillingModeSummary" => {
|
82 - | builder = builder.set_billing_mode_summary(crate::protocol_serde::shape_billing_mode_summary::de_billing_mode_summary(
|
83 - | tokens, _value,
|
84 - | )?);
|
85 - | }
|
86 - | "LocalSecondaryIndexes" => {
|
87 - | builder = builder.set_local_secondary_indexes(
|
88 - | crate::protocol_serde::shape_local_secondary_index_description_list::de_local_secondary_index_description_list(
|
89 - | tokens, _value,
|
90 - | )?,
|
91 - | );
|
92 - | }
|
93 - | "GlobalSecondaryIndexes" => {
|
94 - | builder = builder.set_global_secondary_indexes(
|
95 - | crate::protocol_serde::shape_global_secondary_index_description_list::de_global_secondary_index_description_list(
|
96 - | tokens, _value,
|
97 - | )?,
|
98 - | );
|
99 - | }
|
100 - | "StreamSpecification" => {
|
101 - | builder = builder.set_stream_specification(crate::protocol_serde::shape_stream_specification::de_stream_specification(
|
102 - | tokens, _value,
|
103 - | )?);
|
104 - | }
|
105 - | "LatestStreamLabel" => {
|
106 - | builder = builder.set_latest_stream_label(
|
107 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
108 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
109 - | .transpose()?,
|
110 - | );
|
111 - | }
|
112 - | "LatestStreamArn" => {
|
113 - | builder = builder.set_latest_stream_arn(
|
114 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
115 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
116 - | .transpose()?,
|
117 - | );
|
118 - | }
|
119 - | "GlobalTableVersion" => {
|
120 - | builder = builder.set_global_table_version(
|
121 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
122 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
123 - | .transpose()?,
|
124 - | );
|
125 - | }
|
126 - | "Replicas" => {
|
127 - | builder = builder.set_replicas(crate::protocol_serde::shape_replica_description_list::de_replica_description_list(
|
128 - | tokens, _value,
|
129 - | )?);
|
130 - | }
|
131 - | "GlobalTableWitnesses" => {
|
132 - | builder = builder.set_global_table_witnesses(
|
133 - | crate::protocol_serde::shape_global_table_witness_description_list::de_global_table_witness_description_list(
|
134 - | tokens, _value,
|
135 - | )?,
|
136 - | );
|
137 - | }
|
138 - | "RestoreSummary" => {
|
139 - | builder = builder.set_restore_summary(crate::protocol_serde::shape_restore_summary::de_restore_summary(tokens, _value)?);
|
140 - | }
|
141 - | "SSEDescription" => {
|
142 - | builder = builder.set_sse_description(crate::protocol_serde::shape_sse_description::de_sse_description(tokens, _value)?);
|
143 - | }
|
144 - | "ArchivalSummary" => {
|
145 - | builder =
|
146 - | builder.set_archival_summary(crate::protocol_serde::shape_archival_summary::de_archival_summary(tokens, _value)?);
|
147 - | }
|
148 - | "TableClassSummary" => {
|
149 - | builder = builder
|
150 - | .set_table_class_summary(crate::protocol_serde::shape_table_class_summary::de_table_class_summary(tokens, _value)?);
|
151 - | }
|
152 - | "DeletionProtectionEnabled" => {
|
153 - | builder =
|
154 - | builder.set_deletion_protection_enabled(::aws_smithy_json::deserialize::token::expect_bool_or_null(tokens.next())?);
|
155 - | }
|
156 - | "OnDemandThroughput" => {
|
157 - | builder = builder.set_on_demand_throughput(crate::protocol_serde::shape_on_demand_throughput::de_on_demand_throughput(
|
158 - | tokens, _value,
|
159 - | )?);
|
160 - | }
|
161 - | "WarmThroughput" => {
|
162 - | builder = builder.set_warm_throughput(
|
163 - | crate::protocol_serde::shape_table_warm_throughput_description::de_table_warm_throughput_description(tokens, _value)?,
|
164 - | );
|
165 - | }
|
166 - | "MultiRegionConsistency" => {
|
167 - | builder = builder.set_multi_region_consistency(
|
168 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
169 - | .map(|s| s.to_unescaped().map(|u| crate::types::MultiRegionConsistency::from(u.as_ref())))
|
170 - | .transpose()?,
|
171 - | );
|
172 - | }
|
173 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
174 - | },
|
175 - | other => {
|
176 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
177 - | "expected object key or end object, found: {other:?}"
|
178 - | )))
|
179 - | }
|
180 - | }
|
181 - | }
|
182 - | Ok(Some(builder.build()))
|
183 - | }
|
184 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
185 - | "expected start object or null",
|
186 - | )),
|
187 - | }
|
188 - | }
|