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_flattened_xml_map_with_xml_name_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<
|
8 10 | crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
|
9 11 | crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
|
10 12 | > {
|
13 + | /* RustType.kt:516 */
|
11 14 | #[allow(unused_mut)]
|
15 + | /* ProtocolParserGenerator.kt:106 */
|
12 16 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 17 | .map_err(crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError::unhandled)?;
|
18 + | /* ProtocolParserGenerator.kt:120 */
|
14 19 | let generic = generic_builder.build();
|
20 + | /* ProtocolParserGenerator.kt:185 */
|
15 21 | Err(crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError::generic(generic))
|
22 + | /* ProtocolParserGenerator.kt:99 */
|
16 23 | }
|
17 24 |
|
25 + | /* RustType.kt:516 */
|
18 26 | #[allow(clippy::unnecessary_wraps)]
|
27 + | /* ProtocolParserGenerator.kt:71 */
|
19 28 | pub fn de_flattened_xml_map_with_xml_name_http_response(
|
20 29 | _response_status: u16,
|
21 30 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
22 31 | _response_body: &[u8],
|
23 32 | ) -> std::result::Result<
|
24 33 | crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameOutput,
|
25 34 | crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError,
|
26 35 | > {
|
36 + | /* ProtocolParserGenerator.kt:77 */
|
27 37 | Ok({
|
38 + | /* RustType.kt:516 */
|
28 39 | #[allow(unused_mut)]
|
40 + | /* ProtocolParserGenerator.kt:240 */
|
29 41 | let mut output = crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameOutputBuilder::default();
|
42 + | /* ProtocolParserGenerator.kt:247 */
|
30 43 | output = crate::protocol_serde::shape_flattened_xml_map_with_xml_name::de_flattened_xml_map_with_xml_name(_response_body, output)
|
31 44 | .map_err(crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameError::unhandled)?;
|
45 + | /* ClientBuilderInstantiator.kt:56 */
|
32 46 | output.build()
|
47 + | /* ProtocolParserGenerator.kt:77 */
|
33 48 | })
|
49 + | /* ProtocolParserGenerator.kt:71 */
|
34 50 | }
|
35 51 |
|
52 + | /* XmlBindingTraitSerializerGenerator.kt:116 */
|
36 53 | pub fn ser_flattened_xml_map_with_xml_name_op_input(
|
37 54 | input: &crate::operation::flattened_xml_map_with_xml_name::FlattenedXmlMapWithXmlNameInput,
|
38 55 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
56 + | /* XmlBindingTraitSerializerGenerator.kt:120 */
|
39 57 | let mut out = String::new();
|
58 + | /* XmlBindingTraitSerializerGenerator.kt:124 */
|
40 59 | {
|
60 + | /* XmlBindingTraitSerializerGenerator.kt:125 */
|
41 61 | let mut writer = ::aws_smithy_xml::encode::XmlWriter::new(&mut out);
|
42 62 | #[allow(unused_mut)]
|
43 63 | let mut root = writer.start_el("FlattenedXmlMapWithXmlNameRequest");
|
64 + | /* XmlBindingTraitSerializerGenerator.kt:440 */
|
44 65 | crate::protocol_serde::shape_flattened_xml_map_with_xml_name_input::ser_flattened_xml_map_with_xml_name_input_input_input(input, root)?
|
66 + | /* XmlBindingTraitSerializerGenerator.kt:124 */
|
45 67 | }
|
68 + | /* XmlBindingTraitSerializerGenerator.kt:137 */
|
46 69 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|
70 + | /* XmlBindingTraitSerializerGenerator.kt:116 */
|
47 71 | }
|
48 72 |
|
73 + | /* RustType.kt:516 */
|
49 74 | #[allow(unused_mut)]
|
75 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
50 76 | pub fn de_flattened_xml_map_with_xml_name(
|
51 77 | inp: &[u8],
|
52 78 | mut builder: crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameOutputBuilder,
|
53 79 | ) -> std::result::Result<
|
54 80 | crate::operation::flattened_xml_map_with_xml_name::builders::FlattenedXmlMapWithXmlNameOutputBuilder,
|
55 81 | ::aws_smithy_xml::decode::XmlDecodeError,
|
56 82 | > {
|
83 + | /* XmlBindingTraitParserGenerator.kt:194 */
|
57 84 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
58 85 |
|
59 86 | #[allow(unused_mut)]
|
60 87 | let mut decoder = doc.root_element()?;
|
61 88 | #[allow(unused_variables)]
|
62 89 | let start_el = decoder.start_el();
|
90 + | /* RestXmlParserGenerator.kt:36 */
|
63 91 | if !start_el.matches("FlattenedXmlMapWithXmlNameResponse") {
|
64 92 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
65 93 | "encountered invalid XML root: expected FlattenedXmlMapWithXmlNameResponse but got {:?}. This is likely a bug in the SDK.",
|
66 94 | start_el
|
67 95 | )));
|
68 96 | }
|
97 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
69 98 | while let Some(mut tag) = decoder.next_tag() {
|
99 + | /* XmlBindingTraitParserGenerator.kt:353 */
|
70 100 | match tag.start_el() {
|
71 - | s if s.matches("KVP") /* myMap aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNameOutput$myMap */ => {
|
72 - | let var_1 =
|
73 - | Some(
|
74 - | Result::<::std::collections::HashMap::<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
|
75 - | let mut map_2 = builder.my_map.take().unwrap_or_default();
|
101 + | /* XmlBindingTraitParserGenerator.kt:492 */s if s.matches("KVP") /* myMap aws.protocoltests.restxml.synthetic#FlattenedXmlMapWithXmlNameOutput$myMap */ => {
|
102 + | /* XmlBindingTraitParserGenerator.kt:329 */let var_1 =
|
103 + | /* XmlBindingTraitParserGenerator.kt:372 */Some(
|
104 + | /* XmlBindingTraitParserGenerator.kt:609 */Result::<::std::collections::HashMap::<::std::string::String, ::std::string::String>, ::aws_smithy_xml::decode::XmlDecodeError>::Ok({
|
105 + | /* XmlBindingTraitParserGenerator.kt:611 */let mut map_2 = builder.my_map.take().unwrap_or_default();
|
76 106 | crate::protocol_serde::shape_flattened_xml_map_with_xml_name_input_output_map::de_flattened_xml_map_with_xml_name_input_output_map_entry(&mut tag, &mut map_2)?;
|
77 107 | map_2
|
78 - | })
|
79 - | ?
|
80 - | )
|
81 - | ;
|
82 - | builder = builder.set_my_map(var_1);
|
83 - | }
|
108 + | /* XmlBindingTraitParserGenerator.kt:609 */})
|
109 + | /* XmlBindingTraitParserGenerator.kt:402 */?
|
110 + | /* XmlBindingTraitParserGenerator.kt:372 */)
|
111 + | /* XmlBindingTraitParserGenerator.kt:329 */;
|
112 + | /* XmlBindingTraitParserGenerator.kt:336 */builder = builder.set_my_map(var_1);
|
113 + | /* XmlBindingTraitParserGenerator.kt:492 */}
|
84 114 | ,
|
85 - | _ => {}
|
86 - | }
|
115 + | /* XmlBindingTraitParserGenerator.kt:356 */_ => {}
|
116 + | /* XmlBindingTraitParserGenerator.kt:353 */}
|
117 + | /* XmlBindingTraitParserGenerator.kt:352 */
|
87 118 | }
|
119 + | /* XmlBindingTraitParserGenerator.kt:213 */
|
88 120 | Ok(builder)
|
121 + | /* XmlBindingTraitParserGenerator.kt:189 */
|
89 122 | }
|