25 25 | "aws.protocoltests.misc.synthetic",
|
26 26 | "RequiredHeaderCollectionOperationOutput",
|
27 27 | );
|
28 28 | static REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_LIST: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
29 29 | ::aws_smithy_schema::ShapeId::from_static(
|
30 30 | "aws.protocoltests.misc.synthetic#RequiredHeaderCollectionOperationOutput$requiredHeaderList",
|
31 31 | "aws.protocoltests.misc.synthetic",
|
32 32 | "RequiredHeaderCollectionOperationOutput",
|
33 33 | ),
|
34 34 | ::aws_smithy_schema::ShapeType::List,
|
35 - | "required_header_list",
|
35 + | "requiredHeaderList",
|
36 36 | 0,
|
37 37 | )
|
38 38 | .with_http_header("X-Required-List");
|
39 39 | static REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_SET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
40 40 | ::aws_smithy_schema::ShapeId::from_static(
|
41 41 | "aws.protocoltests.misc.synthetic#RequiredHeaderCollectionOperationOutput$requiredHeaderSet",
|
42 42 | "aws.protocoltests.misc.synthetic",
|
43 43 | "RequiredHeaderCollectionOperationOutput",
|
44 44 | ),
|
45 45 | ::aws_smithy_schema::ShapeType::List,
|
46 - | "required_header_set",
|
46 + | "requiredHeaderSet",
|
47 47 | 1,
|
48 48 | )
|
49 49 | .with_http_header("X-Required-Set");
|
50 50 | static REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
51 51 | REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA_ID,
|
52 52 | ::aws_smithy_schema::ShapeType::Structure,
|
53 53 | &[
|
54 54 | &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_LIST,
|
55 55 | &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_SET,
|
56 56 | ],
|
57 57 | );
|
58 58 | impl RequiredHeaderCollectionOperationOutput {
|
59 59 | /// The schema for this shape.
|
60 60 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA;
|
61 61 | }
|
62 62 | impl ::aws_smithy_schema::serde::SerializableStruct for RequiredHeaderCollectionOperationOutput {
|
63 63 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
64 64 | fn serialize_members(
|
65 65 | &self,
|
66 66 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
67 67 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
68 68 | {
|
69 69 | let val = &self.required_header_list;
|
70 70 |
|
71 71 | ser.write_list(
|
72 72 | &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_LIST,
|
73 73 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
74 74 | for item in val {
|
75 75 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
76 76 | }
|
77 77 | Ok(())
|
78 78 | },
|
79 79 | )?;
|
80 80 | }
|
81 81 | {
|
82 82 | let val = &self.required_header_set;
|
83 83 |
|
84 84 | ser.write_list(
|
85 85 | &REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_MEMBER_REQUIRED_HEADER_SET,
|
86 86 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
87 87 | for item in val {
|
88 88 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
89 89 | }
|
90 90 | Ok(())
|
91 91 | },
|
92 92 | )?;
|
93 93 | }
|
94 94 | Ok(())
|
95 95 | }
|
96 96 | }
|
97 97 | impl RequiredHeaderCollectionOperationOutput {
|
98 98 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
99 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
100 - | deserializer: &mut D,
|
99 + | pub fn deserialize(
|
100 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
101 101 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
102 102 | #[allow(unused_variables, unused_mut)]
|
103 103 | let mut builder = Self::builder();
|
104 104 | #[allow(
|
105 105 | unused_variables,
|
106 106 | unreachable_code,
|
107 107 | clippy::single_match,
|
108 108 | clippy::match_single_binding,
|
109 109 | clippy::diverging_sub_expression
|
110 110 | )]
|
111 - | deserializer.read_struct(&REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA, (), |_, member, deser| {
|
111 + | deserializer.read_struct(&REQUIREDHEADERCOLLECTIONOPERATIONOUTPUT_SCHEMA, &mut |member, deser| {
|
112 112 | match member.member_index() {
|
113 113 | Some(0) => {
|
114 - | builder.required_header_list = Some({
|
115 - | let container = if let Some(cap) = deser.container_size() {
|
116 - | Vec::with_capacity(cap)
|
117 - | } else {
|
118 - | Vec::new()
|
119 - | };
|
120 - | deser.read_list(member, container, |mut list, deser| {
|
121 - | list.push(deser.read_string(member)?);
|
122 - | Ok(list)
|
123 - | })?
|
124 - | });
|
114 + | builder.required_header_list = Some(deser.read_string_list(member)?);
|
125 115 | }
|
126 116 | Some(1) => {
|
127 - | builder.required_header_set = Some({
|
128 - | let container = if let Some(cap) = deser.container_size() {
|
129 - | Vec::with_capacity(cap)
|
130 - | } else {
|
131 - | Vec::new()
|
132 - | };
|
133 - | deser.read_list(member, container, |mut list, deser| {
|
134 - | list.push(deser.read_string(member)?);
|
135 - | Ok(list)
|
136 - | })?
|
137 - | });
|
117 + | builder.required_header_set = Some(deser.read_string_list(member)?);
|
138 118 | }
|
139 119 | _ => {}
|
140 120 | }
|
141 121 | Ok(())
|
142 122 | })?;
|
123 + | builder.required_header_list = builder.required_header_list.or(Some(Vec::new()));
|
124 + | builder.required_header_set = builder.required_header_set.or(Some(Vec::new()));
|
125 + | builder
|
126 + | .build()
|
127 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
128 + | }
|
129 + | }
|
130 + | impl RequiredHeaderCollectionOperationOutput {
|
131 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
132 + | /// Header-bound members are read directly from headers, avoiding runtime
|
133 + | /// member iteration overhead. Body members are read via the deserializer.
|
134 + | pub fn deserialize_with_response(
|
135 + | _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
136 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
137 + | _status: u16,
|
138 + | _body: &[u8],
|
139 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
140 + | #[allow(unused_variables, unused_mut)]
|
141 + | let mut builder = Self::builder();
|
142 + | if let Some(val) = headers.get("X-Required-List") {
|
143 + | builder.required_header_list = {
|
144 + | let mut items = Vec::new();
|
145 + | let mut chars = val.chars().peekable();
|
146 + | while chars.peek().is_some() {
|
147 + | // Skip whitespace
|
148 + | while chars.peek() == Some(&' ') {
|
149 + | chars.next();
|
150 + | }
|
151 + | if chars.peek() == Some(&'"') {
|
152 + | chars.next(); // skip opening quote
|
153 + | let mut s = String::new();
|
154 + | while let Some(&c) = chars.peek() {
|
155 + | if c == '\\' {
|
156 + | chars.next();
|
157 + | if let Some(escaped) = chars.next() {
|
158 + | s.push(escaped);
|
159 + | }
|
160 + | } else if c == '"' {
|
161 + | chars.next();
|
162 + | break;
|
163 + | } else {
|
164 + | s.push(c);
|
165 + | chars.next();
|
166 + | }
|
167 + | }
|
168 + | items.push(s);
|
169 + | } else {
|
170 + | let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
|
171 + | let trimmed = s.trim();
|
172 + | if !trimmed.is_empty() {
|
173 + | items.push(trimmed.to_string());
|
174 + | }
|
175 + | }
|
176 + | // Skip comma separator
|
177 + | while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
|
178 + | chars.next();
|
179 + | }
|
180 + | }
|
181 + | Some(items)
|
182 + | };
|
183 + | }
|
184 + | if let Some(val) = headers.get("X-Required-Set") {
|
185 + | builder.required_header_set = {
|
186 + | let mut items = Vec::new();
|
187 + | let mut chars = val.chars().peekable();
|
188 + | while chars.peek().is_some() {
|
189 + | // Skip whitespace
|
190 + | while chars.peek() == Some(&' ') {
|
191 + | chars.next();
|
192 + | }
|
193 + | if chars.peek() == Some(&'"') {
|
194 + | chars.next(); // skip opening quote
|
195 + | let mut s = String::new();
|
196 + | while let Some(&c) = chars.peek() {
|
197 + | if c == '\\' {
|
198 + | chars.next();
|
199 + | if let Some(escaped) = chars.next() {
|
200 + | s.push(escaped);
|
201 + | }
|
202 + | } else if c == '"' {
|
203 + | chars.next();
|
204 + | break;
|
205 + | } else {
|
206 + | s.push(c);
|
207 + | chars.next();
|
208 + | }
|
209 + | }
|
210 + | items.push(s);
|
211 + | } else {
|
212 + | let s: String = chars.by_ref().take_while(|&c| c != ',').collect();
|
213 + | let trimmed = s.trim();
|
214 + | if !trimmed.is_empty() {
|
215 + | items.push(trimmed.to_string());
|
216 + | }
|
217 + | }
|
218 + | // Skip comma separator
|
219 + | while chars.peek() == Some(&',') || chars.peek() == Some(&' ') {
|
220 + | chars.next();
|
221 + | }
|
222 + | }
|
223 + | Some(items)
|
224 + | };
|
225 + | }
|
143 226 | builder
|
144 227 | .build()
|
145 228 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
146 229 | }
|
147 230 | }
|
148 231 | impl RequiredHeaderCollectionOperationOutput {
|
149 232 | /// Creates a new builder-style object to manufacture [`RequiredHeaderCollectionOperationOutput`](crate::operation::required_header_collection_operation::RequiredHeaderCollectionOperationOutput).
|
150 233 | pub fn builder() -> crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder {
|
151 234 | crate::operation::required_header_collection_operation::builders::RequiredHeaderCollectionOperationOutputBuilder::default()
|
152 235 | }
|