aws_sdk_memorydb/operation/
create_cluster.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateCluster`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateCluster;
6impl CreateCluster {
7    /// Creates a new `CreateCluster`
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_cluster::CreateClusterInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_cluster::CreateClusterOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_cluster::CreateClusterError,
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_cluster::CreateClusterError>()
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_cluster::CreateClusterOutput>()
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_cluster::CreateClusterInput,
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        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("memorydb", "CreateCluster", input, runtime_plugins, stop_point).await
54    }
55
56    pub(crate) fn operation_runtime_plugins(
57        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
58        client_config: &crate::config::Config,
59        config_override: ::std::option::Option<crate::config::Builder>,
60    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
61        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
62        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
63            ::aws_runtime::auth::sigv4::SCHEME_ID,
64        ]));
65        if let ::std::option::Option::Some(config_override) = config_override {
66            for plugin in config_override.runtime_plugins.iter().cloned() {
67                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
68            }
69            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
70                config_override,
71                client_config.config.clone(),
72                &client_config.runtime_components,
73            ));
74        }
75        runtime_plugins
76    }
77}
78impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateCluster {
79    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
80        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateCluster");
81
82        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
83            CreateClusterRequestSerializer,
84        ));
85        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
86            CreateClusterResponseDeserializer,
87        ));
88
89        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
90            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
91        ));
92
93        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("CreateCluster", "memorydb"));
94        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
95        signing_options.double_uri_encode = true;
96        signing_options.content_sha256_header = false;
97        signing_options.normalize_uri_path = true;
98        signing_options.payload_override = None;
99
100        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
101            signing_options,
102            ..::std::default::Default::default()
103        });
104
105        ::std::option::Option::Some(cfg.freeze())
106    }
107
108    fn runtime_components(
109        &self,
110        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
111    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
112        #[allow(unused_mut)]
113        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateCluster")
114            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
115            .with_interceptor(CreateClusterEndpointParamsInterceptor)
116            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
117                crate::operation::create_cluster::CreateClusterError,
118            >::new())
119            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
120                crate::operation::create_cluster::CreateClusterError,
121            >::new())
122            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
123                crate::operation::create_cluster::CreateClusterError,
124            >::new());
125
126        ::std::borrow::Cow::Owned(rcb)
127    }
128}
129
130#[derive(Debug)]
131struct CreateClusterResponseDeserializer;
132impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateClusterResponseDeserializer {
133    fn deserialize_nonstreaming(
134        &self,
135        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
136    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
137        let (success, status) = (response.status().is_success(), response.status().as_u16());
138        let headers = response.headers();
139        let body = response.body().bytes().expect("body loaded");
140        #[allow(unused_mut)]
141        let mut force_error = false;
142        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
143        let parse_result = if !success && status != 200 || force_error {
144            crate::protocol_serde::shape_create_cluster::de_create_cluster_http_error(status, headers, body)
145        } else {
146            crate::protocol_serde::shape_create_cluster::de_create_cluster_http_response(status, headers, body)
147        };
148        crate::protocol_serde::type_erase_result(parse_result)
149    }
150}
151#[derive(Debug)]
152struct CreateClusterRequestSerializer;
153impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateClusterRequestSerializer {
154    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
155    fn serialize_input(
156        &self,
157        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
158        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
159    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
160        let input = input
161            .downcast::<crate::operation::create_cluster::CreateClusterInput>()
162            .expect("correct type");
163        let _header_serialization_settings = _cfg
164            .load::<crate::serialization_settings::HeaderSerializationSettings>()
165            .cloned()
166            .unwrap_or_default();
167        let mut request_builder = {
168            fn uri_base(
169                _input: &crate::operation::create_cluster::CreateClusterInput,
170                output: &mut ::std::string::String,
171            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
172                use ::std::fmt::Write as _;
173                ::std::write!(output, "/").expect("formatting should succeed");
174                ::std::result::Result::Ok(())
175            }
176            #[allow(clippy::unnecessary_wraps)]
177            fn update_http_builder(
178                input: &crate::operation::create_cluster::CreateClusterInput,
179                builder: ::http::request::Builder,
180            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
181                let mut uri = ::std::string::String::new();
182                uri_base(input, &mut uri)?;
183                ::std::result::Result::Ok(builder.method("POST").uri(uri))
184            }
185            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
186            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-amz-json-1.1");
187            builder = _header_serialization_settings.set_default_header(
188                builder,
189                ::http::header::HeaderName::from_static("x-amz-target"),
190                "AmazonMemoryDB.CreateCluster",
191            );
192            builder
193        };
194        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_cluster::ser_create_cluster_input(&input)?);
195        if let Some(content_length) = body.content_length() {
196            let content_length = content_length.to_string();
197            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
198        }
199        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
200    }
201}
202#[derive(Debug)]
203struct CreateClusterEndpointParamsInterceptor;
204
205impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateClusterEndpointParamsInterceptor {
206    fn name(&self) -> &'static str {
207        "CreateClusterEndpointParamsInterceptor"
208    }
209
210    fn read_before_execution(
211        &self,
212        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
213            '_,
214            ::aws_smithy_runtime_api::client::interceptors::context::Input,
215            ::aws_smithy_runtime_api::client::interceptors::context::Output,
216            ::aws_smithy_runtime_api::client::interceptors::context::Error,
217        >,
218        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
219    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
220        let _input = context
221            .input()
222            .downcast_ref::<CreateClusterInput>()
223            .ok_or("failed to downcast to CreateClusterInput")?;
224
225        let params = crate::config::endpoint::Params::builder()
226            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
227            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
228            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
229            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
230            .build()
231            .map_err(|err| {
232                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
233            })?;
234        cfg.interceptor_state()
235            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
236        ::std::result::Result::Ok(())
237    }
238}
239
240// The get_* functions below are generated from JMESPath expressions in the
241// operationContextParams trait. They target the operation's input shape.
242
243/// Error type for the `CreateClusterError` operation.
244#[non_exhaustive]
245#[derive(::std::fmt::Debug)]
246pub enum CreateClusterError {
247    /// <p></p>
248    AclNotFoundFault(crate::types::error::AclNotFoundFault),
249    /// <p></p>
250    ClusterAlreadyExistsFault(crate::types::error::ClusterAlreadyExistsFault),
251    /// <p></p>
252    ClusterQuotaForCustomerExceededFault(crate::types::error::ClusterQuotaForCustomerExceededFault),
253    /// <p></p>
254    InsufficientClusterCapacityFault(crate::types::error::InsufficientClusterCapacityFault),
255    /// <p></p>
256    InvalidAclStateFault(crate::types::error::InvalidAclStateFault),
257    /// <p></p>
258    InvalidCredentialsException(crate::types::error::InvalidCredentialsException),
259    /// <p>The requested operation cannot be performed on the multi-Region cluster in its current state.</p>
260    InvalidMultiRegionClusterStateFault(crate::types::error::InvalidMultiRegionClusterStateFault),
261    /// <p></p>
262    InvalidParameterCombinationException(crate::types::error::InvalidParameterCombinationException),
263    /// <p></p>
264    InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
265    /// <p></p>
266    InvalidVpcNetworkStateFault(crate::types::error::InvalidVpcNetworkStateFault),
267    /// <p>The specified multi-Region cluster does not exist.</p>
268    MultiRegionClusterNotFoundFault(crate::types::error::MultiRegionClusterNotFoundFault),
269    /// <p></p>
270    NodeQuotaForClusterExceededFault(crate::types::error::NodeQuotaForClusterExceededFault),
271    /// <p></p>
272    NodeQuotaForCustomerExceededFault(crate::types::error::NodeQuotaForCustomerExceededFault),
273    /// <p></p>
274    ParameterGroupNotFoundFault(crate::types::error::ParameterGroupNotFoundFault),
275    /// <p></p>
276    ServiceLinkedRoleNotFoundFault(crate::types::error::ServiceLinkedRoleNotFoundFault),
277    /// <p></p>
278    ShardsPerClusterQuotaExceededFault(crate::types::error::ShardsPerClusterQuotaExceededFault),
279    /// <p></p>
280    SubnetGroupNotFoundFault(crate::types::error::SubnetGroupNotFoundFault),
281    /// <p></p>
282    TagQuotaPerResourceExceeded(crate::types::error::TagQuotaPerResourceExceeded),
283    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
284    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
285    variable wildcard pattern and check `.code()`:
286     \
287    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
288     \
289    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateClusterError) for what information is available for the error.")]
290    Unhandled(crate::error::sealed_unhandled::Unhandled),
291}
292impl CreateClusterError {
293    /// Creates the `CreateClusterError::Unhandled` variant from any error type.
294    pub fn unhandled(
295        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
296    ) -> Self {
297        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
298            source: err.into(),
299            meta: ::std::default::Default::default(),
300        })
301    }
302
303    /// Creates the `CreateClusterError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
304    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
305        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
306            source: err.clone().into(),
307            meta: err,
308        })
309    }
310    ///
311    /// Returns error metadata, which includes the error code, message,
312    /// request ID, and potentially additional information.
313    ///
314    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
315        match self {
316            Self::AclNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
317            Self::ClusterAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
318            Self::ClusterQuotaForCustomerExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
319            Self::InsufficientClusterCapacityFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
320            Self::InvalidAclStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
321            Self::InvalidCredentialsException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
322            Self::InvalidMultiRegionClusterStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
323            Self::InvalidParameterCombinationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
324            Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
325            Self::InvalidVpcNetworkStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
326            Self::MultiRegionClusterNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
327            Self::NodeQuotaForClusterExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
328            Self::NodeQuotaForCustomerExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
329            Self::ParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
330            Self::ServiceLinkedRoleNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
331            Self::ShardsPerClusterQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
332            Self::SubnetGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
333            Self::TagQuotaPerResourceExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
334            Self::Unhandled(e) => &e.meta,
335        }
336    }
337    /// Returns `true` if the error kind is `CreateClusterError::AclNotFoundFault`.
338    pub fn is_acl_not_found_fault(&self) -> bool {
339        matches!(self, Self::AclNotFoundFault(_))
340    }
341    /// Returns `true` if the error kind is `CreateClusterError::ClusterAlreadyExistsFault`.
342    pub fn is_cluster_already_exists_fault(&self) -> bool {
343        matches!(self, Self::ClusterAlreadyExistsFault(_))
344    }
345    /// Returns `true` if the error kind is `CreateClusterError::ClusterQuotaForCustomerExceededFault`.
346    pub fn is_cluster_quota_for_customer_exceeded_fault(&self) -> bool {
347        matches!(self, Self::ClusterQuotaForCustomerExceededFault(_))
348    }
349    /// Returns `true` if the error kind is `CreateClusterError::InsufficientClusterCapacityFault`.
350    pub fn is_insufficient_cluster_capacity_fault(&self) -> bool {
351        matches!(self, Self::InsufficientClusterCapacityFault(_))
352    }
353    /// Returns `true` if the error kind is `CreateClusterError::InvalidAclStateFault`.
354    pub fn is_invalid_acl_state_fault(&self) -> bool {
355        matches!(self, Self::InvalidAclStateFault(_))
356    }
357    /// Returns `true` if the error kind is `CreateClusterError::InvalidCredentialsException`.
358    pub fn is_invalid_credentials_exception(&self) -> bool {
359        matches!(self, Self::InvalidCredentialsException(_))
360    }
361    /// Returns `true` if the error kind is `CreateClusterError::InvalidMultiRegionClusterStateFault`.
362    pub fn is_invalid_multi_region_cluster_state_fault(&self) -> bool {
363        matches!(self, Self::InvalidMultiRegionClusterStateFault(_))
364    }
365    /// Returns `true` if the error kind is `CreateClusterError::InvalidParameterCombinationException`.
366    pub fn is_invalid_parameter_combination_exception(&self) -> bool {
367        matches!(self, Self::InvalidParameterCombinationException(_))
368    }
369    /// Returns `true` if the error kind is `CreateClusterError::InvalidParameterValueException`.
370    pub fn is_invalid_parameter_value_exception(&self) -> bool {
371        matches!(self, Self::InvalidParameterValueException(_))
372    }
373    /// Returns `true` if the error kind is `CreateClusterError::InvalidVpcNetworkStateFault`.
374    pub fn is_invalid_vpc_network_state_fault(&self) -> bool {
375        matches!(self, Self::InvalidVpcNetworkStateFault(_))
376    }
377    /// Returns `true` if the error kind is `CreateClusterError::MultiRegionClusterNotFoundFault`.
378    pub fn is_multi_region_cluster_not_found_fault(&self) -> bool {
379        matches!(self, Self::MultiRegionClusterNotFoundFault(_))
380    }
381    /// Returns `true` if the error kind is `CreateClusterError::NodeQuotaForClusterExceededFault`.
382    pub fn is_node_quota_for_cluster_exceeded_fault(&self) -> bool {
383        matches!(self, Self::NodeQuotaForClusterExceededFault(_))
384    }
385    /// Returns `true` if the error kind is `CreateClusterError::NodeQuotaForCustomerExceededFault`.
386    pub fn is_node_quota_for_customer_exceeded_fault(&self) -> bool {
387        matches!(self, Self::NodeQuotaForCustomerExceededFault(_))
388    }
389    /// Returns `true` if the error kind is `CreateClusterError::ParameterGroupNotFoundFault`.
390    pub fn is_parameter_group_not_found_fault(&self) -> bool {
391        matches!(self, Self::ParameterGroupNotFoundFault(_))
392    }
393    /// Returns `true` if the error kind is `CreateClusterError::ServiceLinkedRoleNotFoundFault`.
394    pub fn is_service_linked_role_not_found_fault(&self) -> bool {
395        matches!(self, Self::ServiceLinkedRoleNotFoundFault(_))
396    }
397    /// Returns `true` if the error kind is `CreateClusterError::ShardsPerClusterQuotaExceededFault`.
398    pub fn is_shards_per_cluster_quota_exceeded_fault(&self) -> bool {
399        matches!(self, Self::ShardsPerClusterQuotaExceededFault(_))
400    }
401    /// Returns `true` if the error kind is `CreateClusterError::SubnetGroupNotFoundFault`.
402    pub fn is_subnet_group_not_found_fault(&self) -> bool {
403        matches!(self, Self::SubnetGroupNotFoundFault(_))
404    }
405    /// Returns `true` if the error kind is `CreateClusterError::TagQuotaPerResourceExceeded`.
406    pub fn is_tag_quota_per_resource_exceeded(&self) -> bool {
407        matches!(self, Self::TagQuotaPerResourceExceeded(_))
408    }
409}
410impl ::std::error::Error for CreateClusterError {
411    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
412        match self {
413            Self::AclNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
414            Self::ClusterAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
415            Self::ClusterQuotaForCustomerExceededFault(_inner) => ::std::option::Option::Some(_inner),
416            Self::InsufficientClusterCapacityFault(_inner) => ::std::option::Option::Some(_inner),
417            Self::InvalidAclStateFault(_inner) => ::std::option::Option::Some(_inner),
418            Self::InvalidCredentialsException(_inner) => ::std::option::Option::Some(_inner),
419            Self::InvalidMultiRegionClusterStateFault(_inner) => ::std::option::Option::Some(_inner),
420            Self::InvalidParameterCombinationException(_inner) => ::std::option::Option::Some(_inner),
421            Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
422            Self::InvalidVpcNetworkStateFault(_inner) => ::std::option::Option::Some(_inner),
423            Self::MultiRegionClusterNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
424            Self::NodeQuotaForClusterExceededFault(_inner) => ::std::option::Option::Some(_inner),
425            Self::NodeQuotaForCustomerExceededFault(_inner) => ::std::option::Option::Some(_inner),
426            Self::ParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
427            Self::ServiceLinkedRoleNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
428            Self::ShardsPerClusterQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
429            Self::SubnetGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
430            Self::TagQuotaPerResourceExceeded(_inner) => ::std::option::Option::Some(_inner),
431            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
432        }
433    }
434}
435impl ::std::fmt::Display for CreateClusterError {
436    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
437        match self {
438            Self::AclNotFoundFault(_inner) => _inner.fmt(f),
439            Self::ClusterAlreadyExistsFault(_inner) => _inner.fmt(f),
440            Self::ClusterQuotaForCustomerExceededFault(_inner) => _inner.fmt(f),
441            Self::InsufficientClusterCapacityFault(_inner) => _inner.fmt(f),
442            Self::InvalidAclStateFault(_inner) => _inner.fmt(f),
443            Self::InvalidCredentialsException(_inner) => _inner.fmt(f),
444            Self::InvalidMultiRegionClusterStateFault(_inner) => _inner.fmt(f),
445            Self::InvalidParameterCombinationException(_inner) => _inner.fmt(f),
446            Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
447            Self::InvalidVpcNetworkStateFault(_inner) => _inner.fmt(f),
448            Self::MultiRegionClusterNotFoundFault(_inner) => _inner.fmt(f),
449            Self::NodeQuotaForClusterExceededFault(_inner) => _inner.fmt(f),
450            Self::NodeQuotaForCustomerExceededFault(_inner) => _inner.fmt(f),
451            Self::ParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
452            Self::ServiceLinkedRoleNotFoundFault(_inner) => _inner.fmt(f),
453            Self::ShardsPerClusterQuotaExceededFault(_inner) => _inner.fmt(f),
454            Self::SubnetGroupNotFoundFault(_inner) => _inner.fmt(f),
455            Self::TagQuotaPerResourceExceeded(_inner) => _inner.fmt(f),
456            Self::Unhandled(_inner) => {
457                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
458                    write!(f, "unhandled error ({code})")
459                } else {
460                    f.write_str("unhandled error")
461                }
462            }
463        }
464    }
465}
466impl ::aws_smithy_types::retry::ProvideErrorKind for CreateClusterError {
467    fn code(&self) -> ::std::option::Option<&str> {
468        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
469    }
470    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
471        ::std::option::Option::None
472    }
473}
474impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateClusterError {
475    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
476        match self {
477            Self::AclNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
478            Self::ClusterAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
479            Self::ClusterQuotaForCustomerExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
480            Self::InsufficientClusterCapacityFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
481            Self::InvalidAclStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
482            Self::InvalidCredentialsException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
483            Self::InvalidMultiRegionClusterStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
484            Self::InvalidParameterCombinationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
485            Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
486            Self::InvalidVpcNetworkStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
487            Self::MultiRegionClusterNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
488            Self::NodeQuotaForClusterExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
489            Self::NodeQuotaForCustomerExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
490            Self::ParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
491            Self::ServiceLinkedRoleNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
492            Self::ShardsPerClusterQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
493            Self::SubnetGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
494            Self::TagQuotaPerResourceExceeded(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
495            Self::Unhandled(_inner) => &_inner.meta,
496        }
497    }
498}
499impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateClusterError {
500    fn create_unhandled_error(
501        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
502        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
503    ) -> Self {
504        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
505            source,
506            meta: meta.unwrap_or_default(),
507        })
508    }
509}
510impl ::aws_types::request_id::RequestId for crate::operation::create_cluster::CreateClusterError {
511    fn request_id(&self) -> Option<&str> {
512        self.meta().request_id()
513    }
514}
515
516pub use crate::operation::create_cluster::_create_cluster_output::CreateClusterOutput;
517
518pub use crate::operation::create_cluster::_create_cluster_input::CreateClusterInput;
519
520mod _create_cluster_input;
521
522mod _create_cluster_output;
523
524/// Builders
525pub mod builders;