aws_sdk_chime/operation/create_user/
_create_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)]
5pub struct CreateUserInput {
6    /// <p>The Amazon Chime account ID.</p>
7    pub account_id: ::std::option::Option<::std::string::String>,
8    /// <p>The user name.</p>
9    pub username: ::std::option::Option<::std::string::String>,
10    /// <p>The user's email address.</p>
11    pub email: ::std::option::Option<::std::string::String>,
12    /// <p>The user type.</p>
13    pub user_type: ::std::option::Option<crate::types::UserType>,
14}
15impl CreateUserInput {
16    /// <p>The Amazon Chime account ID.</p>
17    pub fn account_id(&self) -> ::std::option::Option<&str> {
18        self.account_id.as_deref()
19    }
20    /// <p>The user name.</p>
21    pub fn username(&self) -> ::std::option::Option<&str> {
22        self.username.as_deref()
23    }
24    /// <p>The user's email address.</p>
25    pub fn email(&self) -> ::std::option::Option<&str> {
26        self.email.as_deref()
27    }
28    /// <p>The user type.</p>
29    pub fn user_type(&self) -> ::std::option::Option<&crate::types::UserType> {
30        self.user_type.as_ref()
31    }
32}
33impl ::std::fmt::Debug for CreateUserInput {
34    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
35        let mut formatter = f.debug_struct("CreateUserInput");
36        formatter.field("account_id", &self.account_id);
37        formatter.field("username", &self.username);
38        formatter.field("email", &"*** Sensitive Data Redacted ***");
39        formatter.field("user_type", &self.user_type);
40        formatter.finish()
41    }
42}
43impl CreateUserInput {
44    /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
45    pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
46        crate::operation::create_user::builders::CreateUserInputBuilder::default()
47    }
48}
49
50/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
52#[non_exhaustive]
53pub struct CreateUserInputBuilder {
54    pub(crate) account_id: ::std::option::Option<::std::string::String>,
55    pub(crate) username: ::std::option::Option<::std::string::String>,
56    pub(crate) email: ::std::option::Option<::std::string::String>,
57    pub(crate) user_type: ::std::option::Option<crate::types::UserType>,
58}
59impl CreateUserInputBuilder {
60    /// <p>The Amazon Chime account ID.</p>
61    /// This field is required.
62    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.account_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The Amazon Chime account ID.</p>
67    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.account_id = input;
69        self
70    }
71    /// <p>The Amazon Chime account ID.</p>
72    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.account_id
74    }
75    /// <p>The user name.</p>
76    pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77        self.username = ::std::option::Option::Some(input.into());
78        self
79    }
80    /// <p>The user name.</p>
81    pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82        self.username = input;
83        self
84    }
85    /// <p>The user name.</p>
86    pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
87        &self.username
88    }
89    /// <p>The user's email address.</p>
90    pub fn email(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.email = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>The user's email address.</p>
95    pub fn set_email(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.email = input;
97        self
98    }
99    /// <p>The user's email address.</p>
100    pub fn get_email(&self) -> &::std::option::Option<::std::string::String> {
101        &self.email
102    }
103    /// <p>The user type.</p>
104    pub fn user_type(mut self, input: crate::types::UserType) -> Self {
105        self.user_type = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The user type.</p>
109    pub fn set_user_type(mut self, input: ::std::option::Option<crate::types::UserType>) -> Self {
110        self.user_type = input;
111        self
112    }
113    /// <p>The user type.</p>
114    pub fn get_user_type(&self) -> &::std::option::Option<crate::types::UserType> {
115        &self.user_type
116    }
117    /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
118    pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
119        ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
120            account_id: self.account_id,
121            username: self.username,
122            email: self.email,
123            user_type: self.user_type,
124        })
125    }
126}
127impl ::std::fmt::Debug for CreateUserInputBuilder {
128    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
129        let mut formatter = f.debug_struct("CreateUserInputBuilder");
130        formatter.field("account_id", &self.account_id);
131        formatter.field("username", &self.username);
132        formatter.field("email", &"*** Sensitive Data Redacted ***");
133        formatter.field("user_type", &self.user_type);
134        formatter.finish()
135    }
136}