aws_sdk_paymentcryptography/operation/disable_default_key_replication_regions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::disable_default_key_replication_regions::_disable_default_key_replication_regions_output::DisableDefaultKeyReplicationRegionsOutputBuilder;
3
4pub use crate::operation::disable_default_key_replication_regions::_disable_default_key_replication_regions_input::DisableDefaultKeyReplicationRegionsInputBuilder;
5
6impl crate::operation::disable_default_key_replication_regions::builders::DisableDefaultKeyReplicationRegionsInputBuilder {
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::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.disable_default_key_replication_regions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DisableDefaultKeyReplicationRegions`.
24///
25/// <p>Disables <a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a> settings for the specified Amazon Web Services Regions in your Amazon Web Services account, preventing new keys from being automatically replicated to those regions.</p>
26/// <p>After disabling Multi-Region key replication for specific regions, new keys created in your account will not be automatically replicated to those regions. You can still manually add replication to those regions for individual keys using the <a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_AddKeyReplicationRegions.html">AddKeyReplicationRegions</a> operation.</p>
27/// <p>This operation does not affect existing keys or their current replication configuration.</p>
28/// <p><b>Cross-account use:</b> This operation can't be used across different Amazon Web Services accounts.</p>
29/// <p><b>Related operations:</b></p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_EnableDefaultKeyReplicationRegions.html">EnableDefaultKeyReplicationRegions</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetDefaultKeyReplicationRegions.html">GetDefaultKeyReplicationRegions</a></p></li>
35/// </ul>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct DisableDefaultKeyReplicationRegionsFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::disable_default_key_replication_regions::builders::DisableDefaultKeyReplicationRegionsInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsOutput,
45        crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsError,
46    > for DisableDefaultKeyReplicationRegionsFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsOutput,
54            crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl DisableDefaultKeyReplicationRegionsFluentBuilder {
61    /// Creates a new `DisableDefaultKeyReplicationRegionsFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the DisableDefaultKeyReplicationRegions as a reference.
70    pub fn as_input(&self) -> &crate::operation::disable_default_key_replication_regions::builders::DisableDefaultKeyReplicationRegionsInputBuilder {
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins =
95            crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegions::operation_runtime_plugins(
96                self.handle.runtime_plugins.clone(),
97                &self.handle.conf,
98                self.config_override,
99            );
100        crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegions::orchestrate(&runtime_plugins, input).await
101    }
102
103    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104    pub fn customize(
105        self,
106    ) -> crate::client::customize::CustomizableOperation<
107        crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsOutput,
108        crate::operation::disable_default_key_replication_regions::DisableDefaultKeyReplicationRegionsError,
109        Self,
110    > {
111        crate::client::customize::CustomizableOperation::new(self)
112    }
113    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114        self.set_config_override(::std::option::Option::Some(config_override.into()));
115        self
116    }
117
118    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119        self.config_override = config_override;
120        self
121    }
122    ///
123    /// Appends an item to `ReplicationRegions`.
124    ///
125    /// To override the contents of this collection use [`set_replication_regions`](Self::set_replication_regions).
126    ///
127    /// <p>The list of Amazon Web Services Regions to remove from the account's default replication regions.</p>
128    /// <p>New keys created after this operation will not automatically be replicated to these regions, though existing keys with replication to these regions will be unaffected.</p>
129    pub fn replication_regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.replication_regions(input.into());
131        self
132    }
133    /// <p>The list of Amazon Web Services Regions to remove from the account's default replication regions.</p>
134    /// <p>New keys created after this operation will not automatically be replicated to these regions, though existing keys with replication to these regions will be unaffected.</p>
135    pub fn set_replication_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
136        self.inner = self.inner.set_replication_regions(input);
137        self
138    }
139    /// <p>The list of Amazon Web Services Regions to remove from the account's default replication regions.</p>
140    /// <p>New keys created after this operation will not automatically be replicated to these regions, though existing keys with replication to these regions will be unaffected.</p>
141    pub fn get_replication_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
142        self.inner.get_replication_regions()
143    }
144}