87 87 | "structure",
|
88 88 | 0,
|
89 89 | );
|
90 90 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_EMPTY_STRUCTURE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
91 91 | ::aws_smithy_schema::ShapeId::from_static(
|
92 92 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$emptyStructure",
|
93 93 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
94 94 | "ComplexStructOperationOutput",
|
95 95 | ),
|
96 96 | ::aws_smithy_schema::ShapeType::Structure,
|
97 - | "empty_structure",
|
97 + | "emptyStructure",
|
98 98 | 1,
|
99 99 | );
|
100 100 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
101 101 | ::aws_smithy_schema::ShapeId::from_static(
|
102 102 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$list",
|
103 103 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
104 104 | "ComplexStructOperationOutput",
|
105 105 | ),
|
106 106 | ::aws_smithy_schema::ShapeType::List,
|
107 107 | "list",
|
108 108 | 2,
|
109 109 | );
|
110 110 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
111 111 | ::aws_smithy_schema::ShapeId::from_static(
|
112 112 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$map",
|
113 113 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
114 114 | "ComplexStructOperationOutput",
|
115 115 | ),
|
116 116 | ::aws_smithy_schema::ShapeType::Map,
|
117 117 | "map",
|
118 118 | 3,
|
119 119 | );
|
120 120 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
121 121 | ::aws_smithy_schema::ShapeId::from_static(
|
122 122 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$union",
|
123 123 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
124 124 | "ComplexStructOperationOutput",
|
125 125 | ),
|
126 126 | ::aws_smithy_schema::ShapeType::Union,
|
127 127 | "union",
|
128 128 | 4,
|
129 129 | );
|
130 130 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
131 131 | ::aws_smithy_schema::ShapeId::from_static(
|
132 132 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$unitUnion",
|
133 133 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
134 134 | "ComplexStructOperationOutput",
|
135 135 | ),
|
136 136 | ::aws_smithy_schema::ShapeType::Union,
|
137 - | "unit_union",
|
137 + | "unitUnion",
|
138 138 | 5,
|
139 139 | );
|
140 140 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
141 141 | ::aws_smithy_schema::ShapeId::from_static(
|
142 142 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$structureList",
|
143 143 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
144 144 | "ComplexStructOperationOutput",
|
145 145 | ),
|
146 146 | ::aws_smithy_schema::ShapeType::List,
|
147 - | "structure_list",
|
147 + | "structureList",
|
148 148 | 6,
|
149 149 | );
|
150 150 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
151 151 | ::aws_smithy_schema::ShapeId::from_static(
|
152 152 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$complexList",
|
153 153 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
154 154 | "ComplexStructOperationOutput",
|
155 155 | ),
|
156 156 | ::aws_smithy_schema::ShapeType::List,
|
157 - | "complex_list",
|
157 + | "complexList",
|
158 158 | 7,
|
159 159 | );
|
160 160 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_MAP: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
161 161 | ::aws_smithy_schema::ShapeId::from_static(
|
162 162 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$complexMap",
|
163 163 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
164 164 | "ComplexStructOperationOutput",
|
165 165 | ),
|
166 166 | ::aws_smithy_schema::ShapeType::Map,
|
167 - | "complex_map",
|
167 + | "complexMap",
|
168 168 | 8,
|
169 169 | );
|
170 170 | static COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
171 171 | ::aws_smithy_schema::ShapeId::from_static(
|
172 172 | "smithy.protocoltests.rpcv2Cbor.synthetic#ComplexStructOperationOutput$complexUnion",
|
173 173 | "smithy.protocoltests.rpcv2Cbor.synthetic",
|
174 174 | "ComplexStructOperationOutput",
|
175 175 | ),
|
176 176 | ::aws_smithy_schema::ShapeType::Union,
|
177 - | "complex_union",
|
177 + | "complexUnion",
|
178 178 | 9,
|
179 179 | );
|
180 180 | static COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
181 181 | COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA_ID,
|
182 182 | ::aws_smithy_schema::ShapeType::Structure,
|
183 183 | &[
|
184 184 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE,
|
185 185 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_EMPTY_STRUCTURE,
|
186 186 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_LIST,
|
187 187 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_MAP,
|
188 188 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION,
|
189 189 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION,
|
190 190 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE_LIST,
|
191 191 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_LIST,
|
192 192 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_MAP,
|
193 193 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION,
|
194 194 | ],
|
195 195 | );
|
196 196 | impl ComplexStructOperationOutput {
|
197 197 | /// The schema for this shape.
|
198 198 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA;
|
199 199 | }
|
200 200 | impl ::aws_smithy_schema::serde::SerializableStruct for ComplexStructOperationOutput {
|
201 201 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
202 202 | fn serialize_members(
|
203 203 | &self,
|
204 204 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
205 205 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
206 206 | if let Some(ref val) = self.structure {
|
207 207 | ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE, val)?;
|
208 208 | }
|
209 209 | if let Some(ref val) = self.empty_structure {
|
210 210 | ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_EMPTY_STRUCTURE, val)?;
|
211 211 | }
|
212 212 | if let Some(ref val) = self.list {
|
213 213 | ser.write_list(
|
214 214 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_LIST,
|
215 215 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
216 216 | for item in val {
|
217 217 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
218 218 | }
|
219 219 | Ok(())
|
220 220 | },
|
221 221 | )?;
|
222 222 | }
|
223 223 | if let Some(ref val) = self.map {
|
224 224 | ser.write_map(
|
225 225 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_MAP,
|
226 226 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
227 227 | for (key, value) in val {
|
228 228 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
229 229 | ser.write_integer(&::aws_smithy_schema::prelude::INTEGER, *value)?;
|
230 230 | }
|
231 231 | Ok(())
|
232 232 | },
|
233 233 | )?;
|
234 234 | }
|
235 235 | if let Some(ref val) = self.union {
|
236 - | ser.write_null(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION)?;
|
236 + | ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNION, val)?;
|
237 237 | }
|
238 238 | if let Some(ref val) = self.unit_union {
|
239 - | ser.write_null(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION)?;
|
239 + | ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_UNIT_UNION, val)?;
|
240 240 | }
|
241 241 | if let Some(ref val) = self.structure_list {
|
242 242 | ser.write_list(
|
243 243 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_STRUCTURE_LIST,
|
244 244 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
245 245 | for item in val {
|
246 246 | ser.write_struct(crate::types::SimpleStruct::SCHEMA, item)?;
|
247 247 | }
|
248 248 | Ok(())
|
249 249 | },
|
250 250 | )?;
|
251 251 | }
|
252 252 | {
|
253 253 | let val = &self.complex_list;
|
254 254 |
|
255 255 | ser.write_list(
|
256 256 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_LIST,
|
257 257 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
258 258 | for item in val {
|
259 - | todo!("schema: unsupported list element type");
|
259 + | ser.write_map(
|
260 + | &::aws_smithy_schema::prelude::DOCUMENT,
|
261 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
262 + | for (key, value) in item {
|
263 + | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
264 + | ser.write_struct(crate::types::ComplexUnion::SCHEMA, value)?;
|
265 + | }
|
266 + | Ok(())
|
267 + | },
|
268 + | )?;
|
260 269 | }
|
261 270 | Ok(())
|
262 271 | },
|
263 272 | )?;
|
264 273 | }
|
265 274 | {
|
266 275 | let val = &self.complex_map;
|
267 276 |
|
268 277 | ser.write_map(
|
269 278 | &COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_MAP,
|
270 279 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
271 280 | for (key, value) in val {
|
272 281 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
273 - | todo!("schema: unsupported map value type");
|
282 + | ser.write_struct(crate::types::ComplexUnion::SCHEMA, value)?;
|
274 283 | }
|
275 284 | Ok(())
|
276 285 | },
|
277 286 | )?;
|
278 287 | }
|
279 288 | {
|
280 289 | let val = &self.complex_union;
|
281 - | ser.write_null(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION)?;
|
290 + | ser.write_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_MEMBER_COMPLEX_UNION, val)?;
|
282 291 | }
|
283 292 | Ok(())
|
284 293 | }
|
285 294 | }
|
286 295 | impl ComplexStructOperationOutput {
|
287 296 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
288 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
289 - | deserializer: &mut D,
|
297 + | pub fn deserialize(
|
298 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
290 299 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
291 300 | #[allow(unused_variables, unused_mut)]
|
292 301 | let mut builder = Self::builder();
|
293 302 | #[allow(
|
294 303 | unused_variables,
|
295 304 | unreachable_code,
|
296 305 | clippy::single_match,
|
297 306 | clippy::match_single_binding,
|
298 307 | clippy::diverging_sub_expression
|
299 308 | )]
|
300 - | deserializer.read_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
|
309 + | deserializer.read_struct(&COMPLEXSTRUCTOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
|
301 310 | match member.member_index() {
|
302 311 | Some(0) => {
|
303 312 | builder.structure = Some(crate::types::SimpleStruct::deserialize(deser)?);
|
304 313 | }
|
305 314 | Some(1) => {
|
306 315 | builder.empty_structure = Some(crate::types::EmptyStruct::deserialize(deser)?);
|
307 316 | }
|
308 317 | Some(2) => {
|
309 - | builder.list = Some({
|
310 - | let container = if let Some(cap) = deser.container_size() {
|
311 - | Vec::with_capacity(cap)
|
312 - | } else {
|
313 - | Vec::new()
|
314 - | };
|
315 - | deser.read_list(member, container, |mut list, deser| {
|
316 - | list.push(deser.read_string(member)?);
|
317 - | Ok(list)
|
318 - | })?
|
319 - | });
|
318 + | builder.list = Some(deser.read_string_list(member)?);
|
320 319 | }
|
321 320 | Some(3) => {
|
322 321 | builder.map = Some({
|
323 - | let container = if let Some(cap) = deser.container_size() {
|
324 - | std::collections::HashMap::with_capacity(cap)
|
325 - | } else {
|
326 - | std::collections::HashMap::new()
|
327 - | };
|
328 - | deser.read_map(member, container, |mut map, key, deser| {
|
329 - | map.insert(key, deser.read_integer(member)?);
|
330 - | Ok(map)
|
331 - | })?
|
322 + | let mut container = std::collections::HashMap::new();
|
323 + | deser.read_map(member, &mut |key, deser| {
|
324 + | container.insert(key, deser.read_integer(member)?);
|
325 + | Ok(())
|
326 + | })?;
|
327 + | container
|
332 328 | });
|
333 329 | }
|
334 330 | Some(4) => {
|
335 - | builder.union = Some({
|
336 - | let _ = member;
|
337 - | todo!("deserialize aggregate")
|
338 - | });
|
331 + | builder.union = Some(crate::types::SimpleUnion::deserialize(deser)?);
|
339 332 | }
|
340 333 | Some(5) => {
|
341 - | builder.unit_union = Some({
|
342 - | let _ = member;
|
343 - | todo!("deserialize aggregate")
|
344 - | });
|
334 + | builder.unit_union = Some(crate::types::UnitUnion::deserialize(deser)?);
|
345 335 | }
|
346 336 | Some(6) => {
|
347 337 | builder.structure_list = Some({
|
348 - | let container = if let Some(cap) = deser.container_size() {
|
349 - | Vec::with_capacity(cap)
|
350 - | } else {
|
351 - | Vec::new()
|
352 - | };
|
353 - | deser.read_list(member, container, |mut list, deser| {
|
354 - | list.push(crate::types::SimpleStruct::deserialize(deser)?);
|
355 - | Ok(list)
|
356 - | })?
|
338 + | let mut container = Vec::new();
|
339 + | deser.read_list(member, &mut |deser| {
|
340 + | container.push(crate::types::SimpleStruct::deserialize(deser)?);
|
341 + | Ok(())
|
342 + | })?;
|
343 + | container
|
357 344 | });
|
358 345 | }
|
359 346 | Some(7) => {
|
360 347 | builder.complex_list = Some({
|
361 - | let container = if let Some(cap) = deser.container_size() {
|
362 - | Vec::with_capacity(cap)
|
363 - | } else {
|
364 - | Vec::new()
|
365 - | };
|
366 - | deser.read_list(member, container, |mut list, deser| {
|
367 - | list.push(todo!("deserialize nested aggregate"));
|
368 - | Ok(list)
|
369 - | })?
|
348 + | let mut container = Vec::new();
|
349 + | deser.read_list(member, &mut |deser| {
|
350 + | container.push({
|
351 + | let mut map = ::std::collections::HashMap::new();
|
352 + | deser.read_map(member, &mut |key, deser| {
|
353 + | let value = crate::types::ComplexUnion::deserialize(deser)?;
|
354 + | map.insert(key, value);
|
355 + | Ok(())
|
356 + | })?;
|
357 + | map
|
358 + | });
|
359 + | Ok(())
|
360 + | })?;
|
361 + | container
|
370 362 | });
|
371 363 | }
|
372 364 | Some(8) => {
|
373 365 | builder.complex_map = Some({
|
374 - | let container = if let Some(cap) = deser.container_size() {
|
375 - | std::collections::HashMap::with_capacity(cap)
|
376 - | } else {
|
377 - | std::collections::HashMap::new()
|
378 - | };
|
379 - | deser.read_map(member, container, |mut map, key, deser| {
|
380 - | map.insert(key, todo!("deserialize nested aggregate"));
|
381 - | Ok(map)
|
382 - | })?
|
366 + | let mut container = std::collections::HashMap::new();
|
367 + | deser.read_map(member, &mut |key, deser| {
|
368 + | container.insert(key, crate::types::ComplexUnion::deserialize(deser)?);
|
369 + | Ok(())
|
370 + | })?;
|
371 + | container
|
383 372 | });
|
384 373 | }
|
385 374 | Some(9) => {
|
386 - | builder.complex_union = Some(Box::new({
|
387 - | let _ = member;
|
388 - | todo!("deserialize aggregate")
|
389 - | }));
|
375 + | builder.complex_union = Some(Box::new(crate::types::ComplexUnion::deserialize(deser)?));
|
390 376 | }
|
391 377 | _ => {}
|
392 378 | }
|
393 379 | Ok(())
|
394 380 | })?;
|
381 + | builder.complex_list = builder.complex_list.or(Some(Vec::new()));
|
382 + | builder.complex_map = builder.complex_map.or(Some(::std::collections::HashMap::new()));
|
395 383 | builder
|
396 384 | .build()
|
397 385 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
398 386 | }
|
399 387 | }
|
388 + | impl ComplexStructOperationOutput {
|
389 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
390 + | pub fn deserialize_with_response(
|
391 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
392 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
393 + | _status: u16,
|
394 + | _body: &[u8],
|
395 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
396 + | Self::deserialize(deserializer)
|
397 + | }
|
398 + | }
|
400 399 | impl ComplexStructOperationOutput {
|
401 400 | /// Creates a new builder-style object to manufacture [`ComplexStructOperationOutput`](crate::operation::complex_struct_operation::ComplexStructOperationOutput).
|
402 401 | pub fn builder() -> crate::operation::complex_struct_operation::builders::ComplexStructOperationOutputBuilder {
|
403 402 | crate::operation::complex_struct_operation::builders::ComplexStructOperationOutputBuilder::default()
|
404 403 | }
|
405 404 | }
|
406 405 |
|
407 406 | /// A builder for [`ComplexStructOperationOutput`](crate::operation::complex_struct_operation::ComplexStructOperationOutput).
|
408 407 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
409 408 | #[non_exhaustive]
|