197 197 |
|
198 198 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
199 199 | }
|
200 200 | }
|
201 201 | #[derive(Debug)]
|
202 202 | struct InputAndOutputWithHeadersEndpointParamsInterceptor;
|
203 203 |
|
204 204 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for InputAndOutputWithHeadersEndpointParamsInterceptor {
|
205 205 | fn name(&self) -> &'static str {
|
206 206 | "InputAndOutputWithHeadersEndpointParamsInterceptor"
|
207 207 | }
|
208 208 |
|
209 209 | fn read_before_execution(
|
210 210 | &self,
|
211 211 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
212 212 | '_,
|
213 213 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
214 214 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
215 215 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
216 216 | >,
|
217 217 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
218 218 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
219 219 | let _input = context
|
220 220 | .input()
|
221 221 | .downcast_ref::<InputAndOutputWithHeadersInput>()
|
222 222 | .ok_or("failed to downcast to InputAndOutputWithHeadersInput")?;
|
223 223 |
|
224 224 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
225 225 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
226 226 | })?;
|
227 + |
|
227 228 | cfg.interceptor_state()
|
228 229 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
230 + |
|
229 231 | ::std::result::Result::Ok(())
|
230 232 | }
|
231 233 | }
|
232 234 |
|
233 235 | // The get_* functions below are generated from JMESPath expressions in the
|
234 236 | // operationContextParams trait. They target the operation's input shape.
|
235 237 |
|
236 238 | #[allow(unreachable_code, unused_variables)]
|
237 239 | #[cfg(test)]
|
238 240 | mod input_and_output_with_headers_test {
|
239 241 | use ::aws_smithy_protocol_test::FloatEquals;
|
240 242 |
|
241 243 | /// Tests requests with string header bindings
|
242 244 | /// Test ID: InputAndOutputWithStringHeaders
|
243 245 | #[::tokio::test]
|
244 246 | #[::tracing_test::traced_test]
|
245 247 | async fn input_and_output_with_string_headers_request() {
|
246 248 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
247 249 | let config_builder = crate::config::Config::builder()
|
248 250 | .with_test_defaults()
|
249 251 | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
250 252 | .endpoint_url("https://example.com");
|
251 253 |
|
252 254 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
253 255 | let result = client
|
254 256 | .input_and_output_with_headers()
|
255 257 | .set_header_string(::std::option::Option::Some("Hello".to_owned()))
|
256 258 | .set_header_string_list(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
|
257 259 | .set_header_string_set(::std::option::Option::Some(vec!["a".to_owned(), "b".to_owned(), "c".to_owned()]))
|
258 260 | .send()
|