35 35 | "aws.protocoltests.restxml.synthetic",
|
36 36 | "NestedXmlMapsOutput",
|
37 37 | );
|
38 38 | static NESTEDXMLMAPSOUTPUT_MEMBER_NESTED_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
39 39 | ::aws_smithy_schema::ShapeId::from_static(
|
40 40 | "aws.protocoltests.restxml.synthetic#NestedXmlMapsOutput$nestedMap",
|
41 41 | "aws.protocoltests.restxml.synthetic",
|
42 42 | "NestedXmlMapsOutput",
|
43 43 | ),
|
44 44 | ::aws_smithy_schema::ShapeType::Map,
|
45 - | "nested_map",
|
45 + | "nestedMap",
|
46 46 | 0,
|
47 47 | );
|
48 48 | static NESTEDXMLMAPSOUTPUT_MEMBER_FLAT_NESTED_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
49 49 | ::aws_smithy_schema::ShapeId::from_static(
|
50 50 | "aws.protocoltests.restxml.synthetic#NestedXmlMapsOutput$flatNestedMap",
|
51 51 | "aws.protocoltests.restxml.synthetic",
|
52 52 | "NestedXmlMapsOutput",
|
53 53 | ),
|
54 54 | ::aws_smithy_schema::ShapeType::Map,
|
55 - | "flat_nested_map",
|
55 + | "flatNestedMap",
|
56 56 | 1,
|
57 57 | )
|
58 58 | .with_xml_flattened();
|
59 59 | static NESTEDXMLMAPSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
60 60 | NESTEDXMLMAPSOUTPUT_SCHEMA_ID,
|
61 61 | ::aws_smithy_schema::ShapeType::Structure,
|
62 62 | &[&NESTEDXMLMAPSOUTPUT_MEMBER_NESTED_MAP, &NESTEDXMLMAPSOUTPUT_MEMBER_FLAT_NESTED_MAP],
|
63 63 | );
|
64 64 | impl NestedXmlMapsOutput {
|
65 65 | /// The schema for this shape.
|
66 66 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &NESTEDXMLMAPSOUTPUT_SCHEMA;
|
67 67 | }
|
68 68 | impl ::aws_smithy_schema::serde::SerializableStruct for NestedXmlMapsOutput {
|
69 69 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
70 70 | fn serialize_members(
|
71 71 | &self,
|
72 72 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
73 73 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
74 74 | if let Some(ref val) = self.nested_map {
|
75 75 | ser.write_map(
|
76 76 | &NESTEDXMLMAPSOUTPUT_MEMBER_NESTED_MAP,
|
77 77 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
78 78 | for (key, value) in val {
|
79 79 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
80 - | todo!("schema: unsupported map value type");
|
80 + |
|
81 + | ser.write_map(
|
82 + | &::aws_smithy_schema::prelude::DOCUMENT,
|
83 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
84 + | for (key, value) in value {
|
85 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
86 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, value.as_str())?;
|
87 + | }
|
88 + | Ok(())
|
89 + | },
|
90 + | )?;
|
81 91 | }
|
82 92 | Ok(())
|
83 93 | },
|
84 94 | )?;
|
85 95 | }
|
86 96 | if let Some(ref val) = self.flat_nested_map {
|
87 97 | ser.write_map(
|
88 98 | &NESTEDXMLMAPSOUTPUT_MEMBER_FLAT_NESTED_MAP,
|
89 99 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
90 100 | for (key, value) in val {
|
91 101 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
92 - | todo!("schema: unsupported map value type");
|
102 + |
|
103 + | ser.write_map(
|
104 + | &::aws_smithy_schema::prelude::DOCUMENT,
|
105 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
106 + | for (key, value) in value {
|
107 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
108 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, value.as_str())?;
|
109 + | }
|
110 + | Ok(())
|
111 + | },
|
112 + | )?;
|
93 113 | }
|
94 114 | Ok(())
|
95 115 | },
|
96 116 | )?;
|
97 117 | }
|
98 118 | Ok(())
|
99 119 | }
|
100 120 | }
|
101 121 | impl NestedXmlMapsOutput {
|
102 122 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
103 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
104 - | deserializer: &mut D,
|
123 + | pub fn deserialize(
|
124 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
105 125 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
106 126 | #[allow(unused_variables, unused_mut)]
|
107 127 | let mut builder = Self::builder();
|
108 128 | #[allow(
|
109 129 | unused_variables,
|
110 130 | unreachable_code,
|
111 131 | clippy::single_match,
|
112 132 | clippy::match_single_binding,
|
113 133 | clippy::diverging_sub_expression
|
114 134 | )]
|
115 - | deserializer.read_struct(&NESTEDXMLMAPSOUTPUT_SCHEMA, (), |_, member, deser| {
|
135 + | deserializer.read_struct(&NESTEDXMLMAPSOUTPUT_SCHEMA, &mut |member, deser| {
|
116 136 | match member.member_index() {
|
117 137 | Some(0) => {
|
118 138 | builder.nested_map = Some({
|
119 - | let container = if let Some(cap) = deser.container_size() {
|
120 - | std::collections::HashMap::with_capacity(cap)
|
121 - | } else {
|
122 - | std::collections::HashMap::new()
|
123 - | };
|
124 - | deser.read_map(member, container, |mut map, key, deser| {
|
125 - | map.insert(key, todo!("deserialize nested aggregate"));
|
126 - | Ok(map)
|
127 - | })?
|
139 + | let mut container = std::collections::HashMap::new();
|
140 + | deser.read_map(member, &mut |key, deser| {
|
141 + | container.insert(key, {
|
142 + | let mut map = ::std::collections::HashMap::new();
|
143 + | deser.read_map(member, &mut |key, deser| {
|
144 + | let value = crate::types::FooEnum::from(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?.as_str());
|
145 + | map.insert(key, value);
|
146 + | Ok(())
|
147 + | })?;
|
148 + | map
|
149 + | });
|
150 + | Ok(())
|
151 + | })?;
|
152 + | container
|
128 153 | });
|
129 154 | }
|
130 155 | Some(1) => {
|
131 156 | builder.flat_nested_map = Some({
|
132 - | let container = if let Some(cap) = deser.container_size() {
|
133 - | std::collections::HashMap::with_capacity(cap)
|
134 - | } else {
|
135 - | std::collections::HashMap::new()
|
136 - | };
|
137 - | deser.read_map(member, container, |mut map, key, deser| {
|
138 - | map.insert(key, todo!("deserialize nested aggregate"));
|
139 - | Ok(map)
|
140 - | })?
|
157 + | let mut container = std::collections::HashMap::new();
|
158 + | deser.read_map(member, &mut |key, deser| {
|
159 + | container.insert(key, {
|
160 + | let mut map = ::std::collections::HashMap::new();
|
161 + | deser.read_map(member, &mut |key, deser| {
|
162 + | let value = crate::types::FooEnum::from(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?.as_str());
|
163 + | map.insert(key, value);
|
164 + | Ok(())
|
165 + | })?;
|
166 + | map
|
167 + | });
|
168 + | Ok(())
|
169 + | })?;
|
170 + | container
|
141 171 | });
|
142 172 | }
|
143 173 | _ => {}
|
144 174 | }
|
145 175 | Ok(())
|
146 176 | })?;
|
147 177 | Ok(builder.build())
|
148 178 | }
|
149 179 | }
|
180 + | impl NestedXmlMapsOutput {
|
181 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
182 + | pub fn deserialize_with_response(
|
183 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
184 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
185 + | _status: u16,
|
186 + | _body: &[u8],
|
187 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
188 + | Self::deserialize(deserializer)
|
189 + | }
|
190 + | }
|
150 191 | impl NestedXmlMapsOutput {
|
151 192 | /// Creates a new builder-style object to manufacture [`NestedXmlMapsOutput`](crate::operation::nested_xml_maps::NestedXmlMapsOutput).
|
152 193 | pub fn builder() -> crate::operation::nested_xml_maps::builders::NestedXmlMapsOutputBuilder {
|
153 194 | crate::operation::nested_xml_maps::builders::NestedXmlMapsOutputBuilder::default()
|
154 195 | }
|
155 196 | }
|
156 197 |
|
157 198 | /// A builder for [`NestedXmlMapsOutput`](crate::operation::nested_xml_maps::NestedXmlMapsOutput).
|
158 199 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
159 200 | #[non_exhaustive]
|