210 210 |
|
211 211 | ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
|
212 212 | }
|
213 213 | }
|
214 214 | #[derive(Debug)]
|
215 215 | struct OperationWithRequiredMembersWithDefaultsEndpointParamsInterceptor;
|
216 216 |
|
217 217 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for OperationWithRequiredMembersWithDefaultsEndpointParamsInterceptor {
|
218 218 | fn name(&self) -> &'static str {
|
219 219 | "OperationWithRequiredMembersWithDefaultsEndpointParamsInterceptor"
|
220 220 | }
|
221 221 |
|
222 222 | fn read_before_execution(
|
223 223 | &self,
|
224 224 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
225 225 | '_,
|
226 226 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
227 227 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
228 228 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
229 229 | >,
|
230 230 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
231 231 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
232 232 | let _input = context
|
233 233 | .input()
|
234 234 | .downcast_ref::<OperationWithRequiredMembersWithDefaultsInput>()
|
235 235 | .ok_or("failed to downcast to OperationWithRequiredMembersWithDefaultsInput")?;
|
236 236 |
|
237 237 | let params = crate::config::endpoint::Params::builder().build().map_err(|err| {
|
238 238 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
239 239 | })?;
|
240 + |
|
240 241 | cfg.interceptor_state()
|
241 242 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
243 + |
|
242 244 | ::std::result::Result::Ok(())
|
243 245 | }
|
244 246 | }
|
245 247 |
|
246 248 | // The get_* functions below are generated from JMESPath expressions in the
|
247 249 | // operationContextParams trait. They target the operation's input shape.
|
248 250 |
|
249 251 | #[allow(unreachable_code, unused_variables)]
|
250 252 | #[cfg(test)]
|
251 253 | mod operation_with_required_members_with_defaults_test {
|
252 254 | use ::aws_smithy_protocol_test::FloatEquals;
|
253 255 |
|
254 256 | /// Client error corrects with default values when server fails to serialize required values.
|
255 257 | /// Test ID: AwsJson10ClientErrorCorrectsWithDefaultValuesWhenServerFailsToSerializeRequiredValues
|
256 258 | #[::tokio::test]
|
257 259 | #[::tracing_test::traced_test]
|
258 260 | #[should_panic]
|
259 261 | async fn aws_json10_client_error_corrects_with_default_values_when_server_fails_to_serialize_required_values_response() {
|
260 262 | let expected_output =
|
261 263 | crate::operation::operation_with_required_members_with_defaults::OperationWithRequiredMembersWithDefaultsOutput::builder()
|
262 264 | .set_required_string(::std::option::Option::Some("hi".to_owned()))
|
263 265 | .set_required_boolean(::std::option::Option::Some(true))
|
264 266 | .set_required_list(::std::option::Option::Some(vec![]))
|
265 267 | .set_required_timestamp(::std::option::Option::Some(::aws_smithy_types::DateTime::from_fractional_secs(1, 0_f64)))
|
266 268 | .set_required_blob(::std::option::Option::Some(::aws_smithy_types::Blob::new("blob")))
|
267 269 | .set_required_byte(::std::option::Option::Some(1))
|
268 270 | .set_required_short(::std::option::Option::Some(1))
|
269 271 | .set_required_integer(::std::option::Option::Some(10))
|
270 272 | .set_required_long(::std::option::Option::Some(100))
|
271 273 | .set_required_float(::std::option::Option::Some(1.0_f32))
|