Skip to main content

aws_sdk_databasemigration/operation/
start_replication_task_assessment_run.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `StartReplicationTaskAssessmentRun`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct StartReplicationTaskAssessmentRun;
6impl StartReplicationTaskAssessmentRun {
7    /// Creates a new `StartReplicationTaskAssessmentRun`
8    pub fn new() -> Self {
9        Self
10    }
11    pub(crate) async fn orchestrate(
12        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13        input: crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunInput,
14    ) -> ::std::result::Result<
15        crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunError,
18            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19        >,
20    > {
21        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22            ::aws_smithy_runtime_api::client::interceptors::context::Error,
23            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24        >| {
25            err.map_service_error(|err| {
26                err.downcast::<crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunError>()
27                    .expect("correct error type")
28            })
29        };
30        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31            .await
32            .map_err(map_err)?;
33        let output = context.finalize().map_err(map_err)?;
34        ::std::result::Result::Ok(
35            output
36                .downcast::<crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunOutput>()
37                .expect("correct output type"),
38        )
39    }
40
41    pub(crate) async fn orchestrate_with_stop_point(
42        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43        input: crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        use ::tracing::Instrument;
54        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
55            "Database Migration Service",
56            "StartReplicationTaskAssessmentRun",
57            input,
58            runtime_plugins,
59            stop_point,
60        )
61        // Create a parent span for the entire operation. Includes a random, internal-only,
62        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63        .instrument(::tracing::debug_span!(
64            "Database Migration Service.StartReplicationTaskAssessmentRun",
65            "rpc.service" = "Database Migration Service",
66            "rpc.method" = "StartReplicationTaskAssessmentRun",
67            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68            "rpc.system" = "aws-api",
69        ))
70        .await
71    }
72
73    pub(crate) fn operation_runtime_plugins(
74        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75        client_config: &crate::config::Config,
76        config_override: ::std::option::Option<crate::config::Builder>,
77    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80        if let ::std::option::Option::Some(config_override) = config_override {
81            for plugin in config_override.runtime_plugins.iter().cloned() {
82                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83            }
84            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85                config_override,
86                client_config.config.clone(),
87                &client_config.runtime_components,
88            ));
89        }
90        runtime_plugins
91    }
92}
93impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for StartReplicationTaskAssessmentRun {
94    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
95        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("StartReplicationTaskAssessmentRun");
96
97        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
98            StartReplicationTaskAssessmentRunRequestSerializer,
99        ));
100        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
101            StartReplicationTaskAssessmentRunResponseDeserializer,
102        ));
103
104        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
105            crate::config::auth::Params::builder()
106                .operation_name("StartReplicationTaskAssessmentRun")
107                .build()
108                .expect("required fields set"),
109        ));
110
111        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
112            "StartReplicationTaskAssessmentRun",
113            "Database Migration Service",
114        ));
115        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
116        signing_options.double_uri_encode = true;
117        signing_options.content_sha256_header = false;
118        signing_options.normalize_uri_path = true;
119        signing_options.payload_override = None;
120
121        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
122            signing_options,
123            ..::std::default::Default::default()
124        });
125
126        ::std::option::Option::Some(cfg.freeze())
127    }
128
129    fn runtime_components(
130        &self,
131        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
132    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
133        #[allow(unused_mut)]
134        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("StartReplicationTaskAssessmentRun")
135            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
136                StartReplicationTaskAssessmentRunTelemetryInputCaptureInterceptor,
137            ))
138            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
139                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
140            ))
141            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
142                StartReplicationTaskAssessmentRunEndpointParamsInterceptor,
143            ))
144            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
145                crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunError,
146            >::new())
147            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
148                crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunError,
149            >::new())
150            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
151                crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunError,
152            >::new());
153
154        ::std::borrow::Cow::Owned(rcb)
155    }
156}
157
158#[derive(Debug)]
159struct StartReplicationTaskAssessmentRunTelemetryInputCaptureInterceptor;
160
161#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
162impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartReplicationTaskAssessmentRunTelemetryInputCaptureInterceptor {
163    fn name(&self) -> &'static str {
164        "StartReplicationTaskAssessmentRunTelemetryInputCaptureInterceptor"
165    }
166
167    fn read_before_execution(
168        &self,
169        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
170            '_,
171            ::aws_smithy_runtime_api::client::interceptors::context::Input,
172            ::aws_smithy_runtime_api::client::interceptors::context::Output,
173            ::aws_smithy_runtime_api::client::interceptors::context::Error,
174        >,
175        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
176    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
177        // Nothing to do unless the customer opted in by naming members to record.
178        let ::std::option::Option::Some(requested) = cfg
179            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
180            .filter(|r| !r.is_empty())
181        else {
182            return ::std::result::Result::Ok(());
183        };
184
185        let ::std::option::Option::Some(input) = context.input().downcast_ref::<StartReplicationTaskAssessmentRunInput>() else {
186            // A mismatched input is not this interceptor's concern; skip quietly.
187            return ::std::result::Result::Ok(());
188        };
189
190        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
191        if requested.should_capture("ReplicationTaskArn") {
192            if let ::std::option::Option::Some(value) = input.replication_task_arn.as_deref() {
193                captured.insert("ReplicationTaskArn", value);
194            }
195        }
196        if requested.should_capture("ServiceAccessRoleArn") {
197            if let ::std::option::Option::Some(value) = input.service_access_role_arn.as_deref() {
198                captured.insert("ServiceAccessRoleArn", value);
199            }
200        }
201        if requested.should_capture("ResultLocationBucket") {
202            if let ::std::option::Option::Some(value) = input.result_location_bucket.as_deref() {
203                captured.insert("ResultLocationBucket", value);
204            }
205        }
206        if requested.should_capture("ResultLocationFolder") {
207            if let ::std::option::Option::Some(value) = input.result_location_folder.as_deref() {
208                captured.insert("ResultLocationFolder", value);
209            }
210        }
211        if requested.should_capture("ResultEncryptionMode") {
212            if let ::std::option::Option::Some(value) = input.result_encryption_mode.as_deref() {
213                captured.insert("ResultEncryptionMode", value);
214            }
215        }
216        if requested.should_capture("ResultKmsKeyArn") {
217            if let ::std::option::Option::Some(value) = input.result_kms_key_arn.as_deref() {
218                captured.insert("ResultKmsKeyArn", value);
219            }
220        }
221        if requested.should_capture("AssessmentRunName") {
222            if let ::std::option::Option::Some(value) = input.assessment_run_name.as_deref() {
223                captured.insert("AssessmentRunName", value);
224            }
225        }
226
227        cfg.interceptor_state().store_put(captured);
228        ::std::result::Result::Ok(())
229    }
230}
231#[derive(Debug)]
232struct StartReplicationTaskAssessmentRunResponseDeserializer;
233impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for StartReplicationTaskAssessmentRunResponseDeserializer {
234    fn deserialize_nonstreaming_with_config(
235        &self,
236        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
237        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
238    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
239        let (success, status) = (response.status().is_success(), response.status().as_u16());
240        let headers = response.headers();
241        let body = response.body().bytes().expect("body loaded");
242        #[allow(unused_mut)]
243        let mut force_error = false;
244        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
245        let parse_result = if !success && status != 200 || force_error {
246            crate::protocol_serde::shape_start_replication_task_assessment_run::de_start_replication_task_assessment_run_http_error(
247                status, headers, body,
248            )
249        } else {
250            crate::protocol_serde::shape_start_replication_task_assessment_run::de_start_replication_task_assessment_run_http_response(
251                status, headers, body,
252            )
253        };
254        crate::protocol_serde::type_erase_result(parse_result)
255    }
256}
257#[derive(Debug)]
258struct StartReplicationTaskAssessmentRunRequestSerializer;
259impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for StartReplicationTaskAssessmentRunRequestSerializer {
260    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
261    fn serialize_input(
262        &self,
263        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
264        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
265    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
266        let input = input
267            .downcast::<crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunInput>()
268            .expect("correct type");
269        let _header_serialization_settings = _cfg
270            .load::<crate::serialization_settings::HeaderSerializationSettings>()
271            .cloned()
272            .unwrap_or_default();
273        let mut request_builder = {
274            #[allow(clippy::uninlined_format_args)]
275            fn uri_base(
276                _input: &crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunInput,
277                output: &mut ::std::string::String,
278            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
279                use ::std::fmt::Write as _;
280                ::std::write!(output, "/").expect("formatting should succeed");
281                ::std::result::Result::Ok(())
282            }
283            #[allow(clippy::unnecessary_wraps)]
284            fn update_http_builder(
285                input: &crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunInput,
286                builder: ::http_1x::request::Builder,
287            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
288                let mut uri = ::std::string::String::new();
289                uri_base(input, &mut uri)?;
290                ::std::result::Result::Ok(builder.method("POST").uri(uri))
291            }
292            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
293            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
294            builder = _header_serialization_settings.set_default_header(
295                builder,
296                ::http_1x::header::HeaderName::from_static("x-amz-target"),
297                "AmazonDMSv20160101.StartReplicationTaskAssessmentRun",
298            );
299            builder
300        };
301        let body = ::aws_smithy_types::body::SdkBody::from(
302            crate::protocol_serde::shape_start_replication_task_assessment_run::ser_start_replication_task_assessment_run_input(&input)?,
303        );
304        if let Some(content_length) = body.content_length() {
305            let content_length = content_length.to_string();
306            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
307        }
308        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
309    }
310}
311#[derive(Debug)]
312struct StartReplicationTaskAssessmentRunEndpointParamsInterceptor;
313
314#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
315impl ::aws_smithy_runtime_api::client::interceptors::Intercept for StartReplicationTaskAssessmentRunEndpointParamsInterceptor {
316    fn name(&self) -> &'static str {
317        "StartReplicationTaskAssessmentRunEndpointParamsInterceptor"
318    }
319
320    fn read_before_execution(
321        &self,
322        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
323            '_,
324            ::aws_smithy_runtime_api::client::interceptors::context::Input,
325            ::aws_smithy_runtime_api::client::interceptors::context::Output,
326            ::aws_smithy_runtime_api::client::interceptors::context::Error,
327        >,
328        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
329    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
330        let _input = context
331            .input()
332            .downcast_ref::<StartReplicationTaskAssessmentRunInput>()
333            .ok_or("failed to downcast to StartReplicationTaskAssessmentRunInput")?;
334
335        let params = crate::config::endpoint::Params::builder()
336            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
337            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
338            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
339            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
340            .build()
341            .map_err(|err| {
342                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
343            })?;
344        cfg.interceptor_state()
345            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
346        ::std::result::Result::Ok(())
347    }
348}
349
350// The get_* functions below are generated from JMESPath expressions in the
351// operationContextParams trait. They target the operation's input shape.
352
353/// Error type for the `StartReplicationTaskAssessmentRunError` operation.
354#[non_exhaustive]
355#[derive(::std::fmt::Debug)]
356pub enum StartReplicationTaskAssessmentRunError {
357    /// <p>DMS was denied access to the endpoint. Check that the role is correctly configured.</p>
358    AccessDeniedFault(crate::types::error::AccessDeniedFault),
359    /// <p>The resource is in a state that prevents it from being used for database migration.</p>
360    InvalidResourceStateFault(crate::types::error::InvalidResourceStateFault),
361    /// <p>The ciphertext references a key that doesn't exist or that the DMS account doesn't have access to.</p>
362    KmsAccessDeniedFault(crate::types::error::KmsAccessDeniedFault),
363    /// <p>The specified KMS key isn't enabled.</p>
364    KmsDisabledFault(crate::types::error::KmsDisabledFault),
365    /// <p>An Key Management Service (KMS) error is preventing access to KMS.</p>
366    KmsFault(crate::types::error::KmsFault),
367    /// <p>The state of the specified KMS resource isn't valid for this request.</p>
368    KmsInvalidStateFault(crate::types::error::KmsInvalidStateFault),
369    /// <p>DMS cannot access the KMS key.</p>
370    KmsKeyNotAccessibleFault(crate::types::error::KmsKeyNotAccessibleFault),
371    /// <p>The specified KMS entity or resource can't be found.</p>
372    KmsNotFoundFault(crate::types::error::KmsNotFoundFault),
373    /// <p>The resource you are attempting to create already exists.</p>
374    ResourceAlreadyExistsFault(crate::types::error::ResourceAlreadyExistsFault),
375    /// <p>The resource could not be found.</p>
376    ResourceNotFoundFault(crate::types::error::ResourceNotFoundFault),
377    /// <p>Insufficient privileges are preventing access to an Amazon S3 object.</p>
378    S3AccessDeniedFault(crate::types::error::S3AccessDeniedFault),
379    /// <p>A specified Amazon S3 bucket, bucket folder, or other object can't be found.</p>
380    S3ResourceNotFoundFault(crate::types::error::S3ResourceNotFoundFault),
381    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
382    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
383    variable wildcard pattern and check `.code()`:
384     \
385    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
386     \
387    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-StartReplicationTaskAssessmentRunError) for what information is available for the error.")]
388    Unhandled(crate::error::sealed_unhandled::Unhandled),
389}
390impl StartReplicationTaskAssessmentRunError {
391    /// Creates the `StartReplicationTaskAssessmentRunError::Unhandled` variant from any error type.
392    pub fn unhandled(
393        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
394    ) -> Self {
395        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
396            source: err.into(),
397            meta: ::std::default::Default::default(),
398        })
399    }
400
401    /// Creates the `StartReplicationTaskAssessmentRunError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
402    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
403        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
404            source: err.clone().into(),
405            meta: err,
406        })
407    }
408    ///
409    /// Returns error metadata, which includes the error code, message,
410    /// request ID, and potentially additional information.
411    ///
412    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
413        match self {
414            Self::AccessDeniedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
415            Self::InvalidResourceStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416            Self::KmsAccessDeniedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417            Self::KmsDisabledFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418            Self::KmsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419            Self::KmsInvalidStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
420            Self::KmsKeyNotAccessibleFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
421            Self::KmsNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
422            Self::ResourceAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
423            Self::ResourceNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
424            Self::S3AccessDeniedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
425            Self::S3ResourceNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
426            Self::Unhandled(e) => &e.meta,
427        }
428    }
429    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::AccessDeniedFault`.
430    pub fn is_access_denied_fault(&self) -> bool {
431        matches!(self, Self::AccessDeniedFault(_))
432    }
433    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::InvalidResourceStateFault`.
434    pub fn is_invalid_resource_state_fault(&self) -> bool {
435        matches!(self, Self::InvalidResourceStateFault(_))
436    }
437    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::KmsAccessDeniedFault`.
438    pub fn is_kms_access_denied_fault(&self) -> bool {
439        matches!(self, Self::KmsAccessDeniedFault(_))
440    }
441    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::KmsDisabledFault`.
442    pub fn is_kms_disabled_fault(&self) -> bool {
443        matches!(self, Self::KmsDisabledFault(_))
444    }
445    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::KmsFault`.
446    pub fn is_kms_fault(&self) -> bool {
447        matches!(self, Self::KmsFault(_))
448    }
449    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::KmsInvalidStateFault`.
450    pub fn is_kms_invalid_state_fault(&self) -> bool {
451        matches!(self, Self::KmsInvalidStateFault(_))
452    }
453    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::KmsKeyNotAccessibleFault`.
454    pub fn is_kms_key_not_accessible_fault(&self) -> bool {
455        matches!(self, Self::KmsKeyNotAccessibleFault(_))
456    }
457    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::KmsNotFoundFault`.
458    pub fn is_kms_not_found_fault(&self) -> bool {
459        matches!(self, Self::KmsNotFoundFault(_))
460    }
461    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::ResourceAlreadyExistsFault`.
462    pub fn is_resource_already_exists_fault(&self) -> bool {
463        matches!(self, Self::ResourceAlreadyExistsFault(_))
464    }
465    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::ResourceNotFoundFault`.
466    pub fn is_resource_not_found_fault(&self) -> bool {
467        matches!(self, Self::ResourceNotFoundFault(_))
468    }
469    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::S3AccessDeniedFault`.
470    pub fn is_s3_access_denied_fault(&self) -> bool {
471        matches!(self, Self::S3AccessDeniedFault(_))
472    }
473    /// Returns `true` if the error kind is `StartReplicationTaskAssessmentRunError::S3ResourceNotFoundFault`.
474    pub fn is_s3_resource_not_found_fault(&self) -> bool {
475        matches!(self, Self::S3ResourceNotFoundFault(_))
476    }
477}
478impl ::std::error::Error for StartReplicationTaskAssessmentRunError {
479    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
480        match self {
481            Self::AccessDeniedFault(_inner) => ::std::option::Option::Some(_inner),
482            Self::InvalidResourceStateFault(_inner) => ::std::option::Option::Some(_inner),
483            Self::KmsAccessDeniedFault(_inner) => ::std::option::Option::Some(_inner),
484            Self::KmsDisabledFault(_inner) => ::std::option::Option::Some(_inner),
485            Self::KmsFault(_inner) => ::std::option::Option::Some(_inner),
486            Self::KmsInvalidStateFault(_inner) => ::std::option::Option::Some(_inner),
487            Self::KmsKeyNotAccessibleFault(_inner) => ::std::option::Option::Some(_inner),
488            Self::KmsNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
489            Self::ResourceAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
490            Self::ResourceNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
491            Self::S3AccessDeniedFault(_inner) => ::std::option::Option::Some(_inner),
492            Self::S3ResourceNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
493            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
494        }
495    }
496}
497impl ::std::fmt::Display for StartReplicationTaskAssessmentRunError {
498    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
499        match self {
500            Self::AccessDeniedFault(_inner) => _inner.fmt(f),
501            Self::InvalidResourceStateFault(_inner) => _inner.fmt(f),
502            Self::KmsAccessDeniedFault(_inner) => _inner.fmt(f),
503            Self::KmsDisabledFault(_inner) => _inner.fmt(f),
504            Self::KmsFault(_inner) => _inner.fmt(f),
505            Self::KmsInvalidStateFault(_inner) => _inner.fmt(f),
506            Self::KmsKeyNotAccessibleFault(_inner) => _inner.fmt(f),
507            Self::KmsNotFoundFault(_inner) => _inner.fmt(f),
508            Self::ResourceAlreadyExistsFault(_inner) => _inner.fmt(f),
509            Self::ResourceNotFoundFault(_inner) => _inner.fmt(f),
510            Self::S3AccessDeniedFault(_inner) => _inner.fmt(f),
511            Self::S3ResourceNotFoundFault(_inner) => _inner.fmt(f),
512            Self::Unhandled(_inner) => {
513                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
514                    write!(f, "unhandled error ({code})")
515                } else {
516                    f.write_str("unhandled error")
517                }
518            }
519        }
520    }
521}
522impl ::aws_smithy_types::retry::ProvideErrorKind for StartReplicationTaskAssessmentRunError {
523    fn code(&self) -> ::std::option::Option<&str> {
524        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
525    }
526    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
527        ::std::option::Option::None
528    }
529}
530impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for StartReplicationTaskAssessmentRunError {
531    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
532        match self {
533            Self::AccessDeniedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
534            Self::InvalidResourceStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
535            Self::KmsAccessDeniedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
536            Self::KmsDisabledFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
537            Self::KmsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
538            Self::KmsInvalidStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
539            Self::KmsKeyNotAccessibleFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
540            Self::KmsNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
541            Self::ResourceAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
542            Self::ResourceNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
543            Self::S3AccessDeniedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
544            Self::S3ResourceNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
545            Self::Unhandled(_inner) => &_inner.meta,
546        }
547    }
548}
549impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for StartReplicationTaskAssessmentRunError {
550    fn create_unhandled_error(
551        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
552        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
553    ) -> Self {
554        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
555            source,
556            meta: meta.unwrap_or_default(),
557        })
558    }
559}
560impl ::aws_types::request_id::RequestId for crate::operation::start_replication_task_assessment_run::StartReplicationTaskAssessmentRunError {
561    fn request_id(&self) -> Option<&str> {
562        self.meta().request_id()
563    }
564}
565
566pub use crate::operation::start_replication_task_assessment_run::_start_replication_task_assessment_run_input::StartReplicationTaskAssessmentRunInput;
567
568pub use crate::operation::start_replication_task_assessment_run::_start_replication_task_assessment_run_output::StartReplicationTaskAssessmentRunOutput;
569
570mod _start_replication_task_assessment_run_input;
571
572mod _start_replication_task_assessment_run_output;
573
574/// Builders
575pub mod builders;