196 196 |
|
197 197 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
198 198 | }
|
199 199 | }
|
200 200 | #[derive(Debug)]
|
201 201 | struct TestGetNoInputNoPayloadEndpointParamsInterceptor;
|
202 202 |
|
203 203 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TestGetNoInputNoPayloadEndpointParamsInterceptor {
|
204 204 | fn name(&self) -> &'static str {
|
205 205 | "TestGetNoInputNoPayloadEndpointParamsInterceptor"
|
206 206 | }
|
207 207 |
|
208 208 | fn read_before_execution(
|
209 209 | &self,
|
210 210 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
211 211 | '_,
|
212 212 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
213 213 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
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::<TestGetNoInputNoPayloadInput>()
|
221 221 | .ok_or("failed to downcast to TestGetNoInputNoPayloadInput")?;
|
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 227 | cfg.interceptor_state()
|
227 228 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
229 + |
|
228 230 | ::std::result::Result::Ok(())
|
229 231 | }
|
230 232 | }
|
231 233 |
|
232 234 | // The get_* functions below are generated from JMESPath expressions in the
|
233 235 | // operationContextParams trait. They target the operation's input shape.
|
234 236 |
|
235 237 | #[allow(unreachable_code, unused_variables)]
|
236 238 | #[cfg(test)]
|
237 239 | mod test_get_no_input_no_payload_test {
|
238 240 |
|
239 241 | /// Serializes a GET request for an operation with no input, and therefore no modeled body
|
240 242 | /// Test ID: RestJsonHttpGetWithNoInput
|
241 243 | #[::tokio::test]
|
242 244 | #[::tracing_test::traced_test]
|
243 245 | async fn rest_json_http_get_with_no_input_request() {
|
244 246 | let (http_client, request_receiver) = ::aws_smithy_http_client::test_util::capture_request(None);
|
245 247 | let config_builder = crate::config::Config::builder()
|
246 248 | .with_test_defaults()
|
247 249 | .auth_scheme_resolver(crate::config::auth::NoAuthSchemeResolver)
|
248 250 | .endpoint_url("https://example.com");
|
249 251 |
|
250 252 | let client = crate::Client::from_conf(config_builder.http_client(http_client).build());
|
251 253 | let result = client.test_get_no_input_no_payload().send().await;
|
252 254 | let _ = dbg!(result);
|
253 255 | let http_request = request_receiver.expect_request();
|
254 256 | let forbidden_headers = &["Content-Type", "Content-Length"];
|
255 257 | ::aws_smithy_protocol_test::assert_ok(::aws_smithy_protocol_test::forbid_headers(http_request.headers(), forbidden_headers));
|
256 258 | let body = http_request.body().bytes().expect("body should be strict");
|
257 259 | // No body.
|