Skip to main content

aws_sdk_backup/operation/create_backup_vault/
_create_backup_vault_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateBackupVaultInput {
6    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of letters, numbers, and hyphens.</p>
7    pub backup_vault_name: ::std::option::Option<::std::string::String>,
8    /// <p>The tags to assign to the backup vault.</p>
9    pub backup_vault_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10    /// <p>The server-side encryption key that is used to protect your backups; for example, <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>.</p>
11    pub encryption_key_arn: ::std::option::Option<::std::string::String>,
12    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
13    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
14    pub creator_request_id: ::std::option::Option<::std::string::String>,
15}
16impl CreateBackupVaultInput {
17    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of letters, numbers, and hyphens.</p>
18    pub fn backup_vault_name(&self) -> ::std::option::Option<&str> {
19        self.backup_vault_name.as_deref()
20    }
21    /// <p>The tags to assign to the backup vault.</p>
22    pub fn backup_vault_tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
23        self.backup_vault_tags.as_ref()
24    }
25    /// <p>The server-side encryption key that is used to protect your backups; for example, <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>.</p>
26    pub fn encryption_key_arn(&self) -> ::std::option::Option<&str> {
27        self.encryption_key_arn.as_deref()
28    }
29    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
30    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
31    pub fn creator_request_id(&self) -> ::std::option::Option<&str> {
32        self.creator_request_id.as_deref()
33    }
34}
35impl ::std::fmt::Debug for CreateBackupVaultInput {
36    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
37        let mut formatter = f.debug_struct("CreateBackupVaultInput");
38        formatter.field("backup_vault_name", &self.backup_vault_name);
39        formatter.field("backup_vault_tags", &"*** Sensitive Data Redacted ***");
40        formatter.field("encryption_key_arn", &self.encryption_key_arn);
41        formatter.field("creator_request_id", &self.creator_request_id);
42        formatter.finish()
43    }
44}
45impl CreateBackupVaultInput {
46    /// Creates a new builder-style object to manufacture [`CreateBackupVaultInput`](crate::operation::create_backup_vault::CreateBackupVaultInput).
47    pub fn builder() -> crate::operation::create_backup_vault::builders::CreateBackupVaultInputBuilder {
48        crate::operation::create_backup_vault::builders::CreateBackupVaultInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateBackupVaultInput`](crate::operation::create_backup_vault::CreateBackupVaultInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
54#[non_exhaustive]
55pub struct CreateBackupVaultInputBuilder {
56    pub(crate) backup_vault_name: ::std::option::Option<::std::string::String>,
57    pub(crate) backup_vault_tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
58    pub(crate) encryption_key_arn: ::std::option::Option<::std::string::String>,
59    pub(crate) creator_request_id: ::std::option::Option<::std::string::String>,
60}
61impl CreateBackupVaultInputBuilder {
62    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of letters, numbers, and hyphens.</p>
63    /// This field is required.
64    pub fn backup_vault_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.backup_vault_name = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of letters, numbers, and hyphens.</p>
69    pub fn set_backup_vault_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.backup_vault_name = input;
71        self
72    }
73    /// <p>The name of a logical container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the Amazon Web Services Region where they are created. They consist of letters, numbers, and hyphens.</p>
74    pub fn get_backup_vault_name(&self) -> &::std::option::Option<::std::string::String> {
75        &self.backup_vault_name
76    }
77    /// Adds a key-value pair to `backup_vault_tags`.
78    ///
79    /// To override the contents of this collection use [`set_backup_vault_tags`](Self::set_backup_vault_tags).
80    ///
81    /// <p>The tags to assign to the backup vault.</p>
82    pub fn backup_vault_tags(
83        mut self,
84        k: impl ::std::convert::Into<::std::string::String>,
85        v: impl ::std::convert::Into<::std::string::String>,
86    ) -> Self {
87        let mut hash_map = self.backup_vault_tags.unwrap_or_default();
88        hash_map.insert(k.into(), v.into());
89        self.backup_vault_tags = ::std::option::Option::Some(hash_map);
90        self
91    }
92    /// <p>The tags to assign to the backup vault.</p>
93    pub fn set_backup_vault_tags(
94        mut self,
95        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
96    ) -> Self {
97        self.backup_vault_tags = input;
98        self
99    }
100    /// <p>The tags to assign to the backup vault.</p>
101    pub fn get_backup_vault_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
102        &self.backup_vault_tags
103    }
104    /// <p>The server-side encryption key that is used to protect your backups; for example, <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>.</p>
105    pub fn encryption_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.encryption_key_arn = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>The server-side encryption key that is used to protect your backups; for example, <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>.</p>
110    pub fn set_encryption_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.encryption_key_arn = input;
112        self
113    }
114    /// <p>The server-side encryption key that is used to protect your backups; for example, <code>arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code>.</p>
115    pub fn get_encryption_key_arn(&self) -> &::std::option::Option<::std::string::String> {
116        &self.encryption_key_arn
117    }
118    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
119    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
120    pub fn creator_request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.creator_request_id = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
125    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
126    pub fn set_creator_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.creator_request_id = input;
128        self
129    }
130    /// <p>A unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. This parameter is optional.</p>
131    /// <p>If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
132    pub fn get_creator_request_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.creator_request_id
134    }
135    /// Consumes the builder and constructs a [`CreateBackupVaultInput`](crate::operation::create_backup_vault::CreateBackupVaultInput).
136    pub fn build(
137        self,
138    ) -> ::std::result::Result<crate::operation::create_backup_vault::CreateBackupVaultInput, ::aws_smithy_types::error::operation::BuildError> {
139        ::std::result::Result::Ok(crate::operation::create_backup_vault::CreateBackupVaultInput {
140            backup_vault_name: self.backup_vault_name,
141            backup_vault_tags: self.backup_vault_tags,
142            encryption_key_arn: self.encryption_key_arn,
143            creator_request_id: self.creator_request_id,
144        })
145    }
146}
147impl ::std::fmt::Debug for CreateBackupVaultInputBuilder {
148    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
149        let mut formatter = f.debug_struct("CreateBackupVaultInputBuilder");
150        formatter.field("backup_vault_name", &self.backup_vault_name);
151        formatter.field("backup_vault_tags", &"*** Sensitive Data Redacted ***");
152        formatter.field("encryption_key_arn", &self.encryption_key_arn);
153        formatter.field("creator_request_id", &self.creator_request_id);
154        formatter.finish()
155    }
156}