208 208 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
209 209 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
210 210 | })?;
|
211 211 | cfg.interceptor_state()
|
212 212 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
213 213 | ::std::result::Result::Ok(())
|
214 214 | }
|
215 215 | }
|
216 216 | #[allow(unreachable_code, unused_variables)]
|
217 217 | #[cfg(test)]
|
218 - | mod json_unions_request_test {
|
218 + | mod json_unions_test {
|
219 + |
|
219 220 | /// Serializes a string union value
|
220 221 | /// Test ID: RestJsonSerializeStringUnionValue
|
221 222 | #[::tokio::test]
|
222 - | #[allow(unused_mut)]
|
223 + | #[::tracing_test::traced_test]
|
223 224 | async fn rest_json_serialize_string_union_value_request() {
|
224 225 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
225 226 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
226 227 |
|
227 228 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
228 229 | let result = client
|
229 230 | .json_unions()
|
230 231 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StringValue("foo".to_owned())))
|
231 232 | .send()
|
232 233 | .await;
|
233 234 | let _ = dbg!(result);
|
234 235 | let http_request = request_receiver.expect_request();
|
235 236 | let expected_headers = [("Content-Type", "application/json")];
|
236 237 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
237 238 | let body = http_request.body().bytes().expect("body should be strict");
|
238 239 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
239 240 | body,
|
240 241 | "{\n \"contents\": {\n \"stringValue\": \"foo\"\n }\n}",
|
241 242 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
242 243 | ));
|
243 244 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
244 245 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
245 246 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
246 247 | }
|
247 248 | /// Serializes a boolean union value
|
248 249 | /// Test ID: RestJsonSerializeBooleanUnionValue
|
249 250 | #[::tokio::test]
|
250 - | #[allow(unused_mut)]
|
251 + | #[::tracing_test::traced_test]
|
251 252 | async fn rest_json_serialize_boolean_union_value_request() {
|
252 253 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
253 254 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
254 255 |
|
255 256 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
256 257 | let result = client
|
257 258 | .json_unions()
|
258 259 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
|
259 260 | .send()
|
260 261 | .await;
|
261 262 | let _ = dbg!(result);
|
262 263 | let http_request = request_receiver.expect_request();
|
263 264 | let expected_headers = [("Content-Type", "application/json")];
|
264 265 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
265 266 | let body = http_request.body().bytes().expect("body should be strict");
|
266 267 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
267 268 | body,
|
268 269 | "{\n \"contents\": {\n \"booleanValue\": true\n }\n}",
|
269 270 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
270 271 | ));
|
271 272 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
272 273 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
273 274 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
274 275 | }
|
275 276 | /// Serializes a number union value
|
276 277 | /// Test ID: RestJsonSerializeNumberUnionValue
|
277 278 | #[::tokio::test]
|
278 - | #[allow(unused_mut)]
|
279 + | #[::tracing_test::traced_test]
|
279 280 | async fn rest_json_serialize_number_union_value_request() {
|
280 281 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
281 282 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
282 283 |
|
283 284 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
284 285 | let result = client
|
285 286 | .json_unions()
|
286 287 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
|
287 288 | .send()
|
288 289 | .await;
|
289 290 | let _ = dbg!(result);
|
290 291 | let http_request = request_receiver.expect_request();
|
291 292 | let expected_headers = [("Content-Type", "application/json")];
|
292 293 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
293 294 | let body = http_request.body().bytes().expect("body should be strict");
|
294 295 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
295 296 | body,
|
296 297 | "{\n \"contents\": {\n \"numberValue\": 1\n }\n}",
|
297 298 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
298 299 | ));
|
299 300 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
300 301 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
301 302 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
302 303 | }
|
303 304 | /// Serializes a blob union value
|
304 305 | /// Test ID: RestJsonSerializeBlobUnionValue
|
305 306 | #[::tokio::test]
|
306 - | #[allow(unused_mut)]
|
307 + | #[::tracing_test::traced_test]
|
307 308 | async fn rest_json_serialize_blob_union_value_request() {
|
308 309 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
309 310 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
310 311 |
|
311 312 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
312 313 | let result = client
|
313 314 | .json_unions()
|
314 315 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
|
315 316 | ::aws_smithy_types::Blob::new("foo"),
|
316 317 | )))
|
317 318 | .send()
|
318 319 | .await;
|
319 320 | let _ = dbg!(result);
|
320 321 | let http_request = request_receiver.expect_request();
|
321 322 | let expected_headers = [("Content-Type", "application/json")];
|
322 323 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
323 324 | let body = http_request.body().bytes().expect("body should be strict");
|
324 325 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
325 326 | body,
|
326 327 | "{\n \"contents\": {\n \"blobValue\": \"Zm9v\"\n }\n}",
|
327 328 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
328 329 | ));
|
329 330 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
330 331 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
331 332 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
332 333 | }
|
333 334 | /// Serializes a timestamp union value
|
334 335 | /// Test ID: RestJsonSerializeTimestampUnionValue
|
335 336 | #[::tokio::test]
|
336 - | #[allow(unused_mut)]
|
337 + | #[::tracing_test::traced_test]
|
337 338 | async fn rest_json_serialize_timestamp_union_value_request() {
|
338 339 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
339 340 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
340 341 |
|
341 342 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
342 343 | let result = client
|
343 344 | .json_unions()
|
344 345 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
|
345 346 | ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
|
346 347 | )))
|
347 348 | .send()
|
348 349 | .await;
|
349 350 | let _ = dbg!(result);
|
350 351 | let http_request = request_receiver.expect_request();
|
351 352 | let expected_headers = [("Content-Type", "application/json")];
|
352 353 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
353 354 | let body = http_request.body().bytes().expect("body should be strict");
|
354 355 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
355 356 | body,
|
356 357 | "{\n \"contents\": {\n \"timestampValue\": 1398796238\n }\n}",
|
357 358 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
358 359 | ));
|
359 360 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
360 361 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
361 362 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
362 363 | }
|
363 364 | /// Serializes an enum union value
|
364 365 | /// Test ID: RestJsonSerializeEnumUnionValue
|
365 366 | #[::tokio::test]
|
366 - | #[allow(unused_mut)]
|
367 + | #[::tracing_test::traced_test]
|
367 368 | async fn rest_json_serialize_enum_union_value_request() {
|
368 369 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
369 370 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
370 371 |
|
371 372 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
372 373 | let result = client
|
373 374 | .json_unions()
|
374 375 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
|
375 376 | "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
376 377 | )))
|
377 378 | .send()
|
378 379 | .await;
|
379 380 | let _ = dbg!(result);
|
380 381 | let http_request = request_receiver.expect_request();
|
381 382 | let expected_headers = [("Content-Type", "application/json")];
|
382 383 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
383 384 | let body = http_request.body().bytes().expect("body should be strict");
|
384 385 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
385 386 | body,
|
386 387 | "{\n \"contents\": {\n \"enumValue\": \"Foo\"\n }\n}",
|
387 388 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
388 389 | ));
|
389 390 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
390 391 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
391 392 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
392 393 | }
|
393 394 | /// Serializes a list union value
|
394 395 | /// Test ID: RestJsonSerializeListUnionValue
|
395 396 | #[::tokio::test]
|
396 - | #[allow(unused_mut)]
|
397 + | #[::tracing_test::traced_test]
|
397 398 | async fn rest_json_serialize_list_union_value_request() {
|
398 399 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
399 400 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
400 401 |
|
401 402 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
402 403 | let result = client
|
403 404 | .json_unions()
|
404 405 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
|
405 406 | "foo".to_owned(),
|
406 407 | "bar".to_owned(),
|
407 408 | ])))
|
408 409 | .send()
|
409 410 | .await;
|
410 411 | let _ = dbg!(result);
|
411 412 | let http_request = request_receiver.expect_request();
|
412 413 | let expected_headers = [("Content-Type", "application/json")];
|
413 414 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
414 415 | let body = http_request.body().bytes().expect("body should be strict");
|
415 416 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
416 417 | body,
|
417 418 | "{\n \"contents\": {\n \"listValue\": [\"foo\", \"bar\"]\n }\n}",
|
418 419 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
419 420 | ));
|
420 421 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
421 422 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
422 423 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
423 424 | }
|
424 425 | /// Serializes a map union value
|
425 426 | /// Test ID: RestJsonSerializeMapUnionValue
|
426 427 | #[::tokio::test]
|
427 - | #[allow(unused_mut)]
|
428 + | #[::tracing_test::traced_test]
|
428 429 | async fn rest_json_serialize_map_union_value_request() {
|
429 430 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
430 431 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
431 432 |
|
432 433 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
433 434 | let result = client
|
434 435 | .json_unions()
|
435 436 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
|
436 437 | let mut ret = ::std::collections::HashMap::new();
|
437 438 | ret.insert("foo".to_owned(), "bar".to_owned());
|
438 439 | ret.insert("spam".to_owned(), "eggs".to_owned());
|
439 440 | ret
|
440 441 | })))
|
441 442 | .send()
|
442 443 | .await;
|
443 444 | let _ = dbg!(result);
|
444 445 | let http_request = request_receiver.expect_request();
|
445 446 | let expected_headers = [("Content-Type", "application/json")];
|
446 447 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
447 448 | let body = http_request.body().bytes().expect("body should be strict");
|
448 449 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
449 450 | body,
|
450 451 | "{\n \"contents\": {\n \"mapValue\": {\n \"foo\": \"bar\",\n \"spam\": \"eggs\"\n }\n }\n}",
|
451 452 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
452 453 | ));
|
453 454 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
454 455 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
455 456 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
456 457 | }
|
457 458 | /// Serializes a structure union value
|
458 459 | /// Test ID: RestJsonSerializeStructureUnionValue
|
459 460 | #[::tokio::test]
|
460 - | #[allow(unused_mut)]
|
461 + | #[::tracing_test::traced_test]
|
461 462 | async fn rest_json_serialize_structure_union_value_request() {
|
462 463 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
463 464 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
464 465 |
|
465 466 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
466 467 | let result = client
|
467 468 | .json_unions()
|
468 469 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
|
469 470 | crate::types::GreetingStruct::builder()
|
470 471 | .set_hi(::std::option::Option::Some("hello".to_owned()))
|
471 472 | .build(),
|
472 473 | )))
|
473 474 | .send()
|
474 475 | .await;
|
475 476 | let _ = dbg!(result);
|
476 477 | let http_request = request_receiver.expect_request();
|
477 478 | let expected_headers = [("Content-Type", "application/json")];
|
478 479 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
479 480 | let body = http_request.body().bytes().expect("body should be strict");
|
480 481 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
481 482 | body,
|
482 483 | "{\n \"contents\": {\n \"structureValue\": {\n \"hi\": \"hello\"\n }\n }\n}",
|
483 484 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
484 485 | ));
|
485 486 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
486 487 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
487 488 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
488 489 | }
|
489 490 | /// Serializes a renamed structure union value
|
490 491 | /// Test ID: RestJsonSerializeRenamedStructureUnionValue
|
491 492 | #[::tokio::test]
|
492 - | #[allow(unused_mut)]
|
493 + | #[::tracing_test::traced_test]
|
493 494 | async fn rest_json_serialize_renamed_structure_union_value_request() {
|
494 495 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
495 496 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
496 497 |
|
497 498 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
498 499 | let result = client
|
499 500 | .json_unions()
|
500 501 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::RenamedStructureValue(
|
501 502 | crate::types::RenamedGreeting::builder()
|
502 503 | .set_salutation(::std::option::Option::Some("hello!".to_owned()))
|
503 504 | .build(),
|
504 505 | )))
|
505 506 | .send()
|
506 507 | .await;
|
507 508 | let _ = dbg!(result);
|
508 509 | let http_request = request_receiver.expect_request();
|
509 510 | let expected_headers = [("Content-Type", "application/json")];
|
510 511 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
511 512 | let body = http_request.body().bytes().expect("body should be strict");
|
512 513 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
513 514 | body,
|
514 515 | "{\n \"contents\": {\n \"renamedStructureValue\": {\n \"salutation\": \"hello!\"\n }\n }\n}",
|
515 516 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
516 517 | ));
|
517 518 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
518 519 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
519 520 | ::pretty_assertions::assert_eq!(uri.path(), "/JsonUnions", "path was incorrect");
|
520 521 | }
|
521 522 | /// Deserializes a string union value
|
522 523 | /// Test ID: RestJsonDeserializeStringUnionValue
|
523 524 | #[::tokio::test]
|
524 - | #[allow(unused_mut)]
|
525 + | #[::tracing_test::traced_test]
|
525 526 | async fn rest_json_deserialize_string_union_value_response() {
|
526 527 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
527 528 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StringValue("foo".to_owned())))
|
528 529 | .build();
|
529 530 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
530 531 | ::http::response::Builder::new()
|
531 532 | .header("Content-Type", "application/json")
|
532 533 | .status(200)
|
533 534 | .body(::aws_smithy_types::body::SdkBody::from(
|
534 535 | "{\n \"contents\": {\n \"stringValue\": \"foo\"\n }\n}",
|
535 536 | ))
|
536 537 | .unwrap(),
|
537 538 | )
|
538 539 | .unwrap();
|
539 540 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
540 541 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
541 542 |
|
542 543 | let op = crate::operation::json_unions::JsonUnions::new();
|
543 544 | let config = op.config().expect("the operation has config");
|
544 545 | let de = config
|
545 546 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
546 547 | .expect("the config must have a deserializer");
|
547 548 |
|
548 549 | let parsed = de.deserialize_streaming(&mut http_response);
|
549 550 | let parsed = parsed.unwrap_or_else(|| {
|
550 551 | let http_response =
|
551 552 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
552 553 | de.deserialize_nonstreaming(&http_response)
|
553 554 | });
|
554 555 | let parsed = parsed
|
555 556 | .expect("should be successful response")
|
556 557 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
557 558 | .unwrap();
|
558 559 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
559 560 | }
|
560 561 | /// Deserializes a boolean union value
|
561 562 | /// Test ID: RestJsonDeserializeBooleanUnionValue
|
562 563 | #[::tokio::test]
|
563 - | #[allow(unused_mut)]
|
564 + | #[::tracing_test::traced_test]
|
564 565 | async fn rest_json_deserialize_boolean_union_value_response() {
|
565 566 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
566 567 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::BooleanValue(true)))
|
567 568 | .build();
|
568 569 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
569 570 | ::http::response::Builder::new()
|
570 571 | .header("Content-Type", "application/json")
|
571 572 | .status(200)
|
572 573 | .body(::aws_smithy_types::body::SdkBody::from(
|
573 574 | "{\n \"contents\": {\n \"booleanValue\": true\n }\n}",
|
574 575 | ))
|
575 576 | .unwrap(),
|
576 577 | )
|
577 578 | .unwrap();
|
578 579 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
579 580 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
580 581 |
|
581 582 | let op = crate::operation::json_unions::JsonUnions::new();
|
582 583 | let config = op.config().expect("the operation has config");
|
583 584 | let de = config
|
584 585 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
585 586 | .expect("the config must have a deserializer");
|
586 587 |
|
587 588 | let parsed = de.deserialize_streaming(&mut http_response);
|
588 589 | let parsed = parsed.unwrap_or_else(|| {
|
589 590 | let http_response =
|
590 591 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
591 592 | de.deserialize_nonstreaming(&http_response)
|
592 593 | });
|
593 594 | let parsed = parsed
|
594 595 | .expect("should be successful response")
|
595 596 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
596 597 | .unwrap();
|
597 598 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
598 599 | }
|
599 600 | /// Deserializes a number union value
|
600 601 | /// Test ID: RestJsonDeserializeNumberUnionValue
|
601 602 | #[::tokio::test]
|
602 - | #[allow(unused_mut)]
|
603 + | #[::tracing_test::traced_test]
|
603 604 | async fn rest_json_deserialize_number_union_value_response() {
|
604 605 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
605 606 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::NumberValue(1)))
|
606 607 | .build();
|
607 608 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
608 609 | ::http::response::Builder::new()
|
609 610 | .header("Content-Type", "application/json")
|
610 611 | .status(200)
|
611 612 | .body(::aws_smithy_types::body::SdkBody::from(
|
612 613 | "{\n \"contents\": {\n \"numberValue\": 1\n }\n}",
|
613 614 | ))
|
614 615 | .unwrap(),
|
615 616 | )
|
616 617 | .unwrap();
|
617 618 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
618 619 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
619 620 |
|
620 621 | let op = crate::operation::json_unions::JsonUnions::new();
|
621 622 | let config = op.config().expect("the operation has config");
|
622 623 | let de = config
|
623 624 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
624 625 | .expect("the config must have a deserializer");
|
625 626 |
|
626 627 | let parsed = de.deserialize_streaming(&mut http_response);
|
627 628 | let parsed = parsed.unwrap_or_else(|| {
|
628 629 | let http_response =
|
629 630 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
630 631 | de.deserialize_nonstreaming(&http_response)
|
631 632 | });
|
632 633 | let parsed = parsed
|
633 634 | .expect("should be successful response")
|
634 635 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
635 636 | .unwrap();
|
636 637 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
637 638 | }
|
638 639 | /// Deserializes a blob union value
|
639 640 | /// Test ID: RestJsonDeserializeBlobUnionValue
|
640 641 | #[::tokio::test]
|
641 - | #[allow(unused_mut)]
|
642 + | #[::tracing_test::traced_test]
|
642 643 | async fn rest_json_deserialize_blob_union_value_response() {
|
643 644 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
644 645 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::BlobValue(
|
645 646 | ::aws_smithy_types::Blob::new("foo"),
|
646 647 | )))
|
647 648 | .build();
|
648 649 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
649 650 | ::http::response::Builder::new()
|
650 651 | .header("Content-Type", "application/json")
|
651 652 | .status(200)
|
652 653 | .body(::aws_smithy_types::body::SdkBody::from(
|
653 654 | "{\n \"contents\": {\n \"blobValue\": \"Zm9v\"\n }\n}",
|
654 655 | ))
|
655 656 | .unwrap(),
|
656 657 | )
|
657 658 | .unwrap();
|
658 659 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
659 660 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
660 661 |
|
661 662 | let op = crate::operation::json_unions::JsonUnions::new();
|
662 663 | let config = op.config().expect("the operation has config");
|
663 664 | let de = config
|
664 665 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
665 666 | .expect("the config must have a deserializer");
|
666 667 |
|
667 668 | let parsed = de.deserialize_streaming(&mut http_response);
|
668 669 | let parsed = parsed.unwrap_or_else(|| {
|
669 670 | let http_response =
|
670 671 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
671 672 | de.deserialize_nonstreaming(&http_response)
|
672 673 | });
|
673 674 | let parsed = parsed
|
674 675 | .expect("should be successful response")
|
675 676 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
676 677 | .unwrap();
|
677 678 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
678 679 | }
|
679 680 | /// Deserializes a timestamp union value
|
680 681 | /// Test ID: RestJsonDeserializeTimestampUnionValue
|
681 682 | #[::tokio::test]
|
682 - | #[allow(unused_mut)]
|
683 + | #[::tracing_test::traced_test]
|
683 684 | async fn rest_json_deserialize_timestamp_union_value_response() {
|
684 685 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
685 686 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::TimestampValue(
|
686 687 | ::aws_smithy_types::DateTime::from_fractional_secs(1398796238, 0_f64),
|
687 688 | )))
|
688 689 | .build();
|
689 690 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
690 691 | ::http::response::Builder::new()
|
691 692 | .header("Content-Type", "application/json")
|
692 693 | .status(200)
|
693 694 | .body(::aws_smithy_types::body::SdkBody::from(
|
694 695 | "{\n \"contents\": {\n \"timestampValue\": 1398796238\n }\n}",
|
695 696 | ))
|
696 697 | .unwrap(),
|
697 698 | )
|
698 699 | .unwrap();
|
699 700 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
700 701 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
701 702 |
|
702 703 | let op = crate::operation::json_unions::JsonUnions::new();
|
703 704 | let config = op.config().expect("the operation has config");
|
704 705 | let de = config
|
705 706 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
706 707 | .expect("the config must have a deserializer");
|
707 708 |
|
708 709 | let parsed = de.deserialize_streaming(&mut http_response);
|
709 710 | let parsed = parsed.unwrap_or_else(|| {
|
710 711 | let http_response =
|
711 712 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
712 713 | de.deserialize_nonstreaming(&http_response)
|
713 714 | });
|
714 715 | let parsed = parsed
|
715 716 | .expect("should be successful response")
|
716 717 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
717 718 | .unwrap();
|
718 719 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
719 720 | }
|
720 721 | /// Deserializes an enum union value
|
721 722 | /// Test ID: RestJsonDeserializeEnumUnionValue
|
722 723 | #[::tokio::test]
|
723 - | #[allow(unused_mut)]
|
724 + | #[::tracing_test::traced_test]
|
724 725 | async fn rest_json_deserialize_enum_union_value_response() {
|
725 726 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
726 727 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::EnumValue(
|
727 728 | "Foo".parse::<crate::types::FooEnum>().expect("static value validated to member"),
|
728 729 | )))
|
729 730 | .build();
|
730 731 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
731 732 | ::http::response::Builder::new()
|
732 733 | .header("Content-Type", "application/json")
|
733 734 | .status(200)
|
734 735 | .body(::aws_smithy_types::body::SdkBody::from(
|
735 736 | "{\n \"contents\": {\n \"enumValue\": \"Foo\"\n }\n}",
|
736 737 | ))
|
737 738 | .unwrap(),
|
738 739 | )
|
739 740 | .unwrap();
|
740 741 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
741 742 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
742 743 |
|
743 744 | let op = crate::operation::json_unions::JsonUnions::new();
|
744 745 | let config = op.config().expect("the operation has config");
|
745 746 | let de = config
|
746 747 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
747 748 | .expect("the config must have a deserializer");
|
748 749 |
|
749 750 | let parsed = de.deserialize_streaming(&mut http_response);
|
750 751 | let parsed = parsed.unwrap_or_else(|| {
|
751 752 | let http_response =
|
752 753 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
753 754 | de.deserialize_nonstreaming(&http_response)
|
754 755 | });
|
755 756 | let parsed = parsed
|
756 757 | .expect("should be successful response")
|
757 758 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
758 759 | .unwrap();
|
759 760 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
760 761 | }
|
761 762 | /// Deserializes a list union value
|
762 763 | /// Test ID: RestJsonDeserializeListUnionValue
|
763 764 | #[::tokio::test]
|
764 - | #[allow(unused_mut)]
|
765 + | #[::tracing_test::traced_test]
|
765 766 | async fn rest_json_deserialize_list_union_value_response() {
|
766 767 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
767 768 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::ListValue(vec![
|
768 769 | "foo".to_owned(),
|
769 770 | "bar".to_owned(),
|
770 771 | ])))
|
771 772 | .build();
|
772 773 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
773 774 | ::http::response::Builder::new()
|
774 775 | .header("Content-Type", "application/json")
|
775 776 | .status(200)
|
776 777 | .body(::aws_smithy_types::body::SdkBody::from(
|
777 778 | "{\n \"contents\": {\n \"listValue\": [\"foo\", \"bar\"]\n }\n}",
|
778 779 | ))
|
779 780 | .unwrap(),
|
780 781 | )
|
781 782 | .unwrap();
|
782 783 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
783 784 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
784 785 |
|
785 786 | let op = crate::operation::json_unions::JsonUnions::new();
|
786 787 | let config = op.config().expect("the operation has config");
|
787 788 | let de = config
|
788 789 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
789 790 | .expect("the config must have a deserializer");
|
790 791 |
|
791 792 | let parsed = de.deserialize_streaming(&mut http_response);
|
792 793 | let parsed = parsed.unwrap_or_else(|| {
|
793 794 | let http_response =
|
794 795 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
795 796 | de.deserialize_nonstreaming(&http_response)
|
796 797 | });
|
797 798 | let parsed = parsed
|
798 799 | .expect("should be successful response")
|
799 800 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
800 801 | .unwrap();
|
801 802 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
802 803 | }
|
803 804 | /// Deserializes a map union value
|
804 805 | /// Test ID: RestJsonDeserializeMapUnionValue
|
805 806 | #[::tokio::test]
|
806 - | #[allow(unused_mut)]
|
807 + | #[::tracing_test::traced_test]
|
807 808 | async fn rest_json_deserialize_map_union_value_response() {
|
808 809 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
809 810 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::MapValue({
|
810 811 | let mut ret = ::std::collections::HashMap::new();
|
811 812 | ret.insert("foo".to_owned(), "bar".to_owned());
|
812 813 | ret.insert("spam".to_owned(), "eggs".to_owned());
|
813 814 | ret
|
814 815 | })))
|
815 816 | .build();
|
816 817 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
|
817 818 | .header("Content-Type", "application/json")
|
818 819 | .status(200)
|
819 820 | .body(::aws_smithy_types::body::SdkBody::from("{\n \"contents\": {\n \"mapValue\": {\n \"foo\": \"bar\",\n \"spam\": \"eggs\"\n }\n }\n}"))
|
820 821 | .unwrap()
|
821 822 | ).unwrap();
|
822 823 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
823 824 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
824 825 |
|
825 826 | let op = crate::operation::json_unions::JsonUnions::new();
|
826 827 | let config = op.config().expect("the operation has config");
|
827 828 | let de = config
|
828 829 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
829 830 | .expect("the config must have a deserializer");
|
830 831 |
|
831 832 | let parsed = de.deserialize_streaming(&mut http_response);
|
832 833 | let parsed = parsed.unwrap_or_else(|| {
|
833 834 | let http_response =
|
834 835 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
835 836 | de.deserialize_nonstreaming(&http_response)
|
836 837 | });
|
837 838 | let parsed = parsed
|
838 839 | .expect("should be successful response")
|
839 840 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
840 841 | .unwrap();
|
841 842 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
842 843 | }
|
843 844 | /// Deserializes a structure union value
|
844 845 | /// Test ID: RestJsonDeserializeStructureUnionValue
|
845 846 | #[::tokio::test]
|
846 - | #[allow(unused_mut)]
|
847 + | #[::tracing_test::traced_test]
|
847 848 | async fn rest_json_deserialize_structure_union_value_response() {
|
848 849 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
849 850 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
|
850 851 | crate::types::GreetingStruct::builder()
|
851 852 | .set_hi(::std::option::Option::Some("hello".to_owned()))
|
852 853 | .build(),
|
853 854 | )))
|
854 855 | .build();
|
855 856 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
856 857 | ::http::response::Builder::new()
|
857 858 | .header("Content-Type", "application/json")
|
858 859 | .status(200)
|
859 860 | .body(::aws_smithy_types::body::SdkBody::from(
|
860 861 | "{\n \"contents\": {\n \"structureValue\": {\n \"hi\": \"hello\"\n }\n }\n}",
|
861 862 | ))
|
862 863 | .unwrap(),
|
863 864 | )
|
864 865 | .unwrap();
|
865 866 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
866 867 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
867 868 |
|
868 869 | let op = crate::operation::json_unions::JsonUnions::new();
|
869 870 | let config = op.config().expect("the operation has config");
|
870 871 | let de = config
|
871 872 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
872 873 | .expect("the config must have a deserializer");
|
873 874 |
|
874 875 | let parsed = de.deserialize_streaming(&mut http_response);
|
875 876 | let parsed = parsed.unwrap_or_else(|| {
|
876 877 | let http_response =
|
877 878 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
878 879 | de.deserialize_nonstreaming(&http_response)
|
879 880 | });
|
880 881 | let parsed = parsed
|
881 882 | .expect("should be successful response")
|
882 883 | .downcast::<crate::operation::json_unions::JsonUnionsOutput>()
|
883 884 | .unwrap();
|
884 885 | ::pretty_assertions::assert_eq!(parsed.contents, expected_output.contents, "Unexpected value for `contents`");
|
885 886 | }
|
886 887 | /// Ignores an unrecognized __type property
|
887 888 | /// Test ID: RestJsonDeserializeIgnoreType
|
888 889 | #[::tokio::test]
|
889 - | #[allow(unused_mut)]
|
890 + | #[::tracing_test::traced_test]
|
890 891 | async fn rest_json_deserialize_ignore_type_response() {
|
891 892 | let expected_output = crate::operation::json_unions::JsonUnionsOutput::builder()
|
892 893 | .set_contents(::std::option::Option::Some(crate::types::MyUnion::StructureValue(
|
893 894 | crate::types::GreetingStruct::builder()
|
894 895 | .set_hi(::std::option::Option::Some("hello".to_owned()))
|
895 896 | .build(),
|
896 897 | )))
|
897 898 | .build();
|
898 899 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
|
899 900 | .header("Content-Type", "application/json")
|