// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::change_password::_change_password_input::ChangePasswordInputBuilder;
pub use crate::operation::change_password::_change_password_output::ChangePasswordOutputBuilder;
impl crate::operation::change_password::builders::ChangePasswordInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::change_password::ChangePasswordOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::change_password::ChangePasswordError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.change_password();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `ChangePassword`.
///
/// <p>Changes the password of the IAM user who is calling this operation. This operation can be performed using the CLI, the Amazon Web Services API, or the <b>My Security Credentials</b> page in the Amazon Web Services Management Console. The Amazon Web Services account root user password is not affected by this operation.</p>
/// <p>Use <a href="https://docs.aws.amazon.com/IAM/latest/APIReference/API_UpdateLoginProfile.html">UpdateLoginProfile</a> to use the CLI, the Amazon Web Services API, or the <b>Users</b> page in the IAM console to change the password for any IAM user. For more information about modifying passwords, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_ManagingLogins.html">Managing passwords</a> in the <i>IAM User Guide</i>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ChangePasswordFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::change_password::builders::ChangePasswordInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::change_password::ChangePasswordOutput,
crate::operation::change_password::ChangePasswordError,
> for ChangePasswordFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::change_password::ChangePasswordOutput,
crate::operation::change_password::ChangePasswordError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl ChangePasswordFluentBuilder {
/// Creates a new `ChangePasswordFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the ChangePassword as a reference.
pub fn as_input(&self) -> &crate::operation::change_password::builders::ChangePasswordInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::change_password::ChangePasswordOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::change_password::ChangePasswordError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::change_password::ChangePassword::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::change_password::ChangePassword::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::change_password::ChangePasswordOutput,
crate::operation::change_password::ChangePasswordError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The IAM user's current password.</p>
pub fn old_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.old_password(input.into());
self
}
/// <p>The IAM user's current password.</p>
pub fn set_old_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_old_password(input);
self
}
/// <p>The IAM user's current password.</p>
pub fn get_old_password(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_old_password()
}
/// <p>The new password. The new password must conform to the Amazon Web Services account's password policy, if one exists.</p>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (<code>\u0020</code>) through the end of the ASCII character range (<code>\u00FF</code>). You can also include the tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>) characters. Any of these characters are valid in a password. However, many tools, such as the Amazon Web Services Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.</p>
pub fn new_password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.new_password(input.into());
self
}
/// <p>The new password. The new password must conform to the Amazon Web Services account's password policy, if one exists.</p>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (<code>\u0020</code>) through the end of the ASCII character range (<code>\u00FF</code>). You can also include the tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>) characters. Any of these characters are valid in a password. However, many tools, such as the Amazon Web Services Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.</p>
pub fn set_new_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_new_password(input);
self
}
/// <p>The new password. The new password must conform to the Amazon Web Services account's password policy, if one exists.</p>
/// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> that is used to validate this parameter is a string of characters. That string can include almost any printable ASCII character from the space (<code>\u0020</code>) through the end of the ASCII character range (<code>\u00FF</code>). You can also include the tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>) characters. Any of these characters are valid in a password. However, many tools, such as the Amazon Web Services Management Console, might restrict the ability to type certain characters because they have special meaning within that tool.</p>
pub fn get_new_password(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_new_password()
}
}