22 22 | "aws.protocoltests.restxml.synthetic#QueryParamsAsStringListMapInput",
|
23 23 | "aws.protocoltests.restxml.synthetic",
|
24 24 | "QueryParamsAsStringListMapInput",
|
25 25 | );
|
26 26 | static QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_QUX: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
27 27 | ::aws_smithy_schema::ShapeId::from_static(
|
28 28 | "aws.protocoltests.restxml.synthetic#QueryParamsAsStringListMapInput$qux",
|
29 29 | "aws.protocoltests.restxml.synthetic",
|
30 30 | "QueryParamsAsStringListMapInput",
|
31 31 | ),
|
32 32 | ::aws_smithy_schema::ShapeType::String,
|
33 33 | "qux",
|
34 34 | 0,
|
35 35 | )
|
36 36 | .with_http_query("corge");
|
37 37 | static QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_FOO: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
38 38 | ::aws_smithy_schema::ShapeId::from_static(
|
39 39 | "aws.protocoltests.restxml.synthetic#QueryParamsAsStringListMapInput$foo",
|
40 40 | "aws.protocoltests.restxml.synthetic",
|
41 41 | "QueryParamsAsStringListMapInput",
|
42 42 | ),
|
43 43 | ::aws_smithy_schema::ShapeType::Map,
|
44 44 | "foo",
|
45 45 | 1,
|
46 46 | )
|
47 47 | .with_http_query_params();
|
48 48 | static QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
49 49 | QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA_ID,
|
50 50 | ::aws_smithy_schema::ShapeType::Structure,
|
51 51 | &[&QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_QUX, &QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_FOO],
|
52 - | );
|
52 + | )
|
53 + | .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/StringListMap", None));
|
53 54 | impl QueryParamsAsStringListMapInput {
|
54 55 | /// The schema for this shape.
|
55 56 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA;
|
56 57 | }
|
57 58 | impl ::aws_smithy_schema::serde::SerializableStruct for QueryParamsAsStringListMapInput {
|
58 59 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
59 60 | fn serialize_members(
|
60 61 | &self,
|
61 62 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
62 63 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
63 64 | if let Some(ref val) = self.qux {
|
64 65 | ser.write_string(&QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_QUX, val)?;
|
65 66 | }
|
66 67 | if let Some(ref val) = self.foo {
|
67 68 | ser.write_map(
|
68 69 | &QUERYPARAMSASSTRINGLISTMAPINPUT_MEMBER_FOO,
|
69 70 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
70 71 | for (key, value) in val {
|
71 72 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
72 - | todo!("schema: unsupported map value type");
|
73 + |
|
74 + | ser.write_list(
|
75 + | &::aws_smithy_schema::prelude::DOCUMENT,
|
76 + | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
77 + | for item in value {
|
78 + | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
79 + | }
|
80 + | Ok(())
|
81 + | },
|
82 + | )?;
|
73 83 | }
|
74 84 | Ok(())
|
75 85 | },
|
76 86 | )?;
|
77 87 | }
|
78 88 | Ok(())
|
79 89 | }
|
80 90 | }
|
81 91 | impl QueryParamsAsStringListMapInput {
|
82 92 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
83 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
84 - | deserializer: &mut D,
|
93 + | pub fn deserialize(
|
94 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
85 95 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
86 96 | #[allow(unused_variables, unused_mut)]
|
87 97 | let mut builder = Self::builder();
|
88 98 | #[allow(
|
89 99 | unused_variables,
|
90 100 | unreachable_code,
|
91 101 | clippy::single_match,
|
92 102 | clippy::match_single_binding,
|
93 103 | clippy::diverging_sub_expression
|
94 104 | )]
|
95 - | deserializer.read_struct(&QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA, (), |_, member, deser| {
|
105 + | deserializer.read_struct(&QUERYPARAMSASSTRINGLISTMAPINPUT_SCHEMA, &mut |member, deser| {
|
96 106 | match member.member_index() {
|
97 107 | Some(0) => {
|
98 108 | builder.qux = Some(deser.read_string(member)?);
|
99 109 | }
|
100 110 | Some(1) => {
|
101 111 | builder.foo = Some({
|
102 - | let container = if let Some(cap) = deser.container_size() {
|
103 - | std::collections::HashMap::with_capacity(cap)
|
104 - | } else {
|
105 - | std::collections::HashMap::new()
|
106 - | };
|
107 - | deser.read_map(member, container, |mut map, key, deser| {
|
108 - | map.insert(key, todo!("deserialize nested aggregate"));
|
109 - | Ok(map)
|
110 - | })?
|
112 + | let mut container = std::collections::HashMap::new();
|
113 + | deser.read_map(member, &mut |key, deser| {
|
114 + | container.insert(key, {
|
115 + | let mut list = Vec::new();
|
116 + | deser.read_list(member, &mut |deser| {
|
117 + | list.push(deser.read_string(&::aws_smithy_schema::prelude::DOCUMENT)?);
|
118 + | Ok(())
|
119 + | })?;
|
120 + | list
|
121 + | });
|
122 + | Ok(())
|
123 + | })?;
|
124 + | container
|
111 125 | });
|
112 126 | }
|
113 127 | _ => {}
|
114 128 | }
|
115 129 | Ok(())
|
116 130 | })?;
|
117 131 | builder
|
118 132 | .build()
|
119 133 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
120 134 | }
|
121 135 | }
|
136 + | impl QueryParamsAsStringListMapInput {
|
137 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
138 + | pub fn deserialize_with_response(
|
139 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
140 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
141 + | _status: u16,
|
142 + | _body: &[u8],
|
143 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
144 + | Self::deserialize(deserializer)
|
145 + | }
|
146 + | }
|
122 147 | impl QueryParamsAsStringListMapInput {
|
123 148 | /// Creates a new builder-style object to manufacture [`QueryParamsAsStringListMapInput`](crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput).
|
124 149 | pub fn builder() -> crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder {
|
125 150 | crate::operation::query_params_as_string_list_map::builders::QueryParamsAsStringListMapInputBuilder::default()
|
126 151 | }
|
127 152 | }
|
128 153 |
|
129 154 | /// A builder for [`QueryParamsAsStringListMapInput`](crate::operation::query_params_as_string_list_map::QueryParamsAsStringListMapInput).
|
130 155 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
131 156 | #[non_exhaustive]
|