214 214 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
215 215 | >,
|
216 216 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
217 217 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
218 218 | let _input = context
|
219 219 | .input()
|
220 220 | .downcast_ref::<SparseNullsOperationInput>()
|
221 221 | .ok_or("failed to downcast to SparseNullsOperationInput")?;
|
222 222 |
|
223 223 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
224 224 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
225 225 | })?;
|
226 226 | cfg.interceptor_state()
|
227 227 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
228 228 | ::std::result::Result::Ok(())
|
229 229 | }
|
230 230 | }
|
231 231 |
|
232 232 | // The get_* functions below are generated from JMESPath expressions in the
|
233 233 | // operationContextParams trait. They target the operation's input shape.
|
234 234 |
|
235 235 | #[allow(unreachable_code, unused_variables)]
|
236 236 | #[cfg(test)]
|
237 237 | mod sparse_nulls_operation_test {
|
238 238 |
|
239 239 | /// Serializes null values in maps
|
240 240 | /// Test ID: RpcV2CborSparseMapsSerializeNullValues
|
241 241 | #[::tokio::test]
|
242 242 | #[::tracing_test::traced_test]
|
243 243 | async fn rpc_v2_cbor_sparse_maps_serialize_null_values_request() {
|
244 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
244 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
245 245 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
246 246 |
|
247 247 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
248 248 | let result = client
|
249 249 | .sparse_nulls_operation()
|
250 250 | .set_sparse_string_map(::std::option::Option::Some({
|
251 251 | let mut ret = ::std::collections::HashMap::new();
|
252 252 | ret.insert("foo".to_owned(), ::std::option::Option::None);
|
253 253 | ret
|
254 254 | }))
|
255 255 | .send()
|
256 256 | .await;
|
257 257 | let _ = dbg!(result);
|
258 258 | let http_request = request_receiver.expect_request();
|
259 259 | let expected_headers = [
|
260 260 | ("Accept", "application/cbor"),
|
261 261 | ("Content-Type", "application/cbor"),
|
262 262 | ("smithy-protocol", "rpc-v2-cbor"),
|
263 263 | ];
|
264 264 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
265 265 | let required_headers = &["Content-Length"];
|
266 266 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
267 267 | let body = http_request.body().bytes().expect("body should be strict");
|
268 268 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
269 269 | body,
|
270 270 | "v29zcGFyc2VTdHJpbmdNYXC/Y2Zvb/b//w==",
|
271 271 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
272 272 | ));
|
273 273 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
274 274 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
275 275 | ::pretty_assertions::assert_eq!(uri.path(), "/service/RpcV2Protocol/operation/SparseNullsOperation", "path was incorrect");
|
276 276 | }
|
277 277 |
|
278 278 | /// Serializes null values in lists
|
279 279 | /// Test ID: RpcV2CborSparseListsSerializeNull
|
280 280 | #[::tokio::test]
|
281 281 | #[::tracing_test::traced_test]
|
282 282 | async fn rpc_v2_cbor_sparse_lists_serialize_null_request() {
|
283 - | let (http_client, request_receiver) = ::aws_smithy_runtime::client::http::test_util::capture_request(None);
|
283 + | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
284 284 | let config_builder = crate::config::Config::builder().with_test_defaults().endpoint_url("https://example.com");
|
285 285 |
|
286 286 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
287 287 | let result = client
|
288 288 | .sparse_nulls_operation()
|
289 289 | .set_sparse_string_list(::std::option::Option::Some(vec![::std::option::Option::None]))
|
290 290 | .send()
|
291 291 | .await;
|
292 292 | let _ = dbg!(result);
|
293 293 | let http_request = request_receiver.expect_request();
|
294 294 | let expected_headers = [
|
295 295 | ("Accept", "application/cbor"),
|
296 296 | ("Content-Type", "application/cbor"),
|
297 297 | ("smithy-protocol", "rpc-v2-cbor"),
|
298 298 | ];
|
299 299 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_headers(http_request.headers(), expected_headers));
|
300 300 | let required_headers = &["Content-Length"];
|
301 301 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::require_headers(http_request.headers(), required_headers));
|
302 302 | let body = http_request.body().bytes().expect("body should be strict");
|
303 303 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_body(
|
304 304 | body,
|
305 305 | "v3BzcGFyc2VTdHJpbmdMaXN0n/b//w==",
|
306 306 | ::aws_smithy_protocol_test::MediaType::from("application/cbor"),
|
307 307 | ));
|
308 308 | let uri: ::http::Uri = http_request.uri().parse().expect("invalid URI sent");
|
309 309 | ::pretty_assertions::assert_eq!(http_request.method(), "POST", "method was incorrect");
|
310 310 | ::pretty_assertions::assert_eq!(uri.path(), "/service/RpcV2Protocol/operation/SparseNullsOperation", "path was incorrect");
|
311 311 | }
|
312 312 |
|
313 313 | /// Deserializes null values in maps
|