aws_sdk_redshiftserverless/operation/update_namespace/
_update_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 UpdateNamespaceInput {
6    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
7    pub namespace_name: ::std::option::Option<::std::string::String>,
8    /// <p>The password of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUsername</code>.</p>
9    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
10    pub admin_user_password: ::std::option::Option<::std::string::String>,
11    /// <p>The username of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUserPassword</code>.</p>
12    pub admin_username: ::std::option::Option<::std::string::String>,
13    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
14    pub kms_key_id: ::std::option::Option<::std::string::String>,
15    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with <code>iamRoles</code>.</p>
16    pub default_iam_role_arn: ::std::option::Option<::std::string::String>,
17    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
18    pub iam_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
20    pub log_exports: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>,
21    /// <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>
22    pub manage_admin_password: ::std::option::Option<bool>,
23    /// <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>
24    pub admin_password_secret_kms_key_id: ::std::option::Option<::std::string::String>,
25}
26impl UpdateNamespaceInput {
27    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
28    pub fn namespace_name(&self) -> ::std::option::Option<&str> {
29        self.namespace_name.as_deref()
30    }
31    /// <p>The password of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUsername</code>.</p>
32    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
33    pub fn admin_user_password(&self) -> ::std::option::Option<&str> {
34        self.admin_user_password.as_deref()
35    }
36    /// <p>The username of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUserPassword</code>.</p>
37    pub fn admin_username(&self) -> ::std::option::Option<&str> {
38        self.admin_username.as_deref()
39    }
40    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
41    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
42        self.kms_key_id.as_deref()
43    }
44    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with <code>iamRoles</code>.</p>
45    pub fn default_iam_role_arn(&self) -> ::std::option::Option<&str> {
46        self.default_iam_role_arn.as_deref()
47    }
48    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
49    ///
50    /// 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()`.
51    pub fn iam_roles(&self) -> &[::std::string::String] {
52        self.iam_roles.as_deref().unwrap_or_default()
53    }
54    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
55    ///
56    /// 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()`.
57    pub fn log_exports(&self) -> &[crate::types::LogExport] {
58        self.log_exports.as_deref().unwrap_or_default()
59    }
60    /// <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>
61    pub fn manage_admin_password(&self) -> ::std::option::Option<bool> {
62        self.manage_admin_password
63    }
64    /// <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>
65    pub fn admin_password_secret_kms_key_id(&self) -> ::std::option::Option<&str> {
66        self.admin_password_secret_kms_key_id.as_deref()
67    }
68}
69impl ::std::fmt::Debug for UpdateNamespaceInput {
70    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
71        let mut formatter = f.debug_struct("UpdateNamespaceInput");
72        formatter.field("namespace_name", &self.namespace_name);
73        formatter.field("admin_user_password", &"*** Sensitive Data Redacted ***");
74        formatter.field("admin_username", &"*** Sensitive Data Redacted ***");
75        formatter.field("kms_key_id", &self.kms_key_id);
76        formatter.field("default_iam_role_arn", &self.default_iam_role_arn);
77        formatter.field("iam_roles", &self.iam_roles);
78        formatter.field("log_exports", &self.log_exports);
79        formatter.field("manage_admin_password", &self.manage_admin_password);
80        formatter.field("admin_password_secret_kms_key_id", &self.admin_password_secret_kms_key_id);
81        formatter.finish()
82    }
83}
84impl UpdateNamespaceInput {
85    /// Creates a new builder-style object to manufacture [`UpdateNamespaceInput`](crate::operation::update_namespace::UpdateNamespaceInput).
86    pub fn builder() -> crate::operation::update_namespace::builders::UpdateNamespaceInputBuilder {
87        crate::operation::update_namespace::builders::UpdateNamespaceInputBuilder::default()
88    }
89}
90
91/// A builder for [`UpdateNamespaceInput`](crate::operation::update_namespace::UpdateNamespaceInput).
92#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
93#[non_exhaustive]
94pub struct UpdateNamespaceInputBuilder {
95    pub(crate) namespace_name: ::std::option::Option<::std::string::String>,
96    pub(crate) admin_user_password: ::std::option::Option<::std::string::String>,
97    pub(crate) admin_username: ::std::option::Option<::std::string::String>,
98    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
99    pub(crate) default_iam_role_arn: ::std::option::Option<::std::string::String>,
100    pub(crate) iam_roles: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
101    pub(crate) log_exports: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>,
102    pub(crate) manage_admin_password: ::std::option::Option<bool>,
103    pub(crate) admin_password_secret_kms_key_id: ::std::option::Option<::std::string::String>,
104}
105impl UpdateNamespaceInputBuilder {
106    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
107    /// This field is required.
108    pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.namespace_name = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
113    pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.namespace_name = input;
115        self
116    }
117    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
118    pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
119        &self.namespace_name
120    }
121    /// <p>The password of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUsername</code>.</p>
122    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
123    pub fn admin_user_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.admin_user_password = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The password of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUsername</code>.</p>
128    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
129    pub fn set_admin_user_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.admin_user_password = input;
131        self
132    }
133    /// <p>The password of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUsername</code>.</p>
134    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
135    pub fn get_admin_user_password(&self) -> &::std::option::Option<::std::string::String> {
136        &self.admin_user_password
137    }
138    /// <p>The username of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUserPassword</code>.</p>
139    pub fn admin_username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.admin_username = ::std::option::Option::Some(input.into());
141        self
142    }
143    /// <p>The username of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUserPassword</code>.</p>
144    pub fn set_admin_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.admin_username = input;
146        self
147    }
148    /// <p>The username of the administrator for the first database created in the namespace. This parameter must be updated together with <code>adminUserPassword</code>.</p>
149    pub fn get_admin_username(&self) -> &::std::option::Option<::std::string::String> {
150        &self.admin_username
151    }
152    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
153    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.kms_key_id = ::std::option::Option::Some(input.into());
155        self
156    }
157    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
158    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.kms_key_id = input;
160        self
161    }
162    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
163    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
164        &self.kms_key_id
165    }
166    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with <code>iamRoles</code>.</p>
167    pub fn default_iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168        self.default_iam_role_arn = ::std::option::Option::Some(input.into());
169        self
170    }
171    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with <code>iamRoles</code>.</p>
172    pub fn set_default_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173        self.default_iam_role_arn = input;
174        self
175    }
176    /// <p>The Amazon Resource Name (ARN) of the IAM role to set as a default in the namespace. This parameter must be updated together with <code>iamRoles</code>.</p>
177    pub fn get_default_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
178        &self.default_iam_role_arn
179    }
180    /// Appends an item to `iam_roles`.
181    ///
182    /// To override the contents of this collection use [`set_iam_roles`](Self::set_iam_roles).
183    ///
184    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
185    pub fn iam_roles(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186        let mut v = self.iam_roles.unwrap_or_default();
187        v.push(input.into());
188        self.iam_roles = ::std::option::Option::Some(v);
189        self
190    }
191    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
192    pub fn set_iam_roles(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
193        self.iam_roles = input;
194        self
195    }
196    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
197    pub fn get_iam_roles(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
198        &self.iam_roles
199    }
200    /// Appends an item to `log_exports`.
201    ///
202    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
203    ///
204    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
205    pub fn log_exports(mut self, input: crate::types::LogExport) -> Self {
206        let mut v = self.log_exports.unwrap_or_default();
207        v.push(input);
208        self.log_exports = ::std::option::Option::Some(v);
209        self
210    }
211    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
212    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>) -> Self {
213        self.log_exports = input;
214        self
215    }
216    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
217    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogExport>> {
218        &self.log_exports
219    }
220    /// <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>
221    pub fn manage_admin_password(mut self, input: bool) -> Self {
222        self.manage_admin_password = ::std::option::Option::Some(input);
223        self
224    }
225    /// <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>
226    pub fn set_manage_admin_password(mut self, input: ::std::option::Option<bool>) -> Self {
227        self.manage_admin_password = input;
228        self
229    }
230    /// <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>
231    pub fn get_manage_admin_password(&self) -> &::std::option::Option<bool> {
232        &self.manage_admin_password
233    }
234    /// <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>
235    pub fn admin_password_secret_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
236        self.admin_password_secret_kms_key_id = ::std::option::Option::Some(input.into());
237        self
238    }
239    /// <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>
240    pub fn set_admin_password_secret_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
241        self.admin_password_secret_kms_key_id = input;
242        self
243    }
244    /// <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>
245    pub fn get_admin_password_secret_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
246        &self.admin_password_secret_kms_key_id
247    }
248    /// Consumes the builder and constructs a [`UpdateNamespaceInput`](crate::operation::update_namespace::UpdateNamespaceInput).
249    pub fn build(
250        self,
251    ) -> ::std::result::Result<crate::operation::update_namespace::UpdateNamespaceInput, ::aws_smithy_types::error::operation::BuildError> {
252        ::std::result::Result::Ok(crate::operation::update_namespace::UpdateNamespaceInput {
253            namespace_name: self.namespace_name,
254            admin_user_password: self.admin_user_password,
255            admin_username: self.admin_username,
256            kms_key_id: self.kms_key_id,
257            default_iam_role_arn: self.default_iam_role_arn,
258            iam_roles: self.iam_roles,
259            log_exports: self.log_exports,
260            manage_admin_password: self.manage_admin_password,
261            admin_password_secret_kms_key_id: self.admin_password_secret_kms_key_id,
262        })
263    }
264}
265impl ::std::fmt::Debug for UpdateNamespaceInputBuilder {
266    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
267        let mut formatter = f.debug_struct("UpdateNamespaceInputBuilder");
268        formatter.field("namespace_name", &self.namespace_name);
269        formatter.field("admin_user_password", &"*** Sensitive Data Redacted ***");
270        formatter.field("admin_username", &"*** Sensitive Data Redacted ***");
271        formatter.field("kms_key_id", &self.kms_key_id);
272        formatter.field("default_iam_role_arn", &self.default_iam_role_arn);
273        formatter.field("iam_roles", &self.iam_roles);
274        formatter.field("log_exports", &self.log_exports);
275        formatter.field("manage_admin_password", &self.manage_admin_password);
276        formatter.field("admin_password_secret_kms_key_id", &self.admin_password_secret_kms_key_id);
277        formatter.finish()
278    }
279}