aws_sdk_redshift/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("redshift", "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::SensitiveOutput);
94        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("CreateCluster", "redshift"));
95        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
96        signing_options.double_uri_encode = true;
97        signing_options.content_sha256_header = false;
98        signing_options.normalize_uri_path = true;
99        signing_options.payload_override = None;
100
101        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
102            signing_options,
103            ..::std::default::Default::default()
104        });
105
106        ::std::option::Option::Some(cfg.freeze())
107    }
108
109    fn runtime_components(
110        &self,
111        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
112    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
113        #[allow(unused_mut)]
114        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateCluster")
115            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
116            .with_interceptor(CreateClusterEndpointParamsInterceptor)
117            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
118                crate::operation::create_cluster::CreateClusterError,
119            >::new())
120            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
121                crate::operation::create_cluster::CreateClusterError,
122            >::new())
123            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
124                crate::operation::create_cluster::CreateClusterError,
125            >::new());
126
127        ::std::borrow::Cow::Owned(rcb)
128    }
129}
130
131#[derive(Debug)]
132struct CreateClusterResponseDeserializer;
133impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateClusterResponseDeserializer {
134    fn deserialize_nonstreaming(
135        &self,
136        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
137    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
138        let (success, status) = (response.status().is_success(), response.status().as_u16());
139        let headers = response.headers();
140        let body = response.body().bytes().expect("body loaded");
141        #[allow(unused_mut)]
142        let mut force_error = false;
143        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
144        let parse_result = if !success && status != 200 || force_error {
145            crate::protocol_serde::shape_create_cluster::de_create_cluster_http_error(status, headers, body)
146        } else {
147            crate::protocol_serde::shape_create_cluster::de_create_cluster_http_response(status, headers, body)
148        };
149        crate::protocol_serde::type_erase_result(parse_result)
150    }
151}
152#[derive(Debug)]
153struct CreateClusterRequestSerializer;
154impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateClusterRequestSerializer {
155    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
156    fn serialize_input(
157        &self,
158        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
159        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
160    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
161        let input = input
162            .downcast::<crate::operation::create_cluster::CreateClusterInput>()
163            .expect("correct type");
164        let _header_serialization_settings = _cfg
165            .load::<crate::serialization_settings::HeaderSerializationSettings>()
166            .cloned()
167            .unwrap_or_default();
168        let mut request_builder = {
169            fn uri_base(
170                _input: &crate::operation::create_cluster::CreateClusterInput,
171                output: &mut ::std::string::String,
172            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
173                use ::std::fmt::Write as _;
174                ::std::write!(output, "/").expect("formatting should succeed");
175                ::std::result::Result::Ok(())
176            }
177            #[allow(clippy::unnecessary_wraps)]
178            fn update_http_builder(
179                input: &crate::operation::create_cluster::CreateClusterInput,
180                builder: ::http::request::Builder,
181            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
182                let mut uri = ::std::string::String::new();
183                uri_base(input, &mut uri)?;
184                ::std::result::Result::Ok(builder.method("POST").uri(uri))
185            }
186            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
187            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
188            builder
189        };
190        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_cluster_input::ser_create_cluster_input_input_input(
191            &input,
192        )?);
193        if let Some(content_length) = body.content_length() {
194            let content_length = content_length.to_string();
195            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
196        }
197        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
198    }
199}
200#[derive(Debug)]
201struct CreateClusterEndpointParamsInterceptor;
202
203impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateClusterEndpointParamsInterceptor {
204    fn name(&self) -> &'static str {
205        "CreateClusterEndpointParamsInterceptor"
206    }
207
208    fn read_before_execution(
209        &self,
210        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
211            '_,
212            ::aws_smithy_runtime_api::client::interceptors::context::Input,
213            ::aws_smithy_runtime_api::client::interceptors::context::Output,
214            ::aws_smithy_runtime_api::client::interceptors::context::Error,
215        >,
216        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
217    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
218        let _input = context
219            .input()
220            .downcast_ref::<CreateClusterInput>()
221            .ok_or("failed to downcast to CreateClusterInput")?;
222
223        let params = crate::config::endpoint::Params::builder()
224            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
225            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
226            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
227            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
228            .build()
229            .map_err(|err| {
230                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
231            })?;
232        cfg.interceptor_state()
233            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
234        ::std::result::Result::Ok(())
235    }
236}
237
238// The get_* functions below are generated from JMESPath expressions in the
239// operationContextParams trait. They target the operation's input shape.
240
241/// Error type for the `CreateClusterError` operation.
242#[non_exhaustive]
243#[derive(::std::fmt::Debug)]
244pub enum CreateClusterError {
245    /// <p>The account already has a cluster with the given identifier.</p>
246    ClusterAlreadyExistsFault(crate::types::error::ClusterAlreadyExistsFault),
247    /// <p>The parameter group name does not refer to an existing parameter group.</p>
248    ClusterParameterGroupNotFoundFault(crate::types::error::ClusterParameterGroupNotFoundFault),
249    /// <p>The request would exceed the allowed number of cluster instances for this account. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>
250    ClusterQuotaExceededFault(crate::types::error::ClusterQuotaExceededFault),
251    /// <p>The cluster security group name does not refer to an existing cluster security group.</p>
252    ClusterSecurityGroupNotFoundFault(crate::types::error::ClusterSecurityGroupNotFoundFault),
253    /// <p>The cluster subnet group name does not refer to an existing cluster subnet group.</p>
254    ClusterSubnetGroupNotFoundFault(crate::types::error::ClusterSubnetGroupNotFoundFault),
255    /// <p>The request cannot be completed because a dependent service is throttling requests made by Amazon Redshift on your behalf. Wait and retry the request.</p>
256    DependentServiceRequestThrottlingFault(crate::types::error::DependentServiceRequestThrottlingFault),
257    /// <p>There is no Amazon Redshift HSM client certificate with the specified identifier.</p>
258    HsmClientCertificateNotFoundFault(crate::types::error::HsmClientCertificateNotFoundFault),
259    /// <p>There is no Amazon Redshift HSM configuration with the specified identifier.</p>
260    HsmConfigurationNotFoundFault(crate::types::error::HsmConfigurationNotFoundFault),
261    /// <p>The number of nodes specified exceeds the allotted capacity of the cluster.</p>
262    InsufficientClusterCapacityFault(crate::types::error::InsufficientClusterCapacityFault),
263    /// <p>The cluster subnet group cannot be deleted because it is in use.</p>
264    InvalidClusterSubnetGroupStateFault(crate::types::error::InvalidClusterSubnetGroupStateFault),
265    /// <p>The provided cluster track name is not valid.</p>
266    InvalidClusterTrackFault(crate::types::error::InvalidClusterTrackFault),
267    /// <p>The Elastic IP (EIP) is invalid or cannot be found.</p>
268    InvalidElasticIpFault(crate::types::error::InvalidElasticIpFault),
269    /// <p>The retention period specified is either in the past or is not a valid value.</p>
270    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
271    InvalidRetentionPeriodFault(crate::types::error::InvalidRetentionPeriodFault),
272    /// <p>The requested subnet is not valid, or not all of the subnets are in the same VPC.</p>
273    InvalidSubnet(crate::types::error::InvalidSubnet),
274    /// <p>The tag is invalid.</p>
275    InvalidTagFault(crate::types::error::InvalidTagFault),
276    /// <p>The cluster subnet group does not cover all Availability Zones.</p>
277    InvalidVpcNetworkStateFault(crate::types::error::InvalidVpcNetworkStateFault),
278    /// <p>There are no subnets in your VPC with associated IPv6 CIDR blocks. To use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.</p>
279    Ipv6CidrBlockNotFoundFault(crate::types::error::Ipv6CidrBlockNotFoundFault),
280    /// <p>The encryption key has exceeded its grant limit in Amazon Web Services KMS.</p>
281    LimitExceededFault(crate::types::error::LimitExceededFault),
282    /// <p>The operation would exceed the number of nodes allowed for a cluster.</p>
283    NumberOfNodesPerClusterLimitExceededFault(crate::types::error::NumberOfNodesPerClusterLimitExceededFault),
284    /// <p>The operation would exceed the number of nodes allotted to the account. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>
285    NumberOfNodesQuotaExceededFault(crate::types::error::NumberOfNodesQuotaExceededFault),
286    /// <p>The application you attempted to find doesn't exist.</p>
287    RedshiftIdcApplicationNotExistsFault(crate::types::error::RedshiftIdcApplicationNotExistsFault),
288    /// <p>We could not find the specified snapshot schedule.</p>
289    SnapshotScheduleNotFoundFault(crate::types::error::SnapshotScheduleNotFoundFault),
290    /// <p>You have exceeded the number of tags allowed.</p>
291    TagLimitExceededFault(crate::types::error::TagLimitExceededFault),
292    /// <p>Your account is not authorized to perform the requested operation.</p>
293    UnauthorizedOperation(crate::types::error::UnauthorizedOperation),
294    /// <p>The requested operation isn't supported.</p>
295    UnsupportedOperationFault(crate::types::error::UnsupportedOperationFault),
296    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
297    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
298    variable wildcard pattern and check `.code()`:
299     \
300    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
301     \
302    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateClusterError) for what information is available for the error.")]
303    Unhandled(crate::error::sealed_unhandled::Unhandled),
304}
305impl CreateClusterError {
306    /// Creates the `CreateClusterError::Unhandled` variant from any error type.
307    pub fn unhandled(
308        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
309    ) -> Self {
310        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
311            source: err.into(),
312            meta: ::std::default::Default::default(),
313        })
314    }
315
316    /// Creates the `CreateClusterError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
317    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
318        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
319            source: err.clone().into(),
320            meta: err,
321        })
322    }
323    ///
324    /// Returns error metadata, which includes the error code, message,
325    /// request ID, and potentially additional information.
326    ///
327    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
328        match self {
329            Self::ClusterAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
330            Self::ClusterParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
331            Self::ClusterQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
332            Self::ClusterSecurityGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
333            Self::ClusterSubnetGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
334            Self::DependentServiceRequestThrottlingFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
335            Self::HsmClientCertificateNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
336            Self::HsmConfigurationNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
337            Self::InsufficientClusterCapacityFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
338            Self::InvalidClusterSubnetGroupStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
339            Self::InvalidClusterTrackFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
340            Self::InvalidElasticIpFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
341            Self::InvalidRetentionPeriodFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
342            Self::InvalidSubnet(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
343            Self::InvalidTagFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
344            Self::InvalidVpcNetworkStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
345            Self::Ipv6CidrBlockNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
346            Self::LimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
347            Self::NumberOfNodesPerClusterLimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
348            Self::NumberOfNodesQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
349            Self::RedshiftIdcApplicationNotExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
350            Self::SnapshotScheduleNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
351            Self::TagLimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
352            Self::UnauthorizedOperation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
353            Self::UnsupportedOperationFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
354            Self::Unhandled(e) => &e.meta,
355        }
356    }
357    /// Returns `true` if the error kind is `CreateClusterError::ClusterAlreadyExistsFault`.
358    pub fn is_cluster_already_exists_fault(&self) -> bool {
359        matches!(self, Self::ClusterAlreadyExistsFault(_))
360    }
361    /// Returns `true` if the error kind is `CreateClusterError::ClusterParameterGroupNotFoundFault`.
362    pub fn is_cluster_parameter_group_not_found_fault(&self) -> bool {
363        matches!(self, Self::ClusterParameterGroupNotFoundFault(_))
364    }
365    /// Returns `true` if the error kind is `CreateClusterError::ClusterQuotaExceededFault`.
366    pub fn is_cluster_quota_exceeded_fault(&self) -> bool {
367        matches!(self, Self::ClusterQuotaExceededFault(_))
368    }
369    /// Returns `true` if the error kind is `CreateClusterError::ClusterSecurityGroupNotFoundFault`.
370    pub fn is_cluster_security_group_not_found_fault(&self) -> bool {
371        matches!(self, Self::ClusterSecurityGroupNotFoundFault(_))
372    }
373    /// Returns `true` if the error kind is `CreateClusterError::ClusterSubnetGroupNotFoundFault`.
374    pub fn is_cluster_subnet_group_not_found_fault(&self) -> bool {
375        matches!(self, Self::ClusterSubnetGroupNotFoundFault(_))
376    }
377    /// Returns `true` if the error kind is `CreateClusterError::DependentServiceRequestThrottlingFault`.
378    pub fn is_dependent_service_request_throttling_fault(&self) -> bool {
379        matches!(self, Self::DependentServiceRequestThrottlingFault(_))
380    }
381    /// Returns `true` if the error kind is `CreateClusterError::HsmClientCertificateNotFoundFault`.
382    pub fn is_hsm_client_certificate_not_found_fault(&self) -> bool {
383        matches!(self, Self::HsmClientCertificateNotFoundFault(_))
384    }
385    /// Returns `true` if the error kind is `CreateClusterError::HsmConfigurationNotFoundFault`.
386    pub fn is_hsm_configuration_not_found_fault(&self) -> bool {
387        matches!(self, Self::HsmConfigurationNotFoundFault(_))
388    }
389    /// Returns `true` if the error kind is `CreateClusterError::InsufficientClusterCapacityFault`.
390    pub fn is_insufficient_cluster_capacity_fault(&self) -> bool {
391        matches!(self, Self::InsufficientClusterCapacityFault(_))
392    }
393    /// Returns `true` if the error kind is `CreateClusterError::InvalidClusterSubnetGroupStateFault`.
394    pub fn is_invalid_cluster_subnet_group_state_fault(&self) -> bool {
395        matches!(self, Self::InvalidClusterSubnetGroupStateFault(_))
396    }
397    /// Returns `true` if the error kind is `CreateClusterError::InvalidClusterTrackFault`.
398    pub fn is_invalid_cluster_track_fault(&self) -> bool {
399        matches!(self, Self::InvalidClusterTrackFault(_))
400    }
401    /// Returns `true` if the error kind is `CreateClusterError::InvalidElasticIpFault`.
402    pub fn is_invalid_elastic_ip_fault(&self) -> bool {
403        matches!(self, Self::InvalidElasticIpFault(_))
404    }
405    /// Returns `true` if the error kind is `CreateClusterError::InvalidRetentionPeriodFault`.
406    pub fn is_invalid_retention_period_fault(&self) -> bool {
407        matches!(self, Self::InvalidRetentionPeriodFault(_))
408    }
409    /// Returns `true` if the error kind is `CreateClusterError::InvalidSubnet`.
410    pub fn is_invalid_subnet(&self) -> bool {
411        matches!(self, Self::InvalidSubnet(_))
412    }
413    /// Returns `true` if the error kind is `CreateClusterError::InvalidTagFault`.
414    pub fn is_invalid_tag_fault(&self) -> bool {
415        matches!(self, Self::InvalidTagFault(_))
416    }
417    /// Returns `true` if the error kind is `CreateClusterError::InvalidVpcNetworkStateFault`.
418    pub fn is_invalid_vpc_network_state_fault(&self) -> bool {
419        matches!(self, Self::InvalidVpcNetworkStateFault(_))
420    }
421    /// Returns `true` if the error kind is `CreateClusterError::Ipv6CidrBlockNotFoundFault`.
422    pub fn is_ipv6_cidr_block_not_found_fault(&self) -> bool {
423        matches!(self, Self::Ipv6CidrBlockNotFoundFault(_))
424    }
425    /// Returns `true` if the error kind is `CreateClusterError::LimitExceededFault`.
426    pub fn is_limit_exceeded_fault(&self) -> bool {
427        matches!(self, Self::LimitExceededFault(_))
428    }
429    /// Returns `true` if the error kind is `CreateClusterError::NumberOfNodesPerClusterLimitExceededFault`.
430    pub fn is_number_of_nodes_per_cluster_limit_exceeded_fault(&self) -> bool {
431        matches!(self, Self::NumberOfNodesPerClusterLimitExceededFault(_))
432    }
433    /// Returns `true` if the error kind is `CreateClusterError::NumberOfNodesQuotaExceededFault`.
434    pub fn is_number_of_nodes_quota_exceeded_fault(&self) -> bool {
435        matches!(self, Self::NumberOfNodesQuotaExceededFault(_))
436    }
437    /// Returns `true` if the error kind is `CreateClusterError::RedshiftIdcApplicationNotExistsFault`.
438    pub fn is_redshift_idc_application_not_exists_fault(&self) -> bool {
439        matches!(self, Self::RedshiftIdcApplicationNotExistsFault(_))
440    }
441    /// Returns `true` if the error kind is `CreateClusterError::SnapshotScheduleNotFoundFault`.
442    pub fn is_snapshot_schedule_not_found_fault(&self) -> bool {
443        matches!(self, Self::SnapshotScheduleNotFoundFault(_))
444    }
445    /// Returns `true` if the error kind is `CreateClusterError::TagLimitExceededFault`.
446    pub fn is_tag_limit_exceeded_fault(&self) -> bool {
447        matches!(self, Self::TagLimitExceededFault(_))
448    }
449    /// Returns `true` if the error kind is `CreateClusterError::UnauthorizedOperation`.
450    pub fn is_unauthorized_operation(&self) -> bool {
451        matches!(self, Self::UnauthorizedOperation(_))
452    }
453    /// Returns `true` if the error kind is `CreateClusterError::UnsupportedOperationFault`.
454    pub fn is_unsupported_operation_fault(&self) -> bool {
455        matches!(self, Self::UnsupportedOperationFault(_))
456    }
457}
458impl ::std::error::Error for CreateClusterError {
459    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
460        match self {
461            Self::ClusterAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
462            Self::ClusterParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
463            Self::ClusterQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
464            Self::ClusterSecurityGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
465            Self::ClusterSubnetGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
466            Self::DependentServiceRequestThrottlingFault(_inner) => ::std::option::Option::Some(_inner),
467            Self::HsmClientCertificateNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
468            Self::HsmConfigurationNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
469            Self::InsufficientClusterCapacityFault(_inner) => ::std::option::Option::Some(_inner),
470            Self::InvalidClusterSubnetGroupStateFault(_inner) => ::std::option::Option::Some(_inner),
471            Self::InvalidClusterTrackFault(_inner) => ::std::option::Option::Some(_inner),
472            Self::InvalidElasticIpFault(_inner) => ::std::option::Option::Some(_inner),
473            Self::InvalidRetentionPeriodFault(_inner) => ::std::option::Option::Some(_inner),
474            Self::InvalidSubnet(_inner) => ::std::option::Option::Some(_inner),
475            Self::InvalidTagFault(_inner) => ::std::option::Option::Some(_inner),
476            Self::InvalidVpcNetworkStateFault(_inner) => ::std::option::Option::Some(_inner),
477            Self::Ipv6CidrBlockNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
478            Self::LimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
479            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
480            Self::NumberOfNodesQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
481            Self::RedshiftIdcApplicationNotExistsFault(_inner) => ::std::option::Option::Some(_inner),
482            Self::SnapshotScheduleNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
483            Self::TagLimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
484            Self::UnauthorizedOperation(_inner) => ::std::option::Option::Some(_inner),
485            Self::UnsupportedOperationFault(_inner) => ::std::option::Option::Some(_inner),
486            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
487        }
488    }
489}
490impl ::std::fmt::Display for CreateClusterError {
491    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
492        match self {
493            Self::ClusterAlreadyExistsFault(_inner) => _inner.fmt(f),
494            Self::ClusterParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
495            Self::ClusterQuotaExceededFault(_inner) => _inner.fmt(f),
496            Self::ClusterSecurityGroupNotFoundFault(_inner) => _inner.fmt(f),
497            Self::ClusterSubnetGroupNotFoundFault(_inner) => _inner.fmt(f),
498            Self::DependentServiceRequestThrottlingFault(_inner) => _inner.fmt(f),
499            Self::HsmClientCertificateNotFoundFault(_inner) => _inner.fmt(f),
500            Self::HsmConfigurationNotFoundFault(_inner) => _inner.fmt(f),
501            Self::InsufficientClusterCapacityFault(_inner) => _inner.fmt(f),
502            Self::InvalidClusterSubnetGroupStateFault(_inner) => _inner.fmt(f),
503            Self::InvalidClusterTrackFault(_inner) => _inner.fmt(f),
504            Self::InvalidElasticIpFault(_inner) => _inner.fmt(f),
505            Self::InvalidRetentionPeriodFault(_inner) => _inner.fmt(f),
506            Self::InvalidSubnet(_inner) => _inner.fmt(f),
507            Self::InvalidTagFault(_inner) => _inner.fmt(f),
508            Self::InvalidVpcNetworkStateFault(_inner) => _inner.fmt(f),
509            Self::Ipv6CidrBlockNotFoundFault(_inner) => _inner.fmt(f),
510            Self::LimitExceededFault(_inner) => _inner.fmt(f),
511            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => _inner.fmt(f),
512            Self::NumberOfNodesQuotaExceededFault(_inner) => _inner.fmt(f),
513            Self::RedshiftIdcApplicationNotExistsFault(_inner) => _inner.fmt(f),
514            Self::SnapshotScheduleNotFoundFault(_inner) => _inner.fmt(f),
515            Self::TagLimitExceededFault(_inner) => _inner.fmt(f),
516            Self::UnauthorizedOperation(_inner) => _inner.fmt(f),
517            Self::UnsupportedOperationFault(_inner) => _inner.fmt(f),
518            Self::Unhandled(_inner) => {
519                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
520                    write!(f, "unhandled error ({code})")
521                } else {
522                    f.write_str("unhandled error")
523                }
524            }
525        }
526    }
527}
528impl ::aws_smithy_types::retry::ProvideErrorKind for CreateClusterError {
529    fn code(&self) -> ::std::option::Option<&str> {
530        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
531    }
532    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
533        ::std::option::Option::None
534    }
535}
536impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateClusterError {
537    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
538        match self {
539            Self::ClusterAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
540            Self::ClusterParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
541            Self::ClusterQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
542            Self::ClusterSecurityGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
543            Self::ClusterSubnetGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
544            Self::DependentServiceRequestThrottlingFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
545            Self::HsmClientCertificateNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
546            Self::HsmConfigurationNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
547            Self::InsufficientClusterCapacityFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
548            Self::InvalidClusterSubnetGroupStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
549            Self::InvalidClusterTrackFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
550            Self::InvalidElasticIpFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
551            Self::InvalidRetentionPeriodFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
552            Self::InvalidSubnet(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
553            Self::InvalidTagFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
554            Self::InvalidVpcNetworkStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
555            Self::Ipv6CidrBlockNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
556            Self::LimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
557            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
558            Self::NumberOfNodesQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
559            Self::RedshiftIdcApplicationNotExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
560            Self::SnapshotScheduleNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
561            Self::TagLimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
562            Self::UnauthorizedOperation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
563            Self::UnsupportedOperationFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
564            Self::Unhandled(_inner) => &_inner.meta,
565        }
566    }
567}
568impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateClusterError {
569    fn create_unhandled_error(
570        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
571        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
572    ) -> Self {
573        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
574            source,
575            meta: meta.unwrap_or_default(),
576        })
577    }
578}
579impl ::aws_types::request_id::RequestId for crate::operation::create_cluster::CreateClusterError {
580    fn request_id(&self) -> Option<&str> {
581        self.meta().request_id()
582    }
583}
584
585pub use crate::operation::create_cluster::_create_cluster_output::CreateClusterOutput;
586
587pub use crate::operation::create_cluster::_create_cluster_input::CreateClusterInput;
588
589mod _create_cluster_input;
590
591mod _create_cluster_output;
592
593/// Builders
594pub mod builders;