312 312 | ::aws_smithy_runtime_api::client::interceptors::context::Error,
|
313 313 | >,
|
314 314 | cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
|
315 315 | ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
|
316 316 | let _input = context
|
317 317 | .input()
|
318 318 | .downcast_ref::<PutObjectLockConfigurationInput>()
|
319 319 | .ok_or("failed to downcast to PutObjectLockConfigurationInput")?;
|
320 320 |
|
321 321 | let params = crate::config::endpoint::Params::builder()
|
322 322 | .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
|
323 323 | .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
|
324 324 | .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
|
325 325 | .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
|
326 326 | .set_force_path_style(cfg.load::<crate::config::ForcePathStyle>().map(|ty| ty.0))
|
327 327 | .set_use_arn_region(cfg.load::<crate::config::UseArnRegion>().map(|ty| ty.0))
|
328 328 | .set_disable_multi_region_access_points(cfg.load::<crate::config::DisableMultiRegionAccessPoints>().map(|ty| ty.0))
|
329 329 | .set_accelerate(cfg.load::<crate::config::Accelerate>().map(|ty| ty.0))
|
330 330 | .set_disable_s3_express_session_auth(cfg.load::<crate::config::DisableS3ExpressSessionAuth>().map(|ty| ty.0))
|
331 331 | .set_bucket(Some(
|
332 332 | _input
|
333 333 | .bucket
|
334 334 | .clone()
|
335 335 | .filter(|f| !AsRef::<str>::as_ref(f).trim().is_empty())
|
336 336 | .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("bucket", "A required field was not set"))?,
|
337 337 | ))
|
338 338 | .build()
|
339 339 | .map_err(|err| {
|
340 340 | ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
|
341 341 | })?;
|
342 + |
|
342 343 | cfg.interceptor_state()
|
343 344 | .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
|
345 + |
|
344 346 | ::std::result::Result::Ok(())
|
345 347 | }
|
346 348 | }
|
347 349 |
|
348 350 | // The get_* functions below are generated from JMESPath expressions in the
|
349 351 | // operationContextParams trait. They target the operation's input shape.
|
350 352 |
|
351 353 | /// Error type for the `PutObjectLockConfigurationError` operation.
|
352 354 | #[non_exhaustive]
|
353 355 | #[derive(::std::fmt::Debug)]
|
354 356 | pub enum PutObjectLockConfigurationError {
|
355 357 | /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
|
356 358 | #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
|
357 359 | variable wildcard pattern and check `.code()`:
|
358 360 | \
|
359 361 | `err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
|
360 362 | \
|
361 363 | See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-PutObjectLockConfigurationError) for what information is available for the error.")]
|
362 364 | Unhandled(crate::error::sealed_unhandled::Unhandled),
|
363 365 | }
|
364 366 | impl PutObjectLockConfigurationError {
|
365 367 | /// Creates the `PutObjectLockConfigurationError::Unhandled` variant from any error type.
|
366 368 | pub fn unhandled(
|
367 369 | err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
|
368 370 | ) -> Self {
|
369 371 | Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
|
370 372 | source: err.into(),
|
371 373 | meta: ::std::default::Default::default(),
|
372 374 | })
|
373 375 | }
|