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