133 137 | ::std::borrow::Cow::Owned(rcb)
|
134 138 | }
|
135 139 | }
|
136 140 |
|
137 141 | #[derive(Debug)]
|
138 142 | struct AllQueryStringTypesResponseDeserializer;
|
139 143 | impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AllQueryStringTypesResponseDeserializer {
|
140 144 | fn deserialize_nonstreaming(
|
141 145 | &self,
|
142 146 | response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
|
147 + | _cfg: &::aws_smithy_types::config_bag::ConfigBag,
|
143 148 | ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
|
144 149 | let (success, status) = (response.status().is_success(), response.status().as_u16());
|
150 + | #[allow(unused_mut)]
|
151 + | let mut force_error = false;
|
152 + |
|
153 + | if !success && status != 200 || force_error {
|
145 154 | let headers = response.headers();
|
146 155 | let body = response.body().bytes().expect("body loaded");
|
147 156 | #[allow(unused_mut)]
|
148 - | let mut force_error = false;
|
157 + | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(status, headers, body).map_err(|e| {
|
158 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
159 + | })?;
|
149 160 |
|
150 - | let parse_result = if !success && status != 200 || force_error {
|
151 - | crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_error(status, headers, body)
|
161 + | let generic = generic_builder.build();
|
162 + | ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
|
163 + | ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(
|
164 + | crate::operation::all_query_string_types::AllQueryStringTypesError::generic(generic),
|
165 + | ),
|
166 + | ))
|
152 167 | } else {
|
153 - | crate::protocol_serde::shape_all_query_string_types::de_all_query_string_types_http_response(status, headers, body)
|
154 - | };
|
155 - | crate::protocol_serde::type_erase_result(parse_result)
|
168 + | let protocol = _cfg
|
169 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
170 + | .expect("a SharedClientProtocol is required");
|
171 + | let mut deser = protocol
|
172 + | .deserialize_response(response, AllQueryStringTypes::OUTPUT_SCHEMA, _cfg)
|
173 + | .map_err(|e| {
|
174 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
175 + | })?;
|
176 + | let body = response.body().bytes().expect("body loaded");
|
177 + | let output = crate::operation::all_query_string_types::AllQueryStringTypesOutput::deserialize_with_response(
|
178 + | &mut *deser,
|
179 + | response.headers(),
|
180 + | response.status().into(),
|
181 + | body,
|
182 + | )
|
183 + | .map_err(|e| {
|
184 + | ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
|
185 + | })?;
|
186 + | ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
|
187 + | }
|
156 188 | }
|
157 189 | }
|
158 190 | #[derive(Debug)]
|
159 191 | struct AllQueryStringTypesRequestSerializer;
|
160 192 | impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for AllQueryStringTypesRequestSerializer {
|
161 193 | #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
|
162 194 | fn serialize_input(
|
163 195 | &self,
|
164 196 | input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
165 197 | _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
166 198 | ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
|
167 199 | let input = input
|
168 200 | .downcast::<crate::operation::all_query_string_types::AllQueryStringTypesInput>()
|
169 201 | .expect("correct type");
|
170 - | let _header_serialization_settings = _cfg
|
171 - | .load::<crate::serialization_settings::HeaderSerializationSettings>()
|
172 - | .cloned()
|
173 - | .unwrap_or_default();
|
174 - | let mut request_builder = {
|
175 - | #[allow(clippy::uninlined_format_args)]
|
176 - | fn uri_base(
|
177 - | _input: &crate::operation::all_query_string_types::AllQueryStringTypesInput,
|
178 - | output: &mut ::std::string::String,
|
179 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
180 - | use ::std::fmt::Write as _;
|
181 - | ::std::write!(output, "/AllQueryStringTypesInput").expect("formatting should succeed");
|
182 - | ::std::result::Result::Ok(())
|
183 - | }
|
184 - | fn uri_query(
|
185 - | _input: &crate::operation::all_query_string_types::AllQueryStringTypesInput,
|
186 - | mut output: &mut ::std::string::String,
|
187 - | ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
|
188 - | let mut query = ::aws_smithy_http::query::Writer::new(output);
|
189 - | let protected_params = [
|
190 - | "String",
|
191 - | "StringList",
|
192 - | "StringSet",
|
193 - | "Byte",
|
194 - | "Short",
|
195 - | "Integer",
|
196 - | "IntegerList",
|
197 - | "IntegerSet",
|
198 - | "Long",
|
199 - | "Float",
|
200 - | "Double",
|
201 - | "DoubleList",
|
202 - | "Boolean",
|
203 - | "BooleanList",
|
204 - | "Timestamp",
|
205 - | "TimestampList",
|
206 - | "Enum",
|
207 - | "EnumList",
|
208 - | "IntegerEnum",
|
209 - | "IntegerEnumList",
|
210 - | ];
|
211 - | if let ::std::option::Option::Some(inner_1) = &_input.query_params_map_of_string_list {
|
202 + | let protocol = _cfg
|
203 + | .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
|
204 + | .expect("a SharedClientProtocol is required");
|
205 + | if protocol.supports_http_bindings() {
|
206 + | let mut request = protocol
|
207 + | .serialize_body(&input, AllQueryStringTypes::INPUT_SCHEMA, "", _cfg)
|
208 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
212 209 | {
|
213 - | for (k, v) in inner_1 {
|
214 - | for inner_2 in v {
|
215 - | if !protected_params.contains(&k.as_str()) {
|
216 - | query.push_kv(&::aws_smithy_http::query::fmt_string(k), &::aws_smithy_http::query::fmt_string(inner_2));
|
210 + | let mut uri = "/AllQueryStringTypesInput".to_string();
|
211 + | let mut query_params: Vec<(String, String)> = Vec::new();
|
212 + | if let Some(ref val) = input.query_string {
|
213 + | query_params.push(("String".to_string(), val.to_string()));
|
217 214 | }
|
215 + | if let Some(ref val) = input.query_string_list {
|
216 + | for item in val {
|
217 + | query_params.push(("StringList".to_string(), item.to_string()));
|
218 218 | }
|
219 219 | }
|
220 + | if let Some(ref val) = input.query_string_set {
|
221 + | for item in val {
|
222 + | query_params.push(("StringSet".to_string(), item.to_string()));
|
220 223 | }
|
221 224 | }
|
222 - | if let ::std::option::Option::Some(inner_3) = &_input.query_string {
|
223 - | {
|
224 - | query.push_kv("String", &::aws_smithy_http::query::fmt_string(inner_3));
|
225 + | if let Some(ref val) = input.query_byte {
|
226 + | query_params.push(("Byte".to_string(), val.to_string()));
|
225 227 | }
|
228 + | if let Some(ref val) = input.query_short {
|
229 + | query_params.push(("Short".to_string(), val.to_string()));
|
226 230 | }
|
227 - | if let ::std::option::Option::Some(inner_4) = &_input.query_string_list {
|
228 - | {
|
229 - | for inner_5 in inner_4 {
|
230 - | query.push_kv("StringList", &::aws_smithy_http::query::fmt_string(inner_5));
|
231 + | if let Some(ref val) = input.query_integer {
|
232 + | query_params.push(("Integer".to_string(), val.to_string()));
|
231 233 | }
|
234 + | if let Some(ref val) = input.query_integer_list {
|
235 + | for item in val {
|
236 + | query_params.push(("IntegerList".to_string(), item.to_string()));
|
232 237 | }
|
233 238 | }
|
234 - | if let ::std::option::Option::Some(inner_6) = &_input.query_string_set {
|
235 - | {
|
236 - | for inner_7 in inner_6 {
|
237 - | query.push_kv("StringSet", &::aws_smithy_http::query::fmt_string(inner_7));
|
239 + | if let Some(ref val) = input.query_integer_set {
|
240 + | for item in val {
|
241 + | query_params.push(("IntegerSet".to_string(), item.to_string()));
|
238 242 | }
|
239 243 | }
|
244 + | if let Some(ref val) = input.query_long {
|
245 + | query_params.push(("Long".to_string(), val.to_string()));
|
240 246 | }
|
241 - | if let ::std::option::Option::Some(inner_8) = &_input.query_byte {
|
242 - | {
|
243 - | query.push_kv("Byte", ::aws_smithy_types::primitive::Encoder::from(*inner_8).encode());
|
244 - | }
|
245 - | }
|
246 - | if let ::std::option::Option::Some(inner_9) = &_input.query_short {
|
247 - | {
|
248 - | query.push_kv("Short", ::aws_smithy_types::primitive::Encoder::from(*inner_9).encode());
|
249 - | }
|
250 - | }
|
251 - | if let ::std::option::Option::Some(inner_10) = &_input.query_integer {
|
252 - | {
|
253 - | query.push_kv("Integer", ::aws_smithy_types::primitive::Encoder::from(*inner_10).encode());
|
254 - | }
|
255 - | }
|
256 - | if let ::std::option::Option::Some(inner_11) = &_input.query_integer_list {
|
257 - | {
|
258 - | for inner_12 in inner_11 {
|
259 - | query.push_kv("IntegerList", ::aws_smithy_types::primitive::Encoder::from(*inner_12).encode());
|
247 + | if let Some(ref val) = input.query_float {
|
248 + | query_params.push(("Float".to_string(), {
|
249 + | let s = val.to_string();
|
250 + | match s.as_str() {
|
251 + | "inf" => "Infinity".to_string(),
|
252 + | "-inf" => "-Infinity".to_string(),
|
253 + | _ => s,
|
260 254 | }
|
255 + | }));
|
261 256 | }
|
257 + | if let Some(ref val) = input.query_double {
|
258 + | query_params.push(("Double".to_string(), {
|
259 + | let s = val.to_string();
|
260 + | match s.as_str() {
|
261 + | "inf" => "Infinity".to_string(),
|
262 + | "-inf" => "-Infinity".to_string(),
|
263 + | _ => s,
|
262 264 | }
|
263 - | if let ::std::option::Option::Some(inner_13) = &_input.query_integer_set {
|
264 - | {
|
265 - | for inner_14 in inner_13 {
|
266 - | query.push_kv("IntegerSet", ::aws_smithy_types::primitive::Encoder::from(*inner_14).encode());
|
267 - | }
|
265 + | }));
|
268 266 | }
|
267 + | if let Some(ref val) = input.query_double_list {
|
268 + | for item in val {
|
269 + | query_params.push(("DoubleList".to_string(), {
|
270 + | let s = item.to_string();
|
271 + | match s.as_str() {
|
272 + | "inf" => "Infinity".to_string(),
|
273 + | "-inf" => "-Infinity".to_string(),
|
274 + | _ => s,
|
269 275 | }
|
270 - | if let ::std::option::Option::Some(inner_15) = &_input.query_long {
|
271 - | {
|
272 - | query.push_kv("Long", ::aws_smithy_types::primitive::Encoder::from(*inner_15).encode());
|
276 + | }));
|
273 277 | }
|
274 278 | }
|
275 - | if let ::std::option::Option::Some(inner_16) = &_input.query_float {
|
276 - | {
|
277 - | query.push_kv("Float", ::aws_smithy_types::primitive::Encoder::from(*inner_16).encode());
|
278 - | }
|
279 + | if let Some(ref val) = input.query_boolean {
|
280 + | query_params.push(("Boolean".to_string(), val.to_string()));
|
279 281 | }
|
280 - | if let ::std::option::Option::Some(inner_17) = &_input.query_double {
|
281 - | {
|
282 - | query.push_kv("Double", ::aws_smithy_types::primitive::Encoder::from(*inner_17).encode());
|
283 - | }
|
284 - | }
|
285 - | if let ::std::option::Option::Some(inner_18) = &_input.query_double_list {
|
286 - | {
|
287 - | for inner_19 in inner_18 {
|
288 - | query.push_kv("DoubleList", ::aws_smithy_types::primitive::Encoder::from(*inner_19).encode());
|
282 + | if let Some(ref val) = input.query_boolean_list {
|
283 + | for item in val {
|
284 + | query_params.push(("BooleanList".to_string(), item.to_string()));
|
289 285 | }
|
290 286 | }
|
287 + | if let Some(ref val) = input.query_timestamp {
|
288 + | query_params.push((
|
289 + | "Timestamp".to_string(),
|
290 + | val.fmt(::aws_smithy_types::date_time::Format::DateTime).expect("valid timestamp"),
|
291 + | ));
|
291 292 | }
|
292 - | if let ::std::option::Option::Some(inner_20) = &_input.query_boolean {
|
293 - | {
|
294 - | query.push_kv("Boolean", ::aws_smithy_types::primitive::Encoder::from(*inner_20).encode());
|
295 - | }
|
296 - | }
|
297 - | if let ::std::option::Option::Some(inner_21) = &_input.query_boolean_list {
|
298 - | {
|
299 - | for inner_22 in inner_21 {
|
300 - | query.push_kv("BooleanList", ::aws_smithy_types::primitive::Encoder::from(*inner_22).encode());
|
301 - | }
|
302 - | }
|
303 - | }
|
304 - | if let ::std::option::Option::Some(inner_23) = &_input.query_timestamp {
|
305 - | {
|
306 - | query.push_kv(
|
307 - | "Timestamp",
|
308 - | &::aws_smithy_http::query::fmt_timestamp(inner_23, ::aws_smithy_types::date_time::Format::DateTime)?,
|
309 - | );
|
310 - | }
|
311 - | }
|
312 - | if let ::std::option::Option::Some(inner_24) = &_input.query_timestamp_list {
|
313 - | {
|
314 - | for inner_25 in inner_24 {
|
315 - | query.push_kv(
|
316 - | "TimestampList",
|
317 - | &::aws_smithy_http::query::fmt_timestamp(inner_25, ::aws_smithy_types::date_time::Format::DateTime)?,
|
318 - | );
|
319 - | }
|
320 - | }
|
321 - | }
|
322 - | if let ::std::option::Option::Some(inner_26) = &_input.query_enum {
|
323 - | {
|
324 - | query.push_kv("Enum", &::aws_smithy_http::query::fmt_string(inner_26.as_str()));
|
325 - | }
|
326 - | }
|
327 - | if let ::std::option::Option::Some(inner_27) = &_input.query_enum_list {
|
328 - | {
|
329 - | for inner_28 in inner_27 {
|
330 - | query.push_kv("EnumList", &::aws_smithy_http::query::fmt_string(inner_28.as_str()));
|
331 - | }
|
332 - | }
|
333 - | }
|
334 - | if let ::std::option::Option::Some(inner_29) = &_input.query_integer_enum {
|
335 - | {
|
336 - | query.push_kv("IntegerEnum", ::aws_smithy_types::primitive::Encoder::from(*inner_29).encode());
|
337 - | }
|
338 - | }
|
339 - | if let ::std::option::Option::Some(inner_30) = &_input.query_integer_enum_list {
|
340 - | {
|
341 - | for inner_31 in inner_30 {
|
342 - | query.push_kv("IntegerEnumList", ::aws_smithy_types::primitive::Encoder::from(*inner_31).encode());
|
293 + | if let Some(ref val) = input.query_timestamp_list {
|
294 + | for item in val {
|
295 + | query_params.push((
|
296 + | "TimestampList".to_string(),
|
297 + | item.fmt(::aws_smithy_types::date_time::Format::DateTime).expect("valid timestamp"),
|
298 + | ));
|
343 299 | }
|
344 300 | }
|
301 + | if let Some(ref val) = input.query_enum {
|
302 + | query_params.push(("Enum".to_string(), val.as_str().to_string()));
|
303 + | }
|
304 + | if let Some(ref val) = input.query_enum_list {
|
305 + | for item in val {
|
306 + | query_params.push(("EnumList".to_string(), item.as_str().to_string()));
|
307 + | }
|
308 + | }
|
309 + | if let Some(ref val) = input.query_integer_enum {
|
310 + | query_params.push(("IntegerEnum".to_string(), val.to_string()));
|
311 + | }
|
312 + | if let Some(ref val) = input.query_integer_enum_list {
|
313 + | for item in val {
|
314 + | query_params.push(("IntegerEnumList".to_string(), item.to_string()));
|
315 + | }
|
316 + | }
|
317 + | if let Some(ref map) = input.query_params_map_of_string_list {
|
318 + | for (k, v) in map {
|
319 + | if matches!(
|
320 + | k.as_str(),
|
321 + | "String"
|
322 + | | "StringList"
|
323 + | | "StringSet"
|
324 + | | "Byte"
|
325 + | | "Short"
|
326 + | | "Integer"
|
327 + | | "IntegerList"
|
328 + | | "IntegerSet"
|
329 + | | "Long"
|
330 + | | "Float"
|
331 + | | "Double"
|
332 + | | "DoubleList"
|
333 + | | "Boolean"
|
334 + | | "BooleanList"
|
335 + | | "Timestamp"
|
336 + | | "TimestampList"
|
337 + | | "Enum"
|
338 + | | "EnumList"
|
339 + | | "IntegerEnum"
|
340 + | | "IntegerEnumList"
|
341 + | ) {
|
342 + | continue;
|
343 + | }
|
344 + | for item in v {
|
345 + | query_params.push((k.clone(), item.clone()));
|
346 + | }
|
347 + | }
|
348 + | }
|
349 + | if !query_params.is_empty() {
|
350 + | uri.push(if uri.contains('?') { '&' } else { '?' });
|
351 + | let pairs: Vec<String> = query_params
|
352 + | .iter()
|
353 + | .map(|(k, v)| {
|
354 + | format!(
|
355 + | "{}={}",
|
356 + | ::aws_smithy_schema::http_protocol::percent_encode(k),
|
357 + | ::aws_smithy_schema::http_protocol::percent_encode(v)
|
358 + | )
|
359 + | })
|
360 + | .collect();
|
361 + | uri.push_str(&pairs.join("&"));
|
345 362 | }
|
346 - | ::std::result::Result::Ok(())
|
363 + | request.set_uri(uri.as_str()).expect("valid URI");
|
347 364 | }
|
348 - | #[allow(clippy::unnecessary_wraps)]
|
349 - | fn update_http_builder(
|
350 - | input: &crate::operation::all_query_string_types::AllQueryStringTypesInput,
|
351 - | builder: ::http_1x::request::Builder,
|
352 - | ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
353 - | let mut uri = ::std::string::String::new();
|
354 - | uri_base(input, &mut uri)?;
|
355 - | uri_query(input, &mut uri)?;
|
356 - | ::std::result::Result::Ok(builder.method("GET").uri(uri))
|
357 - | }
|
358 - | let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
|
359 - | builder
|
360 - | };
|
361 - | let body = ::aws_smithy_types::body::SdkBody::from("");
|
362 365 |
|
363 - | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
366 + | return ::std::result::Result::Ok(request);
|
367 + | } else {
|
368 + | let mut request = protocol
|
369 + | .serialize_request(&input, AllQueryStringTypes::INPUT_SCHEMA, "", _cfg)
|
370 + | .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
|
371 + |
|
372 + | return ::std::result::Result::Ok(request);
|
373 + | }
|
364 374 | }
|
365 375 | }
|
366 376 | #[derive(Debug)]
|
367 377 | struct AllQueryStringTypesEndpointParamsInterceptor;
|
368 378 |
|
369 379 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AllQueryStringTypesEndpointParamsInterceptor {
|
370 380 | fn name(&self) -> &'static str {
|
371 381 | "AllQueryStringTypesEndpointParamsInterceptor"
|
372 382 | }
|
373 383 |
|