aws_sdk_redshiftserverless/operation/update_namespace/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_namespace::_update_namespace_output::UpdateNamespaceOutputBuilder;
3
4pub use crate::operation::update_namespace::_update_namespace_input::UpdateNamespaceInputBuilder;
5
6impl crate::operation::update_namespace::builders::UpdateNamespaceInputBuilder {
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::update_namespace::UpdateNamespaceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_namespace::UpdateNamespaceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_namespace();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateNamespace`.
24///
25/// <p>Updates a namespace with the specified settings. Unless required, you can't update multiple parameters in one request. For example, you must specify both <code>adminUsername</code> and <code>adminUserPassword</code> to update either field, but you can't update both <code>kmsKeyId</code> and <code>logExports</code> in a single request.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateNamespaceFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_namespace::builders::UpdateNamespaceInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_namespace::UpdateNamespaceOutput,
35        crate::operation::update_namespace::UpdateNamespaceError,
36    > for UpdateNamespaceFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::update_namespace::UpdateNamespaceOutput,
44            crate::operation::update_namespace::UpdateNamespaceError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateNamespaceFluentBuilder {
51    /// Creates a new `UpdateNamespaceFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the UpdateNamespace as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_namespace::builders::UpdateNamespaceInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::update_namespace::UpdateNamespaceOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_namespace::UpdateNamespaceError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::update_namespace::UpdateNamespace::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_namespace::UpdateNamespace::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::update_namespace::UpdateNamespaceOutput,
97        crate::operation::update_namespace::UpdateNamespaceError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
112    pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.namespace_name(input.into());
114        self
115    }
116    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
117    pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_namespace_name(input);
119        self
120    }
121    /// <p>The name of the namespace to update. You can't update the name of a namespace once it is created.</p>
122    pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_namespace_name()
124    }
125    /// <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>
126    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
127    pub fn admin_user_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.admin_user_password(input.into());
129        self
130    }
131    /// <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>
132    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
133    pub fn set_admin_user_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_admin_user_password(input);
135        self
136    }
137    /// <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>
138    /// <p>You can't use <code>adminUserPassword</code> if <code>manageAdminPassword</code> is true.</p>
139    pub fn get_admin_user_password(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_admin_user_password()
141    }
142    /// <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>
143    pub fn admin_username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.admin_username(input.into());
145        self
146    }
147    /// <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>
148    pub fn set_admin_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_admin_username(input);
150        self
151    }
152    /// <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>
153    pub fn get_admin_username(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_admin_username()
155    }
156    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
157    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.kms_key_id(input.into());
159        self
160    }
161    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
162    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_kms_key_id(input);
164        self
165    }
166    /// <p>The ID of the Amazon Web Services Key Management Service key used to encrypt your data.</p>
167    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_kms_key_id()
169    }
170    /// <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>
171    pub fn default_iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.default_iam_role_arn(input.into());
173        self
174    }
175    /// <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>
176    pub fn set_default_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_default_iam_role_arn(input);
178        self
179    }
180    /// <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>
181    pub fn get_default_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_default_iam_role_arn()
183    }
184    ///
185    /// Appends an item to `iamRoles`.
186    ///
187    /// To override the contents of this collection use [`set_iam_roles`](Self::set_iam_roles).
188    ///
189    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
190    pub fn iam_roles(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.iam_roles(input.into());
192        self
193    }
194    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
195    pub fn set_iam_roles(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
196        self.inner = self.inner.set_iam_roles(input);
197        self
198    }
199    /// <p>A list of IAM roles to associate with the namespace. This parameter must be updated together with <code>defaultIamRoleArn</code>.</p>
200    pub fn get_iam_roles(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
201        self.inner.get_iam_roles()
202    }
203    ///
204    /// Appends an item to `logExports`.
205    ///
206    /// To override the contents of this collection use [`set_log_exports`](Self::set_log_exports).
207    ///
208    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
209    pub fn log_exports(mut self, input: crate::types::LogExport) -> Self {
210        self.inner = self.inner.log_exports(input);
211        self
212    }
213    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
214    pub fn set_log_exports(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::LogExport>>) -> Self {
215        self.inner = self.inner.set_log_exports(input);
216        self
217    }
218    /// <p>The types of logs the namespace can export. The export types are <code>userlog</code>, <code>connectionlog</code>, and <code>useractivitylog</code>.</p>
219    pub fn get_log_exports(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::LogExport>> {
220        self.inner.get_log_exports()
221    }
222    /// <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>
223    pub fn manage_admin_password(mut self, input: bool) -> Self {
224        self.inner = self.inner.manage_admin_password(input);
225        self
226    }
227    /// <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>
228    pub fn set_manage_admin_password(mut self, input: ::std::option::Option<bool>) -> Self {
229        self.inner = self.inner.set_manage_admin_password(input);
230        self
231    }
232    /// <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>
233    pub fn get_manage_admin_password(&self) -> &::std::option::Option<bool> {
234        self.inner.get_manage_admin_password()
235    }
236    /// <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>
237    pub fn admin_password_secret_kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.admin_password_secret_kms_key_id(input.into());
239        self
240    }
241    /// <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>
242    pub fn set_admin_password_secret_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.inner = self.inner.set_admin_password_secret_kms_key_id(input);
244        self
245    }
246    /// <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>
247    pub fn get_admin_password_secret_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
248        self.inner.get_admin_password_secret_kms_key_id()
249    }
250}