Skip to main content

aws_sdk_memorydb/operation/
update_cluster.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `UpdateCluster`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct UpdateCluster;
6impl UpdateCluster {
7    /// Creates a new `UpdateCluster`
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::update_cluster::UpdateClusterInput,
14    ) -> ::std::result::Result<
15        crate::operation::update_cluster::UpdateClusterOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::update_cluster::UpdateClusterError,
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::update_cluster::UpdateClusterError>()
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::update_cluster::UpdateClusterOutput>()
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::update_cluster::UpdateClusterInput,
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("MemoryDB", "UpdateCluster", 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                "MemoryDB.UpdateCluster",
59                "rpc.service" = "MemoryDB",
60                "rpc.method" = "UpdateCluster",
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 UpdateCluster {
88    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
89        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("UpdateCluster");
90
91        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
92            UpdateClusterRequestSerializer,
93        ));
94        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
95            UpdateClusterResponseDeserializer,
96        ));
97
98        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
99            crate::config::auth::Params::builder()
100                .operation_name("UpdateCluster")
101                .build()
102                .expect("required fields set"),
103        ));
104
105        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("UpdateCluster", "MemoryDB"));
106        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
107        signing_options.double_uri_encode = true;
108        signing_options.content_sha256_header = false;
109        signing_options.normalize_uri_path = true;
110        signing_options.payload_override = None;
111
112        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
113            signing_options,
114            ..::std::default::Default::default()
115        });
116
117        ::std::option::Option::Some(cfg.freeze())
118    }
119
120    fn runtime_components(
121        &self,
122        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
123    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
124        #[allow(unused_mut)]
125        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateCluster")
126            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
127                UpdateClusterTelemetryInputCaptureInterceptor,
128            ))
129            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
130                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
131            ))
132            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
133                UpdateClusterEndpointParamsInterceptor,
134            ))
135            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
136                crate::operation::update_cluster::UpdateClusterError,
137            >::new())
138            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
139                crate::operation::update_cluster::UpdateClusterError,
140            >::new())
141            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
142                crate::operation::update_cluster::UpdateClusterError,
143            >::new())
144            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
145                crate::operation::update_cluster::UpdateClusterError,
146            >::new());
147
148        ::std::borrow::Cow::Owned(rcb)
149    }
150}
151
152#[derive(Debug)]
153struct UpdateClusterTelemetryInputCaptureInterceptor;
154
155#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
156impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateClusterTelemetryInputCaptureInterceptor {
157    fn name(&self) -> &'static str {
158        "UpdateClusterTelemetryInputCaptureInterceptor"
159    }
160
161    fn read_before_execution(
162        &self,
163        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
164            '_,
165            ::aws_smithy_runtime_api::client::interceptors::context::Input,
166            ::aws_smithy_runtime_api::client::interceptors::context::Output,
167            ::aws_smithy_runtime_api::client::interceptors::context::Error,
168        >,
169        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
170    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
171        // Nothing to do unless the customer opted in by naming members to record.
172        let ::std::option::Option::Some(requested) = cfg
173            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
174            .filter(|r| !r.is_empty())
175        else {
176            return ::std::result::Result::Ok(());
177        };
178
179        let ::std::option::Option::Some(input) = context.input().downcast_ref::<UpdateClusterInput>() else {
180            // A mismatched input is not this interceptor's concern; skip quietly.
181            return ::std::result::Result::Ok(());
182        };
183
184        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
185        if requested.should_capture("ClusterName") {
186            if let ::std::option::Option::Some(value) = input.cluster_name.as_deref() {
187                captured.insert("ClusterName", value);
188            }
189        }
190        if requested.should_capture("Description") {
191            if let ::std::option::Option::Some(value) = input.description.as_deref() {
192                captured.insert("Description", value);
193            }
194        }
195        if requested.should_capture("MaintenanceWindow") {
196            if let ::std::option::Option::Some(value) = input.maintenance_window.as_deref() {
197                captured.insert("MaintenanceWindow", value);
198            }
199        }
200        if requested.should_capture("SnsTopicArn") {
201            if let ::std::option::Option::Some(value) = input.sns_topic_arn.as_deref() {
202                captured.insert("SnsTopicArn", value);
203            }
204        }
205        if requested.should_capture("SnsTopicStatus") {
206            if let ::std::option::Option::Some(value) = input.sns_topic_status.as_deref() {
207                captured.insert("SnsTopicStatus", value);
208            }
209        }
210        if requested.should_capture("ParameterGroupName") {
211            if let ::std::option::Option::Some(value) = input.parameter_group_name.as_deref() {
212                captured.insert("ParameterGroupName", value);
213            }
214        }
215        if requested.should_capture("SnapshotWindow") {
216            if let ::std::option::Option::Some(value) = input.snapshot_window.as_deref() {
217                captured.insert("SnapshotWindow", value);
218            }
219        }
220        if requested.should_capture("NodeType") {
221            if let ::std::option::Option::Some(value) = input.node_type.as_deref() {
222                captured.insert("NodeType", value);
223            }
224        }
225        if requested.should_capture("Engine") {
226            if let ::std::option::Option::Some(value) = input.engine.as_deref() {
227                captured.insert("Engine", value);
228            }
229        }
230        if requested.should_capture("EngineVersion") {
231            if let ::std::option::Option::Some(value) = input.engine_version.as_deref() {
232                captured.insert("EngineVersion", value);
233            }
234        }
235        if requested.should_capture("ACLName") {
236            if let ::std::option::Option::Some(value) = input.acl_name.as_deref() {
237                captured.insert("ACLName", value);
238            }
239        }
240
241        cfg.interceptor_state().store_put(captured);
242        ::std::result::Result::Ok(())
243    }
244}
245#[derive(Debug)]
246struct UpdateClusterResponseDeserializer;
247impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateClusterResponseDeserializer {
248    fn deserialize_nonstreaming_with_config(
249        &self,
250        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
251        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
252    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
253        let (success, status) = (response.status().is_success(), response.status().as_u16());
254        let headers = response.headers();
255        let body = response.body().bytes().expect("body loaded");
256        #[allow(unused_mut)]
257        let mut force_error = false;
258        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
259        let parse_result = if !success && status != 200 || force_error {
260            crate::protocol_serde::shape_update_cluster::de_update_cluster_http_error(status, headers, body)
261        } else {
262            crate::protocol_serde::shape_update_cluster::de_update_cluster_http_response(status, headers, body)
263        };
264        crate::protocol_serde::type_erase_result(parse_result)
265    }
266}
267#[derive(Debug)]
268struct UpdateClusterRequestSerializer;
269impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for UpdateClusterRequestSerializer {
270    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
271    fn serialize_input(
272        &self,
273        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
274        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
275    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
276        let input = input
277            .downcast::<crate::operation::update_cluster::UpdateClusterInput>()
278            .expect("correct type");
279        let _header_serialization_settings = _cfg
280            .load::<crate::serialization_settings::HeaderSerializationSettings>()
281            .cloned()
282            .unwrap_or_default();
283        let mut request_builder = {
284            #[allow(clippy::uninlined_format_args)]
285            fn uri_base(
286                _input: &crate::operation::update_cluster::UpdateClusterInput,
287                output: &mut ::std::string::String,
288            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
289                use ::std::fmt::Write as _;
290                ::std::write!(output, "/").expect("formatting should succeed");
291                ::std::result::Result::Ok(())
292            }
293            #[allow(clippy::unnecessary_wraps)]
294            fn update_http_builder(
295                input: &crate::operation::update_cluster::UpdateClusterInput,
296                builder: ::http_1x::request::Builder,
297            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
298                let mut uri = ::std::string::String::new();
299                uri_base(input, &mut uri)?;
300                ::std::result::Result::Ok(builder.method("POST").uri(uri))
301            }
302            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
303            builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-amz-json-1.1");
304            builder = _header_serialization_settings.set_default_header(
305                builder,
306                ::http_1x::header::HeaderName::from_static("x-amz-target"),
307                "AmazonMemoryDB.UpdateCluster",
308            );
309            builder
310        };
311        let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_cluster::ser_update_cluster_input(&input)?);
312        if let Some(content_length) = body.content_length() {
313            let content_length = content_length.to_string();
314            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
315        }
316        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
317    }
318}
319#[derive(Debug)]
320struct UpdateClusterEndpointParamsInterceptor;
321
322#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
323impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateClusterEndpointParamsInterceptor {
324    fn name(&self) -> &'static str {
325        "UpdateClusterEndpointParamsInterceptor"
326    }
327
328    fn read_before_execution(
329        &self,
330        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
331            '_,
332            ::aws_smithy_runtime_api::client::interceptors::context::Input,
333            ::aws_smithy_runtime_api::client::interceptors::context::Output,
334            ::aws_smithy_runtime_api::client::interceptors::context::Error,
335        >,
336        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
337    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
338        let _input = context
339            .input()
340            .downcast_ref::<UpdateClusterInput>()
341            .ok_or("failed to downcast to UpdateClusterInput")?;
342
343        let params = crate::config::endpoint::Params::builder()
344            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
345            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
346            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
347            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
348            .build()
349            .map_err(|err| {
350                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
351            })?;
352        cfg.interceptor_state()
353            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
354        ::std::result::Result::Ok(())
355    }
356}
357
358// The get_* functions below are generated from JMESPath expressions in the
359// operationContextParams trait. They target the operation's input shape.
360
361/// Error type for the `UpdateClusterError` operation.
362#[non_exhaustive]
363#[derive(::std::fmt::Debug)]
364pub enum UpdateClusterError {
365    /// <p>The specified ACL does not exist.</p>
366    AclNotFoundFault(crate::types::error::AclNotFoundFault),
367    /// <p>The specified cluster does not exist.</p>
368    ClusterNotFoundFault(crate::types::error::ClusterNotFoundFault),
369    /// <p>The request cannot be processed because it would exceed the maximum number of clusters allowed for this customer.</p>
370    ClusterQuotaForCustomerExceededFault(crate::types::error::ClusterQuotaForCustomerExceededFault),
371    /// <p>The ACL is not in a valid state for the requested operation.</p>
372    InvalidAclStateFault(crate::types::error::InvalidAclStateFault),
373    /// <p>The cluster is not in a valid state for the requested operation.</p>
374    InvalidClusterStateFault(crate::types::error::InvalidClusterStateFault),
375    /// <p>The specified KMS key is not valid or accessible.</p>
376    InvalidKmsKeyFault(crate::types::error::InvalidKmsKeyFault),
377    /// <p>The node is not in a valid state for the requested operation.</p>
378    InvalidNodeStateFault(crate::types::error::InvalidNodeStateFault),
379    /// <p>The specified parameter combination is not valid.</p>
380    InvalidParameterCombinationException(crate::types::error::InvalidParameterCombinationException),
381    /// <p>The specified parameter value is not valid.</p>
382    InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
383    /// <p>The VPC network is not in a valid state for the requested operation.</p>
384    InvalidVpcNetworkStateFault(crate::types::error::InvalidVpcNetworkStateFault),
385    /// <p>The request cannot be processed because it would exceed the maximum number of nodes allowed for this cluster.</p>
386    NodeQuotaForClusterExceededFault(crate::types::error::NodeQuotaForClusterExceededFault),
387    /// <p>The request cannot be processed because it would exceed the maximum number of nodes allowed for this customer.</p>
388    NodeQuotaForCustomerExceededFault(crate::types::error::NodeQuotaForCustomerExceededFault),
389    /// <p>The requested operation would result in no changes.</p>
390    NoOperationFault(crate::types::error::NoOperationFault),
391    /// <p>The specified parameter group does not exist.</p>
392    ParameterGroupNotFoundFault(crate::types::error::ParameterGroupNotFoundFault),
393    /// <p>The required service-linked role was not found.</p>
394    ServiceLinkedRoleNotFoundFault(crate::types::error::ServiceLinkedRoleNotFoundFault),
395    /// <p>The request cannot be processed because it would exceed the maximum number of shards allowed per cluster.</p>
396    ShardsPerClusterQuotaExceededFault(crate::types::error::ShardsPerClusterQuotaExceededFault),
397    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
398    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
399    variable wildcard pattern and check `.code()`:
400     \
401    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
402     \
403    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-UpdateClusterError) for what information is available for the error.")]
404    Unhandled(crate::error::sealed_unhandled::Unhandled),
405}
406impl UpdateClusterError {
407    /// Creates the `UpdateClusterError::Unhandled` variant from any error type.
408    pub fn unhandled(
409        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
410    ) -> Self {
411        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
412            source: err.into(),
413            meta: ::std::default::Default::default(),
414        })
415    }
416
417    /// Creates the `UpdateClusterError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
418    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
419        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
420            source: err.clone().into(),
421            meta: err,
422        })
423    }
424    ///
425    /// Returns error metadata, which includes the error code, message,
426    /// request ID, and potentially additional information.
427    ///
428    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
429        match self {
430            Self::AclNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
431            Self::ClusterNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
432            Self::ClusterQuotaForCustomerExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
433            Self::InvalidAclStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
434            Self::InvalidClusterStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
435            Self::InvalidKmsKeyFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
436            Self::InvalidNodeStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
437            Self::InvalidParameterCombinationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
438            Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
439            Self::InvalidVpcNetworkStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
440            Self::NodeQuotaForClusterExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
441            Self::NodeQuotaForCustomerExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
442            Self::NoOperationFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
443            Self::ParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
444            Self::ServiceLinkedRoleNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
445            Self::ShardsPerClusterQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
446            Self::Unhandled(e) => &e.meta,
447        }
448    }
449    /// Returns `true` if the error kind is `UpdateClusterError::AclNotFoundFault`.
450    pub fn is_acl_not_found_fault(&self) -> bool {
451        matches!(self, Self::AclNotFoundFault(_))
452    }
453    /// Returns `true` if the error kind is `UpdateClusterError::ClusterNotFoundFault`.
454    pub fn is_cluster_not_found_fault(&self) -> bool {
455        matches!(self, Self::ClusterNotFoundFault(_))
456    }
457    /// Returns `true` if the error kind is `UpdateClusterError::ClusterQuotaForCustomerExceededFault`.
458    pub fn is_cluster_quota_for_customer_exceeded_fault(&self) -> bool {
459        matches!(self, Self::ClusterQuotaForCustomerExceededFault(_))
460    }
461    /// Returns `true` if the error kind is `UpdateClusterError::InvalidAclStateFault`.
462    pub fn is_invalid_acl_state_fault(&self) -> bool {
463        matches!(self, Self::InvalidAclStateFault(_))
464    }
465    /// Returns `true` if the error kind is `UpdateClusterError::InvalidClusterStateFault`.
466    pub fn is_invalid_cluster_state_fault(&self) -> bool {
467        matches!(self, Self::InvalidClusterStateFault(_))
468    }
469    /// Returns `true` if the error kind is `UpdateClusterError::InvalidKmsKeyFault`.
470    pub fn is_invalid_kms_key_fault(&self) -> bool {
471        matches!(self, Self::InvalidKmsKeyFault(_))
472    }
473    /// Returns `true` if the error kind is `UpdateClusterError::InvalidNodeStateFault`.
474    pub fn is_invalid_node_state_fault(&self) -> bool {
475        matches!(self, Self::InvalidNodeStateFault(_))
476    }
477    /// Returns `true` if the error kind is `UpdateClusterError::InvalidParameterCombinationException`.
478    pub fn is_invalid_parameter_combination_exception(&self) -> bool {
479        matches!(self, Self::InvalidParameterCombinationException(_))
480    }
481    /// Returns `true` if the error kind is `UpdateClusterError::InvalidParameterValueException`.
482    pub fn is_invalid_parameter_value_exception(&self) -> bool {
483        matches!(self, Self::InvalidParameterValueException(_))
484    }
485    /// Returns `true` if the error kind is `UpdateClusterError::InvalidVpcNetworkStateFault`.
486    pub fn is_invalid_vpc_network_state_fault(&self) -> bool {
487        matches!(self, Self::InvalidVpcNetworkStateFault(_))
488    }
489    /// Returns `true` if the error kind is `UpdateClusterError::NodeQuotaForClusterExceededFault`.
490    pub fn is_node_quota_for_cluster_exceeded_fault(&self) -> bool {
491        matches!(self, Self::NodeQuotaForClusterExceededFault(_))
492    }
493    /// Returns `true` if the error kind is `UpdateClusterError::NodeQuotaForCustomerExceededFault`.
494    pub fn is_node_quota_for_customer_exceeded_fault(&self) -> bool {
495        matches!(self, Self::NodeQuotaForCustomerExceededFault(_))
496    }
497    /// Returns `true` if the error kind is `UpdateClusterError::NoOperationFault`.
498    pub fn is_no_operation_fault(&self) -> bool {
499        matches!(self, Self::NoOperationFault(_))
500    }
501    /// Returns `true` if the error kind is `UpdateClusterError::ParameterGroupNotFoundFault`.
502    pub fn is_parameter_group_not_found_fault(&self) -> bool {
503        matches!(self, Self::ParameterGroupNotFoundFault(_))
504    }
505    /// Returns `true` if the error kind is `UpdateClusterError::ServiceLinkedRoleNotFoundFault`.
506    pub fn is_service_linked_role_not_found_fault(&self) -> bool {
507        matches!(self, Self::ServiceLinkedRoleNotFoundFault(_))
508    }
509    /// Returns `true` if the error kind is `UpdateClusterError::ShardsPerClusterQuotaExceededFault`.
510    pub fn is_shards_per_cluster_quota_exceeded_fault(&self) -> bool {
511        matches!(self, Self::ShardsPerClusterQuotaExceededFault(_))
512    }
513}
514impl ::std::error::Error for UpdateClusterError {
515    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
516        match self {
517            Self::AclNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
518            Self::ClusterNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
519            Self::ClusterQuotaForCustomerExceededFault(_inner) => ::std::option::Option::Some(_inner),
520            Self::InvalidAclStateFault(_inner) => ::std::option::Option::Some(_inner),
521            Self::InvalidClusterStateFault(_inner) => ::std::option::Option::Some(_inner),
522            Self::InvalidKmsKeyFault(_inner) => ::std::option::Option::Some(_inner),
523            Self::InvalidNodeStateFault(_inner) => ::std::option::Option::Some(_inner),
524            Self::InvalidParameterCombinationException(_inner) => ::std::option::Option::Some(_inner),
525            Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
526            Self::InvalidVpcNetworkStateFault(_inner) => ::std::option::Option::Some(_inner),
527            Self::NodeQuotaForClusterExceededFault(_inner) => ::std::option::Option::Some(_inner),
528            Self::NodeQuotaForCustomerExceededFault(_inner) => ::std::option::Option::Some(_inner),
529            Self::NoOperationFault(_inner) => ::std::option::Option::Some(_inner),
530            Self::ParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
531            Self::ServiceLinkedRoleNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
532            Self::ShardsPerClusterQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
533            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
534        }
535    }
536}
537impl ::std::fmt::Display for UpdateClusterError {
538    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
539        match self {
540            Self::AclNotFoundFault(_inner) => _inner.fmt(f),
541            Self::ClusterNotFoundFault(_inner) => _inner.fmt(f),
542            Self::ClusterQuotaForCustomerExceededFault(_inner) => _inner.fmt(f),
543            Self::InvalidAclStateFault(_inner) => _inner.fmt(f),
544            Self::InvalidClusterStateFault(_inner) => _inner.fmt(f),
545            Self::InvalidKmsKeyFault(_inner) => _inner.fmt(f),
546            Self::InvalidNodeStateFault(_inner) => _inner.fmt(f),
547            Self::InvalidParameterCombinationException(_inner) => _inner.fmt(f),
548            Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
549            Self::InvalidVpcNetworkStateFault(_inner) => _inner.fmt(f),
550            Self::NodeQuotaForClusterExceededFault(_inner) => _inner.fmt(f),
551            Self::NodeQuotaForCustomerExceededFault(_inner) => _inner.fmt(f),
552            Self::NoOperationFault(_inner) => _inner.fmt(f),
553            Self::ParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
554            Self::ServiceLinkedRoleNotFoundFault(_inner) => _inner.fmt(f),
555            Self::ShardsPerClusterQuotaExceededFault(_inner) => _inner.fmt(f),
556            Self::Unhandled(_inner) => {
557                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
558                    write!(f, "unhandled error ({code})")
559                } else {
560                    f.write_str("unhandled error")
561                }
562            }
563        }
564    }
565}
566impl ::aws_smithy_types::retry::ProvideErrorKind for UpdateClusterError {
567    fn code(&self) -> ::std::option::Option<&str> {
568        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
569    }
570    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
571        ::std::option::Option::None
572    }
573}
574impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for UpdateClusterError {
575    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
576        match self {
577            Self::AclNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
578            Self::ClusterNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
579            Self::ClusterQuotaForCustomerExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
580            Self::InvalidAclStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
581            Self::InvalidClusterStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
582            Self::InvalidKmsKeyFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
583            Self::InvalidNodeStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
584            Self::InvalidParameterCombinationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
585            Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
586            Self::InvalidVpcNetworkStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
587            Self::NodeQuotaForClusterExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
588            Self::NodeQuotaForCustomerExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
589            Self::NoOperationFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
590            Self::ParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
591            Self::ServiceLinkedRoleNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
592            Self::ShardsPerClusterQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
593            Self::Unhandled(_inner) => &_inner.meta,
594        }
595    }
596}
597impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateClusterError {
598    fn create_unhandled_error(
599        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
600        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
601    ) -> Self {
602        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
603            source,
604            meta: meta.unwrap_or_default(),
605        })
606    }
607}
608impl ::aws_types::request_id::RequestId for crate::operation::update_cluster::UpdateClusterError {
609    fn request_id(&self) -> Option<&str> {
610        self.meta().request_id()
611    }
612}
613
614pub use crate::operation::update_cluster::_update_cluster_input::UpdateClusterInput;
615
616pub use crate::operation::update_cluster::_update_cluster_output::UpdateClusterOutput;
617
618mod _update_cluster_input;
619
620mod _update_cluster_output;
621
622/// Builders
623pub mod builders;