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