Skip to main content

aws_sdk_secretsmanager/operation/stop_replication_to_replica/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::stop_replication_to_replica::_stop_replication_to_replica_input::StopReplicationToReplicaInputBuilder;
3
4pub use crate::operation::stop_replication_to_replica::_stop_replication_to_replica_output::StopReplicationToReplicaOutputBuilder;
5
6impl crate::operation::stop_replication_to_replica::builders::StopReplicationToReplicaInputBuilder {
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::stop_replication_to_replica::StopReplicationToReplicaOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::stop_replication_to_replica::StopReplicationToReplicaError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.stop_replication_to_replica();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `StopReplicationToReplica`.
24///
25/// <p>Removes the link between a replica secret and its primary secret, and stops replication to the replica. You call this operation from the replica account or Region. Depending on the type of replica, the behavior is:</p>
26/// <ul>
27/// <li>
28/// <p><b>Cross-Region replica</b>: promotes the replica to a standalone primary secret in the replica Region.</p></li>
29/// <li>
30/// <p><b>Cross-account replica</b>: promotes the replica in your account to a standalone secret and stops replication from its primary secret in the other account. Secrets Manager updates the primary secret's replication status to <code>Detached</code> for this replica.</p></li>
31/// </ul>
32/// <p>To stop cross-account replication from the primary account instead, use <code>DisassociateCrossAccountReplica</code>.</p>
33/// <p>Secrets Manager generates a CloudTrail log entry when you call this action. Do not include sensitive information in request parameters because it might be logged. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/retrieve-ct-entries.html">Logging Secrets Manager events with CloudTrail</a>.</p>
34/// <p><b>Required permissions: </b> <code>secretsmanager:StopReplicationToReplica</code>. For cross-account replica secrets, you must also have <code>secretsmanager:DeleteResourcePolicy</code> permissions. For more information, see <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/reference_iam-permissions.html#reference_iam-permissions_actions"> IAM policy actions for Secrets Manager</a> and <a href="https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access.html">Authentication and access control in Secrets Manager</a>.</p>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct StopReplicationToReplicaFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::stop_replication_to_replica::builders::StopReplicationToReplicaInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::stop_replication_to_replica::StopReplicationToReplicaOutput,
44        crate::operation::stop_replication_to_replica::StopReplicationToReplicaError,
45    > for StopReplicationToReplicaFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::stop_replication_to_replica::StopReplicationToReplicaOutput,
53            crate::operation::stop_replication_to_replica::StopReplicationToReplicaError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl StopReplicationToReplicaFluentBuilder {
60    /// Creates a new `StopReplicationToReplicaFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the StopReplicationToReplica as a reference.
69    pub fn as_input(&self) -> &crate::operation::stop_replication_to_replica::builders::StopReplicationToReplicaInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::stop_replication_to_replica::StopReplicationToReplicaOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::stop_replication_to_replica::StopReplicationToReplicaError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::stop_replication_to_replica::StopReplicationToReplica::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::stop_replication_to_replica::StopReplicationToReplica::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::stop_replication_to_replica::StopReplicationToReplicaOutput,
106        crate::operation::stop_replication_to_replica::StopReplicationToReplicaError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The ARN or name of the replica secret.</p>
121    /// <p>For a cross-region replica, the replica ARN is the same as the original primary secret ARN except that the Region is changed to the replica Region. For a cross-account replica, this is the ARN or name of the replica secret in your account.</p>
122    pub fn secret_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.secret_id(input.into());
124        self
125    }
126    /// <p>The ARN or name of the replica secret.</p>
127    /// <p>For a cross-region replica, the replica ARN is the same as the original primary secret ARN except that the Region is changed to the replica Region. For a cross-account replica, this is the ARN or name of the replica secret in your account.</p>
128    pub fn set_secret_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.inner = self.inner.set_secret_id(input);
130        self
131    }
132    /// <p>The ARN or name of the replica secret.</p>
133    /// <p>For a cross-region replica, the replica ARN is the same as the original primary secret ARN except that the Region is changed to the replica Region. For a cross-account replica, this is the ARN or name of the replica secret in your account.</p>
134    pub fn get_secret_id(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_secret_id()
136    }
137}