Skip to main content

aws_sdk_redshift/operation/
restore_from_cluster_snapshot.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `RestoreFromClusterSnapshot`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct RestoreFromClusterSnapshot;
6impl RestoreFromClusterSnapshot {
7    /// Creates a new `RestoreFromClusterSnapshot`
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::restore_from_cluster_snapshot::RestoreFromClusterSnapshotInput,
14    ) -> ::std::result::Result<
15        crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotError,
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::restore_from_cluster_snapshot::RestoreFromClusterSnapshotError>()
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::restore_from_cluster_snapshot::RestoreFromClusterSnapshotOutput>()
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::restore_from_cluster_snapshot::RestoreFromClusterSnapshotInput,
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(
55            "Redshift",
56            "RestoreFromClusterSnapshot",
57            input,
58            runtime_plugins,
59            stop_point,
60        )
61        // Create a parent span for the entire operation. Includes a random, internal-only,
62        // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
63        .instrument(::tracing::debug_span!(
64            "Redshift.RestoreFromClusterSnapshot",
65            "rpc.service" = "Redshift",
66            "rpc.method" = "RestoreFromClusterSnapshot",
67            "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
68            "rpc.system" = "aws-api",
69        ))
70        .await
71    }
72
73    pub(crate) fn operation_runtime_plugins(
74        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
75        client_config: &crate::config::Config,
76        config_override: ::std::option::Option<crate::config::Builder>,
77    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
78        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
79
80        if let ::std::option::Option::Some(config_override) = config_override {
81            for plugin in config_override.runtime_plugins.iter().cloned() {
82                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
83            }
84            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
85                config_override,
86                client_config.config.clone(),
87                &client_config.runtime_components,
88            ));
89        }
90        runtime_plugins
91    }
92}
93impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RestoreFromClusterSnapshot {
94    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
95        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("RestoreFromClusterSnapshot");
96
97        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
98            RestoreFromClusterSnapshotRequestSerializer,
99        ));
100        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
101            RestoreFromClusterSnapshotResponseDeserializer,
102        ));
103
104        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
105            crate::config::auth::Params::builder()
106                .operation_name("RestoreFromClusterSnapshot")
107                .build()
108                .expect("required fields set"),
109        ));
110
111        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::SensitiveOutput);
112        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
113            "RestoreFromClusterSnapshot",
114            "Redshift",
115        ));
116        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
117        signing_options.double_uri_encode = true;
118        signing_options.content_sha256_header = false;
119        signing_options.normalize_uri_path = true;
120        signing_options.payload_override = None;
121
122        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
123            signing_options,
124            ..::std::default::Default::default()
125        });
126
127        ::std::option::Option::Some(cfg.freeze())
128    }
129
130    fn runtime_components(
131        &self,
132        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
133    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
134        #[allow(unused_mut)]
135        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RestoreFromClusterSnapshot")
136            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
137                RestoreFromClusterSnapshotTelemetryInputCaptureInterceptor,
138            ))
139            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
140                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
141            ))
142            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
143                RestoreFromClusterSnapshotEndpointParamsInterceptor,
144            ))
145            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
146                crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotError,
147            >::new())
148            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
149                crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotError,
150            >::new())
151            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
152                crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotError,
153            >::new());
154
155        ::std::borrow::Cow::Owned(rcb)
156    }
157}
158
159#[derive(Debug)]
160struct RestoreFromClusterSnapshotTelemetryInputCaptureInterceptor;
161
162#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
163impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RestoreFromClusterSnapshotTelemetryInputCaptureInterceptor {
164    fn name(&self) -> &'static str {
165        "RestoreFromClusterSnapshotTelemetryInputCaptureInterceptor"
166    }
167
168    fn read_before_execution(
169        &self,
170        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
171            '_,
172            ::aws_smithy_runtime_api::client::interceptors::context::Input,
173            ::aws_smithy_runtime_api::client::interceptors::context::Output,
174            ::aws_smithy_runtime_api::client::interceptors::context::Error,
175        >,
176        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
177    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
178        // Nothing to do unless the customer opted in by naming members to record.
179        let ::std::option::Option::Some(requested) = cfg
180            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
181            .filter(|r| !r.is_empty())
182        else {
183            return ::std::result::Result::Ok(());
184        };
185
186        let ::std::option::Option::Some(input) = context.input().downcast_ref::<RestoreFromClusterSnapshotInput>() else {
187            // A mismatched input is not this interceptor's concern; skip quietly.
188            return ::std::result::Result::Ok(());
189        };
190
191        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
192        if requested.should_capture("ClusterIdentifier") {
193            if let ::std::option::Option::Some(value) = input.cluster_identifier.as_deref() {
194                captured.insert("ClusterIdentifier", value);
195            }
196        }
197        if requested.should_capture("SnapshotIdentifier") {
198            if let ::std::option::Option::Some(value) = input.snapshot_identifier.as_deref() {
199                captured.insert("SnapshotIdentifier", value);
200            }
201        }
202        if requested.should_capture("SnapshotArn") {
203            if let ::std::option::Option::Some(value) = input.snapshot_arn.as_deref() {
204                captured.insert("SnapshotArn", value);
205            }
206        }
207        if requested.should_capture("SnapshotClusterIdentifier") {
208            if let ::std::option::Option::Some(value) = input.snapshot_cluster_identifier.as_deref() {
209                captured.insert("SnapshotClusterIdentifier", value);
210            }
211        }
212        if requested.should_capture("AvailabilityZone") {
213            if let ::std::option::Option::Some(value) = input.availability_zone.as_deref() {
214                captured.insert("AvailabilityZone", value);
215            }
216        }
217        if requested.should_capture("ClusterSubnetGroupName") {
218            if let ::std::option::Option::Some(value) = input.cluster_subnet_group_name.as_deref() {
219                captured.insert("ClusterSubnetGroupName", value);
220            }
221        }
222        if requested.should_capture("OwnerAccount") {
223            if let ::std::option::Option::Some(value) = input.owner_account.as_deref() {
224                captured.insert("OwnerAccount", value);
225            }
226        }
227        if requested.should_capture("HsmClientCertificateIdentifier") {
228            if let ::std::option::Option::Some(value) = input.hsm_client_certificate_identifier.as_deref() {
229                captured.insert("HsmClientCertificateIdentifier", value);
230            }
231        }
232        if requested.should_capture("HsmConfigurationIdentifier") {
233            if let ::std::option::Option::Some(value) = input.hsm_configuration_identifier.as_deref() {
234                captured.insert("HsmConfigurationIdentifier", value);
235            }
236        }
237        if requested.should_capture("ElasticIp") {
238            if let ::std::option::Option::Some(value) = input.elastic_ip.as_deref() {
239                captured.insert("ElasticIp", value);
240            }
241        }
242        if requested.should_capture("ClusterParameterGroupName") {
243            if let ::std::option::Option::Some(value) = input.cluster_parameter_group_name.as_deref() {
244                captured.insert("ClusterParameterGroupName", value);
245            }
246        }
247        if requested.should_capture("PreferredMaintenanceWindow") {
248            if let ::std::option::Option::Some(value) = input.preferred_maintenance_window.as_deref() {
249                captured.insert("PreferredMaintenanceWindow", value);
250            }
251        }
252        if requested.should_capture("KmsKeyId") {
253            if let ::std::option::Option::Some(value) = input.kms_key_id.as_deref() {
254                captured.insert("KmsKeyId", value);
255            }
256        }
257        if requested.should_capture("NodeType") {
258            if let ::std::option::Option::Some(value) = input.node_type.as_deref() {
259                captured.insert("NodeType", value);
260            }
261        }
262        if requested.should_capture("AdditionalInfo") {
263            if let ::std::option::Option::Some(value) = input.additional_info.as_deref() {
264                captured.insert("AdditionalInfo", value);
265            }
266        }
267        if requested.should_capture("MaintenanceTrackName") {
268            if let ::std::option::Option::Some(value) = input.maintenance_track_name.as_deref() {
269                captured.insert("MaintenanceTrackName", value);
270            }
271        }
272        if requested.should_capture("SnapshotScheduleIdentifier") {
273            if let ::std::option::Option::Some(value) = input.snapshot_schedule_identifier.as_deref() {
274                captured.insert("SnapshotScheduleIdentifier", value);
275            }
276        }
277        if requested.should_capture("DefaultIamRoleArn") {
278            if let ::std::option::Option::Some(value) = input.default_iam_role_arn.as_deref() {
279                captured.insert("DefaultIamRoleArn", value);
280            }
281        }
282        if requested.should_capture("ReservedNodeId") {
283            if let ::std::option::Option::Some(value) = input.reserved_node_id.as_deref() {
284                captured.insert("ReservedNodeId", value);
285            }
286        }
287        if requested.should_capture("TargetReservedNodeOfferingId") {
288            if let ::std::option::Option::Some(value) = input.target_reserved_node_offering_id.as_deref() {
289                captured.insert("TargetReservedNodeOfferingId", value);
290            }
291        }
292        if requested.should_capture("MasterPasswordSecretKmsKeyId") {
293            if let ::std::option::Option::Some(value) = input.master_password_secret_kms_key_id.as_deref() {
294                captured.insert("MasterPasswordSecretKmsKeyId", value);
295            }
296        }
297        if requested.should_capture("IpAddressType") {
298            if let ::std::option::Option::Some(value) = input.ip_address_type.as_deref() {
299                captured.insert("IpAddressType", value);
300            }
301        }
302        if requested.should_capture("CatalogName") {
303            if let ::std::option::Option::Some(value) = input.catalog_name.as_deref() {
304                captured.insert("CatalogName", value);
305            }
306        }
307        if requested.should_capture("RedshiftIdcApplicationArn") {
308            if let ::std::option::Option::Some(value) = input.redshift_idc_application_arn.as_deref() {
309                captured.insert("RedshiftIdcApplicationArn", value);
310            }
311        }
312
313        cfg.interceptor_state().store_put(captured);
314        ::std::result::Result::Ok(())
315    }
316}
317#[derive(Debug)]
318struct RestoreFromClusterSnapshotResponseDeserializer;
319impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RestoreFromClusterSnapshotResponseDeserializer {
320    fn deserialize_nonstreaming_with_config(
321        &self,
322        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
323        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
324    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
325        let (success, status) = (response.status().is_success(), response.status().as_u16());
326        let headers = response.headers();
327        let body = response.body().bytes().expect("body loaded");
328        #[allow(unused_mut)]
329        let mut force_error = false;
330        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
331        let parse_result = if !success && status != 200 || force_error {
332            crate::protocol_serde::shape_restore_from_cluster_snapshot::de_restore_from_cluster_snapshot_http_error(status, headers, body)
333        } else {
334            crate::protocol_serde::shape_restore_from_cluster_snapshot::de_restore_from_cluster_snapshot_http_response(status, headers, body)
335        };
336        crate::protocol_serde::type_erase_result(parse_result)
337    }
338}
339#[derive(Debug)]
340struct RestoreFromClusterSnapshotRequestSerializer;
341impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for RestoreFromClusterSnapshotRequestSerializer {
342    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
343    fn serialize_input(
344        &self,
345        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
346        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
347    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
348        let input = input
349            .downcast::<crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotInput>()
350            .expect("correct type");
351        let _header_serialization_settings = _cfg
352            .load::<crate::serialization_settings::HeaderSerializationSettings>()
353            .cloned()
354            .unwrap_or_default();
355        let mut request_builder = {
356            #[allow(clippy::uninlined_format_args)]
357            fn uri_base(
358                _input: &crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotInput,
359                output: &mut ::std::string::String,
360            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
361                use ::std::fmt::Write as _;
362                ::std::write!(output, "/").expect("formatting should succeed");
363                ::std::result::Result::Ok(())
364            }
365            #[allow(clippy::unnecessary_wraps)]
366            fn update_http_builder(
367                input: &crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotInput,
368                builder: ::http_1x::request::Builder,
369            ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
370                let mut uri = ::std::string::String::new();
371                uri_base(input, &mut uri)?;
372                ::std::result::Result::Ok(builder.method("POST").uri(uri))
373            }
374            let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?;
375            builder =
376                _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
377            builder
378        };
379        let body = ::aws_smithy_types::body::SdkBody::from(
380            crate::protocol_serde::shape_restore_from_cluster_snapshot_input::ser_restore_from_cluster_snapshot_input_input_input(&input)?,
381        );
382        if let Some(content_length) = body.content_length() {
383            let content_length = content_length.to_string();
384            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length);
385        }
386        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
387    }
388}
389#[derive(Debug)]
390struct RestoreFromClusterSnapshotEndpointParamsInterceptor;
391
392#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
393impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RestoreFromClusterSnapshotEndpointParamsInterceptor {
394    fn name(&self) -> &'static str {
395        "RestoreFromClusterSnapshotEndpointParamsInterceptor"
396    }
397
398    fn read_before_execution(
399        &self,
400        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
401            '_,
402            ::aws_smithy_runtime_api::client::interceptors::context::Input,
403            ::aws_smithy_runtime_api::client::interceptors::context::Output,
404            ::aws_smithy_runtime_api::client::interceptors::context::Error,
405        >,
406        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
407    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
408        let _input = context
409            .input()
410            .downcast_ref::<RestoreFromClusterSnapshotInput>()
411            .ok_or("failed to downcast to RestoreFromClusterSnapshotInput")?;
412
413        let params = crate::config::endpoint::Params::builder()
414            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
415            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
416            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
417            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
418            .build()
419            .map_err(|err| {
420                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
421            })?;
422        cfg.interceptor_state()
423            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
424        ::std::result::Result::Ok(())
425    }
426}
427
428// The get_* functions below are generated from JMESPath expressions in the
429// operationContextParams trait. They target the operation's input shape.
430
431/// Error type for the `RestoreFromClusterSnapshotError` operation.
432#[non_exhaustive]
433#[derive(::std::fmt::Debug)]
434pub enum RestoreFromClusterSnapshotError {
435    /// <p>The owner of the specified snapshot has not authorized your account to access the snapshot.</p>
436    AccessToSnapshotDeniedFault(crate::types::error::AccessToSnapshotDeniedFault),
437    /// <p>The account already has a cluster with the given identifier.</p>
438    ClusterAlreadyExistsFault(crate::types::error::ClusterAlreadyExistsFault),
439    /// <p>The parameter group name does not refer to an existing parameter group.</p>
440    ClusterParameterGroupNotFoundFault(crate::types::error::ClusterParameterGroupNotFoundFault),
441    /// <p>The request would exceed the allowed number of cluster instances for this account. For information about increasing your quota, go to <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/amazon-redshift-limits.html">Limits in Amazon Redshift</a> in the <i>Amazon Redshift Cluster Management Guide</i>.</p>
442    ClusterQuotaExceededFault(crate::types::error::ClusterQuotaExceededFault),
443    /// <p>The cluster security group name does not refer to an existing cluster security group.</p>
444    ClusterSecurityGroupNotFoundFault(crate::types::error::ClusterSecurityGroupNotFoundFault),
445    /// <p>The snapshot identifier does not refer to an existing cluster snapshot.</p>
446    ClusterSnapshotNotFoundFault(crate::types::error::ClusterSnapshotNotFoundFault),
447    /// <p>The cluster subnet group name does not refer to an existing cluster subnet group.</p>
448    ClusterSubnetGroupNotFoundFault(crate::types::error::ClusterSubnetGroupNotFoundFault),
449    /// <p>A dependent service denied access for the integration.</p>
450    DependentServiceAccessDeniedFault(crate::types::error::DependentServiceAccessDeniedFault),
451    /// <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>
452    DependentServiceRequestThrottlingFault(crate::types::error::DependentServiceRequestThrottlingFault),
453    /// <p>Your request cannot be completed because a dependent internal service is temporarily unavailable. Wait 30 to 60 seconds and try again.</p>
454    DependentServiceUnavailableFault(crate::types::error::DependentServiceUnavailableFault),
455    /// <p>There is no Amazon Redshift HSM client certificate with the specified identifier.</p>
456    HsmClientCertificateNotFoundFault(crate::types::error::HsmClientCertificateNotFoundFault),
457    /// <p>There is no Amazon Redshift HSM configuration with the specified identifier.</p>
458    HsmConfigurationNotFoundFault(crate::types::error::HsmConfigurationNotFoundFault),
459    /// <p>The number of nodes specified exceeds the allotted capacity of the cluster.</p>
460    InsufficientClusterCapacityFault(crate::types::error::InsufficientClusterCapacityFault),
461    /// <p>The specified cluster snapshot is not in the <code>available</code> state, or other accounts are authorized to access the snapshot.</p>
462    InvalidClusterSnapshotStateFault(crate::types::error::InvalidClusterSnapshotStateFault),
463    /// <p>The cluster subnet group cannot be deleted because it is in use.</p>
464    InvalidClusterSubnetGroupStateFault(crate::types::error::InvalidClusterSubnetGroupStateFault),
465    /// <p>The provided cluster track name is not valid.</p>
466    InvalidClusterTrackFault(crate::types::error::InvalidClusterTrackFault),
467    /// <p>The Elastic IP (EIP) is invalid or cannot be found.</p>
468    InvalidElasticIpFault(crate::types::error::InvalidElasticIpFault),
469    /// <p>Indicates that the Reserved Node being exchanged is not in an active state.</p>
470    InvalidReservedNodeStateFault(crate::types::error::InvalidReservedNodeStateFault),
471    /// <p>The restore is invalid.</p>
472    InvalidRestoreFault(crate::types::error::InvalidRestoreFault),
473    /// <p>The requested subnet is not valid, or not all of the subnets are in the same VPC.</p>
474    InvalidSubnet(crate::types::error::InvalidSubnet),
475    /// <p>The tag is invalid.</p>
476    InvalidTagFault(crate::types::error::InvalidTagFault),
477    /// <p>The cluster subnet group does not cover all Availability Zones.</p>
478    InvalidVpcNetworkStateFault(crate::types::error::InvalidVpcNetworkStateFault),
479    /// <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>
480    Ipv6CidrBlockNotFoundFault(crate::types::error::Ipv6CidrBlockNotFoundFault),
481    /// <p>The encryption key has exceeded its grant limit in Amazon Web Services KMS.</p>
482    LimitExceededFault(crate::types::error::LimitExceededFault),
483    /// <p>The operation would exceed the number of nodes allowed for a cluster.</p>
484    NumberOfNodesPerClusterLimitExceededFault(crate::types::error::NumberOfNodesPerClusterLimitExceededFault),
485    /// <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>
486    NumberOfNodesQuotaExceededFault(crate::types::error::NumberOfNodesQuotaExceededFault),
487    /// <p>The application you attempted to find doesn't exist.</p>
488    RedshiftIdcApplicationNotExistsFault(crate::types::error::RedshiftIdcApplicationNotExistsFault),
489    /// <p>User already has a reservation with the given identifier.</p>
490    ReservedNodeAlreadyExistsFault(crate::types::error::ReservedNodeAlreadyExistsFault),
491    /// <p>Indicates that the reserved node has already been exchanged.</p>
492    ReservedNodeAlreadyMigratedFault(crate::types::error::ReservedNodeAlreadyMigratedFault),
493    /// <p>The specified reserved compute node not found.</p>
494    ReservedNodeNotFoundFault(crate::types::error::ReservedNodeNotFoundFault),
495    /// <p>Specified offering does not exist.</p>
496    ReservedNodeOfferingNotFoundFault(crate::types::error::ReservedNodeOfferingNotFoundFault),
497    /// <p>We could not find the specified snapshot schedule.</p>
498    SnapshotScheduleNotFoundFault(crate::types::error::SnapshotScheduleNotFoundFault),
499    /// <p>You have exceeded the number of tags allowed.</p>
500    TagLimitExceededFault(crate::types::error::TagLimitExceededFault),
501    /// <p>Your account is not authorized to perform the requested operation.</p>
502    UnauthorizedOperation(crate::types::error::UnauthorizedOperation),
503    /// <p>The requested operation isn't supported.</p>
504    UnsupportedOperationFault(crate::types::error::UnsupportedOperationFault),
505    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
506    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
507    variable wildcard pattern and check `.code()`:
508     \
509    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
510     \
511    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-RestoreFromClusterSnapshotError) for what information is available for the error.")]
512    Unhandled(crate::error::sealed_unhandled::Unhandled),
513}
514impl RestoreFromClusterSnapshotError {
515    /// Creates the `RestoreFromClusterSnapshotError::Unhandled` variant from any error type.
516    pub fn unhandled(
517        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
518    ) -> Self {
519        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
520            source: err.into(),
521            meta: ::std::default::Default::default(),
522        })
523    }
524
525    /// Creates the `RestoreFromClusterSnapshotError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
526    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
527        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
528            source: err.clone().into(),
529            meta: err,
530        })
531    }
532    ///
533    /// Returns error metadata, which includes the error code, message,
534    /// request ID, and potentially additional information.
535    ///
536    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
537        match self {
538            Self::AccessToSnapshotDeniedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
539            Self::ClusterAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
540            Self::ClusterParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
541            Self::ClusterQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
542            Self::ClusterSecurityGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
543            Self::ClusterSnapshotNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
544            Self::ClusterSubnetGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
545            Self::DependentServiceAccessDeniedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
546            Self::DependentServiceRequestThrottlingFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
547            Self::DependentServiceUnavailableFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
548            Self::HsmClientCertificateNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
549            Self::HsmConfigurationNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
550            Self::InsufficientClusterCapacityFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
551            Self::InvalidClusterSnapshotStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
552            Self::InvalidClusterSubnetGroupStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
553            Self::InvalidClusterTrackFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
554            Self::InvalidElasticIpFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
555            Self::InvalidReservedNodeStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
556            Self::InvalidRestoreFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
557            Self::InvalidSubnet(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
558            Self::InvalidTagFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
559            Self::InvalidVpcNetworkStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
560            Self::Ipv6CidrBlockNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
561            Self::LimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
562            Self::NumberOfNodesPerClusterLimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
563            Self::NumberOfNodesQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
564            Self::RedshiftIdcApplicationNotExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
565            Self::ReservedNodeAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
566            Self::ReservedNodeAlreadyMigratedFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
567            Self::ReservedNodeNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
568            Self::ReservedNodeOfferingNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
569            Self::SnapshotScheduleNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
570            Self::TagLimitExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
571            Self::UnauthorizedOperation(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
572            Self::UnsupportedOperationFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
573            Self::Unhandled(e) => &e.meta,
574        }
575    }
576    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::AccessToSnapshotDeniedFault`.
577    pub fn is_access_to_snapshot_denied_fault(&self) -> bool {
578        matches!(self, Self::AccessToSnapshotDeniedFault(_))
579    }
580    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ClusterAlreadyExistsFault`.
581    pub fn is_cluster_already_exists_fault(&self) -> bool {
582        matches!(self, Self::ClusterAlreadyExistsFault(_))
583    }
584    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ClusterParameterGroupNotFoundFault`.
585    pub fn is_cluster_parameter_group_not_found_fault(&self) -> bool {
586        matches!(self, Self::ClusterParameterGroupNotFoundFault(_))
587    }
588    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ClusterQuotaExceededFault`.
589    pub fn is_cluster_quota_exceeded_fault(&self) -> bool {
590        matches!(self, Self::ClusterQuotaExceededFault(_))
591    }
592    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ClusterSecurityGroupNotFoundFault`.
593    pub fn is_cluster_security_group_not_found_fault(&self) -> bool {
594        matches!(self, Self::ClusterSecurityGroupNotFoundFault(_))
595    }
596    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ClusterSnapshotNotFoundFault`.
597    pub fn is_cluster_snapshot_not_found_fault(&self) -> bool {
598        matches!(self, Self::ClusterSnapshotNotFoundFault(_))
599    }
600    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ClusterSubnetGroupNotFoundFault`.
601    pub fn is_cluster_subnet_group_not_found_fault(&self) -> bool {
602        matches!(self, Self::ClusterSubnetGroupNotFoundFault(_))
603    }
604    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::DependentServiceAccessDeniedFault`.
605    pub fn is_dependent_service_access_denied_fault(&self) -> bool {
606        matches!(self, Self::DependentServiceAccessDeniedFault(_))
607    }
608    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::DependentServiceRequestThrottlingFault`.
609    pub fn is_dependent_service_request_throttling_fault(&self) -> bool {
610        matches!(self, Self::DependentServiceRequestThrottlingFault(_))
611    }
612    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::DependentServiceUnavailableFault`.
613    pub fn is_dependent_service_unavailable_fault(&self) -> bool {
614        matches!(self, Self::DependentServiceUnavailableFault(_))
615    }
616    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::HsmClientCertificateNotFoundFault`.
617    pub fn is_hsm_client_certificate_not_found_fault(&self) -> bool {
618        matches!(self, Self::HsmClientCertificateNotFoundFault(_))
619    }
620    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::HsmConfigurationNotFoundFault`.
621    pub fn is_hsm_configuration_not_found_fault(&self) -> bool {
622        matches!(self, Self::HsmConfigurationNotFoundFault(_))
623    }
624    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InsufficientClusterCapacityFault`.
625    pub fn is_insufficient_cluster_capacity_fault(&self) -> bool {
626        matches!(self, Self::InsufficientClusterCapacityFault(_))
627    }
628    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidClusterSnapshotStateFault`.
629    pub fn is_invalid_cluster_snapshot_state_fault(&self) -> bool {
630        matches!(self, Self::InvalidClusterSnapshotStateFault(_))
631    }
632    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidClusterSubnetGroupStateFault`.
633    pub fn is_invalid_cluster_subnet_group_state_fault(&self) -> bool {
634        matches!(self, Self::InvalidClusterSubnetGroupStateFault(_))
635    }
636    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidClusterTrackFault`.
637    pub fn is_invalid_cluster_track_fault(&self) -> bool {
638        matches!(self, Self::InvalidClusterTrackFault(_))
639    }
640    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidElasticIpFault`.
641    pub fn is_invalid_elastic_ip_fault(&self) -> bool {
642        matches!(self, Self::InvalidElasticIpFault(_))
643    }
644    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidReservedNodeStateFault`.
645    pub fn is_invalid_reserved_node_state_fault(&self) -> bool {
646        matches!(self, Self::InvalidReservedNodeStateFault(_))
647    }
648    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidRestoreFault`.
649    pub fn is_invalid_restore_fault(&self) -> bool {
650        matches!(self, Self::InvalidRestoreFault(_))
651    }
652    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidSubnet`.
653    pub fn is_invalid_subnet(&self) -> bool {
654        matches!(self, Self::InvalidSubnet(_))
655    }
656    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidTagFault`.
657    pub fn is_invalid_tag_fault(&self) -> bool {
658        matches!(self, Self::InvalidTagFault(_))
659    }
660    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::InvalidVpcNetworkStateFault`.
661    pub fn is_invalid_vpc_network_state_fault(&self) -> bool {
662        matches!(self, Self::InvalidVpcNetworkStateFault(_))
663    }
664    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::Ipv6CidrBlockNotFoundFault`.
665    pub fn is_ipv6_cidr_block_not_found_fault(&self) -> bool {
666        matches!(self, Self::Ipv6CidrBlockNotFoundFault(_))
667    }
668    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::LimitExceededFault`.
669    pub fn is_limit_exceeded_fault(&self) -> bool {
670        matches!(self, Self::LimitExceededFault(_))
671    }
672    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::NumberOfNodesPerClusterLimitExceededFault`.
673    pub fn is_number_of_nodes_per_cluster_limit_exceeded_fault(&self) -> bool {
674        matches!(self, Self::NumberOfNodesPerClusterLimitExceededFault(_))
675    }
676    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::NumberOfNodesQuotaExceededFault`.
677    pub fn is_number_of_nodes_quota_exceeded_fault(&self) -> bool {
678        matches!(self, Self::NumberOfNodesQuotaExceededFault(_))
679    }
680    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::RedshiftIdcApplicationNotExistsFault`.
681    pub fn is_redshift_idc_application_not_exists_fault(&self) -> bool {
682        matches!(self, Self::RedshiftIdcApplicationNotExistsFault(_))
683    }
684    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ReservedNodeAlreadyExistsFault`.
685    pub fn is_reserved_node_already_exists_fault(&self) -> bool {
686        matches!(self, Self::ReservedNodeAlreadyExistsFault(_))
687    }
688    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ReservedNodeAlreadyMigratedFault`.
689    pub fn is_reserved_node_already_migrated_fault(&self) -> bool {
690        matches!(self, Self::ReservedNodeAlreadyMigratedFault(_))
691    }
692    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ReservedNodeNotFoundFault`.
693    pub fn is_reserved_node_not_found_fault(&self) -> bool {
694        matches!(self, Self::ReservedNodeNotFoundFault(_))
695    }
696    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::ReservedNodeOfferingNotFoundFault`.
697    pub fn is_reserved_node_offering_not_found_fault(&self) -> bool {
698        matches!(self, Self::ReservedNodeOfferingNotFoundFault(_))
699    }
700    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::SnapshotScheduleNotFoundFault`.
701    pub fn is_snapshot_schedule_not_found_fault(&self) -> bool {
702        matches!(self, Self::SnapshotScheduleNotFoundFault(_))
703    }
704    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::TagLimitExceededFault`.
705    pub fn is_tag_limit_exceeded_fault(&self) -> bool {
706        matches!(self, Self::TagLimitExceededFault(_))
707    }
708    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::UnauthorizedOperation`.
709    pub fn is_unauthorized_operation(&self) -> bool {
710        matches!(self, Self::UnauthorizedOperation(_))
711    }
712    /// Returns `true` if the error kind is `RestoreFromClusterSnapshotError::UnsupportedOperationFault`.
713    pub fn is_unsupported_operation_fault(&self) -> bool {
714        matches!(self, Self::UnsupportedOperationFault(_))
715    }
716}
717impl ::std::error::Error for RestoreFromClusterSnapshotError {
718    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
719        match self {
720            Self::AccessToSnapshotDeniedFault(_inner) => ::std::option::Option::Some(_inner),
721            Self::ClusterAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
722            Self::ClusterParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
723            Self::ClusterQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
724            Self::ClusterSecurityGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
725            Self::ClusterSnapshotNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
726            Self::ClusterSubnetGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
727            Self::DependentServiceAccessDeniedFault(_inner) => ::std::option::Option::Some(_inner),
728            Self::DependentServiceRequestThrottlingFault(_inner) => ::std::option::Option::Some(_inner),
729            Self::DependentServiceUnavailableFault(_inner) => ::std::option::Option::Some(_inner),
730            Self::HsmClientCertificateNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
731            Self::HsmConfigurationNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
732            Self::InsufficientClusterCapacityFault(_inner) => ::std::option::Option::Some(_inner),
733            Self::InvalidClusterSnapshotStateFault(_inner) => ::std::option::Option::Some(_inner),
734            Self::InvalidClusterSubnetGroupStateFault(_inner) => ::std::option::Option::Some(_inner),
735            Self::InvalidClusterTrackFault(_inner) => ::std::option::Option::Some(_inner),
736            Self::InvalidElasticIpFault(_inner) => ::std::option::Option::Some(_inner),
737            Self::InvalidReservedNodeStateFault(_inner) => ::std::option::Option::Some(_inner),
738            Self::InvalidRestoreFault(_inner) => ::std::option::Option::Some(_inner),
739            Self::InvalidSubnet(_inner) => ::std::option::Option::Some(_inner),
740            Self::InvalidTagFault(_inner) => ::std::option::Option::Some(_inner),
741            Self::InvalidVpcNetworkStateFault(_inner) => ::std::option::Option::Some(_inner),
742            Self::Ipv6CidrBlockNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
743            Self::LimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
744            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
745            Self::NumberOfNodesQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
746            Self::RedshiftIdcApplicationNotExistsFault(_inner) => ::std::option::Option::Some(_inner),
747            Self::ReservedNodeAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
748            Self::ReservedNodeAlreadyMigratedFault(_inner) => ::std::option::Option::Some(_inner),
749            Self::ReservedNodeNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
750            Self::ReservedNodeOfferingNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
751            Self::SnapshotScheduleNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
752            Self::TagLimitExceededFault(_inner) => ::std::option::Option::Some(_inner),
753            Self::UnauthorizedOperation(_inner) => ::std::option::Option::Some(_inner),
754            Self::UnsupportedOperationFault(_inner) => ::std::option::Option::Some(_inner),
755            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
756        }
757    }
758}
759impl ::std::fmt::Display for RestoreFromClusterSnapshotError {
760    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
761        match self {
762            Self::AccessToSnapshotDeniedFault(_inner) => _inner.fmt(f),
763            Self::ClusterAlreadyExistsFault(_inner) => _inner.fmt(f),
764            Self::ClusterParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
765            Self::ClusterQuotaExceededFault(_inner) => _inner.fmt(f),
766            Self::ClusterSecurityGroupNotFoundFault(_inner) => _inner.fmt(f),
767            Self::ClusterSnapshotNotFoundFault(_inner) => _inner.fmt(f),
768            Self::ClusterSubnetGroupNotFoundFault(_inner) => _inner.fmt(f),
769            Self::DependentServiceAccessDeniedFault(_inner) => _inner.fmt(f),
770            Self::DependentServiceRequestThrottlingFault(_inner) => _inner.fmt(f),
771            Self::DependentServiceUnavailableFault(_inner) => _inner.fmt(f),
772            Self::HsmClientCertificateNotFoundFault(_inner) => _inner.fmt(f),
773            Self::HsmConfigurationNotFoundFault(_inner) => _inner.fmt(f),
774            Self::InsufficientClusterCapacityFault(_inner) => _inner.fmt(f),
775            Self::InvalidClusterSnapshotStateFault(_inner) => _inner.fmt(f),
776            Self::InvalidClusterSubnetGroupStateFault(_inner) => _inner.fmt(f),
777            Self::InvalidClusterTrackFault(_inner) => _inner.fmt(f),
778            Self::InvalidElasticIpFault(_inner) => _inner.fmt(f),
779            Self::InvalidReservedNodeStateFault(_inner) => _inner.fmt(f),
780            Self::InvalidRestoreFault(_inner) => _inner.fmt(f),
781            Self::InvalidSubnet(_inner) => _inner.fmt(f),
782            Self::InvalidTagFault(_inner) => _inner.fmt(f),
783            Self::InvalidVpcNetworkStateFault(_inner) => _inner.fmt(f),
784            Self::Ipv6CidrBlockNotFoundFault(_inner) => _inner.fmt(f),
785            Self::LimitExceededFault(_inner) => _inner.fmt(f),
786            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => _inner.fmt(f),
787            Self::NumberOfNodesQuotaExceededFault(_inner) => _inner.fmt(f),
788            Self::RedshiftIdcApplicationNotExistsFault(_inner) => _inner.fmt(f),
789            Self::ReservedNodeAlreadyExistsFault(_inner) => _inner.fmt(f),
790            Self::ReservedNodeAlreadyMigratedFault(_inner) => _inner.fmt(f),
791            Self::ReservedNodeNotFoundFault(_inner) => _inner.fmt(f),
792            Self::ReservedNodeOfferingNotFoundFault(_inner) => _inner.fmt(f),
793            Self::SnapshotScheduleNotFoundFault(_inner) => _inner.fmt(f),
794            Self::TagLimitExceededFault(_inner) => _inner.fmt(f),
795            Self::UnauthorizedOperation(_inner) => _inner.fmt(f),
796            Self::UnsupportedOperationFault(_inner) => _inner.fmt(f),
797            Self::Unhandled(_inner) => {
798                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
799                    write!(f, "unhandled error ({code})")
800                } else {
801                    f.write_str("unhandled error")
802                }
803            }
804        }
805    }
806}
807impl ::aws_smithy_types::retry::ProvideErrorKind for RestoreFromClusterSnapshotError {
808    fn code(&self) -> ::std::option::Option<&str> {
809        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
810    }
811    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
812        ::std::option::Option::None
813    }
814}
815impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RestoreFromClusterSnapshotError {
816    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
817        match self {
818            Self::AccessToSnapshotDeniedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
819            Self::ClusterAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
820            Self::ClusterParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
821            Self::ClusterQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
822            Self::ClusterSecurityGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
823            Self::ClusterSnapshotNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
824            Self::ClusterSubnetGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
825            Self::DependentServiceAccessDeniedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
826            Self::DependentServiceRequestThrottlingFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
827            Self::DependentServiceUnavailableFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
828            Self::HsmClientCertificateNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
829            Self::HsmConfigurationNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
830            Self::InsufficientClusterCapacityFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
831            Self::InvalidClusterSnapshotStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
832            Self::InvalidClusterSubnetGroupStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
833            Self::InvalidClusterTrackFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
834            Self::InvalidElasticIpFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
835            Self::InvalidReservedNodeStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
836            Self::InvalidRestoreFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
837            Self::InvalidSubnet(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
838            Self::InvalidTagFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
839            Self::InvalidVpcNetworkStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
840            Self::Ipv6CidrBlockNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
841            Self::LimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
842            Self::NumberOfNodesPerClusterLimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
843            Self::NumberOfNodesQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
844            Self::RedshiftIdcApplicationNotExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
845            Self::ReservedNodeAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
846            Self::ReservedNodeAlreadyMigratedFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
847            Self::ReservedNodeNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
848            Self::ReservedNodeOfferingNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
849            Self::SnapshotScheduleNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
850            Self::TagLimitExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
851            Self::UnauthorizedOperation(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
852            Self::UnsupportedOperationFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
853            Self::Unhandled(_inner) => &_inner.meta,
854        }
855    }
856}
857impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RestoreFromClusterSnapshotError {
858    fn create_unhandled_error(
859        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
860        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
861    ) -> Self {
862        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
863            source,
864            meta: meta.unwrap_or_default(),
865        })
866    }
867}
868impl ::aws_types::request_id::RequestId for crate::operation::restore_from_cluster_snapshot::RestoreFromClusterSnapshotError {
869    fn request_id(&self) -> Option<&str> {
870        self.meta().request_id()
871    }
872}
873
874pub use crate::operation::restore_from_cluster_snapshot::_restore_from_cluster_snapshot_input::RestoreFromClusterSnapshotInput;
875
876pub use crate::operation::restore_from_cluster_snapshot::_restore_from_cluster_snapshot_output::RestoreFromClusterSnapshotOutput;
877
878mod _restore_from_cluster_snapshot_input;
879
880mod _restore_from_cluster_snapshot_output;
881
882/// Builders
883pub mod builders;