aws_sdk_backup/operation/create_logically_air_gapped_backup_vault/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_logically_air_gapped_backup_vault::_create_logically_air_gapped_backup_vault_output::CreateLogicallyAirGappedBackupVaultOutputBuilder;
3
4pub use crate::operation::create_logically_air_gapped_backup_vault::_create_logically_air_gapped_backup_vault_input::CreateLogicallyAirGappedBackupVaultInputBuilder;
5
6impl crate::operation::create_logically_air_gapped_backup_vault::builders::CreateLogicallyAirGappedBackupVaultInputBuilder {
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::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_logically_air_gapped_backup_vault();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateLogicallyAirGappedBackupVault`.
24///
25/// <p>Creates a logical container to where backups may be copied.</p>
26/// <p>This request includes a name, the Region, the maximum number of retention days, the minimum number of retention days, and optionally can include tags and a creator request ID.</p><note>
27/// <p>Do not include sensitive data, such as passport numbers, in the name of a backup vault.</p>
28/// </note>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateLogicallyAirGappedBackupVaultFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_logically_air_gapped_backup_vault::builders::CreateLogicallyAirGappedBackupVaultInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultOutput,
38        crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultError,
39    > for CreateLogicallyAirGappedBackupVaultFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultOutput,
47            crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateLogicallyAirGappedBackupVaultFluentBuilder {
54    /// Creates a new `CreateLogicallyAirGappedBackupVaultFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the CreateLogicallyAirGappedBackupVault as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_logically_air_gapped_backup_vault::builders::CreateLogicallyAirGappedBackupVaultInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins =
88            crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVault::operation_runtime_plugins(
89                self.handle.runtime_plugins.clone(),
90                &self.handle.conf,
91                self.config_override,
92            );
93        crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVault::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultOutput,
101        crate::operation::create_logically_air_gapped_backup_vault::CreateLogicallyAirGappedBackupVaultError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The name of a logical container where backups are stored. Logically air-gapped backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.</p>
116    pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.backup_vault_name(input.into());
118        self
119    }
120    /// <p>The name of a logical container where backups are stored. Logically air-gapped backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.</p>
121    pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_backup_vault_name(input);
123        self
124    }
125    /// <p>The name of a logical container where backups are stored. Logically air-gapped backup vaults are identified by names that are unique to the account used to create them and the Region where they are created.</p>
126    pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_backup_vault_name()
128    }
129    ///
130    /// Adds a key-value pair to `BackupVaultTags`.
131    ///
132    /// To override the contents of this collection use [`set_backup_vault_tags`](Self::set_backup_vault_tags).
133    ///
134    /// <p>The tags to assign to the vault.</p>
135    pub fn backup_vault_tags(
136        mut self,
137        k: impl ::std::convert::Into<::std::string::String>,
138        v: impl ::std::convert::Into<::std::string::String>,
139    ) -> Self {
140        self.inner = self.inner.backup_vault_tags(k.into(), v.into());
141        self
142    }
143    /// <p>The tags to assign to the vault.</p>
144    pub fn set_backup_vault_tags(
145        mut self,
146        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
147    ) -> Self {
148        self.inner = self.inner.set_backup_vault_tags(input);
149        self
150    }
151    /// <p>The tags to assign to the vault.</p>
152    pub fn get_backup_vault_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
153        self.inner.get_backup_vault_tags()
154    }
155    /// <p>The ID of the creation request.</p>
156    /// <p>This parameter is optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
157    pub fn creator_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.creator_request_id(input.into());
159        self
160    }
161    /// <p>The ID of the creation request.</p>
162    /// <p>This parameter is optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
163    pub fn set_creator_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_creator_request_id(input);
165        self
166    }
167    /// <p>The ID of the creation request.</p>
168    /// <p>This parameter is optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
169    pub fn get_creator_request_id(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_creator_request_id()
171    }
172    /// <p>This setting specifies the minimum retention period that the vault retains its recovery points.</p>
173    /// <p>The minimum value accepted is 7 days.</p>
174    pub fn min_retention_days(mut self, input: i64) -> Self {
175        self.inner = self.inner.min_retention_days(input);
176        self
177    }
178    /// <p>This setting specifies the minimum retention period that the vault retains its recovery points.</p>
179    /// <p>The minimum value accepted is 7 days.</p>
180    pub fn set_min_retention_days(mut self, input: ::std::option::Option<i64>) -> Self {
181        self.inner = self.inner.set_min_retention_days(input);
182        self
183    }
184    /// <p>This setting specifies the minimum retention period that the vault retains its recovery points.</p>
185    /// <p>The minimum value accepted is 7 days.</p>
186    pub fn get_min_retention_days(&self) -> &::std::option::Option<i64> {
187        self.inner.get_min_retention_days()
188    }
189    /// <p>The maximum retention period that the vault retains its recovery points.</p>
190    pub fn max_retention_days(mut self, input: i64) -> Self {
191        self.inner = self.inner.max_retention_days(input);
192        self
193    }
194    /// <p>The maximum retention period that the vault retains its recovery points.</p>
195    pub fn set_max_retention_days(mut self, input: ::std::option::Option<i64>) -> Self {
196        self.inner = self.inner.set_max_retention_days(input);
197        self
198    }
199    /// <p>The maximum retention period that the vault retains its recovery points.</p>
200    pub fn get_max_retention_days(&self) -> &::std::option::Option<i64> {
201        self.inner.get_max_retention_days()
202    }
203    /// <p>The ARN of the customer-managed KMS key to use for encrypting the logically air-gapped backup vault. If not specified, the vault will be encrypted with an Amazon Web Services-owned key managed by Amazon Web Services Backup.</p>
204    pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.encryption_key_arn(input.into());
206        self
207    }
208    /// <p>The ARN of the customer-managed KMS key to use for encrypting the logically air-gapped backup vault. If not specified, the vault will be encrypted with an Amazon Web Services-owned key managed by Amazon Web Services Backup.</p>
209    pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_encryption_key_arn(input);
211        self
212    }
213    /// <p>The ARN of the customer-managed KMS key to use for encrypting the logically air-gapped backup vault. If not specified, the vault will be encrypted with an Amazon Web Services-owned key managed by Amazon Web Services Backup.</p>
214    pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_encryption_key_arn()
216    }
217}