1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_global_table_description<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::GlobalTableDescription>, ::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::GlobalTableDescriptionBuilder::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 - | "ReplicationGroup" => {
|
19 - | builder = builder.set_replication_group(
|
20 - | crate::protocol_serde::shape_replica_description_list::de_replica_description_list(tokens, _value)?,
|
21 - | );
|
22 - | }
|
23 - | "GlobalTableArn" => {
|
24 - | builder = builder.set_global_table_arn(
|
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 - | "CreationDateTime" => {
|
31 - | builder = builder.set_creation_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
32 - | tokens.next(),
|
33 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
34 - | )?);
|
35 - | }
|
36 - | "GlobalTableStatus" => {
|
37 - | builder = builder.set_global_table_status(
|
38 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
39 - | .map(|s| s.to_unescaped().map(|u| crate::types::GlobalTableStatus::from(u.as_ref())))
|
40 - | .transpose()?,
|
41 - | );
|
42 - | }
|
43 - | "GlobalTableName" => {
|
44 - | builder = builder.set_global_table_name(
|
45 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
46 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
47 - | .transpose()?,
|
48 - | );
|
49 - | }
|
50 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
51 - | },
|
52 - | other => {
|
53 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
54 - | "expected object key or end object, found: {other:?}"
|
55 - | )))
|
56 - | }
|
57 - | }
|
58 - | }
|
59 - | Ok(Some(builder.build()))
|
60 - | }
|
61 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
62 - | "expected start object or null",
|
63 - | )),
|
64 - | }
|
65 - | }
|