256 256 |
|
257 257 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
258 258 | }
|
259 259 | }
|
260 260 | #[derive(Debug)]
|
261 261 | struct OmitsSerializingEmptyListsEndpointParamsInterceptor;
|
262 262 |
|
263 263 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OmitsSerializingEmptyListsEndpointParamsInterceptor {
|
264 264 | fn name(&self) -> &'static str {
|
265 265 | "OmitsSerializingEmptyListsEndpointParamsInterceptor"
|
266 266 | }
|
267 267 |
|
268 268 | fn read_before_execution(
|
269 269 | &self,
|
270 270 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
271 271 | '_,
|
272 272 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
273 273 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
274 274 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
275 275 | >,
|
276 276 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
277 277 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
278 278 | let _input = context
|
279 279 | .input()
|
280 280 | .downcast_ref::<OmitsSerializingEmptyListsInput>()
|
281 281 | .ok_or("failed to downcast to OmitsSerializingEmptyListsInput")?;
|
282 282 |
|
283 283 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
284 284 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
285 285 | })?;
|
286 + |
|
286 287 | cfg.interceptor_state()
|
287 288 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
289 + |
|
288 290 | ::std::result::Result::Ok(())
|
289 291 | }
|
290 292 | }
|
291 293 |
|
292 294 | // The get_* functions below are generated from JMESPath expressions in the
|
293 295 | // operationContextParams trait. They target the operation's input shape.
|
294 296 |
|
295 297 | #[allow(unreachable_code, unused_variables)]
|
296 298 | #[cfg(test)]
|
297 299 | mod omits_serializing_empty_lists_test {
|
298 300 |
|
299 301 | /// Supports omitting empty lists.
|
300 302 | /// Test ID: RestJsonOmitsEmptyListQueryValues
|
301 303 | #[::tokio::test]
|
302 304 | #[::tracing_test::traced_test]
|
303 305 | async fn rest_json_omits_empty_list_query_values_request() {
|
304 306 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
305 307 | let config_builder = crate::config::Config::builder()
|
306 308 | .with_test_defaults()
|
307 309 | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
308 310 | .endpoint_url("https://example.com");
|
309 311 |
|
310 312 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
311 313 | let result = client
|
312 314 | .omits_serializing_empty_lists()
|
313 315 | .set_query_string_list(::std::option::Option::Some(vec![]))
|
314 316 | .set_query_integer_list(::std::option::Option::Some(vec![]))
|
315 317 | .set_query_double_list(::std::option::Option::Some(vec![]))
|
316 318 | .set_query_boolean_list(::std::option::Option::Some(vec![]))
|
317 319 | .set_query_timestamp_list(::std::option::Option::Some(vec![]))
|