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