214 214 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
215 215 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
216 216 | })?;
|
217 217 | cfg.interceptor_state()
|
218 218 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
219 219 | ::std::result::Result::Ok(())
|
220 220 | }
|
221 221 | }
|
222 222 | #[allow(unreachable_code, unused_variables)]
|
223 223 | #[cfg(test)]
|
224 - | mod input_and_output_with_headers_request_test {
|
224 + | mod input_and_output_with_headers_test {
|
225 225 | use ::aws_smithy_protocol_test::FloatEquals;
|
226 + |
|
226 227 | /// Tests requests with string header bindings
|
227 228 | /// Test ID: InputAndOutputWithStringHeaders
|
228 229 | #[::tokio::test]
|
229 - | #[allow(unused_mut)]
|
230 + | #[::tracing_test::traced_test]
|
230 231 | async fn input_and_output_with_string_headers_request() {
|
231 232 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
232 233 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
233 234 |
|
234 235 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
235 236 | let result = client
|
236 237 | .input_and_output_with_headers()
|
237 238 | .set_header_string(::std::option::Option::Some("Hello".to_owned()))
|
238 239 | .set_header_string_list(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
|
239 240 | .set_header_string_set(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
|
240 241 | .send()
|
241 242 | .await;
|
242 243 | let _ = dbg!(result);
|
243 244 | let http_request = request_receiver.expect_request();
|
244 245 | let expected_headers = [("X-String", "Hello"), ("X-StringList", "a, b, c"), ("X-StringSet", "a, b, c")];
|
245 246 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
246 247 | let body = http_request.body().bytes().expect("body should be strict");
|
247 248 | // No body
|
248 249 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
249 250 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
250 251 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
251 252 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
252 253 | }
|
253 254 | /// Tests requests with numeric header bindings
|
254 255 | /// Test ID: InputAndOutputWithNumericHeaders
|
255 256 | #[::tokio::test]
|
256 - | #[allow(unused_mut)]
|
257 + | #[::tracing_test::traced_test]
|
257 258 | async fn input_and_output_with_numeric_headers_request() {
|
258 259 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
259 260 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
260 261 |
|
261 262 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
262 263 | let result = client
|
263 264 | .input_and_output_with_headers()
|
264 265 | .set_header_byte(::std::option::Option::Some(1))
|
265 266 | .set_header_short(::std::option::Option::Some(123))
|
266 267 | .set_header_integer(::std::option::Option::Some(123))
|
267 268 | .set_header_long(::std::option::Option::Some(123))
|
268 269 | .set_header_float(::std::option::Option::Some(1.1_f32))
|
269 270 | .set_header_double(::std::option::Option::Some(1.1_f64))
|
270 271 | .set_header_integer_list(::std::option::Option::Some(vec![1, 2, 3]))
|
271 272 | .send()
|
272 273 | .await;
|
273 274 | let _ = dbg!(result);
|
274 275 | let http_request = request_receiver.expect_request();
|
275 276 | let expected_headers = [
|
276 277 | ("X-Byte", "1"),
|
277 278 | ("X-Double", "1.1"),
|
278 279 | ("X-Float", "1.1"),
|
279 280 | ("X-Integer", "123"),
|
280 281 | ("X-IntegerList", "1, 2, 3"),
|
281 282 | ("X-Long", "123"),
|
282 283 | ("X-Short", "123"),
|
283 284 | ];
|
284 285 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
285 286 | let body = http_request.body().bytes().expect("body should be strict");
|
286 287 | // No body
|
287 288 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
288 289 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
289 290 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
290 291 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
291 292 | }
|
292 293 | /// Tests requests with boolean header bindings
|
293 294 | /// Test ID: InputAndOutputWithBooleanHeaders
|
294 295 | #[::tokio::test]
|
295 - | #[allow(unused_mut)]
|
296 + | #[::tracing_test::traced_test]
|
296 297 | async fn input_and_output_with_boolean_headers_request() {
|
297 298 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
298 299 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
299 300 |
|
300 301 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
301 302 | let result = client
|
302 303 | .input_and_output_with_headers()
|
303 304 | .set_header_true_bool(::std::option::Option::Some(true))
|
304 305 | .set_header_false_bool(::std::option::Option::Some(false))
|
305 306 | .set_header_boolean_list(::std::option::Option::Some(vec![true, false, true]))
|
306 307 | .send()
|
307 308 | .await;
|
308 309 | let _ = dbg!(result);
|
309 310 | let http_request = request_receiver.expect_request();
|
310 311 | let expected_headers = [("X-Boolean1", "true"), ("X-Boolean2", "false"), ("X-BooleanList", "true, false, true")];
|
311 312 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
312 313 | let body = http_request.body().bytes().expect("body should be strict");
|
313 314 | // No body
|
314 315 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
315 316 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
316 317 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
317 318 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
318 319 | }
|
319 320 | /// Tests requests with timestamp header bindings
|
320 321 | /// Test ID: InputAndOutputWithTimestampHeaders
|
321 322 | #[::tokio::test]
|
322 - | #[allow(unused_mut)]
|
323 + | #[::tracing_test::traced_test]
|
323 324 | async fn input_and_output_with_timestamp_headers_request() {
|
324 325 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
325 326 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
326 327 |
|
327 328 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
328 329 | let result = client
|
329 330 | .input_and_output_with_headers()
|
330 331 | .set_header_timestamp_list(::std::option::Option::Some(vec![
|
331 332 | ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
|
332 333 | ::aws_smithy_types::DateTime::from_fractional_secs(1576540098, 0_f64),
|
333 334 | ]))
|
334 335 | .send()
|
335 336 | .await;
|
336 337 | let _ = dbg!(result);
|
337 338 | let http_request = request_receiver.expect_request();
|
338 339 | let expected_headers = [("X-TimestampList", "Mon, 16 Dec 2019 23:48:18 GMT, Mon, 16 Dec 2019 23:48:18 GMT")];
|
339 340 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
340 341 | let body = http_request.body().bytes().expect("body should be strict");
|
341 342 | // No body
|
342 343 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
343 344 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
344 345 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
345 346 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
346 347 | }
|
347 348 | /// Tests requests with enum header bindings
|
348 349 | /// Test ID: InputAndOutputWithEnumHeaders
|
349 350 | #[::tokio::test]
|
350 - | #[allow(unused_mut)]
|
351 + | #[::tracing_test::traced_test]
|
351 352 | async fn input_and_output_with_enum_headers_request() {
|
352 353 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
353 354 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
354 355 |
|
355 356 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
356 357 | let result = client
|
357 358 | .input_and_output_with_headers()
|
358 359 | .set_header_enum(::std::option::Option::Some(
|
359 360 | "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
360 361 | ))
|
361 362 | .set_header_enum_list(::std::option::Option::Some(vec![
|
362 363 | "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
363 364 | "Bar".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
364 365 | "Baz".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
365 366 | ]))
|
366 367 | .send()
|
367 368 | .await;
|
368 369 | let _ = dbg!(result);
|
369 370 | let http_request = request_receiver.expect_request();
|
370 371 | let expected_headers = [("X-Enum", "Foo"), ("X-EnumList", "Foo, Bar, Baz")];
|
371 372 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
372 373 | let body = http_request.body().bytes().expect("body should be strict");
|
373 374 | // No body
|
374 375 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
375 376 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
376 377 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
377 378 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
378 379 | }
|
379 380 | /// Supports handling NaN float header values.
|
380 381 | /// Test ID: RestXmlSupportsNaNFloatHeaderInputs
|
381 382 | #[::tokio::test]
|
382 - | #[allow(unused_mut)]
|
383 + | #[::tracing_test::traced_test]
|
383 384 | async fn rest_xml_supports_na_n_float_header_inputs_request() {
|
384 385 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
385 386 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
386 387 |
|
387 388 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
388 389 | let result = client
|
389 390 | .input_and_output_with_headers()
|
390 391 | .set_header_float(::std::option::Option::Some(
|
391 392 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
392 393 | ))
|
393 394 | .set_header_double(::std::option::Option::Some(
|
394 395 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("NaN").expect("invalid string for number"),
|
395 396 | ))
|
396 397 | .send()
|
397 398 | .await;
|
398 399 | let _ = dbg!(result);
|
399 400 | let http_request = request_receiver.expect_request();
|
400 401 | let expected_headers = [("X-Double", "NaN"), ("X-Float", "NaN")];
|
401 402 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
402 403 | let body = http_request.body().bytes().expect("body should be strict");
|
403 404 | // No body
|
404 405 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
405 406 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
406 407 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
407 408 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
408 409 | }
|
409 410 | /// Supports handling Infinity float header values.
|
410 411 | /// Test ID: RestXmlSupportsInfinityFloatHeaderInputs
|
411 412 | #[::tokio::test]
|
412 - | #[allow(unused_mut)]
|
413 + | #[::tracing_test::traced_test]
|
413 414 | async fn rest_xml_supports_infinity_float_header_inputs_request() {
|
414 415 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
415 416 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
416 417 |
|
417 418 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
418 419 | let result = client
|
419 420 | .input_and_output_with_headers()
|
420 421 | .set_header_float(::std::option::Option::Some(
|
421 422 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
422 423 | ))
|
423 424 | .set_header_double(::std::option::Option::Some(
|
424 425 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("Infinity").expect("invalid string for number"),
|
425 426 | ))
|
426 427 | .send()
|
427 428 | .await;
|
428 429 | let _ = dbg!(result);
|
429 430 | let http_request = request_receiver.expect_request();
|
430 431 | let expected_headers = [("X-Double", "Infinity"), ("X-Float", "Infinity")];
|
431 432 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
432 433 | let body = http_request.body().bytes().expect("body should be strict");
|
433 434 | // No body
|
434 435 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
435 436 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
436 437 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
437 438 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
438 439 | }
|
439 440 | /// Supports handling -Infinity float header values.
|
440 441 | /// Test ID: RestXmlSupportsNegativeInfinityFloatHeaderInputs
|
441 442 | #[::tokio::test]
|
442 - | #[allow(unused_mut)]
|
443 + | #[::tracing_test::traced_test]
|
443 444 | async fn rest_xml_supports_negative_infinity_float_header_inputs_request() {
|
444 445 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
445 446 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
446 447 |
|
447 448 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
448 449 | let result = client
|
449 450 | .input_and_output_with_headers()
|
450 451 | .set_header_float(::std::option::Option::Some(
|
451 452 | <f32 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
452 453 | ))
|
453 454 | .set_header_double(::std::option::Option::Some(
|
454 455 | <f64 as ::aws_smithy_types::primitive::Parse>::parse_smithy_primitive("-Infinity").expect("invalid string for number"),
|
455 456 | ))
|
456 457 | .send()
|
457 458 | .await;
|
458 459 | let _ = dbg!(result);
|
459 460 | let http_request = request_receiver.expect_request();
|
460 461 | let expected_headers = [("X-Double", "-Infinity"), ("X-Float", "-Infinity")];
|
461 462 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
462 463 | let body = http_request.body().bytes().expect("body should be strict");
|
463 464 | // No body
|
464 465 | ::pretty_assertions::assert_eq!(::std::str::from_utf8(body).unwrap(), "");
|
465 466 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
466 467 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
467 468 | ::pretty_assertions::assert_eq!(uri.path(), "/InputAndOutputWithHeaders", "path was incorrect");
|
468 469 | }
|
469 470 | /// Tests responses with string header bindings
|
470 471 | /// Test ID: InputAndOutputWithStringHeaders
|
471 472 | #[::tokio::test]
|
472 - | #[allow(unused_mut)]
|
473 + | #[::tracing_test::traced_test]
|
473 474 | async fn input_and_output_with_string_headers_response() {
|
474 475 | let expected_output = crate::operation::input_and_output_with_headers::InputAndOutputWithHeadersOutput::builder()
|
475 476 | .set_header_string(::std::option::Option::Some("Hello".to_owned()))
|
476 477 | .set_header_string_list(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
|
477 478 | .set_header_string_set(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
|
478 479 | .build();
|
479 480 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
480 481 | ::http::response::Builder::new()
|
481 482 | .header("X-String", "Hello")
|
482 483 | .header("X-StringList", "a, b, c")
|