aws_sdk_elasticache/operation/
create_replication_group.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2/// Orchestration and serialization glue logic for `CreateReplicationGroup`.
3#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
4#[non_exhaustive]
5pub struct CreateReplicationGroup;
6impl CreateReplicationGroup {
7    /// Creates a new `CreateReplicationGroup`
8    pub fn new() -> Self {
9        Self
10    }
11    pub(crate) async fn orchestrate(
12        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
13        input: crate::operation::create_replication_group::CreateReplicationGroupInput,
14    ) -> ::std::result::Result<
15        crate::operation::create_replication_group::CreateReplicationGroupOutput,
16        ::aws_smithy_runtime_api::client::result::SdkError<
17            crate::operation::create_replication_group::CreateReplicationGroupError,
18            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
19        >,
20    > {
21        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
22            ::aws_smithy_runtime_api::client::interceptors::context::Error,
23            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
24        >| {
25            err.map_service_error(|err| {
26                err.downcast::<crate::operation::create_replication_group::CreateReplicationGroupError>()
27                    .expect("correct error type")
28            })
29        };
30        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
31            .await
32            .map_err(map_err)?;
33        let output = context.finalize().map_err(map_err)?;
34        ::std::result::Result::Ok(
35            output
36                .downcast::<crate::operation::create_replication_group::CreateReplicationGroupOutput>()
37                .expect("correct output type"),
38        )
39    }
40
41    pub(crate) async fn orchestrate_with_stop_point(
42        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
43        input: crate::operation::create_replication_group::CreateReplicationGroupInput,
44        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
45    ) -> ::std::result::Result<
46        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
47        ::aws_smithy_runtime_api::client::result::SdkError<
48            ::aws_smithy_runtime_api::client::interceptors::context::Error,
49            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
50        >,
51    > {
52        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
53        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point(
54            "elasticache",
55            "CreateReplicationGroup",
56            input,
57            runtime_plugins,
58            stop_point,
59        )
60        .await
61    }
62
63    pub(crate) fn operation_runtime_plugins(
64        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
65        client_config: &crate::config::Config,
66        config_override: ::std::option::Option<crate::config::Builder>,
67    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
68        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
69        runtime_plugins = runtime_plugins.with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![
70            ::aws_runtime::auth::sigv4::SCHEME_ID,
71        ]));
72        if let ::std::option::Option::Some(config_override) = config_override {
73            for plugin in config_override.runtime_plugins.iter().cloned() {
74                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
75            }
76            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
77                config_override,
78                client_config.config.clone(),
79                &client_config.runtime_components,
80            ));
81        }
82        runtime_plugins
83    }
84}
85impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateReplicationGroup {
86    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
87        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("CreateReplicationGroup");
88
89        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
90            CreateReplicationGroupRequestSerializer,
91        ));
92        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
93            CreateReplicationGroupResponseDeserializer,
94        ));
95
96        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
97            ::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new(),
98        ));
99
100        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new(
101            "CreateReplicationGroup",
102            "elasticache",
103        ));
104        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
105        signing_options.double_uri_encode = true;
106        signing_options.content_sha256_header = false;
107        signing_options.normalize_uri_path = true;
108        signing_options.payload_override = None;
109
110        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
111            signing_options,
112            ..::std::default::Default::default()
113        });
114
115        ::std::option::Option::Some(cfg.freeze())
116    }
117
118    fn runtime_components(
119        &self,
120        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
121    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
122        #[allow(unused_mut)]
123        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateReplicationGroup")
124            .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())
125            .with_interceptor(CreateReplicationGroupEndpointParamsInterceptor)
126            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
127                crate::operation::create_replication_group::CreateReplicationGroupError,
128            >::new())
129            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
130                crate::operation::create_replication_group::CreateReplicationGroupError,
131            >::new())
132            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
133                crate::operation::create_replication_group::CreateReplicationGroupError,
134            >::new());
135
136        ::std::borrow::Cow::Owned(rcb)
137    }
138}
139
140#[derive(Debug)]
141struct CreateReplicationGroupResponseDeserializer;
142impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateReplicationGroupResponseDeserializer {
143    fn deserialize_nonstreaming(
144        &self,
145        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
146    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
147        let (success, status) = (response.status().is_success(), response.status().as_u16());
148        let headers = response.headers();
149        let body = response.body().bytes().expect("body loaded");
150        #[allow(unused_mut)]
151        let mut force_error = false;
152        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
153        let parse_result = if !success && status != 200 || force_error {
154            crate::protocol_serde::shape_create_replication_group::de_create_replication_group_http_error(status, headers, body)
155        } else {
156            crate::protocol_serde::shape_create_replication_group::de_create_replication_group_http_response(status, headers, body)
157        };
158        crate::protocol_serde::type_erase_result(parse_result)
159    }
160}
161#[derive(Debug)]
162struct CreateReplicationGroupRequestSerializer;
163impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for CreateReplicationGroupRequestSerializer {
164    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
165    fn serialize_input(
166        &self,
167        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
168        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
169    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
170        let input = input
171            .downcast::<crate::operation::create_replication_group::CreateReplicationGroupInput>()
172            .expect("correct type");
173        let _header_serialization_settings = _cfg
174            .load::<crate::serialization_settings::HeaderSerializationSettings>()
175            .cloned()
176            .unwrap_or_default();
177        let mut request_builder = {
178            fn uri_base(
179                _input: &crate::operation::create_replication_group::CreateReplicationGroupInput,
180                output: &mut ::std::string::String,
181            ) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> {
182                use ::std::fmt::Write as _;
183                ::std::write!(output, "/").expect("formatting should succeed");
184                ::std::result::Result::Ok(())
185            }
186            #[allow(clippy::unnecessary_wraps)]
187            fn update_http_builder(
188                input: &crate::operation::create_replication_group::CreateReplicationGroupInput,
189                builder: ::http::request::Builder,
190            ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
191                let mut uri = ::std::string::String::new();
192                uri_base(input, &mut uri)?;
193                ::std::result::Result::Ok(builder.method("POST").uri(uri))
194            }
195            let mut builder = update_http_builder(&input, ::http::request::Builder::new())?;
196            builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/x-www-form-urlencoded");
197            builder
198        };
199        let body = ::aws_smithy_types::body::SdkBody::from(
200            crate::protocol_serde::shape_create_replication_group_input::ser_create_replication_group_input_input_input(&input)?,
201        );
202        if let Some(content_length) = body.content_length() {
203            let content_length = content_length.to_string();
204            request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length);
205        }
206        ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap())
207    }
208}
209#[derive(Debug)]
210struct CreateReplicationGroupEndpointParamsInterceptor;
211
212impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateReplicationGroupEndpointParamsInterceptor {
213    fn name(&self) -> &'static str {
214        "CreateReplicationGroupEndpointParamsInterceptor"
215    }
216
217    fn read_before_execution(
218        &self,
219        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
220            '_,
221            ::aws_smithy_runtime_api::client::interceptors::context::Input,
222            ::aws_smithy_runtime_api::client::interceptors::context::Output,
223            ::aws_smithy_runtime_api::client::interceptors::context::Error,
224        >,
225        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
226    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
227        let _input = context
228            .input()
229            .downcast_ref::<CreateReplicationGroupInput>()
230            .ok_or("failed to downcast to CreateReplicationGroupInput")?;
231
232        let params = crate::config::endpoint::Params::builder()
233            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
234            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
235            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
236            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
237            .build()
238            .map_err(|err| {
239                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
240            })?;
241        cfg.interceptor_state()
242            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
243        ::std::result::Result::Ok(())
244    }
245}
246
247// The get_* functions below are generated from JMESPath expressions in the
248// operationContextParams trait. They target the operation's input shape.
249
250/// Error type for the `CreateReplicationGroupError` operation.
251#[non_exhaustive]
252#[derive(::std::fmt::Debug)]
253pub enum CreateReplicationGroupError {
254    /// <p>The requested cluster ID does not refer to an existing cluster.</p>
255    CacheClusterNotFoundFault(crate::types::error::CacheClusterNotFoundFault),
256    /// <p>The requested cache parameter group name does not refer to an existing cache parameter group.</p>
257    CacheParameterGroupNotFoundFault(crate::types::error::CacheParameterGroupNotFoundFault),
258    /// <p>The requested cache security group name does not refer to an existing cache security group.</p>
259    CacheSecurityGroupNotFoundFault(crate::types::error::CacheSecurityGroupNotFoundFault),
260    /// <p>The requested cache subnet group name does not refer to an existing cache subnet group.</p>
261    CacheSubnetGroupNotFoundFault(crate::types::error::CacheSubnetGroupNotFoundFault),
262    /// <p>The request cannot be processed because it would exceed the allowed number of clusters per customer.</p>
263    ClusterQuotaForCustomerExceededFault(crate::types::error::ClusterQuotaForCustomerExceededFault),
264    /// <p>The Global datastore does not exist</p>
265    GlobalReplicationGroupNotFoundFault(crate::types::error::GlobalReplicationGroupNotFoundFault),
266    /// <p>The requested cache node type is not available in the specified Availability Zone. For more information, see <a href="http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ErrorMessages.html#ErrorMessages.INSUFFICIENT_CACHE_CLUSTER_CAPACITY">InsufficientCacheClusterCapacity</a> in the ElastiCache User Guide.</p>
267    InsufficientCacheClusterCapacityFault(crate::types::error::InsufficientCacheClusterCapacityFault),
268    /// <p>The requested cluster is not in the <code>available</code> state.</p>
269    InvalidCacheClusterStateFault(crate::types::error::InvalidCacheClusterStateFault),
270    /// <p>The Global datastore is not available or in primary-only state.</p>
271    InvalidGlobalReplicationGroupStateFault(crate::types::error::InvalidGlobalReplicationGroupStateFault),
272    /// <p>Two or more incompatible parameters were specified.</p>
273    InvalidParameterCombinationException(crate::types::error::InvalidParameterCombinationException),
274    /// <p>The value for a parameter is invalid.</p>
275    InvalidParameterValueException(crate::types::error::InvalidParameterValueException),
276    /// <p>The user group is not in an active state.</p>
277    InvalidUserGroupStateFault(crate::types::error::InvalidUserGroupStateFault),
278    /// <p>The VPC network is in an invalid state.</p>
279    InvalidVpcNetworkStateFault(crate::types::error::InvalidVpcNetworkStateFault),
280    /// <p>The request cannot be processed because it would exceed the maximum allowed number of node groups (shards) in a single replication group. The default maximum is 90</p>
281    NodeGroupsPerReplicationGroupQuotaExceededFault(crate::types::error::NodeGroupsPerReplicationGroupQuotaExceededFault),
282    /// <p>The request cannot be processed because it would exceed the allowed number of cache nodes in a single cluster.</p>
283    NodeQuotaForClusterExceededFault(crate::types::error::NodeQuotaForClusterExceededFault),
284    /// <p>The request cannot be processed because it would exceed the allowed number of cache nodes per customer.</p>
285    NodeQuotaForCustomerExceededFault(crate::types::error::NodeQuotaForCustomerExceededFault),
286    /// <p>The specified replication group already exists.</p>
287    ReplicationGroupAlreadyExistsFault(crate::types::error::ReplicationGroupAlreadyExistsFault),
288    /// <p>The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.</p>
289    TagQuotaPerResourceExceeded(crate::types::error::TagQuotaPerResourceExceeded),
290    /// <p>The user group was not found or does not exist</p>
291    UserGroupNotFoundFault(crate::types::error::UserGroupNotFoundFault),
292    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
293    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
294    variable wildcard pattern and check `.code()`:
295     \
296    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
297     \
298    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-CreateReplicationGroupError) for what information is available for the error.")]
299    Unhandled(crate::error::sealed_unhandled::Unhandled),
300}
301impl CreateReplicationGroupError {
302    /// Creates the `CreateReplicationGroupError::Unhandled` variant from any error type.
303    pub fn unhandled(
304        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
305    ) -> Self {
306        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
307            source: err.into(),
308            meta: ::std::default::Default::default(),
309        })
310    }
311
312    /// Creates the `CreateReplicationGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
313    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
314        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
315            source: err.clone().into(),
316            meta: err,
317        })
318    }
319    ///
320    /// Returns error metadata, which includes the error code, message,
321    /// request ID, and potentially additional information.
322    ///
323    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
324        match self {
325            Self::CacheClusterNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
326            Self::CacheParameterGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
327            Self::CacheSecurityGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
328            Self::CacheSubnetGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
329            Self::ClusterQuotaForCustomerExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
330            Self::GlobalReplicationGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
331            Self::InsufficientCacheClusterCapacityFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
332            Self::InvalidCacheClusterStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
333            Self::InvalidGlobalReplicationGroupStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
334            Self::InvalidParameterCombinationException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
335            Self::InvalidParameterValueException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
336            Self::InvalidUserGroupStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
337            Self::InvalidVpcNetworkStateFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
338            Self::NodeGroupsPerReplicationGroupQuotaExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
339            Self::NodeQuotaForClusterExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
340            Self::NodeQuotaForCustomerExceededFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
341            Self::ReplicationGroupAlreadyExistsFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
342            Self::TagQuotaPerResourceExceeded(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
343            Self::UserGroupNotFoundFault(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
344            Self::Unhandled(e) => &e.meta,
345        }
346    }
347    /// Returns `true` if the error kind is `CreateReplicationGroupError::CacheClusterNotFoundFault`.
348    pub fn is_cache_cluster_not_found_fault(&self) -> bool {
349        matches!(self, Self::CacheClusterNotFoundFault(_))
350    }
351    /// Returns `true` if the error kind is `CreateReplicationGroupError::CacheParameterGroupNotFoundFault`.
352    pub fn is_cache_parameter_group_not_found_fault(&self) -> bool {
353        matches!(self, Self::CacheParameterGroupNotFoundFault(_))
354    }
355    /// Returns `true` if the error kind is `CreateReplicationGroupError::CacheSecurityGroupNotFoundFault`.
356    pub fn is_cache_security_group_not_found_fault(&self) -> bool {
357        matches!(self, Self::CacheSecurityGroupNotFoundFault(_))
358    }
359    /// Returns `true` if the error kind is `CreateReplicationGroupError::CacheSubnetGroupNotFoundFault`.
360    pub fn is_cache_subnet_group_not_found_fault(&self) -> bool {
361        matches!(self, Self::CacheSubnetGroupNotFoundFault(_))
362    }
363    /// Returns `true` if the error kind is `CreateReplicationGroupError::ClusterQuotaForCustomerExceededFault`.
364    pub fn is_cluster_quota_for_customer_exceeded_fault(&self) -> bool {
365        matches!(self, Self::ClusterQuotaForCustomerExceededFault(_))
366    }
367    /// Returns `true` if the error kind is `CreateReplicationGroupError::GlobalReplicationGroupNotFoundFault`.
368    pub fn is_global_replication_group_not_found_fault(&self) -> bool {
369        matches!(self, Self::GlobalReplicationGroupNotFoundFault(_))
370    }
371    /// Returns `true` if the error kind is `CreateReplicationGroupError::InsufficientCacheClusterCapacityFault`.
372    pub fn is_insufficient_cache_cluster_capacity_fault(&self) -> bool {
373        matches!(self, Self::InsufficientCacheClusterCapacityFault(_))
374    }
375    /// Returns `true` if the error kind is `CreateReplicationGroupError::InvalidCacheClusterStateFault`.
376    pub fn is_invalid_cache_cluster_state_fault(&self) -> bool {
377        matches!(self, Self::InvalidCacheClusterStateFault(_))
378    }
379    /// Returns `true` if the error kind is `CreateReplicationGroupError::InvalidGlobalReplicationGroupStateFault`.
380    pub fn is_invalid_global_replication_group_state_fault(&self) -> bool {
381        matches!(self, Self::InvalidGlobalReplicationGroupStateFault(_))
382    }
383    /// Returns `true` if the error kind is `CreateReplicationGroupError::InvalidParameterCombinationException`.
384    pub fn is_invalid_parameter_combination_exception(&self) -> bool {
385        matches!(self, Self::InvalidParameterCombinationException(_))
386    }
387    /// Returns `true` if the error kind is `CreateReplicationGroupError::InvalidParameterValueException`.
388    pub fn is_invalid_parameter_value_exception(&self) -> bool {
389        matches!(self, Self::InvalidParameterValueException(_))
390    }
391    /// Returns `true` if the error kind is `CreateReplicationGroupError::InvalidUserGroupStateFault`.
392    pub fn is_invalid_user_group_state_fault(&self) -> bool {
393        matches!(self, Self::InvalidUserGroupStateFault(_))
394    }
395    /// Returns `true` if the error kind is `CreateReplicationGroupError::InvalidVpcNetworkStateFault`.
396    pub fn is_invalid_vpc_network_state_fault(&self) -> bool {
397        matches!(self, Self::InvalidVpcNetworkStateFault(_))
398    }
399    /// Returns `true` if the error kind is `CreateReplicationGroupError::NodeGroupsPerReplicationGroupQuotaExceededFault`.
400    pub fn is_node_groups_per_replication_group_quota_exceeded_fault(&self) -> bool {
401        matches!(self, Self::NodeGroupsPerReplicationGroupQuotaExceededFault(_))
402    }
403    /// Returns `true` if the error kind is `CreateReplicationGroupError::NodeQuotaForClusterExceededFault`.
404    pub fn is_node_quota_for_cluster_exceeded_fault(&self) -> bool {
405        matches!(self, Self::NodeQuotaForClusterExceededFault(_))
406    }
407    /// Returns `true` if the error kind is `CreateReplicationGroupError::NodeQuotaForCustomerExceededFault`.
408    pub fn is_node_quota_for_customer_exceeded_fault(&self) -> bool {
409        matches!(self, Self::NodeQuotaForCustomerExceededFault(_))
410    }
411    /// Returns `true` if the error kind is `CreateReplicationGroupError::ReplicationGroupAlreadyExistsFault`.
412    pub fn is_replication_group_already_exists_fault(&self) -> bool {
413        matches!(self, Self::ReplicationGroupAlreadyExistsFault(_))
414    }
415    /// Returns `true` if the error kind is `CreateReplicationGroupError::TagQuotaPerResourceExceeded`.
416    pub fn is_tag_quota_per_resource_exceeded(&self) -> bool {
417        matches!(self, Self::TagQuotaPerResourceExceeded(_))
418    }
419    /// Returns `true` if the error kind is `CreateReplicationGroupError::UserGroupNotFoundFault`.
420    pub fn is_user_group_not_found_fault(&self) -> bool {
421        matches!(self, Self::UserGroupNotFoundFault(_))
422    }
423}
424impl ::std::error::Error for CreateReplicationGroupError {
425    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
426        match self {
427            Self::CacheClusterNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
428            Self::CacheParameterGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
429            Self::CacheSecurityGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
430            Self::CacheSubnetGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
431            Self::ClusterQuotaForCustomerExceededFault(_inner) => ::std::option::Option::Some(_inner),
432            Self::GlobalReplicationGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
433            Self::InsufficientCacheClusterCapacityFault(_inner) => ::std::option::Option::Some(_inner),
434            Self::InvalidCacheClusterStateFault(_inner) => ::std::option::Option::Some(_inner),
435            Self::InvalidGlobalReplicationGroupStateFault(_inner) => ::std::option::Option::Some(_inner),
436            Self::InvalidParameterCombinationException(_inner) => ::std::option::Option::Some(_inner),
437            Self::InvalidParameterValueException(_inner) => ::std::option::Option::Some(_inner),
438            Self::InvalidUserGroupStateFault(_inner) => ::std::option::Option::Some(_inner),
439            Self::InvalidVpcNetworkStateFault(_inner) => ::std::option::Option::Some(_inner),
440            Self::NodeGroupsPerReplicationGroupQuotaExceededFault(_inner) => ::std::option::Option::Some(_inner),
441            Self::NodeQuotaForClusterExceededFault(_inner) => ::std::option::Option::Some(_inner),
442            Self::NodeQuotaForCustomerExceededFault(_inner) => ::std::option::Option::Some(_inner),
443            Self::ReplicationGroupAlreadyExistsFault(_inner) => ::std::option::Option::Some(_inner),
444            Self::TagQuotaPerResourceExceeded(_inner) => ::std::option::Option::Some(_inner),
445            Self::UserGroupNotFoundFault(_inner) => ::std::option::Option::Some(_inner),
446            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
447        }
448    }
449}
450impl ::std::fmt::Display for CreateReplicationGroupError {
451    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
452        match self {
453            Self::CacheClusterNotFoundFault(_inner) => _inner.fmt(f),
454            Self::CacheParameterGroupNotFoundFault(_inner) => _inner.fmt(f),
455            Self::CacheSecurityGroupNotFoundFault(_inner) => _inner.fmt(f),
456            Self::CacheSubnetGroupNotFoundFault(_inner) => _inner.fmt(f),
457            Self::ClusterQuotaForCustomerExceededFault(_inner) => _inner.fmt(f),
458            Self::GlobalReplicationGroupNotFoundFault(_inner) => _inner.fmt(f),
459            Self::InsufficientCacheClusterCapacityFault(_inner) => _inner.fmt(f),
460            Self::InvalidCacheClusterStateFault(_inner) => _inner.fmt(f),
461            Self::InvalidGlobalReplicationGroupStateFault(_inner) => _inner.fmt(f),
462            Self::InvalidParameterCombinationException(_inner) => _inner.fmt(f),
463            Self::InvalidParameterValueException(_inner) => _inner.fmt(f),
464            Self::InvalidUserGroupStateFault(_inner) => _inner.fmt(f),
465            Self::InvalidVpcNetworkStateFault(_inner) => _inner.fmt(f),
466            Self::NodeGroupsPerReplicationGroupQuotaExceededFault(_inner) => _inner.fmt(f),
467            Self::NodeQuotaForClusterExceededFault(_inner) => _inner.fmt(f),
468            Self::NodeQuotaForCustomerExceededFault(_inner) => _inner.fmt(f),
469            Self::ReplicationGroupAlreadyExistsFault(_inner) => _inner.fmt(f),
470            Self::TagQuotaPerResourceExceeded(_inner) => _inner.fmt(f),
471            Self::UserGroupNotFoundFault(_inner) => _inner.fmt(f),
472            Self::Unhandled(_inner) => {
473                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
474                    write!(f, "unhandled error ({code})")
475                } else {
476                    f.write_str("unhandled error")
477                }
478            }
479        }
480    }
481}
482impl ::aws_smithy_types::retry::ProvideErrorKind for CreateReplicationGroupError {
483    fn code(&self) -> ::std::option::Option<&str> {
484        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
485    }
486    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
487        ::std::option::Option::None
488    }
489}
490impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for CreateReplicationGroupError {
491    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
492        match self {
493            Self::CacheClusterNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
494            Self::CacheParameterGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
495            Self::CacheSecurityGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
496            Self::CacheSubnetGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
497            Self::ClusterQuotaForCustomerExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
498            Self::GlobalReplicationGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
499            Self::InsufficientCacheClusterCapacityFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
500            Self::InvalidCacheClusterStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
501            Self::InvalidGlobalReplicationGroupStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
502            Self::InvalidParameterCombinationException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
503            Self::InvalidParameterValueException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
504            Self::InvalidUserGroupStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
505            Self::InvalidVpcNetworkStateFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
506            Self::NodeGroupsPerReplicationGroupQuotaExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
507            Self::NodeQuotaForClusterExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
508            Self::NodeQuotaForCustomerExceededFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
509            Self::ReplicationGroupAlreadyExistsFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
510            Self::TagQuotaPerResourceExceeded(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
511            Self::UserGroupNotFoundFault(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
512            Self::Unhandled(_inner) => &_inner.meta,
513        }
514    }
515}
516impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateReplicationGroupError {
517    fn create_unhandled_error(
518        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
519        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
520    ) -> Self {
521        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
522            source,
523            meta: meta.unwrap_or_default(),
524        })
525    }
526}
527impl ::aws_types::request_id::RequestId for crate::operation::create_replication_group::CreateReplicationGroupError {
528    fn request_id(&self) -> Option<&str> {
529        self.meta().request_id()
530    }
531}
532
533pub use crate::operation::create_replication_group::_create_replication_group_output::CreateReplicationGroupOutput;
534
535pub use crate::operation::create_replication_group::_create_replication_group_input::CreateReplicationGroupInput;
536
537mod _create_replication_group_input;
538
539mod _create_replication_group_output;
540
541/// Builders
542pub mod builders;