aws_sdk_appstream/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 email address of the user.</p><note>
7 /// <p>Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.</p>
8 /// </note>
9 pub user_name: ::std::option::Option<::std::string::String>,
10 /// <p>The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent.</p><note>
11 /// <p>The temporary password in the welcome email is valid for only 7 days. If users don’t set their passwords within 7 days, you must send them a new welcome email.</p>
12 /// </note>
13 pub message_action: ::std::option::Option<crate::types::MessageAction>,
14 /// <p>The first name, or given name, of the user.</p>
15 pub first_name: ::std::option::Option<::std::string::String>,
16 /// <p>The last name, or surname, of the user.</p>
17 pub last_name: ::std::option::Option<::std::string::String>,
18 /// <p>The authentication type for the user. You must specify USERPOOL.</p>
19 pub authentication_type: ::std::option::Option<crate::types::AuthenticationType>,
20}
21impl CreateUserInput {
22 /// <p>The email address of the user.</p><note>
23 /// <p>Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.</p>
24 /// </note>
25 pub fn user_name(&self) -> ::std::option::Option<&str> {
26 self.user_name.as_deref()
27 }
28 /// <p>The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent.</p><note>
29 /// <p>The temporary password in the welcome email is valid for only 7 days. If users don’t set their passwords within 7 days, you must send them a new welcome email.</p>
30 /// </note>
31 pub fn message_action(&self) -> ::std::option::Option<&crate::types::MessageAction> {
32 self.message_action.as_ref()
33 }
34 /// <p>The first name, or given name, of the user.</p>
35 pub fn first_name(&self) -> ::std::option::Option<&str> {
36 self.first_name.as_deref()
37 }
38 /// <p>The last name, or surname, of the user.</p>
39 pub fn last_name(&self) -> ::std::option::Option<&str> {
40 self.last_name.as_deref()
41 }
42 /// <p>The authentication type for the user. You must specify USERPOOL.</p>
43 pub fn authentication_type(&self) -> ::std::option::Option<&crate::types::AuthenticationType> {
44 self.authentication_type.as_ref()
45 }
46}
47impl ::std::fmt::Debug for CreateUserInput {
48 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
49 let mut formatter = f.debug_struct("CreateUserInput");
50 formatter.field("user_name", &"*** Sensitive Data Redacted ***");
51 formatter.field("message_action", &self.message_action);
52 formatter.field("first_name", &"*** Sensitive Data Redacted ***");
53 formatter.field("last_name", &"*** Sensitive Data Redacted ***");
54 formatter.field("authentication_type", &self.authentication_type);
55 formatter.finish()
56 }
57}
58impl CreateUserInput {
59 /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
60 pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
61 crate::operation::create_user::builders::CreateUserInputBuilder::default()
62 }
63}
64
65/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
67#[non_exhaustive]
68pub struct CreateUserInputBuilder {
69 pub(crate) user_name: ::std::option::Option<::std::string::String>,
70 pub(crate) message_action: ::std::option::Option<crate::types::MessageAction>,
71 pub(crate) first_name: ::std::option::Option<::std::string::String>,
72 pub(crate) last_name: ::std::option::Option<::std::string::String>,
73 pub(crate) authentication_type: ::std::option::Option<crate::types::AuthenticationType>,
74}
75impl CreateUserInputBuilder {
76 /// <p>The email address of the user.</p><note>
77 /// <p>Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.</p>
78 /// </note>
79 /// This field is required.
80 pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81 self.user_name = ::std::option::Option::Some(input.into());
82 self
83 }
84 /// <p>The email address of the user.</p><note>
85 /// <p>Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.</p>
86 /// </note>
87 pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.user_name = input;
89 self
90 }
91 /// <p>The email address of the user.</p><note>
92 /// <p>Users' email addresses are case-sensitive. During login, if they specify an email address that doesn't use the same capitalization as the email address specified when their user pool account was created, a "user does not exist" error message displays.</p>
93 /// </note>
94 pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
95 &self.user_name
96 }
97 /// <p>The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent.</p><note>
98 /// <p>The temporary password in the welcome email is valid for only 7 days. If users don’t set their passwords within 7 days, you must send them a new welcome email.</p>
99 /// </note>
100 pub fn message_action(mut self, input: crate::types::MessageAction) -> Self {
101 self.message_action = ::std::option::Option::Some(input);
102 self
103 }
104 /// <p>The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent.</p><note>
105 /// <p>The temporary password in the welcome email is valid for only 7 days. If users don’t set their passwords within 7 days, you must send them a new welcome email.</p>
106 /// </note>
107 pub fn set_message_action(mut self, input: ::std::option::Option<crate::types::MessageAction>) -> Self {
108 self.message_action = input;
109 self
110 }
111 /// <p>The action to take for the welcome email that is sent to a user after the user is created in the user pool. If you specify SUPPRESS, no email is sent. If you specify RESEND, do not specify the first name or last name of the user. If the value is null, the email is sent.</p><note>
112 /// <p>The temporary password in the welcome email is valid for only 7 days. If users don’t set their passwords within 7 days, you must send them a new welcome email.</p>
113 /// </note>
114 pub fn get_message_action(&self) -> &::std::option::Option<crate::types::MessageAction> {
115 &self.message_action
116 }
117 /// <p>The first name, or given name, of the user.</p>
118 pub fn first_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.first_name = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>The first name, or given name, of the user.</p>
123 pub fn set_first_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.first_name = input;
125 self
126 }
127 /// <p>The first name, or given name, of the user.</p>
128 pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
129 &self.first_name
130 }
131 /// <p>The last name, or surname, of the user.</p>
132 pub fn last_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133 self.last_name = ::std::option::Option::Some(input.into());
134 self
135 }
136 /// <p>The last name, or surname, of the user.</p>
137 pub fn set_last_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.last_name = input;
139 self
140 }
141 /// <p>The last name, or surname, of the user.</p>
142 pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
143 &self.last_name
144 }
145 /// <p>The authentication type for the user. You must specify USERPOOL.</p>
146 /// This field is required.
147 pub fn authentication_type(mut self, input: crate::types::AuthenticationType) -> Self {
148 self.authentication_type = ::std::option::Option::Some(input);
149 self
150 }
151 /// <p>The authentication type for the user. You must specify USERPOOL.</p>
152 pub fn set_authentication_type(mut self, input: ::std::option::Option<crate::types::AuthenticationType>) -> Self {
153 self.authentication_type = input;
154 self
155 }
156 /// <p>The authentication type for the user. You must specify USERPOOL.</p>
157 pub fn get_authentication_type(&self) -> &::std::option::Option<crate::types::AuthenticationType> {
158 &self.authentication_type
159 }
160 /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
161 pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
162 ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
163 user_name: self.user_name,
164 message_action: self.message_action,
165 first_name: self.first_name,
166 last_name: self.last_name,
167 authentication_type: self.authentication_type,
168 })
169 }
170}
171impl ::std::fmt::Debug for CreateUserInputBuilder {
172 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
173 let mut formatter = f.debug_struct("CreateUserInputBuilder");
174 formatter.field("user_name", &"*** Sensitive Data Redacted ***");
175 formatter.field("message_action", &self.message_action);
176 formatter.field("first_name", &"*** Sensitive Data Redacted ***");
177 formatter.field("last_name", &"*** Sensitive Data Redacted ***");
178 formatter.field("authentication_type", &self.authentication_type);
179 formatter.finish()
180 }
181}