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_fractional_seconds_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::fractional_seconds::FractionalSecondsOutput, crate::operation::fractional_seconds::FractionalSecondsError>
|
8 10 | {
|
11 + | /* RustType.kt:516 */
|
9 12 | #[allow(unused_mut)]
|
13 + | /* ProtocolParserGenerator.kt:106 */
|
10 14 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
11 15 | .map_err(crate::operation::fractional_seconds::FractionalSecondsError::unhandled)?;
|
16 + | /* ProtocolParserGenerator.kt:120 */
|
12 17 | let generic = generic_builder.build();
|
18 + | /* ProtocolParserGenerator.kt:185 */
|
13 19 | Err(crate::operation::fractional_seconds::FractionalSecondsError::generic(generic))
|
20 + | /* ProtocolParserGenerator.kt:99 */
|
14 21 | }
|
15 22 |
|
23 + | /* RustType.kt:516 */
|
16 24 | #[allow(clippy::unnecessary_wraps)]
|
25 + | /* ProtocolParserGenerator.kt:71 */
|
17 26 | pub fn de_fractional_seconds_http_response(
|
18 27 | _response_status: u16,
|
19 28 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
20 29 | _response_body: &[u8],
|
21 30 | ) -> std::result::Result<crate::operation::fractional_seconds::FractionalSecondsOutput, crate::operation::fractional_seconds::FractionalSecondsError>
|
22 31 | {
|
32 + | /* ProtocolParserGenerator.kt:77 */
|
23 33 | Ok({
|
34 + | /* RustType.kt:516 */
|
24 35 | #[allow(unused_mut)]
|
36 + | /* ProtocolParserGenerator.kt:240 */
|
25 37 | let mut output = crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder::default();
|
38 + | /* ProtocolParserGenerator.kt:247 */
|
26 39 | output = crate::protocol_serde::shape_fractional_seconds::de_fractional_seconds(_response_body, output)
|
27 40 | .map_err(crate::operation::fractional_seconds::FractionalSecondsError::unhandled)?;
|
41 + | /* ClientBuilderInstantiator.kt:56 */
|
28 42 | output.build()
|
43 + | /* ProtocolParserGenerator.kt:77 */
|
29 44 | })
|
45 + | /* ProtocolParserGenerator.kt:71 */
|
30 46 | }
|
31 47 |
|
48 + | /* JsonParserGenerator.kt:148 */
|
32 49 | pub(crate) fn de_fractional_seconds(
|
33 50 | value: &[u8],
|
34 51 | mut builder: crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder,
|
35 52 | ) -> ::std::result::Result<
|
36 53 | crate::operation::fractional_seconds::builders::FractionalSecondsOutputBuilder,
|
37 54 | ::aws_smithy_json::deserialize::error::DeserializeError,
|
38 55 | > {
|
56 + | /* JsonParserGenerator.kt:153 */
|
39 57 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
40 58 | let tokens = &mut tokens_owned;
|
41 59 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
60 + | /* JsonParserGenerator.kt:684 */
|
42 61 | loop {
|
62 + | /* JsonParserGenerator.kt:685 */
|
43 63 | match tokens.next().transpose()? {
|
44 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
45 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
64 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
65 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
66 + | /* JsonParserGenerator.kt:260 */
|
67 + | match key.to_unescaped()?.as_ref() {
|
68 + | /* JsonParserGenerator.kt:262 */
|
46 69 | "datetime" => {
|
47 - | builder = builder.set_datetime(::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
70 + | /* JsonParserGenerator.kt:265 */
|
71 + | builder = builder.set_datetime(
|
72 + | /* JsonParserGenerator.kt:384 */
|
73 + | ::aws_smithy_json::deserialize::token::expect_timestamp_or_null(
|
48 74 | tokens.next(),
|
49 75 | ::aws_smithy_types::date_time::Format::DateTimeWithOffset,
|
50 - | )?);
|
76 + | )?, /* JsonParserGenerator.kt:265 */
|
77 + | );
|
78 + | /* JsonParserGenerator.kt:262 */
|
51 79 | }
|
52 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
53 - | },
|
80 + | /* JsonParserGenerator.kt:290 */
|
81 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
82 + | }
|
83 + | /* JsonParserGenerator.kt:686 */
|
84 + | }
|
85 + | /* JsonParserGenerator.kt:695 */
|
54 86 | other => {
|
55 87 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
56 88 | "expected object key or end object, found: {:?}",
|
57 89 | other
|
58 90 | )))
|
91 + | } /* JsonParserGenerator.kt:685 */
|
59 92 | }
|
93 + | /* JsonParserGenerator.kt:684 */
|
60 94 | }
|
61 - | }
|
95 + | /* JsonParserGenerator.kt:250 */
|
62 96 | if tokens.next().is_some() {
|
97 + | /* JsonParserGenerator.kt:251 */
|
63 98 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
64 99 | "found more JSON tokens after completing parsing",
|
65 100 | ));
|
101 + | /* JsonParserGenerator.kt:250 */
|
66 102 | }
|
103 + | /* JsonParserGenerator.kt:163 */
|
67 104 | Ok(builder)
|
105 + | /* JsonParserGenerator.kt:148 */
|
68 106 | }
|