Skip to main content

aws_sdk_connect/operation/
create_contact_flow_module.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateContactFlowModule`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateContactFlowModule;
6impl CreateContactFlowModule {
7    /// Creates a new `CreateContactFlowModule`
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::create_contact_flow_module::CreateContactFlowModuleInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_contact_flow_module::CreateContactFlowModuleOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_contact_flow_module::CreateContactFlowModuleError,
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::create_contact_flow_module::CreateContactFlowModuleError>()
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::create_contact_flow_module::CreateContactFlowModuleOutput>()
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::create_contact_flow_module::CreateContactFlowModuleInput,
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("Connect", "CreateContactFlowModule", input, runtime_plugins, stop_point)
55            // Create a parent span for the entire operation. Includes a random, internal-only,
56            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
57            .instrument(::tracing::debug_span!(
58                "Connect.CreateContactFlowModule",
59                "rpc.service" = "Connect",
60                "rpc.method" = "CreateContactFlowModule",
61                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
62                "rpc.system" = "aws-api",
63            ))
64            .await
65    }
66
67    pub(crate) fn operation_runtime_plugins(
68        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
69        client_config: &crate::config::Config,
70        config_override: ::std::option::Option<crate::config::Builder>,
71    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
72        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
73        runtime_plugins = runtime_plugins.with_operation_plugin(crate::client_idempotency_token::IdempotencyTokenRuntimePlugin::new(
74            |token_provider, input| {
75                let input: &mut crate::operation::create_contact_flow_module::CreateContactFlowModuleInput =
76                    input.downcast_mut().expect("correct type");
77                if input.client_token.is_none() {
78                    input.client_token = ::std::option::Option::Some(token_provider.make_idempotency_token());
79                }
80            },
81        ));
82        if let ::std::option::Option::Some(config_override) = config_override {
83            for plugin in config_override.runtime_plugins.iter().cloned() {
84                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
85            }
86            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
87                config_override,
88                client_config.config.clone(),
89                &client_config.runtime_components,
90            ));
91        }
92        runtime_plugins
93    }
94}
95impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateContactFlowModule {
96    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
97        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateContactFlowModule");
98
99        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
100            CreateContactFlowModuleRequestSerializer,
101        ));
102        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
103            CreateContactFlowModuleResponseDeserializer,
104        ));
105
106        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
107            crate::config::auth::Params::builder()
108                .operation_name("CreateContactFlowModule")
109                .build()
110                .expect("required fields set"),
111        ));
112
113        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
114            "CreateContactFlowModule",
115            "Connect",
116        ));
117        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
118        signing_options.double_uri_encode = true;
119        signing_options.content_sha256_header = false;
120        signing_options.normalize_uri_path = true;
121        signing_options.payload_override = None;
122
123        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
124            signing_options,
125            ..::std::default::Default::default()
126        });
127
128        ::std::option::Option::Some(cfg.freeze())
129    }
130
131    fn runtime_components(
132        &self,
133        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
134    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
135        #[allow(unused_mut)]
136        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateContactFlowModule")
137            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
138                CreateContactFlowModuleTelemetryInputCaptureInterceptor,
139            ))
140            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
141                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
142            ))
143            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
144                CreateContactFlowModuleEndpointParamsInterceptor,
145            ))
146            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
147                crate::operation::create_contact_flow_module::CreateContactFlowModuleError,
148            >::new())
149            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
150                crate::operation::create_contact_flow_module::CreateContactFlowModuleError,
151            >::new())
152            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
153                crate::operation::create_contact_flow_module::CreateContactFlowModuleError,
154            >::new());
155
156        ::std::borrow::Cow::Owned(rcb)
157    }
158}
159
160#[derive(Debug)]
161struct CreateContactFlowModuleTelemetryInputCaptureInterceptor;
162
163#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
164impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateContactFlowModuleTelemetryInputCaptureInterceptor {
165    fn name(&self) -> &'static str {
166        "CreateContactFlowModuleTelemetryInputCaptureInterceptor"
167    }
168
169    fn read_before_execution(
170        &self,
171        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
172            '_,
173            ::aws_smithy_runtime_api::client::interceptors::context::Input,
174            ::aws_smithy_runtime_api::client::interceptors::context::Output,
175            ::aws_smithy_runtime_api::client::interceptors::context::Error,
176        >,
177        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
178    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
179        // Nothing to do unless the customer opted in by naming members to record.
180        let ::std::option::Option::Some(requested) = cfg
181            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
182            .filter(|r| !r.is_empty())
183        else {
184            return ::std::result::Result::Ok(());
185        };
186
187        let ::std::option::Option::Some(input) = context.input().downcast_ref::<CreateContactFlowModuleInput>() else {
188            // A mismatched input is not this interceptor's concern; skip quietly.
189            return ::std::result::Result::Ok(());
190        };
191
192        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
193        if requested.should_capture("InstanceId") {
194            if let ::std::option::Option::Some(value) = input.instance_id.as_deref() {
195                captured.insert("InstanceId", value);
196            }
197        }
198        if requested.should_capture("Name") {
199            if let ::std::option::Option::Some(value) = input.name.as_deref() {
200                captured.insert("Name", value);
201            }
202        }
203        if requested.should_capture("Description") {
204            if let ::std::option::Option::Some(value) = input.description.as_deref() {
205                captured.insert("Description", value);
206            }
207        }
208        if requested.should_capture("Content") {
209            if let ::std::option::Option::Some(value) = input.content.as_deref() {
210                captured.insert("Content", value);
211            }
212        }
213        if requested.should_capture("ClientToken") {
214            if let ::std::option::Option::Some(value) = input.client_token.as_deref() {
215                captured.insert("ClientToken", value);
216            }
217        }
218        if requested.should_capture("Settings") {
219            if let ::std::option::Option::Some(value) = input.settings.as_deref() {
220                captured.insert("Settings", value);
221            }
222        }
223
224        cfg.interceptor_state().store_put(captured);
225        ::std::result::Result::Ok(())
226    }
227}
228#[derive(Debug)]
229struct CreateContactFlowModuleResponseDeserializer;
230impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateContactFlowModuleResponseDeserializer {
231    fn deserialize_nonstreaming_with_config(
232        &self,
233        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
234        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
235    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
236        let (success, status) = (response.status().is_success(), response.status().as_u16());
237        let headers = response.headers();
238        let body = response.body().bytes().expect("body loaded");
239        #[allow(unused_mut)]
240        let mut force_error = false;
241        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
242        let parse_result = if !success && status != 200 || force_error {
243            crate::protocol_serde::shape_create_contact_flow_module::de_create_contact_flow_module_http_error(status, headers, body)
244        } else {
245            crate::protocol_serde::shape_create_contact_flow_module::de_create_contact_flow_module_http_response(status, headers, body)
246        };
247        crate::protocol_serde::type_erase_result(parse_result)
248    }
249}
250#[derive(Debug)]
251struct CreateContactFlowModuleRequestSerializer;
252impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateContactFlowModuleRequestSerializer {
253    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
254    fn serialize_input(
255        &self,
256        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
257        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
258    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
259        let input = input
260            .downcast::<crate::operation::create_contact_flow_module::CreateContactFlowModuleInput>()
261            .expect("correct type");
262        let _header_serialization_settings = _cfg
263            .load::<crate::serialization_settings::HeaderSerializationSettings>()
264            .cloned()
265            .unwrap_or_default();
266        let mut request_builder = {
267            #[allow(clippy::uninlined_format_args)]
268            fn uri_base(
269                _input: &crate::operation::create_contact_flow_module::CreateContactFlowModuleInput,
270                output: &mut ::std::string::String,
271            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
272                use ::std::fmt::Write as _;
273                let input_1 = &_input.instance_id;
274                let input_1 = input_1
275                    .as_ref()
276                    .ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("instance_id", "cannot be empty or unset"))?;
277                let instance_id = ::aws_smithy_http::label::fmt_string(input_1, ::aws_smithy_http::label::EncodingStrategy::Default);
278                if instance_id.is_empty() {
279                    return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field(
280                        "instance_id",
281                        "cannot be empty or unset",
282                    ));
283                }
284                ::std::write!(output, "/contact-flow-modules/{InstanceId}", InstanceId = instance_id).expect("formatting should succeed");
285                ::std::result::Result::Ok(())
286            }
287            #[allow(clippy::unnecessary_wraps)]
288            fn update_http_builder(
289                input: &crate::operation::create_contact_flow_module::CreateContactFlowModuleInput,
290                builder: ::http_1x::request::Builder,
291            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
292                let mut uri = ::std::string::String::new();
293                uri_base(input, &mut uri)?;
294                ::std::result::Result::Ok(builder.method("PUT").uri(uri))
295            }
296            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
297            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json");
298            builder
299        };
300        let body = ::aws_smithy_types::body::SdkBody::from(
301            crate::protocol_serde::shape_create_contact_flow_module::ser_create_contact_flow_module_input(&input)?,
302        );
303        if let Some(content_length) = body.content_length() {
304            let content_length = content_length.to_string();
305            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
306        }
307        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
308    }
309}
310#[derive(Debug)]
311struct CreateContactFlowModuleEndpointParamsInterceptor;
312
313#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
314impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateContactFlowModuleEndpointParamsInterceptor {
315    fn name(&self) -> &'static str {
316        "CreateContactFlowModuleEndpointParamsInterceptor"
317    }
318
319    fn read_before_execution(
320        &self,
321        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
322            '_,
323            ::aws_smithy_runtime_api::client::interceptors::context::Input,
324            ::aws_smithy_runtime_api::client::interceptors::context::Output,
325            ::aws_smithy_runtime_api::client::interceptors::context::Error,
326        >,
327        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
328    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
329        let _input = context
330            .input()
331            .downcast_ref::<CreateContactFlowModuleInput>()
332            .ok_or("failed to downcast to CreateContactFlowModuleInput")?;
333
334        let params = crate::config::endpoint::Params::builder()
335            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
336            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
337            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
338            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
339            .build()
340            .map_err(|err| {
341                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
342            })?;
343        cfg.interceptor_state()
344            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
345        ::std::result::Result::Ok(())
346    }
347}
348
349// The get_* functions below are generated from JMESPath expressions in the
350// operationContextParams trait. They target the operation's input shape.
351
352/// Error type for the `CreateContactFlowModuleError` operation.
353#[non_exhaustive]
354#[derive(::std::fmt::Debug)]
355pub enum CreateContactFlowModuleError {
356    /// <p>You do not have sufficient permissions to perform this action.</p>
357    AccessDeniedException(crate::types::error::AccessDeniedException),
358    /// <p>A resource with the specified name already exists.</p>
359    DuplicateResourceException(crate::types::error::DuplicateResourceException),
360    /// <p>An entity with the same name already exists.</p>
361    IdempotencyException(crate::types::error::IdempotencyException),
362    /// <p>Request processing failed because of an error or failure with the service.</p>
363    InternalServiceException(crate::types::error::InternalServiceException),
364    /// <p>The problems with the module. Please fix before trying again.</p>
365    InvalidContactFlowModuleException(crate::types::error::InvalidContactFlowModuleException),
366    /// <p>One or more of the specified parameters are not valid.</p>
367    InvalidParameterException(crate::types::error::InvalidParameterException),
368    /// <p>The request is not valid.</p>
369    InvalidRequestException(crate::types::error::InvalidRequestException),
370    /// <p>The allowed limit for the resource has been exceeded.</p>
371    LimitExceededException(crate::types::error::LimitExceededException),
372    /// <p>The specified resource was not found.</p>
373    ResourceNotFoundException(crate::types::error::ResourceNotFoundException),
374    /// <p>The throttling limit has been exceeded.</p>
375    ThrottlingException(crate::types::error::ThrottlingException),
376    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
377    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
378    variable wildcard pattern and check `.code()`:
379     \
380    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
381     \
382    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateContactFlowModuleError) for what information is available for the error.")]
383    Unhandled(crate::error::sealed_unhandled::Unhandled),
384}
385impl CreateContactFlowModuleError {
386    /// Creates the `CreateContactFlowModuleError::Unhandled` variant from any error type.
387    pub fn unhandled(
388        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
389    ) -> Self {
390        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
391            source: err.into(),
392            meta: ::std::default::Default::default(),
393        })
394    }
395
396    /// Creates the `CreateContactFlowModuleError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
397    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
398        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
399            source: err.clone().into(),
400            meta: err,
401        })
402    }
403    ///
404    /// Returns error metadata, which includes the error code, message,
405    /// request ID, and potentially additional information.
406    ///
407    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
408        match self {
409            Self::AccessDeniedException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
410            Self::DuplicateResourceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
411            Self::IdempotencyException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
412            Self::InternalServiceException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
413            Self::InvalidContactFlowModuleException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
414            Self::InvalidParameterException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
415            Self::InvalidRequestException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
416            Self::LimitExceededException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
417            Self::ResourceNotFoundException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
418            Self::ThrottlingException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
419            Self::Unhandled(e) => &e.meta,
420        }
421    }
422    /// Returns `true` if the error kind is `CreateContactFlowModuleError::AccessDeniedException`.
423    pub fn is_access_denied_exception(&self) -> bool {
424        matches!(self, Self::AccessDeniedException(_))
425    }
426    /// Returns `true` if the error kind is `CreateContactFlowModuleError::DuplicateResourceException`.
427    pub fn is_duplicate_resource_exception(&self) -> bool {
428        matches!(self, Self::DuplicateResourceException(_))
429    }
430    /// Returns `true` if the error kind is `CreateContactFlowModuleError::IdempotencyException`.
431    pub fn is_idempotency_exception(&self) -> bool {
432        matches!(self, Self::IdempotencyException(_))
433    }
434    /// Returns `true` if the error kind is `CreateContactFlowModuleError::InternalServiceException`.
435    pub fn is_internal_service_exception(&self) -> bool {
436        matches!(self, Self::InternalServiceException(_))
437    }
438    /// Returns `true` if the error kind is `CreateContactFlowModuleError::InvalidContactFlowModuleException`.
439    pub fn is_invalid_contact_flow_module_exception(&self) -> bool {
440        matches!(self, Self::InvalidContactFlowModuleException(_))
441    }
442    /// Returns `true` if the error kind is `CreateContactFlowModuleError::InvalidParameterException`.
443    pub fn is_invalid_parameter_exception(&self) -> bool {
444        matches!(self, Self::InvalidParameterException(_))
445    }
446    /// Returns `true` if the error kind is `CreateContactFlowModuleError::InvalidRequestException`.
447    pub fn is_invalid_request_exception(&self) -> bool {
448        matches!(self, Self::InvalidRequestException(_))
449    }
450    /// Returns `true` if the error kind is `CreateContactFlowModuleError::LimitExceededException`.
451    pub fn is_limit_exceeded_exception(&self) -> bool {
452        matches!(self, Self::LimitExceededException(_))
453    }
454    /// Returns `true` if the error kind is `CreateContactFlowModuleError::ResourceNotFoundException`.
455    pub fn is_resource_not_found_exception(&self) -> bool {
456        matches!(self, Self::ResourceNotFoundException(_))
457    }
458    /// Returns `true` if the error kind is `CreateContactFlowModuleError::ThrottlingException`.
459    pub fn is_throttling_exception(&self) -> bool {
460        matches!(self, Self::ThrottlingException(_))
461    }
462}
463impl ::std::error::Error for CreateContactFlowModuleError {
464    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
465        match self {
466            Self::AccessDeniedException(_inner) => ::std::option::Option::Some(_inner),
467            Self::DuplicateResourceException(_inner) => ::std::option::Option::Some(_inner),
468            Self::IdempotencyException(_inner) => ::std::option::Option::Some(_inner),
469            Self::InternalServiceException(_inner) => ::std::option::Option::Some(_inner),
470            Self::InvalidContactFlowModuleException(_inner) => ::std::option::Option::Some(_inner),
471            Self::InvalidParameterException(_inner) => ::std::option::Option::Some(_inner),
472            Self::InvalidRequestException(_inner) => ::std::option::Option::Some(_inner),
473            Self::LimitExceededException(_inner) => ::std::option::Option::Some(_inner),
474            Self::ResourceNotFoundException(_inner) => ::std::option::Option::Some(_inner),
475            Self::ThrottlingException(_inner) => ::std::option::Option::Some(_inner),
476            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
477        }
478    }
479}
480impl ::std::fmt::Display for CreateContactFlowModuleError {
481    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
482        match self {
483            Self::AccessDeniedException(_inner) => _inner.fmt(f),
484            Self::DuplicateResourceException(_inner) => _inner.fmt(f),
485            Self::IdempotencyException(_inner) => _inner.fmt(f),
486            Self::InternalServiceException(_inner) => _inner.fmt(f),
487            Self::InvalidContactFlowModuleException(_inner) => _inner.fmt(f),
488            Self::InvalidParameterException(_inner) => _inner.fmt(f),
489            Self::InvalidRequestException(_inner) => _inner.fmt(f),
490            Self::LimitExceededException(_inner) => _inner.fmt(f),
491            Self::ResourceNotFoundException(_inner) => _inner.fmt(f),
492            Self::ThrottlingException(_inner) => _inner.fmt(f),
493            Self::Unhandled(_inner) => {
494                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
495                    write!(f, "unhandled error ({code})")
496                } else {
497                    f.write_str("unhandled error")
498                }
499            }
500        }
501    }
502}
503impl ::aws_smithy_types::retry::ProvideErrorKind for CreateContactFlowModuleError {
504    fn code(&self) -> ::std::option::Option<&str> {
505        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
506    }
507    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
508        ::std::option::Option::None
509    }
510}
511impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateContactFlowModuleError {
512    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
513        match self {
514            Self::AccessDeniedException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
515            Self::DuplicateResourceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
516            Self::IdempotencyException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
517            Self::InternalServiceException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
518            Self::InvalidContactFlowModuleException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
519            Self::InvalidParameterException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
520            Self::InvalidRequestException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
521            Self::LimitExceededException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
522            Self::ResourceNotFoundException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
523            Self::ThrottlingException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
524            Self::Unhandled(_inner) => &_inner.meta,
525        }
526    }
527}
528impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateContactFlowModuleError {
529    fn create_unhandled_error(
530        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
531        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
532    ) -> Self {
533        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
534            source,
535            meta: meta.unwrap_or_default(),
536        })
537    }
538}
539impl ::aws_types::request_id::RequestId for crate::operation::create_contact_flow_module::CreateContactFlowModuleError {
540    fn request_id(&self) -> Option<&str> {
541        self.meta().request_id()
542    }
543}
544
545pub use crate::operation::create_contact_flow_module::_create_contact_flow_module_input::CreateContactFlowModuleInput;
546
547pub use crate::operation::create_contact_flow_module::_create_contact_flow_module_output::CreateContactFlowModuleOutput;
548
549mod _create_contact_flow_module_input;
550
551mod _create_contact_flow_module_output;
552
553/// Builders
554pub mod builders;