83 83 | "aws.protocoltests.restjson.synthetic",
|
84 84 | "JsonListsInput",
|
85 85 | );
|
86 86 | static JSONLISTSINPUT_MEMBER_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
87 87 | ::aws_smithy_schema::ShapeId::from_static(
|
88 88 | "aws.protocoltests.restjson.synthetic#JsonListsInput$stringList",
|
89 89 | "aws.protocoltests.restjson.synthetic",
|
90 90 | "JsonListsInput",
|
91 91 | ),
|
92 92 | ::aws_smithy_schema::ShapeType::List,
|
93 - | "string_list",
|
93 + | "stringList",
|
94 94 | 0,
|
95 95 | );
|
96 96 | static JSONLISTSINPUT_MEMBER_STRING_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
97 97 | ::aws_smithy_schema::ShapeId::from_static(
|
98 98 | "aws.protocoltests.restjson.synthetic#JsonListsInput$stringSet",
|
99 99 | "aws.protocoltests.restjson.synthetic",
|
100 100 | "JsonListsInput",
|
101 101 | ),
|
102 102 | ::aws_smithy_schema::ShapeType::List,
|
103 - | "string_set",
|
103 + | "stringSet",
|
104 104 | 1,
|
105 105 | );
|
106 106 | static JSONLISTSINPUT_MEMBER_INTEGER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
107 107 | ::aws_smithy_schema::ShapeId::from_static(
|
108 108 | "aws.protocoltests.restjson.synthetic#JsonListsInput$integerList",
|
109 109 | "aws.protocoltests.restjson.synthetic",
|
110 110 | "JsonListsInput",
|
111 111 | ),
|
112 112 | ::aws_smithy_schema::ShapeType::List,
|
113 - | "integer_list",
|
113 + | "integerList",
|
114 114 | 2,
|
115 115 | );
|
116 116 | static JSONLISTSINPUT_MEMBER_BOOLEAN_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
117 117 | ::aws_smithy_schema::ShapeId::from_static(
|
118 118 | "aws.protocoltests.restjson.synthetic#JsonListsInput$booleanList",
|
119 119 | "aws.protocoltests.restjson.synthetic",
|
120 120 | "JsonListsInput",
|
121 121 | ),
|
122 122 | ::aws_smithy_schema::ShapeType::List,
|
123 - | "boolean_list",
|
123 + | "booleanList",
|
124 124 | 3,
|
125 125 | );
|
126 126 | static JSONLISTSINPUT_MEMBER_TIMESTAMP_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
127 127 | ::aws_smithy_schema::ShapeId::from_static(
|
128 128 | "aws.protocoltests.restjson.synthetic#JsonListsInput$timestampList",
|
129 129 | "aws.protocoltests.restjson.synthetic",
|
130 130 | "JsonListsInput",
|
131 131 | ),
|
132 132 | ::aws_smithy_schema::ShapeType::List,
|
133 - | "timestamp_list",
|
133 + | "timestampList",
|
134 134 | 4,
|
135 135 | );
|
136 136 | static JSONLISTSINPUT_MEMBER_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
137 137 | ::aws_smithy_schema::ShapeId::from_static(
|
138 138 | "aws.protocoltests.restjson.synthetic#JsonListsInput$enumList",
|
139 139 | "aws.protocoltests.restjson.synthetic",
|
140 140 | "JsonListsInput",
|
141 141 | ),
|
142 142 | ::aws_smithy_schema::ShapeType::List,
|
143 - | "enum_list",
|
143 + | "enumList",
|
144 144 | 5,
|
145 145 | );
|
146 146 | static JSONLISTSINPUT_MEMBER_INT_ENUM_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
147 147 | ::aws_smithy_schema::ShapeId::from_static(
|
148 148 | "aws.protocoltests.restjson.synthetic#JsonListsInput$intEnumList",
|
149 149 | "aws.protocoltests.restjson.synthetic",
|
150 150 | "JsonListsInput",
|
151 151 | ),
|
152 152 | ::aws_smithy_schema::ShapeType::List,
|
153 - | "int_enum_list",
|
153 + | "intEnumList",
|
154 154 | 6,
|
155 155 | );
|
156 156 | static JSONLISTSINPUT_MEMBER_NESTED_STRING_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
157 157 | ::aws_smithy_schema::ShapeId::from_static(
|
158 158 | "aws.protocoltests.restjson.synthetic#JsonListsInput$nestedStringList",
|
159 159 | "aws.protocoltests.restjson.synthetic",
|
160 160 | "JsonListsInput",
|
161 161 | ),
|
162 162 | ::aws_smithy_schema::ShapeType::List,
|
163 - | "nested_string_list",
|
163 + | "nestedStringList",
|
164 164 | 7,
|
165 165 | );
|
166 166 | static JSONLISTSINPUT_MEMBER_STRUCTURE_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
167 167 | ::aws_smithy_schema::ShapeId::from_static(
|
168 168 | "aws.protocoltests.restjson.synthetic#JsonListsInput$structureList",
|
169 169 | "aws.protocoltests.restjson.synthetic",
|
170 170 | "JsonListsInput",
|
171 171 | ),
|
172 172 | ::aws_smithy_schema::ShapeType::List,
|
173 - | "structure_list",
|
173 + | "structureList",
|
174 174 | 8,
|
175 175 | )
|
176 176 | .with_json_name("myStructureList");
|
177 177 | static JSONLISTSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
178 178 | JSONLISTSINPUT_SCHEMA_ID,
|
179 179 | ::aws_smithy_schema::ShapeType::Structure,
|
180 180 | &[
|
181 181 | &JSONLISTSINPUT_MEMBER_STRING_LIST,
|
182 182 | &JSONLISTSINPUT_MEMBER_STRING_SET,
|
183 183 | &JSONLISTSINPUT_MEMBER_INTEGER_LIST,
|
184 184 | &JSONLISTSINPUT_MEMBER_BOOLEAN_LIST,
|
185 185 | &JSONLISTSINPUT_MEMBER_TIMESTAMP_LIST,
|
186 186 | &JSONLISTSINPUT_MEMBER_ENUM_LIST,
|
187 187 | &JSONLISTSINPUT_MEMBER_INT_ENUM_LIST,
|
188 188 | &JSONLISTSINPUT_MEMBER_NESTED_STRING_LIST,
|
189 189 | &JSONLISTSINPUT_MEMBER_STRUCTURE_LIST,
|
190 190 | ],
|
191 - | );
|
191 + | )
|
192 + | .with_http(aws_smithy_schema::traits::HttpTrait::new("PUT", "/JsonLists", None));
|
192 193 | impl JsonListsInput {
|
193 194 | /// The schema for this shape.
|
194 195 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &JSONLISTSINPUT_SCHEMA;
|
195 196 | }
|
196 197 | impl ::aws_smithy_schema::serde::SerializableStruct for JsonListsInput {
|
197 198 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
198 199 | fn serialize_members(
|
199 200 | &self,
|
200 201 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
201 202 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
274 275 | }
|
275 276 | Ok(())
|
276 277 | },
|
277 278 | )?;
|
278 279 | }
|
279 280 | if let Some(ref val) = self.nested_string_list {
|
280 281 | ser.write_list(
|
281 282 | &JSONLISTSINPUT_MEMBER_NESTED_STRING_LIST,
|
282 283 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
283 284 | for item in val {
|
284 - | todo!("schema: unsupported list element type");
|
285 + | ser.write_list(
|
286 + | &::aws_smithy_schema::prelude::DOCUMENT,
|
287 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
288 + | for item in item {
|
289 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
290 + | }
|
291 + | Ok(())
|
292 + | },
|
293 + | )?;
|
285 294 | }
|
286 295 | Ok(())
|
287 296 | },
|
288 297 | )?;
|
289 298 | }
|
290 299 | if let Some(ref val) = self.structure_list {
|
291 300 | ser.write_list(
|
292 301 | &JSONLISTSINPUT_MEMBER_STRUCTURE_LIST,
|
293 302 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
294 303 | for item in val {
|
295 304 | ser.write_struct(crate::types::StructureListMember::SCHEMA, item)?;
|
296 305 | }
|
297 306 | Ok(())
|
298 307 | },
|
299 308 | )?;
|
300 309 | }
|
301 310 | Ok(())
|
302 311 | }
|
303 312 | }
|
304 313 | impl JsonListsInput {
|
305 314 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
306 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
307 - | deserializer: &mut D,
|
315 + | pub fn deserialize(
|
316 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
308 317 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
309 318 | #[allow(unused_variables, unused_mut)]
|
310 319 | let mut builder = Self::builder();
|
311 320 | #[allow(
|
312 321 | unused_variables,
|
313 322 | unreachable_code,
|
314 323 | clippy::single_match,
|
315 324 | clippy::match_single_binding,
|
316 325 | clippy::diverging_sub_expression
|
317 326 | )]
|
318 - | deserializer.read_struct(&JSONLISTSINPUT_SCHEMA, (), |_, member, deser| {
|
327 + | deserializer.read_struct(&JSONLISTSINPUT_SCHEMA, &mut |member, deser| {
|
319 328 | match member.member_index() {
|
320 329 | Some(0) => {
|
321 - | builder.string_list = Some({
|
322 - | let container = if let Some(cap) = deser.container_size() {
|
323 - | Vec::with_capacity(cap)
|
324 - | } else {
|
325 - | Vec::new()
|
326 - | };
|
327 - | deser.read_list(member, container, |mut list, deser| {
|
328 - | list.push(deser.read_string(member)?);
|
329 - | Ok(list)
|
330 - | })?
|
331 - | });
|
330 + | builder.string_list = Some(deser.read_string_list(member)?);
|
332 331 | }
|
333 332 | Some(1) => {
|
334 - | builder.string_set = Some({
|
335 - | let container = if let Some(cap) = deser.container_size() {
|
336 - | Vec::with_capacity(cap)
|
337 - | } else {
|
338 - | Vec::new()
|
339 - | };
|
340 - | deser.read_list(member, container, |mut list, deser| {
|
341 - | list.push(deser.read_string(member)?);
|
342 - | Ok(list)
|
343 - | })?
|
344 - | });
|
333 + | builder.string_set = Some(deser.read_string_list(member)?);
|
345 334 | }
|
346 335 | Some(2) => {
|
347 - | builder.integer_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(deser.read_integer(member)?);
|
355 - | Ok(list)
|
356 - | })?
|
357 - | });
|
336 + | builder.integer_list = Some(deser.read_integer_list(member)?);
|
358 337 | }
|
359 338 | Some(3) => {
|
360 339 | builder.boolean_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(deser.read_boolean(member)?);
|
368 - | Ok(list)
|
369 - | })?
|
340 + | let mut container = Vec::new();
|
341 + | deser.read_list(member, &mut |deser| {
|
342 + | container.push(deser.read_boolean(member)?);
|
343 + | Ok(())
|
344 + | })?;
|
345 + | container
|
370 346 | });
|
371 347 | }
|
372 348 | Some(4) => {
|
373 349 | builder.timestamp_list = Some({
|
374 - | let container = if let Some(cap) = deser.container_size() {
|
375 - | Vec::with_capacity(cap)
|
376 - | } else {
|
377 - | Vec::new()
|
378 - | };
|
379 - | deser.read_list(member, container, |mut list, deser| {
|
380 - | list.push(deser.read_timestamp(member)?);
|
381 - | Ok(list)
|
382 - | })?
|
350 + | let mut container = Vec::new();
|
351 + | deser.read_list(member, &mut |deser| {
|
352 + | container.push(deser.read_timestamp(member)?);
|
353 + | Ok(())
|
354 + | })?;
|
355 + | container
|
383 356 | });
|
384 357 | }
|
385 358 | Some(5) => {
|
386 359 | builder.enum_list = Some({
|
387 - | let container = if let Some(cap) = deser.container_size() {
|
388 - | Vec::with_capacity(cap)
|
389 - | } else {
|
390 - | Vec::new()
|
391 - | };
|
392 - | deser.read_list(member, container, |mut list, deser| {
|
393 - | list.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
|
394 - | Ok(list)
|
395 - | })?
|
360 + | let mut container = Vec::new();
|
361 + | deser.read_list(member, &mut |deser| {
|
362 + | container.push(crate::types::FooEnum::from(deser.read_string(member)?.as_str()));
|
363 + | Ok(())
|
364 + | })?;
|
365 + | container
|
396 366 | });
|
397 367 | }
|
398 368 | Some(6) => {
|
399 - | builder.int_enum_list = Some({
|
400 - | let container = if let Some(cap) = deser.container_size() {
|
401 - | Vec::with_capacity(cap)
|
402 - | } else {
|
403 - | Vec::new()
|
404 - | };
|
405 - | deser.read_list(member, container, |mut list, deser| {
|
406 - | list.push(deser.read_integer(member)?);
|
407 - | Ok(list)
|
408 - | })?
|
409 - | });
|
369 + | builder.int_enum_list = Some(deser.read_integer_list(member)?);
|
410 370 | }
|
411 371 | Some(7) => {
|
412 372 | builder.nested_string_list = Some({
|
413 - | let container = if let Some(cap) = deser.container_size() {
|
414 - | Vec::with_capacity(cap)
|
415 - | } else {
|
416 - | Vec::new()
|
417 - | };
|
418 - | deser.read_list(member, container, |mut list, deser| {
|
419 - | list.push(todo!("deserialize nested aggregate"));
|
420 - | Ok(list)
|
421 - | })?
|
373 + | let mut container = Vec::new();
|
374 + | deser.read_list(member, &mut |deser| {
|
375 + | container.push({
|
376 + | let mut list = Vec::new();
|
377 + | deser.read_list(member, &mut |deser| {
|
378 + | list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
|
379 + | Ok(())
|
380 + | })?;
|
381 + | list
|
382 + | });
|
383 + | Ok(())
|
384 + | })?;
|
385 + | container
|
422 386 | });
|
423 387 | }
|
424 388 | Some(8) => {
|
425 389 | builder.structure_list = Some({
|
426 - | let container = if let Some(cap) = deser.container_size() {
|
427 - | Vec::with_capacity(cap)
|
428 - | } else {
|
429 - | Vec::new()
|
430 - | };
|
431 - | deser.read_list(member, container, |mut list, deser| {
|
432 - | list.push(crate::types::StructureListMember::deserialize(deser)?);
|
433 - | Ok(list)
|
434 - | })?
|
390 + | let mut container = Vec::new();
|
391 + | deser.read_list(member, &mut |deser| {
|
392 + | container.push(crate::types::StructureListMember::deserialize(deser)?);
|
393 + | Ok(())
|
394 + | })?;
|
395 + | container
|
435 396 | });
|
436 397 | }
|
437 398 | _ => {}
|
438 399 | }
|
439 400 | Ok(())
|
440 401 | })?;
|
441 402 | builder
|
442 403 | .build()
|
443 404 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
444 405 | }
|
445 406 | }
|
407 + | impl JsonListsInput {
|
408 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
409 + | pub fn deserialize_with_response(
|
410 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
411 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
412 + | _status: u16,
|
413 + | _body: &[u8],
|
414 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
415 + | Self::deserialize(deserializer)
|
416 + | }
|
417 + | }
|
446 418 | impl JsonListsInput {
|
447 419 | /// Creates a new builder-style object to manufacture [`JsonListsInput`](crate::operation::json_lists::JsonListsInput).
|
448 420 | pub fn builder() -> crate::operation::json_lists::builders::JsonListsInputBuilder {
|
449 421 | crate::operation::json_lists::builders::JsonListsInputBuilder::default()
|
450 422 | }
|
451 423 | }
|
452 424 |
|
453 425 | /// A builder for [`JsonListsInput`](crate::operation::json_lists::JsonListsInput).
|
454 426 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
455 427 | #[non_exhaustive]
|