211 211 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
212 212 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
213 213 | })?;
|
214 214 | cfg.interceptor_state()
|
215 215 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
216 216 | ::std::result::Result::Ok(())
|
217 217 | }
|
218 218 | }
|
219 219 | #[allow(unreachable_code, unused_variables)]
|
220 220 | #[cfg(test)]
|
221 - | mod sparse_json_maps_request_test {
|
221 + | mod sparse_json_maps_test {
|
222 + |
|
222 223 | /// Serializes JSON maps
|
223 224 | /// Test ID: RestJsonSparseJsonMaps
|
224 225 | #[::tokio::test]
|
225 - | #[allow(unused_mut)]
|
226 + | #[::tracing_test::traced_test]
|
226 227 | async fn rest_json_sparse_json_maps_request() {
|
227 228 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
228 229 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
229 230 |
|
230 231 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
231 232 | let result = client
|
232 233 | .sparse_json_maps()
|
233 234 | .set_sparse_struct_map(::std::option::Option::Some({
|
234 235 | let mut ret = ::std::collections::HashMap::new();
|
235 236 | ret.insert(
|
236 237 | "foo".to_owned(),
|
237 238 | ::std::option::Option::Some(
|
238 239 | crate::types::GreetingStruct::builder()
|
239 240 | .set_hi(::std::option::Option::Some("there".to_owned()))
|
240 241 | .build(),
|
241 242 | ),
|
242 243 | );
|
243 244 | ret.insert(
|
244 245 | "baz".to_owned(),
|
245 246 | ::std::option::Option::Some(
|
246 247 | crate::types::GreetingStruct::builder()
|
247 248 | .set_hi(::std::option::Option::Some("bye".to_owned()))
|
248 249 | .build(),
|
249 250 | ),
|
250 251 | );
|
251 252 | ret
|
252 253 | }))
|
253 254 | .send()
|
254 255 | .await;
|
255 256 | let _ = dbg!(result);
|
256 257 | let http_request = request_receiver.expect_request();
|
257 258 | let expected_headers = [("Content-Type", "application/json")];
|
258 259 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
259 260 | let body = http_request.body().bytes().expect("body should be strict");
|
260 261 | ::aws_smithy_protocol_test::assert_ok(
|
261 262 | ::aws_smithy_protocol_test::validate_body(body, "{\n \"sparseStructMap\": {\n \"foo\": {\n \"hi\": \"there\"\n },\n \"baz\": {\n \"hi\": \"bye\"\n }\n }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
262 263 | );
|
263 264 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
264 265 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
265 266 | ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
|
266 267 | }
|
267 268 | /// Serializes JSON map values in sparse maps
|
268 269 | /// Test ID: RestJsonSerializesSparseNullMapValues
|
269 270 | #[::tokio::test]
|
270 - | #[allow(unused_mut)]
|
271 + | #[::tracing_test::traced_test]
|
271 272 | async fn rest_json_serializes_sparse_null_map_values_request() {
|
272 273 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
273 274 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
274 275 |
|
275 276 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
276 277 | let result = client
|
277 278 | .sparse_json_maps()
|
278 279 | .set_sparse_boolean_map(::std::option::Option::Some({
|
279 280 | let mut ret = ::std::collections::HashMap::new();
|
280 281 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
281 282 | ret
|
282 283 | }))
|
283 284 | .set_sparse_number_map(::std::option::Option::Some({
|
284 285 | let mut ret = ::std::collections::HashMap::new();
|
285 286 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
286 287 | ret
|
287 288 | }))
|
288 289 | .set_sparse_string_map(::std::option::Option::Some({
|
289 290 | let mut ret = ::std::collections::HashMap::new();
|
290 291 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
291 292 | ret
|
292 293 | }))
|
293 294 | .set_sparse_struct_map(::std::option::Option::Some({
|
294 295 | let mut ret = ::std::collections::HashMap::new();
|
295 296 | ret.insert("x".to_owned(), ::std::option::Option::None);
|
296 297 | ret
|
297 298 | }))
|
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/json")];
|
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(
|
306 307 | ::aws_smithy_protocol_test::validate_body(body, "{\n \"sparseBooleanMap\": {\n \"x\": null\n },\n \"sparseNumberMap\": {\n \"x\": null\n },\n \"sparseStringMap\": {\n \"x\": null\n },\n \"sparseStructMap\": {\n \"x\": null\n }\n}", ::aws_smithy_protocol_test::MediaType::from("application/json"))
|
307 308 | );
|
308 309 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
309 310 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
310 311 | ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
|
311 312 | }
|
312 313 | /// Ensure that 0 and false are sent over the wire in all maps and lists
|
313 314 | /// Test ID: RestJsonSerializesZeroValuesInSparseMaps
|
314 315 | #[::tokio::test]
|
315 - | #[allow(unused_mut)]
|
316 + | #[::tracing_test::traced_test]
|
316 317 | async fn rest_json_serializes_zero_values_in_sparse_maps_request() {
|
317 318 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
318 319 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
319 320 |
|
320 321 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
321 322 | let result = client
|
322 323 | .sparse_json_maps()
|
323 324 | .set_sparse_number_map(::std::option::Option::Some({
|
324 325 | let mut ret = ::std::collections::HashMap::new();
|
325 326 | ret.insert("x".to_owned(), ::std::option::Option::Some(0));
|
326 327 | ret
|
327 328 | }))
|
328 329 | .set_sparse_boolean_map(::std::option::Option::Some({
|
329 330 | let mut ret = ::std::collections::HashMap::new();
|
330 331 | ret.insert("x".to_owned(), ::std::option::Option::Some(false));
|
331 332 | ret
|
332 333 | }))
|
333 334 | .send()
|
334 335 | .await;
|
335 336 | let _ = dbg!(result);
|
336 337 | let http_request = request_receiver.expect_request();
|
337 338 | let expected_headers = [("Content-Type", "application/json")];
|
338 339 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
339 340 | let body = http_request.body().bytes().expect("body should be strict");
|
340 341 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
341 342 | body,
|
342 343 | "{\n \"sparseNumberMap\": {\n \"x\": 0\n },\n \"sparseBooleanMap\": {\n \"x\": false\n }\n}",
|
343 344 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
344 345 | ));
|
345 346 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
346 347 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
347 348 | ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
|
348 349 | }
|
349 350 | /// A request that contains a sparse map of sets
|
350 351 | /// Test ID: RestJsonSerializesSparseSetMap
|
351 352 | #[::tokio::test]
|
352 - | #[allow(unused_mut)]
|
353 + | #[::tracing_test::traced_test]
|
353 354 | async fn rest_json_serializes_sparse_set_map_request() {
|
354 355 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
355 356 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
356 357 |
|
357 358 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
358 359 | let result = client
|
359 360 | .sparse_json_maps()
|
360 361 | .set_sparse_set_map(::std::option::Option::Some({
|
361 362 | let mut ret = ::std::collections::HashMap::new();
|
362 363 | ret.insert("x".to_owned(), ::std::option::Option::Some(vec![]));
|
363 364 | ret.insert("y".to_owned(), ::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned()]));
|
364 365 | ret
|
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 = [("Content-Type", "application/json")];
|
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 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
374 375 | body,
|
375 376 | "{\n \"sparseSetMap\": {\n \"x\": [],\n \"y\": [\"a\", \"b\"]\n }\n}",
|
376 377 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
377 378 | ));
|
378 379 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
379 380 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
380 381 | ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
|
381 382 | }
|
382 383 | /// A request that contains a sparse map of sets.
|
383 384 | /// Test ID: RestJsonSerializesSparseSetMapAndRetainsNull
|
384 385 | #[::tokio::test]
|
385 - | #[allow(unused_mut)]
|
386 + | #[::tracing_test::traced_test]
|
386 387 | async fn rest_json_serializes_sparse_set_map_and_retains_null_request() {
|
387 388 | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
388 389 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
389 390 |
|
390 391 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
391 392 | let result = client
|
392 393 | .sparse_json_maps()
|
393 394 | .set_sparse_set_map(::std::option::Option::Some({
|
394 395 | let mut ret = ::std::collections::HashMap::new();
|
395 396 | ret.insert("x".to_owned(), ::std::option::Option::Some(vec![]));
|
396 397 | ret.insert("y".to_owned(), ::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned()]));
|
397 398 | ret.insert("z".to_owned(), ::std::option::Option::None);
|
398 399 | ret
|
399 400 | }))
|
400 401 | .send()
|
401 402 | .await;
|
402 403 | let _ = dbg!(result);
|
403 404 | let http_request = request_receiver.expect_request();
|
404 405 | let expected_headers = [("Content-Type", "application/json")];
|
405 406 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
406 407 | let body = http_request.body().bytes().expect("body should be strict");
|
407 408 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
408 409 | body,
|
409 410 | "{\n \"sparseSetMap\": {\n \"x\": [],\n \"y\": [\"a\", \"b\"],\n \"z\": null\n }\n}",
|
410 411 | ::aws_smithy_protocol_test::MediaType::from("application/json"),
|
411 412 | ));
|
412 413 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
413 414 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
414 415 | ::pretty_assertions::assert_eq!(uri.path(), "/SparseJsonMaps", "path was incorrect");
|
415 416 | }
|
416 417 | /// Deserializes JSON maps
|
417 418 | /// Test ID: RestJsonSparseJsonMaps
|
418 419 | #[::tokio::test]
|
419 - | #[allow(unused_mut)]
|
420 + | #[::tracing_test::traced_test]
|
420 421 | async fn rest_json_sparse_json_maps_response() {
|
421 422 | let expected_output = crate::operation::sparse_json_maps::SparseJsonMapsOutput::builder()
|
422 423 | .set_sparse_struct_map(::std::option::Option::Some({
|
423 424 | let mut ret = ::std::collections::HashMap::new();
|
424 425 | ret.insert(
|
425 426 | "foo".to_owned(),
|
426 427 | ::std::option::Option::Some(
|
427 428 | crate::types::GreetingStruct::builder()
|
428 429 | .set_hi(::std::option::Option::Some("there".to_owned()))
|
429 430 | .build(),
|