aws_sdk_iam/operation/update_account_password_policy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_account_password_policy::_update_account_password_policy_output::UpdateAccountPasswordPolicyOutputBuilder;
3
4pub use crate::operation::update_account_password_policy::_update_account_password_policy_input::UpdateAccountPasswordPolicyInputBuilder;
5
6impl crate::operation::update_account_password_policy::builders::UpdateAccountPasswordPolicyInputBuilder {
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_account_password_policy::UpdateAccountPasswordPolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_account_password_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAccountPasswordPolicy`.
24///
25/// <p>Updates the password policy settings for the Amazon Web Services account.</p><note>
26/// <p>This operation does not support partial updates. No parameters are required, but if you do not specify a parameter, that parameter's value reverts to its default value. See the <b>Request Parameters</b> section for each parameter's default value. Also note that some parameters do not allow the default parameter to be explicitly set. Instead, to invoke the default value, do not include that parameter when you invoke the operation.</p>
27/// </note>
28/// <p>For more information about using a password policy, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingPasswordPolicies.html">Managing an IAM password policy</a> in the <i>IAM User Guide</i>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct UpdateAccountPasswordPolicyFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::update_account_password_policy::builders::UpdateAccountPasswordPolicyInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyOutput,
38        crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyError,
39    > for UpdateAccountPasswordPolicyFluentBuilder
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::update_account_password_policy::UpdateAccountPasswordPolicyOutput,
47            crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl UpdateAccountPasswordPolicyFluentBuilder {
54    /// Creates a new `UpdateAccountPasswordPolicyFluentBuilder`.
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 UpdateAccountPasswordPolicy as a reference.
63    pub fn as_input(&self) -> &crate::operation::update_account_password_policy::builders::UpdateAccountPasswordPolicyInputBuilder {
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::update_account_password_policy::UpdateAccountPasswordPolicyOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyError,
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 = crate::operation::update_account_password_policy::UpdateAccountPasswordPolicy::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::update_account_password_policy::UpdateAccountPasswordPolicy::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyOutput,
100        crate::operation::update_account_password_policy::UpdateAccountPasswordPolicyError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The minimum number of characters allowed in an IAM user password.</p>
115    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>6</code>.</p>
116    pub fn minimum_password_length(mut self, input: i32) -> Self {
117        self.inner = self.inner.minimum_password_length(input);
118        self
119    }
120    /// <p>The minimum number of characters allowed in an IAM user password.</p>
121    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>6</code>.</p>
122    pub fn set_minimum_password_length(mut self, input: ::std::option::Option<i32>) -> Self {
123        self.inner = self.inner.set_minimum_password_length(input);
124        self
125    }
126    /// <p>The minimum number of characters allowed in an IAM user password.</p>
127    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>6</code>.</p>
128    pub fn get_minimum_password_length(&self) -> &::std::option::Option<i32> {
129        self.inner.get_minimum_password_length()
130    }
131    /// <p>Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:</p>
132    /// <p>! @ # $ % ^ &amp; * ( ) _ + - = \[ \] { } | '</p>
133    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one symbol character.</p>
134    pub fn require_symbols(mut self, input: bool) -> Self {
135        self.inner = self.inner.require_symbols(input);
136        self
137    }
138    /// <p>Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:</p>
139    /// <p>! @ # $ % ^ &amp; * ( ) _ + - = \[ \] { } | '</p>
140    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one symbol character.</p>
141    pub fn set_require_symbols(mut self, input: ::std::option::Option<bool>) -> Self {
142        self.inner = self.inner.set_require_symbols(input);
143        self
144    }
145    /// <p>Specifies whether IAM user passwords must contain at least one of the following non-alphanumeric characters:</p>
146    /// <p>! @ # $ % ^ &amp; * ( ) _ + - = \[ \] { } | '</p>
147    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one symbol character.</p>
148    pub fn get_require_symbols(&self) -> &::std::option::Option<bool> {
149        self.inner.get_require_symbols()
150    }
151    /// <p>Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).</p>
152    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one numeric character.</p>
153    pub fn require_numbers(mut self, input: bool) -> Self {
154        self.inner = self.inner.require_numbers(input);
155        self
156    }
157    /// <p>Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).</p>
158    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one numeric character.</p>
159    pub fn set_require_numbers(mut self, input: ::std::option::Option<bool>) -> Self {
160        self.inner = self.inner.set_require_numbers(input);
161        self
162    }
163    /// <p>Specifies whether IAM user passwords must contain at least one numeric character (0 to 9).</p>
164    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one numeric character.</p>
165    pub fn get_require_numbers(&self) -> &::std::option::Option<bool> {
166        self.inner.get_require_numbers()
167    }
168    /// <p>Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).</p>
169    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one uppercase character.</p>
170    pub fn require_uppercase_characters(mut self, input: bool) -> Self {
171        self.inner = self.inner.require_uppercase_characters(input);
172        self
173    }
174    /// <p>Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).</p>
175    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one uppercase character.</p>
176    pub fn set_require_uppercase_characters(mut self, input: ::std::option::Option<bool>) -> Self {
177        self.inner = self.inner.set_require_uppercase_characters(input);
178        self
179    }
180    /// <p>Specifies whether IAM user passwords must contain at least one uppercase character from the ISO basic Latin alphabet (A to Z).</p>
181    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one uppercase character.</p>
182    pub fn get_require_uppercase_characters(&self) -> &::std::option::Option<bool> {
183        self.inner.get_require_uppercase_characters()
184    }
185    /// <p>Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).</p>
186    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one lowercase character.</p>
187    pub fn require_lowercase_characters(mut self, input: bool) -> Self {
188        self.inner = self.inner.require_lowercase_characters(input);
189        self
190    }
191    /// <p>Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).</p>
192    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one lowercase character.</p>
193    pub fn set_require_lowercase_characters(mut self, input: ::std::option::Option<bool>) -> Self {
194        self.inner = self.inner.set_require_lowercase_characters(input);
195        self
196    }
197    /// <p>Specifies whether IAM user passwords must contain at least one lowercase character from the ISO basic Latin alphabet (a to z).</p>
198    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that passwords do not require at least one lowercase character.</p>
199    pub fn get_require_lowercase_characters(&self) -> &::std::option::Option<bool> {
200        self.inner.get_require_lowercase_characters()
201    }
202    /// <p>Allows all IAM users in your account to use the Amazon Web Services Management Console to change their own passwords. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_enable-user-change.html">Permitting IAM users to change their own passwords</a> in the <i>IAM User Guide</i>.</p>
203    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that IAM users in the account do not automatically have permissions to change their own password.</p>
204    pub fn allow_users_to_change_password(mut self, input: bool) -> Self {
205        self.inner = self.inner.allow_users_to_change_password(input);
206        self
207    }
208    /// <p>Allows all IAM users in your account to use the Amazon Web Services Management Console to change their own passwords. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_enable-user-change.html">Permitting IAM users to change their own passwords</a> in the <i>IAM User Guide</i>.</p>
209    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that IAM users in the account do not automatically have permissions to change their own password.</p>
210    pub fn set_allow_users_to_change_password(mut self, input: ::std::option::Option<bool>) -> Self {
211        self.inner = self.inner.set_allow_users_to_change_password(input);
212        self
213    }
214    /// <p>Allows all IAM users in your account to use the Amazon Web Services Management Console to change their own passwords. For more information, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_passwords_enable-user-change.html">Permitting IAM users to change their own passwords</a> in the <i>IAM User Guide</i>.</p>
215    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that IAM users in the account do not automatically have permissions to change their own password.</p>
216    pub fn get_allow_users_to_change_password(&self) -> &::std::option::Option<bool> {
217        self.inner.get_allow_users_to_change_password()
218    }
219    /// <p>The number of days that an IAM user password is valid.</p>
220    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>0</code>. The result is that IAM user passwords never expire.</p>
221    pub fn max_password_age(mut self, input: i32) -> Self {
222        self.inner = self.inner.max_password_age(input);
223        self
224    }
225    /// <p>The number of days that an IAM user password is valid.</p>
226    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>0</code>. The result is that IAM user passwords never expire.</p>
227    pub fn set_max_password_age(mut self, input: ::std::option::Option<i32>) -> Self {
228        self.inner = self.inner.set_max_password_age(input);
229        self
230    }
231    /// <p>The number of days that an IAM user password is valid.</p>
232    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>0</code>. The result is that IAM user passwords never expire.</p>
233    pub fn get_max_password_age(&self) -> &::std::option::Option<i32> {
234        self.inner.get_max_password_age()
235    }
236    /// <p>Specifies the number of previous passwords that IAM users are prevented from reusing.</p>
237    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>0</code>. The result is that IAM users are not prevented from reusing previous passwords.</p>
238    pub fn password_reuse_prevention(mut self, input: i32) -> Self {
239        self.inner = self.inner.password_reuse_prevention(input);
240        self
241    }
242    /// <p>Specifies the number of previous passwords that IAM users are prevented from reusing.</p>
243    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>0</code>. The result is that IAM users are not prevented from reusing previous passwords.</p>
244    pub fn set_password_reuse_prevention(mut self, input: ::std::option::Option<i32>) -> Self {
245        self.inner = self.inner.set_password_reuse_prevention(input);
246        self
247    }
248    /// <p>Specifies the number of previous passwords that IAM users are prevented from reusing.</p>
249    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>0</code>. The result is that IAM users are not prevented from reusing previous passwords.</p>
250    pub fn get_password_reuse_prevention(&self) -> &::std::option::Option<i32> {
251        self.inner.get_password_reuse_prevention()
252    }
253    /// <p>Prevents IAM users who are accessing the account via the Amazon Web Services Management Console from setting a new console password after their password has expired. The IAM user cannot access the console until an administrator resets the password.</p>
254    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that IAM users can change their passwords after they expire and continue to sign in as the user.</p><note>
255    /// <p>In the Amazon Web Services Management Console, the custom password policy option <b>Allow users to change their own password</b> gives IAM users permissions to <code>iam:ChangePassword</code> for only their user and to the <code>iam:GetAccountPasswordPolicy</code> action. This option does not attach a permissions policy to each user, rather the permissions are applied at the account-level for all users by IAM. IAM users with <code>iam:ChangePassword</code> permission and active access keys can reset their own expired console password using the CLI or API.</p>
256    /// </note>
257    pub fn hard_expiry(mut self, input: bool) -> Self {
258        self.inner = self.inner.hard_expiry(input);
259        self
260    }
261    /// <p>Prevents IAM users who are accessing the account via the Amazon Web Services Management Console from setting a new console password after their password has expired. The IAM user cannot access the console until an administrator resets the password.</p>
262    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that IAM users can change their passwords after they expire and continue to sign in as the user.</p><note>
263    /// <p>In the Amazon Web Services Management Console, the custom password policy option <b>Allow users to change their own password</b> gives IAM users permissions to <code>iam:ChangePassword</code> for only their user and to the <code>iam:GetAccountPasswordPolicy</code> action. This option does not attach a permissions policy to each user, rather the permissions are applied at the account-level for all users by IAM. IAM users with <code>iam:ChangePassword</code> permission and active access keys can reset their own expired console password using the CLI or API.</p>
264    /// </note>
265    pub fn set_hard_expiry(mut self, input: ::std::option::Option<bool>) -> Self {
266        self.inner = self.inner.set_hard_expiry(input);
267        self
268    }
269    /// <p>Prevents IAM users who are accessing the account via the Amazon Web Services Management Console from setting a new console password after their password has expired. The IAM user cannot access the console until an administrator resets the password.</p>
270    /// <p>If you do not specify a value for this parameter, then the operation uses the default value of <code>false</code>. The result is that IAM users can change their passwords after they expire and continue to sign in as the user.</p><note>
271    /// <p>In the Amazon Web Services Management Console, the custom password policy option <b>Allow users to change their own password</b> gives IAM users permissions to <code>iam:ChangePassword</code> for only their user and to the <code>iam:GetAccountPasswordPolicy</code> action. This option does not attach a permissions policy to each user, rather the permissions are applied at the account-level for all users by IAM. IAM users with <code>iam:ChangePassword</code> permission and active access keys can reset their own expired console password using the CLI or API.</p>
272    /// </note>
273    pub fn get_hard_expiry(&self) -> &::std::option::Option<bool> {
274        self.inner.get_hard_expiry()
275    }
276}