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