1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ProtocolParserGenerator.kt:99 */
|
3 5 | pub fn de_json_timestamps_http_error(
|
4 6 | _response_status: u16,
|
5 7 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 8 | _response_body: &[u8],
|
7 9 | ) -> std::result::Result<crate::operation::json_timestamps::JsonTimestampsOutput, crate::operation::json_timestamps::JsonTimestampsError> {
|
10 + | /* RustType.kt:516 */
|
8 11 | #[allow(unused_mut)]
|
12 + | /* ProtocolParserGenerator.kt:106 */
|
9 13 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 14 | .map_err(crate::operation::json_timestamps::JsonTimestampsError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:185 */
|
12 18 | Err(crate::operation::json_timestamps::JsonTimestampsError::generic(generic))
|
19 + | /* ProtocolParserGenerator.kt:99 */
|
13 20 | }
|
14 21 |
|
22 + | /* RustType.kt:516 */
|
15 23 | #[allow(clippy::unnecessary_wraps)]
|
24 + | /* ProtocolParserGenerator.kt:71 */
|
16 25 | pub fn de_json_timestamps_http_response(
|
17 26 | _response_status: u16,
|
18 27 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
19 28 | _response_body: &[u8],
|
20 29 | ) -> std::result::Result<crate::operation::json_timestamps::JsonTimestampsOutput, crate::operation::json_timestamps::JsonTimestampsError> {
|
30 + | /* ProtocolParserGenerator.kt:77 */
|
21 31 | Ok({
|
32 + | /* RustType.kt:516 */
|
22 33 | #[allow(unused_mut)]
|
34 + | /* ProtocolParserGenerator.kt:240 */
|
23 35 | let mut output = crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder::default();
|
36 + | /* ProtocolParserGenerator.kt:247 */
|
24 37 | output = crate::protocol_serde::shape_json_timestamps::de_json_timestamps(_response_body, output)
|
25 38 | .map_err(crate::operation::json_timestamps::JsonTimestampsError::unhandled)?;
|
39 + | /* ClientBuilderInstantiator.kt:56 */
|
26 40 | output.build()
|
41 + | /* ProtocolParserGenerator.kt:77 */
|
27 42 | })
|
43 + | /* ProtocolParserGenerator.kt:71 */
|
28 44 | }
|
29 45 |
|
46 + | /* JsonSerializerGenerator.kt:287 */
|
30 47 | pub fn ser_json_timestamps_input(
|
31 48 | input: &crate::operation::json_timestamps::JsonTimestampsInput,
|
32 49 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
50 + | /* JsonSerializerGenerator.kt:291 */
|
33 51 | let mut out = String::new();
|
52 + | /* JsonSerializerGenerator.kt:292 */
|
34 53 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
54 + | /* JsonSerializerGenerator.kt:375 */
|
35 55 | crate::protocol_serde::shape_json_timestamps_input::ser_json_timestamps_input_input(&mut object, input)?;
|
56 + | /* JsonSerializerGenerator.kt:295 */
|
36 57 | object.finish();
|
58 + | /* JsonSerializerGenerator.kt:296 */
|
37 59 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
60 + | /* JsonSerializerGenerator.kt:287 */
|
38 61 | }
|
39 62 |
|
63 + | /* JsonParserGenerator.kt:148 */
|
40 64 | pub(crate) fn de_json_timestamps(
|
41 65 | value: &[u8],
|
42 66 | mut builder: crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder,
|
43 67 | ) -> ::std::result::Result<
|
44 68 | crate::operation::json_timestamps::builders::JsonTimestampsOutputBuilder,
|
45 69 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
46 70 | > {
|
71 + | /* JsonParserGenerator.kt:153 */
|
47 72 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
48 73 | let tokens = &mut tokens_owned;
|
49 74 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
75 + | /* JsonParserGenerator.kt:684 */
|
50 76 | loop {
|
77 + | /* JsonParserGenerator.kt:685 */
|
51 78 | match tokens.next().transpose()? {
|
52 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
53 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
54 - | "dateTime" => {
|
55 - | builder = builder.set_date_time(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
56 - | tokens.next(),
|
57 - | ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
|
58 - | )?);
|
79 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
80 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
81 + | /* JsonParserGenerator.kt:260 */
|
82 + | match key.to_unescaped()?.as_ref() {
|
83 + | /* JsonParserGenerator.kt:262 */
|
84 + | "dateTime" => {
|
85 + | /* JsonParserGenerator.kt:265 */
|
86 + | builder = builder.set_date_time(
|
87 + | /* JsonParserGenerator.kt:384 */
|
88 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
89 + | tokens.next(),
|
90 + | ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
|
91 + | )?, /* JsonParserGenerator.kt:265 */
|
92 + | );
|
93 + | /* JsonParserGenerator.kt:262 */
|
94 + | }
|
95 + | /* JsonParserGenerator.kt:262 */
|
96 + | "dateTimeOnTarget" => {
|
97 + | /* JsonParserGenerator.kt:265 */
|
98 + | builder = builder.set_date_time_on_target(
|
99 + | /* JsonParserGenerator.kt:384 */
|
100 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
101 + | tokens.next(),
|
102 + | ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
|
103 + | )?, /* JsonParserGenerator.kt:265 */
|
104 + | );
|
105 + | /* JsonParserGenerator.kt:262 */
|
106 + | }
|
107 + | /* JsonParserGenerator.kt:262 */
|
108 + | "epochSeconds" => {
|
109 + | /* JsonParserGenerator.kt:265 */
|
110 + | builder = builder.set_epoch_seconds(
|
111 + | /* JsonParserGenerator.kt:384 */
|
112 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
113 + | tokens.next(),
|
114 + | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
115 + | )?, /* JsonParserGenerator.kt:265 */
|
116 + | );
|
117 + | /* JsonParserGenerator.kt:262 */
|
118 + | }
|
119 + | /* JsonParserGenerator.kt:262 */
|
120 + | "epochSecondsOnTarget" => {
|
121 + | /* JsonParserGenerator.kt:265 */
|
122 + | builder = builder.set_epoch_seconds_on_target(
|
123 + | /* JsonParserGenerator.kt:384 */
|
124 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
125 + | tokens.next(),
|
126 + | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
127 + | )?, /* JsonParserGenerator.kt:265 */
|
128 + | );
|
129 + | /* JsonParserGenerator.kt:262 */
|
130 + | }
|
131 + | /* JsonParserGenerator.kt:262 */
|
132 + | "httpDate" => {
|
133 + | /* JsonParserGenerator.kt:265 */
|
134 + | builder = builder.set_http_date(
|
135 + | /* JsonParserGenerator.kt:384 */
|
136 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
137 + | tokens.next(),
|
138 + | ::aws_smithy_types::date_time::Format::HttpDate,
|
139 + | )?, /* JsonParserGenerator.kt:265 */
|
140 + | );
|
141 + | /* JsonParserGenerator.kt:262 */
|
142 + | }
|
143 + | /* JsonParserGenerator.kt:262 */
|
144 + | "httpDateOnTarget" => {
|
145 + | /* JsonParserGenerator.kt:265 */
|
146 + | builder = builder.set_http_date_on_target(
|
147 + | /* JsonParserGenerator.kt:384 */
|
148 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
149 + | tokens.next(),
|
150 + | ::aws_smithy_types::date_time::Format::HttpDate,
|
151 + | )?, /* JsonParserGenerator.kt:265 */
|
152 + | );
|
153 + | /* JsonParserGenerator.kt:262 */
|
154 + | }
|
155 + | /* JsonParserGenerator.kt:262 */
|
156 + | "normal" => {
|
157 + | /* JsonParserGenerator.kt:265 */
|
158 + | builder = builder.set_normal(
|
159 + | /* JsonParserGenerator.kt:384 */
|
160 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
161 + | tokens.next(),
|
162 + | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
163 + | )?, /* JsonParserGenerator.kt:265 */
|
164 + | );
|
165 + | /* JsonParserGenerator.kt:262 */
|
166 + | }
|
167 + | /* JsonParserGenerator.kt:290 */
|
168 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
59 169 | }
|
60 - | "dateTimeOnTarget" => {
|
61 - | builder = builder.set_date_time_on_target(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
62 - | tokens.next(),
|
63 - | ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
|
64 - | )?);
|
65 - | }
|
66 - | "epochSeconds" => {
|
67 - | builder = builder.set_epoch_seconds(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
68 - | tokens.next(),
|
69 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
70 - | )?);
|
71 - | }
|
72 - | "epochSecondsOnTarget" => {
|
73 - | builder = builder.set_epoch_seconds_on_target(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
74 - | tokens.next(),
|
75 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
76 - | )?);
|
77 - | }
|
78 - | "httpDate" => {
|
79 - | builder = builder.set_http_date(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
80 - | tokens.next(),
|
81 - | ::aws_smithy_types::date_time::Format::HttpDate,
|
82 - | )?);
|
83 - | }
|
84 - | "httpDateOnTarget" => {
|
85 - | builder = builder.set_http_date_on_target(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
86 - | tokens.next(),
|
87 - | ::aws_smithy_types::date_time::Format::HttpDate,
|
88 - | )?);
|
89 - | }
|
90 - | "normal" => {
|
91 - | builder = builder.set_normal(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
92 - | tokens.next(),
|
93 - | ::aws_smithy_types::date_time::Format::EpochSeconds,
|
94 - | )?);
|
95 - | }
|
96 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
97 - | },
|
170 + | /* JsonParserGenerator.kt:686 */
|
171 + | }
|
172 + | /* JsonParserGenerator.kt:695 */
|
98 173 | other => {
|
99 174 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
100 175 | "expected object key or end object, found: {:?}",
|
101 176 | other
|
102 177 | )))
|
103 - | }
|
178 + | } /* JsonParserGenerator.kt:685 */
|
104 179 | }
|
180 + | /* JsonParserGenerator.kt:684 */
|
105 181 | }
|
182 + | /* JsonParserGenerator.kt:250 */
|
106 183 | if tokens.next().is_some() {
|
184 + | /* JsonParserGenerator.kt:251 */
|
107 185 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
108 186 | "found more JSON tokens after completing parsing",
|
109 187 | ));
|
188 + | /* JsonParserGenerator.kt:250 */
|
110 189 | }
|
190 + | /* JsonParserGenerator.kt:163 */
|
111 191 | Ok(builder)
|
192 + | /* JsonParserGenerator.kt:148 */
|
112 193 | }
|