217 217 |
|
218 218 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
219 219 | }
|
220 220 | }
|
221 221 | #[derive(Debug)]
|
222 222 | struct QueryIdempotencyTokenAutoFillEndpointParamsInterceptor;
|
223 223 |
|
224 224 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for QueryIdempotencyTokenAutoFillEndpointParamsInterceptor {
|
225 225 | fn name(&self) -> &'static str {
|
226 226 | "QueryIdempotencyTokenAutoFillEndpointParamsInterceptor"
|
227 227 | }
|
228 228 |
|
229 229 | fn read_before_execution(
|
230 230 | &self,
|
231 231 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
232 232 | '_,
|
233 233 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
234 234 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
235 235 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
236 236 | >,
|
237 237 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
238 238 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
239 239 | let _input = context
|
240 240 | .input()
|
241 241 | .downcast_ref::<QueryIdempotencyTokenAutoFillInput>()
|
242 242 | .ok_or("failed to downcast to QueryIdempotencyTokenAutoFillInput")?;
|
243 243 |
|
244 244 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
245 245 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
246 246 | })?;
|
247 + |
|
247 248 | cfg.interceptor_state()
|
248 249 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
250 + |
|
249 251 | ::std::result::Result::Ok(())
|
250 252 | }
|
251 253 | }
|
252 254 |
|
253 255 | // The get_* functions below are generated from JMESPath expressions in the
|
254 256 | // operationContextParams trait. They target the operation's input shape.
|
255 257 |
|
256 258 | #[allow(unreachable_code, unused_variables)]
|
257 259 | #[cfg(test)]
|
258 260 | mod query_idempotency_token_auto_fill_test {
|
259 261 |
|
260 262 | /// Automatically adds idempotency token when not set
|
261 263 | /// Test ID: RestJsonQueryIdempotencyTokenAutoFill
|
262 264 | #[::tokio::test]
|
263 265 | #[::tracing_test::traced_test]
|
264 266 | async fn rest_json_query_idempotency_token_auto_fill_request() {
|
265 267 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
266 268 | let config_builder = crate::config::Config::builder()
|
267 269 | .with_test_defaults()
|
268 270 | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
269 271 | .endpoint_url("https://example.com");
|
270 272 |
|
271 273 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
272 274 | let result = client.query_idempotency_token_auto_fill().send().await;
|
273 275 | let _ = dbg!(result);
|
274 276 | let http_request = request_receiver.expect_request();
|
275 277 | let expected_query_params = &["token=00000000-0000-4000-8000-000000000000"];
|
276 278 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::validate_query_string(&http_request, expected_query_params));
|
277 279 | let body = http_request.body().bytes().expect("body should be strict");
|
278 280 | // No body.
|