1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | pub(crate) fn de_import_table_description<'a, I>(
|
3 - | tokens: &mut ::std::iter::Peekable<I>,
|
4 - | _value: &'a [u8],
|
5 - | ) -> ::std::result::Result<Option<crate::types::ImportTableDescription>, ::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::ImportTableDescriptionBuilder::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 - | "ImportArn" => {
|
19 - | builder = builder.set_import_arn(
|
20 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
21 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
22 - | .transpose()?,
|
23 - | );
|
24 - | }
|
25 - | "ImportStatus" => {
|
26 - | builder = builder.set_import_status(
|
27 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
28 - | .map(|s| s.to_unescaped().map(|u| crate::types::ImportStatus::from(u.as_ref())))
|
29 - | .transpose()?,
|
30 - | );
|
31 - | }
|
32 - | "TableArn" => {
|
33 - | builder = builder.set_table_arn(
|
34 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
35 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
36 - | .transpose()?,
|
37 - | );
|
38 - | }
|
39 - | "TableId" => {
|
40 - | builder = builder.set_table_id(
|
41 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
42 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
43 - | .transpose()?,
|
44 - | );
|
45 - | }
|
46 - | "ClientToken" => {
|
47 - | builder = builder.set_client_token(
|
48 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
49 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
50 - | .transpose()?,
|
51 - | );
|
52 - | }
|
53 - | "S3BucketSource" => {
|
54 - | builder =
|
55 - | builder.set_s3_bucket_source(crate::protocol_serde::shape_s3_bucket_source::de_s3_bucket_source(tokens, _value)?);
|
56 - | }
|
57 - | "ErrorCount" => {
|
58 - | builder = builder.set_error_count(
|
59 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
60 - | .map(i64::try_from)
|
61 - | .transpose()?,
|
62 - | );
|
63 - | }
|
64 - | "CloudWatchLogGroupArn" => {
|
65 - | builder = builder.set_cloud_watch_log_group_arn(
|
66 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
67 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
68 - | .transpose()?,
|
69 - | );
|
70 - | }
|
71 - | "InputFormat" => {
|
72 - | builder = builder.set_input_format(
|
73 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
74 - | .map(|s| s.to_unescaped().map(|u| crate::types::InputFormat::from(u.as_ref())))
|
75 - | .transpose()?,
|
76 - | );
|
77 - | }
|
78 - | "InputFormatOptions" => {
|
79 - | builder = builder.set_input_format_options(crate::protocol_serde::shape_input_format_options::de_input_format_options(
|
80 - | tokens, _value,
|
81 - | )?);
|
82 - | }
|
83 - | "InputCompressionType" => {
|
84 - | builder = builder.set_input_compression_type(
|
85 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
86 - | .map(|s| s.to_unescaped().map(|u| crate::types::InputCompressionType::from(u.as_ref())))
|
87 - | .transpose()?,
|
88 - | );
|
89 - | }
|
90 - | "TableCreationParameters" => {
|
91 - | builder = builder.set_table_creation_parameters(
|
92 - | crate::protocol_serde::shape_table_creation_parameters::de_table_creation_parameters(tokens, _value)?,
|
93 - | );
|
94 - | }
|
95 - | "StartTime" => {
|
96 - | builder = builder.set_start_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
97 - | tokens.next(),
|
98 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
99 - | )?);
|
100 - | }
|
101 - | "EndTime" => {
|
102 - | builder = builder.set_end_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
103 - | tokens.next(),
|
104 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
105 - | )?);
|
106 - | }
|
107 - | "ProcessedSizeBytes" => {
|
108 - | builder = builder.set_processed_size_bytes(
|
109 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
110 - | .map(i64::try_from)
|
111 - | .transpose()?,
|
112 - | );
|
113 - | }
|
114 - | "ProcessedItemCount" => {
|
115 - | builder = builder.set_processed_item_count(
|
116 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
117 - | .map(i64::try_from)
|
118 - | .transpose()?,
|
119 - | );
|
120 - | }
|
121 - | "ImportedItemCount" => {
|
122 - | builder = builder.set_imported_item_count(
|
123 - | ::aws_smithy_json::deserialize::token::expect_number_or_null(tokens.next())?
|
124 - | .map(i64::try_from)
|
125 - | .transpose()?,
|
126 - | );
|
127 - | }
|
128 - | "FailureCode" => {
|
129 - | builder = builder.set_failure_code(
|
130 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
131 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
132 - | .transpose()?,
|
133 - | );
|
134 - | }
|
135 - | "FailureMessage" => {
|
136 - | builder = builder.set_failure_message(
|
137 - | ::aws_smithy_json::deserialize::token::expect_string_or_null(tokens.next())?
|
138 - | .map(|s| s.to_unescaped().map(|u| u.into_owned()))
|
139 - | .transpose()?,
|
140 - | );
|
141 - | }
|
142 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
143 - | },
|
144 - | other => {
|
145 - | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
146 - | "expected object key or end object, found: {other:?}"
|
147 - | )))
|
148 - | }
|
149 - | }
|
150 - | }
|
151 - | Ok(Some(builder.build()))
|
152 - | }
|
153 - | _ => Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
154 - | "expected start object or null",
|
155 - | )),
|
156 - | }
|
157 - | }
|