aws_sdk_elasticache/operation/delete_replication_group/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_replication_group::_delete_replication_group_output::DeleteReplicationGroupOutputBuilder;
3
4pub use crate::operation::delete_replication_group::_delete_replication_group_input::DeleteReplicationGroupInputBuilder;
5
6impl crate::operation::delete_replication_group::builders::DeleteReplicationGroupInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::delete_replication_group::DeleteReplicationGroupOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_replication_group::DeleteReplicationGroupError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_replication_group();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteReplicationGroup`.
24///
25/// <p>Deletes an existing replication group. By default, this operation deletes the entire replication group, including the primary/primaries and all of the read replicas. If the replication group has only one primary, you can optionally delete only the read replicas, while retaining the primary by setting <code>RetainPrimaryCluster=true</code>.</p>
26/// <p>When you receive a successful response from this operation, Amazon ElastiCache immediately begins deleting the selected resources; you cannot cancel or revert this operation.</p><note>
27/// <ul>
28/// <li>
29/// <p><code>CreateSnapshot</code> permission is required to create a final snapshot. Without this permission, the API call will fail with an <code>Access Denied</code> exception.</p></li>
30/// <li>
31/// <p>This operation is valid for Redis OSS only.</p></li>
32/// </ul>
33/// </note>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct DeleteReplicationGroupFluentBuilder {
36    handle: ::std::sync::Arc<crate::client::Handle>,
37    inner: crate::operation::delete_replication_group::builders::DeleteReplicationGroupInputBuilder,
38    config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41    crate::client::customize::internal::CustomizableSend<
42        crate::operation::delete_replication_group::DeleteReplicationGroupOutput,
43        crate::operation::delete_replication_group::DeleteReplicationGroupError,
44    > for DeleteReplicationGroupFluentBuilder
45{
46    fn send(
47        self,
48        config_override: crate::config::Builder,
49    ) -> crate::client::customize::internal::BoxFuture<
50        crate::client::customize::internal::SendResult<
51            crate::operation::delete_replication_group::DeleteReplicationGroupOutput,
52            crate::operation::delete_replication_group::DeleteReplicationGroupError,
53        >,
54    > {
55        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56    }
57}
58impl DeleteReplicationGroupFluentBuilder {
59    /// Creates a new `DeleteReplicationGroupFluentBuilder`.
60    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61        Self {
62            handle,
63            inner: ::std::default::Default::default(),
64            config_override: ::std::option::Option::None,
65        }
66    }
67    /// Access the DeleteReplicationGroup as a reference.
68    pub fn as_input(&self) -> &crate::operation::delete_replication_group::builders::DeleteReplicationGroupInputBuilder {
69        &self.inner
70    }
71    /// Sends the request and returns the response.
72    ///
73    /// If an error occurs, an `SdkError` will be returned with additional details that
74    /// can be matched against.
75    ///
76    /// By default, any retryable failures will be retried twice. Retry behavior
77    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78    /// set when configuring the client.
79    pub async fn send(
80        self,
81    ) -> ::std::result::Result<
82        crate::operation::delete_replication_group::DeleteReplicationGroupOutput,
83        ::aws_smithy_runtime_api::client::result::SdkError<
84            crate::operation::delete_replication_group::DeleteReplicationGroupError,
85            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86        >,
87    > {
88        let input = self
89            .inner
90            .build()
91            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92        let runtime_plugins = crate::operation::delete_replication_group::DeleteReplicationGroup::operation_runtime_plugins(
93            self.handle.runtime_plugins.clone(),
94            &self.handle.conf,
95            self.config_override,
96        );
97        crate::operation::delete_replication_group::DeleteReplicationGroup::orchestrate(&runtime_plugins, input).await
98    }
99
100    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101    pub fn customize(
102        self,
103    ) -> crate::client::customize::CustomizableOperation<
104        crate::operation::delete_replication_group::DeleteReplicationGroupOutput,
105        crate::operation::delete_replication_group::DeleteReplicationGroupError,
106        Self,
107    > {
108        crate::client::customize::CustomizableOperation::new(self)
109    }
110    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111        self.set_config_override(::std::option::Option::Some(config_override.into()));
112        self
113    }
114
115    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116        self.config_override = config_override;
117        self
118    }
119    /// <p>The identifier for the cluster to be deleted. This parameter is not case sensitive.</p>
120    pub fn replication_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.replication_group_id(input.into());
122        self
123    }
124    /// <p>The identifier for the cluster to be deleted. This parameter is not case sensitive.</p>
125    pub fn set_replication_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.inner = self.inner.set_replication_group_id(input);
127        self
128    }
129    /// <p>The identifier for the cluster to be deleted. This parameter is not case sensitive.</p>
130    pub fn get_replication_group_id(&self) -> &::std::option::Option<::std::string::String> {
131        self.inner.get_replication_group_id()
132    }
133    /// <p>If set to <code>true</code>, all of the read replicas are deleted, but the primary node is retained.</p>
134    pub fn retain_primary_cluster(mut self, input: bool) -> Self {
135        self.inner = self.inner.retain_primary_cluster(input);
136        self
137    }
138    /// <p>If set to <code>true</code>, all of the read replicas are deleted, but the primary node is retained.</p>
139    pub fn set_retain_primary_cluster(mut self, input: ::std::option::Option<bool>) -> Self {
140        self.inner = self.inner.set_retain_primary_cluster(input);
141        self
142    }
143    /// <p>If set to <code>true</code>, all of the read replicas are deleted, but the primary node is retained.</p>
144    pub fn get_retain_primary_cluster(&self) -> &::std::option::Option<bool> {
145        self.inner.get_retain_primary_cluster()
146    }
147    /// <p>The name of a final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster, rather than one of the replicas; this is to ensure that it captures the freshest data. After the final snapshot is taken, the replication group is immediately deleted.</p>
148    pub fn final_snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.inner = self.inner.final_snapshot_identifier(input.into());
150        self
151    }
152    /// <p>The name of a final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster, rather than one of the replicas; this is to ensure that it captures the freshest data. After the final snapshot is taken, the replication group is immediately deleted.</p>
153    pub fn set_final_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.inner = self.inner.set_final_snapshot_identifier(input);
155        self
156    }
157    /// <p>The name of a final node group (shard) snapshot. ElastiCache creates the snapshot from the primary node in the cluster, rather than one of the replicas; this is to ensure that it captures the freshest data. After the final snapshot is taken, the replication group is immediately deleted.</p>
158    pub fn get_final_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_final_snapshot_identifier()
160    }
161}