aws_sdk_paymentcryptography/operation/add_key_replication_regions/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::add_key_replication_regions::_add_key_replication_regions_output::AddKeyReplicationRegionsOutputBuilder;
3
4pub use crate::operation::add_key_replication_regions::_add_key_replication_regions_input::AddKeyReplicationRegionsInputBuilder;
5
6impl crate::operation::add_key_replication_regions::builders::AddKeyReplicationRegionsInputBuilder {
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::add_key_replication_regions::AddKeyReplicationRegionsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::add_key_replication_regions::AddKeyReplicationRegionsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.add_key_replication_regions();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AddKeyReplicationRegions`.
24///
25/// <p>Adds replication Amazon Web Services Regions to an existing Amazon Web Services Payment Cryptography key, enabling the key to be used for cryptographic operations in additional Amazon Web Services Regions.</p>
26/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/userguide/keys-multi-region-replication.html">Multi-Region key replication</a> allow you to use the same key material across multiple Amazon Web Services Regions, providing lower latency for applications distributed across regions. When you add Replication Regions, Amazon Web Services Payment Cryptography securely replicates the key material to the specified Amazon Web Services Regions.</p>
27/// <p>The key must be in an active state to add Replication Regions. You can add multiple regions in a single operation, and the key will be available for use in those regions once replication is complete.</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_RemoveKeyReplicationRegions.html">RemoveKeyReplicationRegions</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_EnableDefaultKeyReplicationRegions.html">EnableDefaultKeyReplicationRegions</a></p></li>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/payment-cryptography/latest/APIReference/API_GetDefaultKeyReplicationRegions.html">GetDefaultKeyReplicationRegions</a></p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct AddKeyReplicationRegionsFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::add_key_replication_regions::builders::AddKeyReplicationRegionsInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::add_key_replication_regions::AddKeyReplicationRegionsOutput,
47        crate::operation::add_key_replication_regions::AddKeyReplicationRegionsError,
48    > for AddKeyReplicationRegionsFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::add_key_replication_regions::AddKeyReplicationRegionsOutput,
56            crate::operation::add_key_replication_regions::AddKeyReplicationRegionsError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl AddKeyReplicationRegionsFluentBuilder {
63    /// Creates a new `AddKeyReplicationRegionsFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the AddKeyReplicationRegions as a reference.
72    pub fn as_input(&self) -> &crate::operation::add_key_replication_regions::builders::AddKeyReplicationRegionsInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::add_key_replication_regions::AddKeyReplicationRegionsOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::add_key_replication_regions::AddKeyReplicationRegionsError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::add_key_replication_regions::AddKeyReplicationRegions::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::add_key_replication_regions::AddKeyReplicationRegions::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::add_key_replication_regions::AddKeyReplicationRegionsOutput,
109        crate::operation::add_key_replication_regions::AddKeyReplicationRegionsError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The key identifier (ARN or alias) of the key for which to add replication regions.</p>
124    /// <p>This key must exist and be in a valid state for replication operations.</p>
125    pub fn key_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.key_identifier(input.into());
127        self
128    }
129    /// <p>The key identifier (ARN or alias) of the key for which to add replication regions.</p>
130    /// <p>This key must exist and be in a valid state for replication operations.</p>
131    pub fn set_key_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_key_identifier(input);
133        self
134    }
135    /// <p>The key identifier (ARN or alias) of the key for which to add replication regions.</p>
136    /// <p>This key must exist and be in a valid state for replication operations.</p>
137    pub fn get_key_identifier(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_key_identifier()
139    }
140    ///
141    /// Appends an item to `ReplicationRegions`.
142    ///
143    /// To override the contents of this collection use [`set_replication_regions`](Self::set_replication_regions).
144    ///
145    /// <p>The list of Amazon Web Services Regions to add to the key's replication configuration.</p>
146    /// <p>Each region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available. The key will be replicated to these regions, allowing cryptographic operations to be performed closer to your applications.</p>
147    pub fn replication_regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.replication_regions(input.into());
149        self
150    }
151    /// <p>The list of Amazon Web Services Regions to add to the key's replication configuration.</p>
152    /// <p>Each region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available. The key will be replicated to these regions, allowing cryptographic operations to be performed closer to your applications.</p>
153    pub fn set_replication_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
154        self.inner = self.inner.set_replication_regions(input);
155        self
156    }
157    /// <p>The list of Amazon Web Services Regions to add to the key's replication configuration.</p>
158    /// <p>Each region must be a valid Amazon Web Services Region where Amazon Web Services Payment Cryptography is available. The key will be replicated to these regions, allowing cryptographic operations to be performed closer to your applications.</p>
159    pub fn get_replication_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
160        self.inner.get_replication_regions()
161    }
162}