249 249 |
|
250 250 | impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListCidrBlocksEndpointParamsInterceptor {
|
251 251 | fn name(&self) -> &'static str {
|
252 252 | "ListCidrBlocksEndpointParamsInterceptor"
|
253 253 | }
|
254 254 |
|
255 255 | fn read_before_execution(
|
256 256 | &self,
|
257 257 | context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
|
258 258 | '_,
|
259 259 | ::aws_smithy_runtime_api::client::interceptors::context::Input,
|
260 260 | ::aws_smithy_runtime_api::client::interceptors::context::Output,
|
261 261 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
262 262 | >,
|
263 263 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
264 264 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
265 265 | let _input = context
|
266 266 | .input()
|
267 267 | .downcast_ref::<ListCidrBlocksInput>()
|
268 268 | .ok_or("failed to downcast to ListCidrBlocksInput")?;
|
269 269 |
|
270 270 | let params = crate::config::endpoint::Params::builder()
|
271 271 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
272 272 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
273 273 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
274 274 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
275 275 | .build()
|
276 276 | .map_err(|err| {
|
277 277 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
278 278 | })?;
|
279 + |
|
279 280 | cfg.interceptor_state()
|
280 281 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
282 + |
|
281 283 | ::std::result::Result::Ok(())
|
282 284 | }
|
283 285 | }
|
284 286 |
|
285 287 | // The get_* functions below are generated from JMESPath expressions in the
|
286 288 | // operationContextParams trait. They target the operation's input shape.
|
287 289 |
|
288 290 | /// Error type for the `ListCidrBlocksError` operation.
|
289 291 | #[non_exhaustive]
|
290 292 | #[derive(::std::fmt::Debug)]
|
291 293 | pub enum ListCidrBlocksError {
|
292 294 | /// <p>The input is not valid.</p>
|
293 295 | InvalidInput(crate::types::error::InvalidInput),
|
294 296 | /// <p>The CIDR collection you specified, doesn't exist.</p>
|
295 297 | NoSuchCidrCollectionException(crate::types::error::NoSuchCidrCollectionException),
|
296 298 | /// <p>The CIDR collection location doesn't match any locations in your account.</p>
|
297 299 | NoSuchCidrLocationException(crate::types::error::NoSuchCidrLocationException),
|
298 300 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
299 301 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
300 302 | variable wildcard pattern and check `.code()`:
|
301 303 | \
|
302 304 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
303 305 | \
|
304 306 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ListCidrBlocksError) for what information is available for the error.")]
|
305 307 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
306 308 | }
|
307 309 | impl ListCidrBlocksError {
|
308 310 | /// Creates the `ListCidrBlocksError::Unhandled` variant from any error type.
|
309 311 | pub fn unhandled(
|
310 312 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|