aws_sdk_iam/operation/update_user/
_update_user_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, ::std::fmt::Debug)]
5pub struct UpdateUserInput {
6    /// <p>Name of the user to update. If you're changing the name of the user, this is the original user name.</p>
7    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
8    pub user_name: ::std::option::Option<::std::string::String>,
9    /// <p>New path for the IAM user. Include this parameter only if you're changing the user's path.</p>
10    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
11    pub new_path: ::std::option::Option<::std::string::String>,
12    /// <p>New name for the user. Include this parameter only if you're changing the user's name.</p>
13    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
14    pub new_user_name: ::std::option::Option<::std::string::String>,
15}
16impl UpdateUserInput {
17    /// <p>Name of the user to update. If you're changing the name of the user, this is the original user name.</p>
18    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
19    pub fn user_name(&self) -> ::std::option::Option<&str> {
20        self.user_name.as_deref()
21    }
22    /// <p>New path for the IAM user. Include this parameter only if you're changing the user's path.</p>
23    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
24    pub fn new_path(&self) -> ::std::option::Option<&str> {
25        self.new_path.as_deref()
26    }
27    /// <p>New name for the user. Include this parameter only if you're changing the user's name.</p>
28    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
29    pub fn new_user_name(&self) -> ::std::option::Option<&str> {
30        self.new_user_name.as_deref()
31    }
32}
33impl UpdateUserInput {
34    /// Creates a new builder-style object to manufacture [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
35    pub fn builder() -> crate::operation::update_user::builders::UpdateUserInputBuilder {
36        crate::operation::update_user::builders::UpdateUserInputBuilder::default()
37    }
38}
39
40/// A builder for [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct UpdateUserInputBuilder {
44    pub(crate) user_name: ::std::option::Option<::std::string::String>,
45    pub(crate) new_path: ::std::option::Option<::std::string::String>,
46    pub(crate) new_user_name: ::std::option::Option<::std::string::String>,
47}
48impl UpdateUserInputBuilder {
49    /// <p>Name of the user to update. If you're changing the name of the user, this is the original user name.</p>
50    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
51    /// This field is required.
52    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.user_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>Name of the user to update. If you're changing the name of the user, this is the original user name.</p>
57    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
58    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
59        self.user_name = input;
60        self
61    }
62    /// <p>Name of the user to update. If you're changing the name of the user, this is the original user name.</p>
63    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
64    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
65        &self.user_name
66    }
67    /// <p>New path for the IAM user. Include this parameter only if you're changing the user's path.</p>
68    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
69    pub fn new_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.new_path = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <p>New path for the IAM user. Include this parameter only if you're changing the user's path.</p>
74    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
75    pub fn set_new_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
76        self.new_path = input;
77        self
78    }
79    /// <p>New path for the IAM user. Include this parameter only if you're changing the user's path.</p>
80    /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of either a forward slash (/) by itself or a string that must begin and end with forward slashes. In addition, it can contain any ASCII character from the ! (<code>\u0021</code>) through the DEL character (<code>\u007F</code>), including most punctuation characters, digits, and upper and lowercased letters.</p>
81    pub fn get_new_path(&self) -> &::std::option::Option<::std::string::String> {
82        &self.new_path
83    }
84    /// <p>New name for the user. Include this parameter only if you're changing the user's name.</p>
85    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
86    pub fn new_user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87        self.new_user_name = ::std::option::Option::Some(input.into());
88        self
89    }
90    /// <p>New name for the user. Include this parameter only if you're changing the user's name.</p>
91    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
92    pub fn set_new_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.new_user_name = input;
94        self
95    }
96    /// <p>New name for the user. Include this parameter only if you're changing the user's name.</p>
97    /// <p>IAM user, group, role, and policy names must be unique within the account. Names are not distinguished by case. For example, you cannot create resources named both "MyResource" and "myresource".</p>
98    pub fn get_new_user_name(&self) -> &::std::option::Option<::std::string::String> {
99        &self.new_user_name
100    }
101    /// Consumes the builder and constructs a [`UpdateUserInput`](crate::operation::update_user::UpdateUserInput).
102    pub fn build(self) -> ::std::result::Result<crate::operation::update_user::UpdateUserInput, ::aws_smithy_types::error::operation::BuildError> {
103        ::std::result::Result::Ok(crate::operation::update_user::UpdateUserInput {
104            user_name: self.user_name,
105            new_path: self.new_path,
106            new_user_name: self.new_user_name,
107        })
108    }
109}