aws_sdk_redshiftserverless/operation/create_namespace/
_create_namespace_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 CreateNamespaceInput {
6    /// <p>The name of the namespace.</p>
7    pub namespace_name: ::std::option::Option<::std::string::String>,
8    /// <p>The username of the administrator for the first database created in the namespace.</p>
9    pub admin_username: ::std::option::Option<::std::string::String>,
10    /// <p>The password of the administrator for the first database created in the namespace.</p>
11    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
12    pub admin_user_password: ::std::option::Option<::std::string::String>,
13    /// <p>The name of the first database created in the namespace.</p>
14    pub db_name: ::std::option::Option<::std::string::String>,
15    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
16    pub kms_key_id: ::std::option::Option<::std::string::String>,
17    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.</p>
18    pub default_iam_role_arn: ::std::option::Option<::std::string::String>,
19    /// <p>A list of IAM roles to associate with the namespace.</p>
20    pub iam_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21    /// <p>The types of logs the namespace can export. Available export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
22    pub log_exports: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>,
23    /// <p>A list of tag instances.</p>
24    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
25    /// <p>If <code>true</code>, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. If <code>manageAdminPassword</code> is false or not set, Amazon Redshift uses <code>adminUserPassword</code> for the admin user account's password.</p>
26    pub manage_admin_password: ::std::option::Option<bool>,
27    /// <p>The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if <code>manageAdminPassword</code> is true.</p>
28    pub admin_password_secret_kms_key_id: ::std::option::Option<::std::string::String>,
29    /// <p>The ARN for the Redshift application that integrates with IAM Identity Center.</p>
30    pub redshift_idc_application_arn: ::std::option::Option<::std::string::String>,
31}
32impl CreateNamespaceInput {
33    /// <p>The name of the namespace.</p>
34    pub fn namespace_name(&self) -> ::std::option::Option<&str> {
35        self.namespace_name.as_deref()
36    }
37    /// <p>The username of the administrator for the first database created in the namespace.</p>
38    pub fn admin_username(&self) -> ::std::option::Option<&str> {
39        self.admin_username.as_deref()
40    }
41    /// <p>The password of the administrator for the first database created in the namespace.</p>
42    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
43    pub fn admin_user_password(&self) -> ::std::option::Option<&str> {
44        self.admin_user_password.as_deref()
45    }
46    /// <p>The name of the first database created in the namespace.</p>
47    pub fn db_name(&self) -> ::std::option::Option<&str> {
48        self.db_name.as_deref()
49    }
50    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
51    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
52        self.kms_key_id.as_deref()
53    }
54    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.</p>
55    pub fn default_iam_role_arn(&self) -> ::std::option::Option<&str> {
56        self.default_iam_role_arn.as_deref()
57    }
58    /// <p>A list of IAM roles to associate with the namespace.</p>
59    ///
60    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.iam_roles.is_none()`.
61    pub fn iam_roles(&self) -> &[::std::string::String] {
62        self.iam_roles.as_deref().unwrap_or_default()
63    }
64    /// <p>The types of logs the namespace can export. Available export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
65    ///
66    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.log_exports.is_none()`.
67    pub fn log_exports(&self) -> &[crate::types::LogExport] {
68        self.log_exports.as_deref().unwrap_or_default()
69    }
70    /// <p>A list of tag instances.</p>
71    ///
72    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
73    pub fn tags(&self) -> &[crate::types::Tag] {
74        self.tags.as_deref().unwrap_or_default()
75    }
76    /// <p>If <code>true</code>, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. If <code>manageAdminPassword</code> is false or not set, Amazon Redshift uses <code>adminUserPassword</code> for the admin user account's password.</p>
77    pub fn manage_admin_password(&self) -> ::std::option::Option<bool> {
78        self.manage_admin_password
79    }
80    /// <p>The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if <code>manageAdminPassword</code> is true.</p>
81    pub fn admin_password_secret_kms_key_id(&self) -> ::std::option::Option<&str> {
82        self.admin_password_secret_kms_key_id.as_deref()
83    }
84    /// <p>The ARN for the Redshift application that integrates with IAM Identity Center.</p>
85    pub fn redshift_idc_application_arn(&self) -> ::std::option::Option<&str> {
86        self.redshift_idc_application_arn.as_deref()
87    }
88}
89impl ::std::fmt::Debug for CreateNamespaceInput {
90    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
91        let mut formatter = f.debug_struct("CreateNamespaceInput");
92        formatter.field("namespace_name", &self.namespace_name);
93        formatter.field("admin_username", &"*** Sensitive Data Redacted ***");
94        formatter.field("admin_user_password", &"*** Sensitive Data Redacted ***");
95        formatter.field("db_name", &self.db_name);
96        formatter.field("kms_key_id", &self.kms_key_id);
97        formatter.field("default_iam_role_arn", &self.default_iam_role_arn);
98        formatter.field("iam_roles", &self.iam_roles);
99        formatter.field("log_exports", &self.log_exports);
100        formatter.field("tags", &self.tags);
101        formatter.field("manage_admin_password", &self.manage_admin_password);
102        formatter.field("admin_password_secret_kms_key_id", &self.admin_password_secret_kms_key_id);
103        formatter.field("redshift_idc_application_arn", &self.redshift_idc_application_arn);
104        formatter.finish()
105    }
106}
107impl CreateNamespaceInput {
108    /// Creates a new builder-style object to manufacture [`CreateNamespaceInput`](crate::operation::create_namespace::CreateNamespaceInput).
109    pub fn builder() -> crate::operation::create_namespace::builders::CreateNamespaceInputBuilder {
110        crate::operation::create_namespace::builders::CreateNamespaceInputBuilder::default()
111    }
112}
113
114/// A builder for [`CreateNamespaceInput`](crate::operation::create_namespace::CreateNamespaceInput).
115#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
116#[non_exhaustive]
117pub struct CreateNamespaceInputBuilder {
118    pub(crate) namespace_name: ::std::option::Option<::std::string::String>,
119    pub(crate) admin_username: ::std::option::Option<::std::string::String>,
120    pub(crate) admin_user_password: ::std::option::Option<::std::string::String>,
121    pub(crate) db_name: ::std::option::Option<::std::string::String>,
122    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
123    pub(crate) default_iam_role_arn: ::std::option::Option<::std::string::String>,
124    pub(crate) iam_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
125    pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>,
126    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
127    pub(crate) manage_admin_password: ::std::option::Option<bool>,
128    pub(crate) admin_password_secret_kms_key_id: ::std::option::Option<::std::string::String>,
129    pub(crate) redshift_idc_application_arn: ::std::option::Option<::std::string::String>,
130}
131impl CreateNamespaceInputBuilder {
132    /// <p>The name of the namespace.</p>
133    /// This field is required.
134    pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.namespace_name = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>The name of the namespace.</p>
139    pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.namespace_name = input;
141        self
142    }
143    /// <p>The name of the namespace.</p>
144    pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
145        &self.namespace_name
146    }
147    /// <p>The username of the administrator for the first database created in the namespace.</p>
148    pub fn admin_username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149        self.admin_username = ::std::option::Option::Some(input.into());
150        self
151    }
152    /// <p>The username of the administrator for the first database created in the namespace.</p>
153    pub fn set_admin_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.admin_username = input;
155        self
156    }
157    /// <p>The username of the administrator for the first database created in the namespace.</p>
158    pub fn get_admin_username(&self) -> &::std::option::Option<::std::string::String> {
159        &self.admin_username
160    }
161    /// <p>The password of the administrator for the first database created in the namespace.</p>
162    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
163    pub fn admin_user_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.admin_user_password = ::std::option::Option::Some(input.into());
165        self
166    }
167    /// <p>The password of the administrator for the first database created in the namespace.</p>
168    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
169    pub fn set_admin_user_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.admin_user_password = input;
171        self
172    }
173    /// <p>The password of the administrator for the first database created in the namespace.</p>
174    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
175    pub fn get_admin_user_password(&self) -> &::std::option::Option<::std::string::String> {
176        &self.admin_user_password
177    }
178    /// <p>The name of the first database created in the namespace.</p>
179    pub fn db_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
180        self.db_name = ::std::option::Option::Some(input.into());
181        self
182    }
183    /// <p>The name of the first database created in the namespace.</p>
184    pub fn set_db_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
185        self.db_name = input;
186        self
187    }
188    /// <p>The name of the first database created in the namespace.</p>
189    pub fn get_db_name(&self) -> &::std::option::Option<::std::string::String> {
190        &self.db_name
191    }
192    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
193    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.kms_key_id = ::std::option::Option::Some(input.into());
195        self
196    }
197    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
198    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.kms_key_id = input;
200        self
201    }
202    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
203    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
204        &self.kms_key_id
205    }
206    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.</p>
207    pub fn default_iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.default_iam_role_arn = ::std::option::Option::Some(input.into());
209        self
210    }
211    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.</p>
212    pub fn set_default_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.default_iam_role_arn = input;
214        self
215    }
216    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace.</p>
217    pub fn get_default_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
218        &self.default_iam_role_arn
219    }
220    /// Appends an item to `iam_roles`.
221    ///
222    /// To override the contents of this collection use [`set_iam_roles`](Self::set_iam_roles).
223    ///
224    /// <p>A list of IAM roles to associate with the namespace.</p>
225    pub fn iam_roles(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226        let mut v = self.iam_roles.unwrap_or_default();
227        v.push(input.into());
228        self.iam_roles = ::std::option::Option::Some(v);
229        self
230    }
231    /// <p>A list of IAM roles to associate with the namespace.</p>
232    pub fn set_iam_roles(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
233        self.iam_roles = input;
234        self
235    }
236    /// <p>A list of IAM roles to associate with the namespace.</p>
237    pub fn get_iam_roles(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
238        &self.iam_roles
239    }
240    /// Appends an item to `log_exports`.
241    ///
242    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
243    ///
244    /// <p>The types of logs the namespace can export. Available export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
245    pub fn log_exports(mut self, input: crate::types::LogExport) -> Self {
246        let mut v = self.log_exports.unwrap_or_default();
247        v.push(input);
248        self.log_exports = ::std::option::Option::Some(v);
249        self
250    }
251    /// <p>The types of logs the namespace can export. Available export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
252    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>) -> Self {
253        self.log_exports = input;
254        self
255    }
256    /// <p>The types of logs the namespace can export. Available export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
257    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogExport>> {
258        &self.log_exports
259    }
260    /// Appends an item to `tags`.
261    ///
262    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
263    ///
264    /// <p>A list of tag instances.</p>
265    pub fn tags(mut self, input: crate::types::Tag) -> Self {
266        let mut v = self.tags.unwrap_or_default();
267        v.push(input);
268        self.tags = ::std::option::Option::Some(v);
269        self
270    }
271    /// <p>A list of tag instances.</p>
272    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
273        self.tags = input;
274        self
275    }
276    /// <p>A list of tag instances.</p>
277    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
278        &self.tags
279    }
280    /// <p>If <code>true</code>, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. If <code>manageAdminPassword</code> is false or not set, Amazon Redshift uses <code>adminUserPassword</code> for the admin user account's password.</p>
281    pub fn manage_admin_password(mut self, input: bool) -> Self {
282        self.manage_admin_password = ::std::option::Option::Some(input);
283        self
284    }
285    /// <p>If <code>true</code>, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. If <code>manageAdminPassword</code> is false or not set, Amazon Redshift uses <code>adminUserPassword</code> for the admin user account's password.</p>
286    pub fn set_manage_admin_password(mut self, input: ::std::option::Option<bool>) -> Self {
287        self.manage_admin_password = input;
288        self
289    }
290    /// <p>If <code>true</code>, Amazon Redshift uses Secrets Manager to manage the namespace's admin credentials. You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true. If <code>manageAdminPassword</code> is false or not set, Amazon Redshift uses <code>adminUserPassword</code> for the admin user account's password.</p>
291    pub fn get_manage_admin_password(&self) -> &::std::option::Option<bool> {
292        &self.manage_admin_password
293    }
294    /// <p>The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if <code>manageAdminPassword</code> is true.</p>
295    pub fn admin_password_secret_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296        self.admin_password_secret_kms_key_id = ::std::option::Option::Some(input.into());
297        self
298    }
299    /// <p>The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if <code>manageAdminPassword</code> is true.</p>
300    pub fn set_admin_password_secret_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301        self.admin_password_secret_kms_key_id = input;
302        self
303    }
304    /// <p>The ID of the Key Management Service (KMS) key used to encrypt and store the namespace's admin credentials secret. You can only use this parameter if <code>manageAdminPassword</code> is true.</p>
305    pub fn get_admin_password_secret_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
306        &self.admin_password_secret_kms_key_id
307    }
308    /// <p>The ARN for the Redshift application that integrates with IAM Identity Center.</p>
309    pub fn redshift_idc_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
310        self.redshift_idc_application_arn = ::std::option::Option::Some(input.into());
311        self
312    }
313    /// <p>The ARN for the Redshift application that integrates with IAM Identity Center.</p>
314    pub fn set_redshift_idc_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315        self.redshift_idc_application_arn = input;
316        self
317    }
318    /// <p>The ARN for the Redshift application that integrates with IAM Identity Center.</p>
319    pub fn get_redshift_idc_application_arn(&self) -> &::std::option::Option<::std::string::String> {
320        &self.redshift_idc_application_arn
321    }
322    /// Consumes the builder and constructs a [`CreateNamespaceInput`](crate::operation::create_namespace::CreateNamespaceInput).
323    pub fn build(
324        self,
325    ) -> ::std::result::Result<crate::operation::create_namespace::CreateNamespaceInput, ::aws_smithy_types::error::operation::BuildError> {
326        ::std::result::Result::Ok(crate::operation::create_namespace::CreateNamespaceInput {
327            namespace_name: self.namespace_name,
328            admin_username: self.admin_username,
329            admin_user_password: self.admin_user_password,
330            db_name: self.db_name,
331            kms_key_id: self.kms_key_id,
332            default_iam_role_arn: self.default_iam_role_arn,
333            iam_roles: self.iam_roles,
334            log_exports: self.log_exports,
335            tags: self.tags,
336            manage_admin_password: self.manage_admin_password,
337            admin_password_secret_kms_key_id: self.admin_password_secret_kms_key_id,
338            redshift_idc_application_arn: self.redshift_idc_application_arn,
339        })
340    }
341}
342impl ::std::fmt::Debug for CreateNamespaceInputBuilder {
343    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
344        let mut formatter = f.debug_struct("CreateNamespaceInputBuilder");
345        formatter.field("namespace_name", &self.namespace_name);
346        formatter.field("admin_username", &"*** Sensitive Data Redacted ***");
347        formatter.field("admin_user_password", &"*** Sensitive Data Redacted ***");
348        formatter.field("db_name", &self.db_name);
349        formatter.field("kms_key_id", &self.kms_key_id);
350        formatter.field("default_iam_role_arn", &self.default_iam_role_arn);
351        formatter.field("iam_roles", &self.iam_roles);
352        formatter.field("log_exports", &self.log_exports);
353        formatter.field("tags", &self.tags);
354        formatter.field("manage_admin_password", &self.manage_admin_password);
355        formatter.field("admin_password_secret_kms_key_id", &self.admin_password_secret_kms_key_id);
356        formatter.field("redshift_idc_application_arn", &self.redshift_idc_application_arn);
357        formatter.finish()
358    }
359}