226 226 |
|
227 227 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ModifyDefaultCreditSpecificationEndpointParamsInterceptor {
|
228 228 | fn name(&self) -> &'static str {
|
229 229 | "ModifyDefaultCreditSpecificationEndpointParamsInterceptor"
|
230 230 | }
|
231 231 |
|
232 232 | fn read_before_execution(
|
233 233 | &self,
|
234 234 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
235 235 | '_,
|
236 236 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
237 237 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
238 238 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
239 239 | >,
|
240 240 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
241 241 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
242 242 | let _input = context
|
243 243 | .input()
|
244 244 | .downcast_ref::<ModifyDefaultCreditSpecificationInput>()
|
245 245 | .ok_or("failed to downcast to ModifyDefaultCreditSpecificationInput")?;
|
246 246 |
|
247 247 | let params = crate::config::endpoint::Params::builder()
|
248 248 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
249 249 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
250 250 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
251 251 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
252 252 | .build()
|
253 253 | .map_err(|err| {
|
254 254 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
255 255 | })?;
|
256 + |
|
256 257 | cfg.interceptor_state()
|
257 258 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
259 + |
|
258 260 | ::std::result::Result::Ok(())
|
259 261 | }
|
260 262 | }
|
261 263 |
|
262 264 | // The get_* functions below are generated from JMESPath expressions in the
|
263 265 | // operationContextParams trait. They target the operation's input shape.
|
264 266 |
|
265 267 | /// Error type for the `ModifyDefaultCreditSpecificationError` operation.
|
266 268 | #[non_exhaustive]
|
267 269 | #[derive(::std::fmt::Debug)]
|
268 270 | pub enum ModifyDefaultCreditSpecificationError {
|
269 271 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
270 272 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
271 273 | variable wildcard pattern and check `.code()`:
|
272 274 | \
|
273 275 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
274 276 | \
|
275 277 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ModifyDefaultCreditSpecificationError) for what information is available for the error.")]
|
276 278 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
277 279 | }
|
278 280 | impl ModifyDefaultCreditSpecificationError {
|
279 281 | /// Creates the `ModifyDefaultCreditSpecificationError::Unhandled` variant from any error type.
|
280 282 | pub fn unhandled(
|
281 283 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
282 284 | ) -> Self {
|
283 285 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
284 286 | source: err.into(),
|
285 287 | meta: ::std::default::Default::default(),
|
286 288 | })
|
287 289 | }
|