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