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 xml_unions_request_test {
|
218 + | mod xml_unions_test {
|
219 + |
|
219 220 | /// Serializes union struct member
|
220 221 | /// Test ID: XmlUnionsWithStructMember
|
221 222 | #[::tokio::test]
|
222 - | #[allow(unused_mut)]
|
223 + | #[::tracing_test::traced_test]
|
223 224 | async fn xml_unions_with_struct_member_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 | .xml_unions()
|
230 231 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::StructValue(
|
231 232 | crate::types::XmlNestedUnionStruct::builder()
|
232 233 | .set_string_value(::std::option::Option::Some("string".to_owned()))
|
233 234 | .set_boolean_value(::std::option::Option::Some(true))
|
234 235 | .set_byte_value(::std::option::Option::Some(1))
|
235 236 | .set_short_value(::std::option::Option::Some(2))
|
236 237 | .set_integer_value(::std::option::Option::Some(3))
|
237 238 | .set_long_value(::std::option::Option::Some(4))
|
238 239 | .set_float_value(::std::option::Option::Some(5.5_f32))
|
239 240 | .set_double_value(::std::option::Option::Some(6.5_f64))
|
240 241 | .build(),
|
241 242 | )))
|
242 243 | .send()
|
243 244 | .await;
|
244 245 | let _ = dbg!(result);
|
245 246 | let http_request = request_receiver.expect_request();
|
246 247 | let expected_headers = [("Content-Type", "application/xml")];
|
247 248 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
248 249 | let body = http_request.body().bytes().expect("body should be strict");
|
249 250 | ::aws_smithy_protocol_test::assert_ok(
|
250 251 | ::aws_smithy_protocol_test::validate_body(body, "<XmlUnionsRequest>\n <unionValue>\n <structValue>\n <stringValue>string</stringValue>\n <booleanValue>true</booleanValue>\n <byteValue>1</byteValue>\n <shortValue>2</shortValue>\n <integerValue>3</integerValue>\n <longValue>4</longValue>\n <floatValue>5.5</floatValue>\n <doubleValue>6.5</doubleValue>\n </structValue>\n </unionValue>\n</XmlUnionsRequest>\n", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
|
251 252 | );
|
252 253 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
253 254 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
254 255 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlUnions", "path was incorrect");
|
255 256 | }
|
256 257 | /// serialize union string member
|
257 258 | /// Test ID: XmlUnionsWithStringMember
|
258 259 | #[::tokio::test]
|
259 - | #[allow(unused_mut)]
|
260 + | #[::tracing_test::traced_test]
|
260 261 | async fn xml_unions_with_string_member_request() {
|
261 262 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
262 263 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
263 264 |
|
264 265 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
265 266 | let result = client
|
266 267 | .xml_unions()
|
267 268 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::StringValue(
|
268 269 | "some string".to_owned(),
|
269 270 | )))
|
270 271 | .send()
|
271 272 | .await;
|
272 273 | let _ = dbg!(result);
|
273 274 | let http_request = request_receiver.expect_request();
|
274 275 | let expected_headers = [("Content-Type", "application/xml")];
|
275 276 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
276 277 | let body = http_request.body().bytes().expect("body should be strict");
|
277 278 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
278 279 | body,
|
279 280 | "<XmlUnionsRequest>\n <unionValue>\n <stringValue>some string</stringValue>\n </unionValue>\n</XmlUnionsRequest>\n",
|
280 281 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
281 282 | ));
|
282 283 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
283 284 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
284 285 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlUnions", "path was incorrect");
|
285 286 | }
|
286 287 | /// Serializes union boolean member
|
287 288 | /// Test ID: XmlUnionsWithBooleanMember
|
288 289 | #[::tokio::test]
|
289 - | #[allow(unused_mut)]
|
290 + | #[::tracing_test::traced_test]
|
290 291 | async fn xml_unions_with_boolean_member_request() {
|
291 292 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
292 293 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
293 294 |
|
294 295 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
295 296 | let result = client
|
296 297 | .xml_unions()
|
297 298 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::BooleanValue(true)))
|
298 299 | .send()
|
299 300 | .await;
|
300 301 | let _ = dbg!(result);
|
301 302 | let http_request = request_receiver.expect_request();
|
302 303 | let expected_headers = [("Content-Type", "application/xml")];
|
303 304 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
304 305 | let body = http_request.body().bytes().expect("body should be strict");
|
305 306 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
306 307 | body,
|
307 308 | "<XmlUnionsRequest>\n <unionValue>\n <booleanValue>true</booleanValue>\n </unionValue>\n</XmlUnionsRequest>\n",
|
308 309 | ::aws_smithy_protocol_test::MediaType::from("application/xml"),
|
309 310 | ));
|
310 311 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
311 312 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
312 313 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlUnions", "path was incorrect");
|
313 314 | }
|
314 315 | /// Serializes union member
|
315 316 | /// Test ID: XmlUnionsWithUnionMember
|
316 317 | #[::tokio::test]
|
317 - | #[allow(unused_mut)]
|
318 + | #[::tracing_test::traced_test]
|
318 319 | async fn xml_unions_with_union_member_request() {
|
319 320 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
320 321 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
321 322 |
|
322 323 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
323 324 | let result = client
|
324 325 | .xml_unions()
|
325 326 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::UnionValue(
|
326 327 | ::std::boxed::Box::new(crate::types::XmlUnionShape::BooleanValue(true)),
|
327 328 | )))
|
328 329 | .send()
|
329 330 | .await;
|
330 331 | let _ = dbg!(result);
|
331 332 | let http_request = request_receiver.expect_request();
|
332 333 | let expected_headers = [("Content-Type", "application/xml")];
|
333 334 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
334 335 | let body = http_request.body().bytes().expect("body should be strict");
|
335 336 | ::aws_smithy_protocol_test::assert_ok(
|
336 337 | ::aws_smithy_protocol_test::validate_body(body, "<XmlUnionsRequest>\n <unionValue>\n <unionValue>\n <booleanValue>true</booleanValue>\n </unionValue>\n </unionValue>\n</XmlUnionsRequest>\n", ::aws_smithy_protocol_test::MediaType::from("application/xml"))
|
337 338 | );
|
338 339 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
339 340 | ::pretty_assertions::assert_eq!(http_request.method(), "PUT", "method was incorrect");
|
340 341 | ::pretty_assertions::assert_eq!(uri.path(), "/XmlUnions", "path was incorrect");
|
341 342 | }
|
342 343 | /// Serializes union struct member
|
343 344 | /// Test ID: XmlUnionsWithStructMember
|
344 345 | #[::tokio::test]
|
345 - | #[allow(unused_mut)]
|
346 + | #[::tracing_test::traced_test]
|
346 347 | async fn xml_unions_with_struct_member_response() {
|
347 348 | let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
|
348 349 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::StructValue(
|
349 350 | crate::types::XmlNestedUnionStruct::builder()
|
350 351 | .set_string_value(::std::option::Option::Some("string".to_owned()))
|
351 352 | .set_boolean_value(::std::option::Option::Some(true))
|
352 353 | .set_byte_value(::std::option::Option::Some(1))
|
353 354 | .set_short_value(::std::option::Option::Some(2))
|
354 355 | .set_integer_value(::std::option::Option::Some(3))
|
355 356 | .set_long_value(::std::option::Option::Some(4))
|
356 357 | .set_float_value(::std::option::Option::Some(5.5_f32))
|
357 358 | .set_double_value(::std::option::Option::Some(6.5_f64))
|
358 359 | .build(),
|
359 360 | )))
|
360 361 | .build();
|
361 362 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
|
362 363 | .header("Content-Type", "application/xml")
|
363 364 | .status(200)
|
364 365 | .body(::aws_smithy_types::body::SdkBody::from("<XmlUnionsResponse>\n <unionValue>\n <structValue>\n <stringValue>string</stringValue>\n <booleanValue>true</booleanValue>\n <byteValue>1</byteValue>\n <shortValue>2</shortValue>\n <integerValue>3</integerValue>\n <longValue>4</longValue>\n <floatValue>5.5</floatValue>\n <doubleValue>6.5</doubleValue>\n </structValue>\n </unionValue>\n</XmlUnionsResponse>\n"))
|
365 366 | .unwrap()
|
366 367 | ).unwrap();
|
367 368 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
368 369 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
369 370 |
|
370 371 | let op = crate::operation::xml_unions::XmlUnions::new();
|
371 372 | let config = op.config().expect("the operation has config");
|
372 373 | let de = config
|
373 374 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
374 375 | .expect("the config must have a deserializer");
|
375 376 |
|
376 377 | let parsed = de.deserialize_streaming(&mut http_response);
|
377 378 | let parsed = parsed.unwrap_or_else(|| {
|
378 379 | let http_response =
|
379 380 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
380 381 | de.deserialize_nonstreaming(&http_response)
|
381 382 | });
|
382 383 | let parsed = parsed
|
383 384 | .expect("should be successful response")
|
384 385 | .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
|
385 386 | .unwrap();
|
386 387 | ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
|
387 388 | }
|
388 389 | /// Serializes union string member
|
389 390 | /// Test ID: XmlUnionsWithStringMember
|
390 391 | #[::tokio::test]
|
391 - | #[allow(unused_mut)]
|
392 + | #[::tracing_test::traced_test]
|
392 393 | async fn xml_unions_with_string_member_response() {
|
393 394 | let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
|
394 395 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::StringValue(
|
395 396 | "some string".to_owned(),
|
396 397 | )))
|
397 398 | .build();
|
398 399 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
399 400 | ::http::response::Builder::new()
|
400 401 | .header("Content-Type", "application/xml")
|
401 402 | .status(200)
|
402 403 | .body(::aws_smithy_types::body::SdkBody::from(
|
403 404 | "<XmlUnionsResponse>\n <unionValue>\n <stringValue>some string</stringValue>\n </unionValue>\n</XmlUnionsResponse>\n",
|
404 405 | ))
|
405 406 | .unwrap(),
|
406 407 | )
|
407 408 | .unwrap();
|
408 409 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
409 410 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
410 411 |
|
411 412 | let op = crate::operation::xml_unions::XmlUnions::new();
|
412 413 | let config = op.config().expect("the operation has config");
|
413 414 | let de = config
|
414 415 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
415 416 | .expect("the config must have a deserializer");
|
416 417 |
|
417 418 | let parsed = de.deserialize_streaming(&mut http_response);
|
418 419 | let parsed = parsed.unwrap_or_else(|| {
|
419 420 | let http_response =
|
420 421 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
421 422 | de.deserialize_nonstreaming(&http_response)
|
422 423 | });
|
423 424 | let parsed = parsed
|
424 425 | .expect("should be successful response")
|
425 426 | .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
|
426 427 | .unwrap();
|
427 428 | ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
|
428 429 | }
|
429 430 | /// Serializes union boolean member
|
430 431 | /// Test ID: XmlUnionsWithBooleanMember
|
431 432 | #[::tokio::test]
|
432 - | #[allow(unused_mut)]
|
433 + | #[::tracing_test::traced_test]
|
433 434 | async fn xml_unions_with_boolean_member_response() {
|
434 435 | let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
|
435 436 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::BooleanValue(true)))
|
436 437 | .build();
|
437 438 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(
|
438 439 | ::http::response::Builder::new()
|
439 440 | .header("Content-Type", "application/xml")
|
440 441 | .status(200)
|
441 442 | .body(::aws_smithy_types::body::SdkBody::from(
|
442 443 | "<XmlUnionsResponse>\n <unionValue>\n <booleanValue>true</booleanValue>\n </unionValue>\n</XmlUnionsResponse>\n",
|
443 444 | ))
|
444 445 | .unwrap(),
|
445 446 | )
|
446 447 | .unwrap();
|
447 448 | use ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin;
|
448 449 | use ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse;
|
449 450 |
|
450 451 | let op = crate::operation::xml_unions::XmlUnions::new();
|
451 452 | let config = op.config().expect("the operation has config");
|
452 453 | let de = config
|
453 454 | .load::<::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer>()
|
454 455 | .expect("the config must have a deserializer");
|
455 456 |
|
456 457 | let parsed = de.deserialize_streaming(&mut http_response);
|
457 458 | let parsed = parsed.unwrap_or_else(|| {
|
458 459 | let http_response =
|
459 460 | http_response.map(|body| ::aws_smithy_types::body::SdkBody::from(::bytes::Bytes::copy_from_slice(body.bytes().unwrap())));
|
460 461 | de.deserialize_nonstreaming(&http_response)
|
461 462 | });
|
462 463 | let parsed = parsed
|
463 464 | .expect("should be successful response")
|
464 465 | .downcast::<crate::operation::xml_unions::XmlUnionsOutput>()
|
465 466 | .unwrap();
|
466 467 | ::pretty_assertions::assert_eq!(parsed.union_value, expected_output.union_value, "Unexpected value for `union_value`");
|
467 468 | }
|
468 469 | /// Serializes union member
|
469 470 | /// Test ID: XmlUnionsWithUnionMember
|
470 471 | #[::tokio::test]
|
471 - | #[allow(unused_mut)]
|
472 + | #[::tracing_test::traced_test]
|
472 473 | async fn xml_unions_with_union_member_response() {
|
473 474 | let expected_output = crate::operation::xml_unions::XmlUnionsOutput::builder()
|
474 475 | .set_union_value(::std::option::Option::Some(crate::types::XmlUnionShape::UnionValue(
|
475 476 | ::std::boxed::Box::new(crate::types::XmlUnionShape::BooleanValue(true)),
|
476 477 | )))
|
477 478 | .build();
|
478 479 | let mut http_response = ::aws_smithy_runtime_api::http::Response::try_from(::http::response::Builder::new()
|
479 480 | .header("Content-Type", "application/xml")
|
480 481 | .status(200)
|
481 482 | .body(::aws_smithy_types::body::SdkBody::from("<XmlUnionsResponse>\n <unionValue>\n <unionValue>\n <booleanValue>true</booleanValue>\n </unionValue>\n </unionValue>\n</XmlUnionsResponse>\n"))
|