Skip to main content

aws_sdk_redshift/operation/
modify_cluster.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `ModifyCluster`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct ModifyCluster;
6impl ModifyCluster {
7    /// Creates a new `ModifyCluster`
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::modify_cluster::ModifyClusterInput,
14    ) -> ::std::result::Result<
15        crate::operation::modify_cluster::ModifyClusterOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::modify_cluster::ModifyClusterError,
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::modify_cluster::ModifyClusterError>()
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::modify_cluster::ModifyClusterOutput>()
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::modify_cluster::ModifyClusterInput,
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("Redshift", "ModifyCluster", 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                "Redshift.ModifyCluster",
59                "rpc.service" = "Redshift",
60                "rpc.method" = "ModifyCluster",
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
74        if let ::std::option::Option::Some(config_override) = config_override {
75            for plugin in config_override.runtime_plugins.iter().cloned() {
76                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
77            }
78            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
79                config_override,
80                client_config.config.clone(),
81                &client_config.runtime_components,
82            ));
83        }
84        runtime_plugins
85    }
86}
87impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ModifyCluster {
88    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("ModifyCluster");
90
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92            ModifyClusterRequestSerializer,
93        ));
94        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95            ModifyClusterResponseDeserializer,
96        ));
97
98        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99            crate::config::auth::Params::builder()
100                .operation_name("ModifyCluster")
101                .build()
102                .expect("required fields set"),
103        ));
104
105        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
106        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("ModifyCluster", "Redshift"));
107        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
108        signing_options.double_uri_encode = true;
109        signing_options.content_sha256_header = false;
110        signing_options.normalize_uri_path = true;
111        signing_options.payload_override = None;
112
113        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
114            signing_options,
115            ..::std::default::Default::default()
116        });
117
118        ::std::option::Option::Some(cfg.freeze())
119    }
120
121    fn runtime_components(
122        &self,
123        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
124    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
125        #[allow(unused_mut)]
126        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ModifyCluster")
127            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
128                ModifyClusterTelemetryInputCaptureInterceptor,
129            ))
130            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
131                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
132            ))
133            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
134                ModifyClusterEndpointParamsInterceptor,
135            ))
136            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
137                crate::operation::modify_cluster::ModifyClusterError,
138            >::new())
139            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
140                crate::operation::modify_cluster::ModifyClusterError,
141            >::new())
142            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
143                crate::operation::modify_cluster::ModifyClusterError,
144            >::new());
145
146        ::std::borrow::Cow::Owned(rcb)
147    }
148}
149
150#[derive(Debug)]
151struct ModifyClusterTelemetryInputCaptureInterceptor;
152
153#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
154impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ModifyClusterTelemetryInputCaptureInterceptor {
155    fn name(&self) -> &'static str {
156        "ModifyClusterTelemetryInputCaptureInterceptor"
157    }
158
159    fn read_before_execution(
160        &self,
161        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
162            '_,
163            ::aws_smithy_runtime_api::client::interceptors::context::Input,
164            ::aws_smithy_runtime_api::client::interceptors::context::Output,
165            ::aws_smithy_runtime_api::client::interceptors::context::Error,
166        >,
167        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
168    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
169        // Nothing to do unless the customer opted in by naming members to record.
170        let ::std::option::Option::Some(requested) = cfg
171            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
172            .filter(|r| !r.is_empty())
173        else {
174            return ::std::result::Result::Ok(());
175        };
176
177        let ::std::option::Option::Some(input) = context.input().downcast_ref::<ModifyClusterInput>() else {
178            // A mismatched input is not this interceptor's concern; skip quietly.
179            return ::std::result::Result::Ok(());
180        };
181
182        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
183        if requested.should_capture("ClusterIdentifier") {
184            if let ::std::option::Option::Some(value) = input.cluster_identifier.as_deref() {
185                captured.insert("ClusterIdentifier", value);
186            }
187        }
188        if requested.should_capture("ClusterType") {
189            if let ::std::option::Option::Some(value) = input.cluster_type.as_deref() {
190                captured.insert("ClusterType", value);
191            }
192        }
193        if requested.should_capture("NodeType") {
194            if let ::std::option::Option::Some(value) = input.node_type.as_deref() {
195                captured.insert("NodeType", value);
196            }
197        }
198        if requested.should_capture("ClusterParameterGroupName") {
199            if let ::std::option::Option::Some(value) = input.cluster_parameter_group_name.as_deref() {
200                captured.insert("ClusterParameterGroupName", value);
201            }
202        }
203        if requested.should_capture("PreferredMaintenanceWindow") {
204            if let ::std::option::Option::Some(value) = input.preferred_maintenance_window.as_deref() {
205                captured.insert("PreferredMaintenanceWindow", value);
206            }
207        }
208        if requested.should_capture("ClusterVersion") {
209            if let ::std::option::Option::Some(value) = input.cluster_version.as_deref() {
210                captured.insert("ClusterVersion", value);
211            }
212        }
213        if requested.should_capture("HsmClientCertificateIdentifier") {
214            if let ::std::option::Option::Some(value) = input.hsm_client_certificate_identifier.as_deref() {
215                captured.insert("HsmClientCertificateIdentifier", value);
216            }
217        }
218        if requested.should_capture("HsmConfigurationIdentifier") {
219            if let ::std::option::Option::Some(value) = input.hsm_configuration_identifier.as_deref() {
220                captured.insert("HsmConfigurationIdentifier", value);
221            }
222        }
223        if requested.should_capture("NewClusterIdentifier") {
224            if let ::std::option::Option::Some(value) = input.new_cluster_identifier.as_deref() {
225                captured.insert("NewClusterIdentifier", value);
226            }
227        }
228        if requested.should_capture("ElasticIp") {
229            if let ::std::option::Option::Some(value) = input.elastic_ip.as_deref() {
230                captured.insert("ElasticIp", value);
231            }
232        }
233        if requested.should_capture("MaintenanceTrackName") {
234            if let ::std::option::Option::Some(value) = input.maintenance_track_name.as_deref() {
235                captured.insert("MaintenanceTrackName", value);
236            }
237        }
238        if requested.should_capture("KmsKeyId") {
239            if let ::std::option::Option::Some(value) = input.kms_key_id.as_deref() {
240                captured.insert("KmsKeyId", value);
241            }
242        }
243        if requested.should_capture("AvailabilityZone") {
244            if let ::std::option::Option::Some(value) = input.availability_zone.as_deref() {
245                captured.insert("AvailabilityZone", value);
246            }
247        }
248        if requested.should_capture("MasterPasswordSecretKmsKeyId") {
249            if let ::std::option::Option::Some(value) = input.master_password_secret_kms_key_id.as_deref() {
250                captured.insert("MasterPasswordSecretKmsKeyId", value);
251            }
252        }
253        if requested.should_capture("IpAddressType") {
254            if let ::std::option::Option::Some(value) = input.ip_address_type.as_deref() {
255                captured.insert("IpAddressType", value);
256            }
257        }
258
259        cfg.interceptor_state().store_put(captured);
260        ::std::result::Result::Ok(())
261    }
262}
263#[derive(Debug)]
264struct ModifyClusterResponseDeserializer;
265impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ModifyClusterResponseDeserializer {
266    fn deserialize_nonstreaming_with_config(
267        &self,
268        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
269        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
270    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
271        let (success, status) = (response.status().is_success(), response.status().as_u16());
272        let headers = response.headers();
273        let body = response.body().bytes().expect("body loaded");
274        #[allow(unused_mut)]
275        let mut force_error = false;
276        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
277        let parse_result = if !success && status != 200 || force_error {
278            crate::protocol_serde::shape_modify_cluster::de_modify_cluster_http_error(status, headers, body)
279        } else {
280            crate::protocol_serde::shape_modify_cluster::de_modify_cluster_http_response(status, headers, body)
281        };
282        crate::protocol_serde::type_erase_result(parse_result)
283    }
284}
285#[derive(Debug)]
286struct ModifyClusterRequestSerializer;
287impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for ModifyClusterRequestSerializer {
288    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
289    fn serialize_input(
290        &self,
291        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
292        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
293    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
294        let input = input
295            .downcast::<crate::operation::modify_cluster::ModifyClusterInput>()
296            .expect("correct type");
297        let _header_serialization_settings = _cfg
298            .load::<crate::serialization_settings::HeaderSerializationSettings>()
299            .cloned()
300            .unwrap_or_default();
301        let mut request_builder = {
302            #[allow(clippy::uninlined_format_args)]
303            fn uri_base(
304                _input: &crate::operation::modify_cluster::ModifyClusterInput,
305                output: &mut ::std::string::String,
306            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
307                use ::std::fmt::Write as _;
308                ::std::write!(output, "/").expect("formatting should succeed");
309                ::std::result::Result::Ok(())
310            }
311            #[allow(clippy::unnecessary_wraps)]
312            fn update_http_builder(
313                input: &crate::operation::modify_cluster::ModifyClusterInput,
314                builder: ::http_1x::request::Builder,
315            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
316                let mut uri = ::std::string::String::new();
317                uri_base(input, &mut uri)?;
318                ::std::result::Result::Ok(builder.method("POST").uri(uri))
319            }
320            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
321            builder =
322                _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
323            builder
324        };
325        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_modify_cluster_input::ser_modify_cluster_input_input_input(
326            &input,
327        )?);
328        if let Some(content_length) = body.content_length() {
329            let content_length = content_length.to_string();
330            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
331        }
332        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
333    }
334}
335#[derive(Debug)]
336struct ModifyClusterEndpointParamsInterceptor;
337
338#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
339impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ModifyClusterEndpointParamsInterceptor {
340    fn name(&self) -> &'static str {
341        "ModifyClusterEndpointParamsInterceptor"
342    }
343
344    fn read_before_execution(
345        &self,
346        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
347            '_,
348            ::aws_smithy_runtime_api::client::interceptors::context::Input,
349            ::aws_smithy_runtime_api::client::interceptors::context::Output,
350            ::aws_smithy_runtime_api::client::interceptors::context::Error,
351        >,
352        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
353    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
354        let _input = context
355            .input()
356            .downcast_ref::<ModifyClusterInput>()
357            .ok_or("failed to downcast to ModifyClusterInput")?;
358
359        let params = crate::config::endpoint::Params::builder()
360            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
361            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
362            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
363            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
364            .build()
365            .map_err(|err| {
366                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
367            })?;
368        cfg.interceptor_state()
369            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
370        ::std::result::Result::Ok(())
371    }
372}
373
374// The get_* functions below are generated from JMESPath expressions in the
375// operationContextParams trait. They target the operation's input shape.
376
377/// Error type for the `ModifyClusterError` operation.
378#[non_exhaustive]
379#[derive(::std::fmt::Debug)]
380pub enum ModifyClusterError {
381    /// <p>The account already has a cluster with the given identifier.</p>
382    ClusterAlreadyExistsFault(crate::types::error::ClusterAlreadyExistsFault),
383    /// <p>The <code>ClusterIdentifier</code> parameter does not refer to an existing cluster.</p>
384    ClusterNotFoundFault(crate::types::error::ClusterNotFoundFault),
385    /// <p>The parameter group name does not refer to an existing parameter group.</p>
386    ClusterParameterGroupNotFoundFault(crate::types::error::ClusterParameterGroupNotFoundFault),
387    /// <p>The cluster security group name does not refer to an existing cluster security group.</p>
388    ClusterSecurityGroupNotFoundFault(crate::types::error::ClusterSecurityGroupNotFoundFault),
389    /// <p>An error occurred when an attempt was made to change the custom domain association.</p>
390    CustomCnameAssociationFault(crate::types::error::CustomCnameAssociationFault),
391    /// <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>
392    DependentServiceRequestThrottlingFault(crate::types::error::DependentServiceRequestThrottlingFault),
393    /// <p>There is no Amazon Redshift HSM client certificate with the specified identifier.</p>
394    HsmClientCertificateNotFoundFault(crate::types::error::HsmClientCertificateNotFoundFault),
395    /// <p>There is no Amazon Redshift HSM configuration with the specified identifier.</p>
396    HsmConfigurationNotFoundFault(crate::types::error::HsmConfigurationNotFoundFault),
397    /// <p>The number of nodes specified exceeds the allotted capacity of the cluster.</p>
398    InsufficientClusterCapacityFault(crate::types::error::InsufficientClusterCapacityFault),
399    /// <p>The state of the cluster security group is not <code>available</code>.</p>
400    InvalidClusterSecurityGroupStateFault(crate::types::error::InvalidClusterSecurityGroupStateFault),
401    /// <p>The specified cluster is not in the <code>available</code> state.</p>
402    InvalidClusterStateFault(crate::types::error::InvalidClusterStateFault),
403    /// <p>The provided cluster track name is not valid.</p>
404    InvalidClusterTrackFault(crate::types::error::InvalidClusterTrackFault),
405    /// <p>The Elastic IP (EIP) is invalid or cannot be found.</p>
406    InvalidElasticIpFault(crate::types::error::InvalidElasticIpFault),
407    /// <p>The retention period specified is either in the past or is not a valid value.</p>
408    /// <p>The value must be either -1 or an integer between 1 and 3,653.</p>
409    InvalidRetentionPeriodFault(crate::types::error::InvalidRetentionPeriodFault),
410    /// <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>
411    Ipv6CidrBlockNotFoundFault(crate::types::error::Ipv6CidrBlockNotFoundFault),
412    /// <p>The encryption key has exceeded its grant limit in Amazon Web Services KMS.</p>
413    LimitExceededFault(crate::types::error::LimitExceededFault),
414    /// <p>The operation would exceed the number of nodes allowed for a cluster.</p>
415    NumberOfNodesPerClusterLimitExceededFault(crate::types::error::NumberOfNodesPerClusterLimitExceededFault),
416    /// <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>
417    NumberOfNodesQuotaExceededFault(crate::types::error::NumberOfNodesQuotaExceededFault),
418    /// <p>The number of tables in the cluster exceeds the limit for the requested new cluster node type.</p>
419    TableLimitExceededFault(crate::types::error::TableLimitExceededFault),
420    /// <p>Your account is not authorized to perform the requested operation.</p>
421    UnauthorizedOperation(crate::types::error::UnauthorizedOperation),
422    /// <p>The requested operation isn't supported.</p>
423    UnsupportedOperationFault(crate::types::error::UnsupportedOperationFault),
424    /// <p>A request option was specified that is not supported.</p>
425    UnsupportedOptionFault(crate::types::error::UnsupportedOptionFault),
426    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
427    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
428    variable wildcard pattern and check `.code()`:
429     \
430    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
431     \
432    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-ModifyClusterError) for what information is available for the error.")]
433    Unhandled(crate::error::sealed_unhandled::Unhandled),
434}
435impl ModifyClusterError {
436    /// Creates the `ModifyClusterError::Unhandled` variant from any error type.
437    pub fn unhandled(
438        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
439    ) -> Self {
440        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
441            source: err.into(),
442            meta: ::std::default::Default::default(),
443        })
444    }
445
446    /// Creates the `ModifyClusterError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
447    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
448        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
449            source: err.clone().into(),
450            meta: err,
451        })
452    }
453    ///
454    /// Returns error metadata, which includes the error code, message,
455    /// request ID, and potentially additional information.
456    ///
457    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
458        match self {
459            Self::ClusterAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
460            Self::ClusterNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
461            Self::ClusterParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
462            Self::ClusterSecurityGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
463            Self::CustomCnameAssociationFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
464            Self::DependentServiceRequestThrottlingFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
465            Self::HsmClientCertificateNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
466            Self::HsmConfigurationNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
467            Self::InsufficientClusterCapacityFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
468            Self::InvalidClusterSecurityGroupStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
469            Self::InvalidClusterStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
470            Self::InvalidClusterTrackFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
471            Self::InvalidElasticIpFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
472            Self::InvalidRetentionPeriodFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
473            Self::Ipv6CidrBlockNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
474            Self::LimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
475            Self::NumberOfNodesPerClusterLimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
476            Self::NumberOfNodesQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
477            Self::TableLimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
478            Self::UnauthorizedOperation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
479            Self::UnsupportedOperationFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
480            Self::UnsupportedOptionFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
481            Self::Unhandled(e) => &e.meta,
482        }
483    }
484    /// Returns `true` if the error kind is `ModifyClusterError::ClusterAlreadyExistsFault`.
485    pub fn is_cluster_already_exists_fault(&self) -> bool {
486        matches!(self, Self::ClusterAlreadyExistsFault(_))
487    }
488    /// Returns `true` if the error kind is `ModifyClusterError::ClusterNotFoundFault`.
489    pub fn is_cluster_not_found_fault(&self) -> bool {
490        matches!(self, Self::ClusterNotFoundFault(_))
491    }
492    /// Returns `true` if the error kind is `ModifyClusterError::ClusterParameterGroupNotFoundFault`.
493    pub fn is_cluster_parameter_group_not_found_fault(&self) -> bool {
494        matches!(self, Self::ClusterParameterGroupNotFoundFault(_))
495    }
496    /// Returns `true` if the error kind is `ModifyClusterError::ClusterSecurityGroupNotFoundFault`.
497    pub fn is_cluster_security_group_not_found_fault(&self) -> bool {
498        matches!(self, Self::ClusterSecurityGroupNotFoundFault(_))
499    }
500    /// Returns `true` if the error kind is `ModifyClusterError::CustomCnameAssociationFault`.
501    pub fn is_custom_cname_association_fault(&self) -> bool {
502        matches!(self, Self::CustomCnameAssociationFault(_))
503    }
504    /// Returns `true` if the error kind is `ModifyClusterError::DependentServiceRequestThrottlingFault`.
505    pub fn is_dependent_service_request_throttling_fault(&self) -> bool {
506        matches!(self, Self::DependentServiceRequestThrottlingFault(_))
507    }
508    /// Returns `true` if the error kind is `ModifyClusterError::HsmClientCertificateNotFoundFault`.
509    pub fn is_hsm_client_certificate_not_found_fault(&self) -> bool {
510        matches!(self, Self::HsmClientCertificateNotFoundFault(_))
511    }
512    /// Returns `true` if the error kind is `ModifyClusterError::HsmConfigurationNotFoundFault`.
513    pub fn is_hsm_configuration_not_found_fault(&self) -> bool {
514        matches!(self, Self::HsmConfigurationNotFoundFault(_))
515    }
516    /// Returns `true` if the error kind is `ModifyClusterError::InsufficientClusterCapacityFault`.
517    pub fn is_insufficient_cluster_capacity_fault(&self) -> bool {
518        matches!(self, Self::InsufficientClusterCapacityFault(_))
519    }
520    /// Returns `true` if the error kind is `ModifyClusterError::InvalidClusterSecurityGroupStateFault`.
521    pub fn is_invalid_cluster_security_group_state_fault(&self) -> bool {
522        matches!(self, Self::InvalidClusterSecurityGroupStateFault(_))
523    }
524    /// Returns `true` if the error kind is `ModifyClusterError::InvalidClusterStateFault`.
525    pub fn is_invalid_cluster_state_fault(&self) -> bool {
526        matches!(self, Self::InvalidClusterStateFault(_))
527    }
528    /// Returns `true` if the error kind is `ModifyClusterError::InvalidClusterTrackFault`.
529    pub fn is_invalid_cluster_track_fault(&self) -> bool {
530        matches!(self, Self::InvalidClusterTrackFault(_))
531    }
532    /// Returns `true` if the error kind is `ModifyClusterError::InvalidElasticIpFault`.
533    pub fn is_invalid_elastic_ip_fault(&self) -> bool {
534        matches!(self, Self::InvalidElasticIpFault(_))
535    }
536    /// Returns `true` if the error kind is `ModifyClusterError::InvalidRetentionPeriodFault`.
537    pub fn is_invalid_retention_period_fault(&self) -> bool {
538        matches!(self, Self::InvalidRetentionPeriodFault(_))
539    }
540    /// Returns `true` if the error kind is `ModifyClusterError::Ipv6CidrBlockNotFoundFault`.
541    pub fn is_ipv6_cidr_block_not_found_fault(&self) -> bool {
542        matches!(self, Self::Ipv6CidrBlockNotFoundFault(_))
543    }
544    /// Returns `true` if the error kind is `ModifyClusterError::LimitExceededFault`.
545    pub fn is_limit_exceeded_fault(&self) -> bool {
546        matches!(self, Self::LimitExceededFault(_))
547    }
548    /// Returns `true` if the error kind is `ModifyClusterError::NumberOfNodesPerClusterLimitExceededFault`.
549    pub fn is_number_of_nodes_per_cluster_limit_exceeded_fault(&self) -> bool {
550        matches!(self, Self::NumberOfNodesPerClusterLimitExceededFault(_))
551    }
552    /// Returns `true` if the error kind is `ModifyClusterError::NumberOfNodesQuotaExceededFault`.
553    pub fn is_number_of_nodes_quota_exceeded_fault(&self) -> bool {
554        matches!(self, Self::NumberOfNodesQuotaExceededFault(_))
555    }
556    /// Returns `true` if the error kind is `ModifyClusterError::TableLimitExceededFault`.
557    pub fn is_table_limit_exceeded_fault(&self) -> bool {
558        matches!(self, Self::TableLimitExceededFault(_))
559    }
560    /// Returns `true` if the error kind is `ModifyClusterError::UnauthorizedOperation`.
561    pub fn is_unauthorized_operation(&self) -> bool {
562        matches!(self, Self::UnauthorizedOperation(_))
563    }
564    /// Returns `true` if the error kind is `ModifyClusterError::UnsupportedOperationFault`.
565    pub fn is_unsupported_operation_fault(&self) -> bool {
566        matches!(self, Self::UnsupportedOperationFault(_))
567    }
568    /// Returns `true` if the error kind is `ModifyClusterError::UnsupportedOptionFault`.
569    pub fn is_unsupported_option_fault(&self) -> bool {
570        matches!(self, Self::UnsupportedOptionFault(_))
571    }
572}
573impl ::std::error::Error for ModifyClusterError {
574    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
575        match self {
576            Self::ClusterAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
577            Self::ClusterNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
578            Self::ClusterParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
579            Self::ClusterSecurityGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
580            Self::CustomCnameAssociationFault(_inner) => ::std::option::Option::Some(_inner),
581            Self::DependentServiceRequestThrottlingFault(_inner) => ::std::option::Option::Some(_inner),
582            Self::HsmClientCertificateNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
583            Self::HsmConfigurationNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
584            Self::InsufficientClusterCapacityFault(_inner) => ::std::option::Option::Some(_inner),
585            Self::InvalidClusterSecurityGroupStateFault(_inner) => ::std::option::Option::Some(_inner),
586            Self::InvalidClusterStateFault(_inner) => ::std::option::Option::Some(_inner),
587            Self::InvalidClusterTrackFault(_inner) => ::std::option::Option::Some(_inner),
588            Self::InvalidElasticIpFault(_inner) => ::std::option::Option::Some(_inner),
589            Self::InvalidRetentionPeriodFault(_inner) => ::std::option::Option::Some(_inner),
590            Self::Ipv6CidrBlockNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
591            Self::LimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
592            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
593            Self::NumberOfNodesQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
594            Self::TableLimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
595            Self::UnauthorizedOperation(_inner) => ::std::option::Option::Some(_inner),
596            Self::UnsupportedOperationFault(_inner) => ::std::option::Option::Some(_inner),
597            Self::UnsupportedOptionFault(_inner) => ::std::option::Option::Some(_inner),
598            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
599        }
600    }
601}
602impl ::std::fmt::Display for ModifyClusterError {
603    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
604        match self {
605            Self::ClusterAlreadyExistsFault(_inner) => _inner.fmt(f),
606            Self::ClusterNotFoundFault(_inner) => _inner.fmt(f),
607            Self::ClusterParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
608            Self::ClusterSecurityGroupNotFoundFault(_inner) => _inner.fmt(f),
609            Self::CustomCnameAssociationFault(_inner) => _inner.fmt(f),
610            Self::DependentServiceRequestThrottlingFault(_inner) => _inner.fmt(f),
611            Self::HsmClientCertificateNotFoundFault(_inner) => _inner.fmt(f),
612            Self::HsmConfigurationNotFoundFault(_inner) => _inner.fmt(f),
613            Self::InsufficientClusterCapacityFault(_inner) => _inner.fmt(f),
614            Self::InvalidClusterSecurityGroupStateFault(_inner) => _inner.fmt(f),
615            Self::InvalidClusterStateFault(_inner) => _inner.fmt(f),
616            Self::InvalidClusterTrackFault(_inner) => _inner.fmt(f),
617            Self::InvalidElasticIpFault(_inner) => _inner.fmt(f),
618            Self::InvalidRetentionPeriodFault(_inner) => _inner.fmt(f),
619            Self::Ipv6CidrBlockNotFoundFault(_inner) => _inner.fmt(f),
620            Self::LimitExceededFault(_inner) => _inner.fmt(f),
621            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => _inner.fmt(f),
622            Self::NumberOfNodesQuotaExceededFault(_inner) => _inner.fmt(f),
623            Self::TableLimitExceededFault(_inner) => _inner.fmt(f),
624            Self::UnauthorizedOperation(_inner) => _inner.fmt(f),
625            Self::UnsupportedOperationFault(_inner) => _inner.fmt(f),
626            Self::UnsupportedOptionFault(_inner) => _inner.fmt(f),
627            Self::Unhandled(_inner) => {
628                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
629                    write!(f, "unhandled error ({code})")
630                } else {
631                    f.write_str("unhandled error")
632                }
633            }
634        }
635    }
636}
637impl ::aws_smithy_types::retry::ProvideErrorKind for ModifyClusterError {
638    fn code(&self) -> ::std::option::Option<&str> {
639        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
640    }
641    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
642        ::std::option::Option::None
643    }
644}
645impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ModifyClusterError {
646    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
647        match self {
648            Self::ClusterAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
649            Self::ClusterNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
650            Self::ClusterParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
651            Self::ClusterSecurityGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
652            Self::CustomCnameAssociationFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
653            Self::DependentServiceRequestThrottlingFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
654            Self::HsmClientCertificateNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
655            Self::HsmConfigurationNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
656            Self::InsufficientClusterCapacityFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
657            Self::InvalidClusterSecurityGroupStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
658            Self::InvalidClusterStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
659            Self::InvalidClusterTrackFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
660            Self::InvalidElasticIpFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
661            Self::InvalidRetentionPeriodFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
662            Self::Ipv6CidrBlockNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
663            Self::LimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
664            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
665            Self::NumberOfNodesQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
666            Self::TableLimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
667            Self::UnauthorizedOperation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
668            Self::UnsupportedOperationFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
669            Self::UnsupportedOptionFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
670            Self::Unhandled(_inner) => &_inner.meta,
671        }
672    }
673}
674impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ModifyClusterError {
675    fn create_unhandled_error(
676        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
677        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
678    ) -> Self {
679        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
680            source,
681            meta: meta.unwrap_or_default(),
682        })
683    }
684}
685impl ::aws_types::request_id::RequestId for crate::operation::modify_cluster::ModifyClusterError {
686    fn request_id(&self) -> Option<&str> {
687        self.meta().request_id()
688    }
689}
690
691pub use crate::operation::modify_cluster::_modify_cluster_input::ModifyClusterInput;
692
693pub use crate::operation::modify_cluster::_modify_cluster_output::ModifyClusterOutput;
694
695mod _modify_cluster_input;
696
697mod _modify_cluster_output;
698
699/// Builders
700pub mod builders;