aws_sdk_iam/operation/get_user/
_get_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 GetUserInput {
6    /// <p>The name of the user to get information about.</p>
7    /// <p>This parameter is optional. If it is not included, it defaults to the user making the request. 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}
10impl GetUserInput {
11    /// <p>The name of the user to get information about.</p>
12    /// <p>This parameter is optional. If it is not included, it defaults to the user making the request. 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>
13    pub fn user_name(&self) -> ::std::option::Option<&str> {
14        self.user_name.as_deref()
15    }
16}
17impl GetUserInput {
18    /// Creates a new builder-style object to manufacture [`GetUserInput`](crate::operation::get_user::GetUserInput).
19    pub fn builder() -> crate::operation::get_user::builders::GetUserInputBuilder {
20        crate::operation::get_user::builders::GetUserInputBuilder::default()
21    }
22}
23
24/// A builder for [`GetUserInput`](crate::operation::get_user::GetUserInput).
25#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
26#[non_exhaustive]
27pub struct GetUserInputBuilder {
28    pub(crate) user_name: ::std::option::Option<::std::string::String>,
29}
30impl GetUserInputBuilder {
31    /// <p>The name of the user to get information about.</p>
32    /// <p>This parameter is optional. If it is not included, it defaults to the user making the request. 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>
33    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
34        self.user_name = ::std::option::Option::Some(input.into());
35        self
36    }
37    /// <p>The name of the user to get information about.</p>
38    /// <p>This parameter is optional. If it is not included, it defaults to the user making the request. 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>
39    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
40        self.user_name = input;
41        self
42    }
43    /// <p>The name of the user to get information about.</p>
44    /// <p>This parameter is optional. If it is not included, it defaults to the user making the request. 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>
45    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
46        &self.user_name
47    }
48    /// Consumes the builder and constructs a [`GetUserInput`](crate::operation::get_user::GetUserInput).
49    pub fn build(self) -> ::std::result::Result<crate::operation::get_user::GetUserInput, ::aws_smithy_types::error::operation::BuildError> {
50        ::std::result::Result::Ok(crate::operation::get_user::GetUserInput { user_name: self.user_name })
51    }
52}