aws_sdk_connect/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 user name for the account. For instances not using SAML for identity management, the user name can include up to 20 characters. If you are using SAML for identity management, the user name can include up to 64 characters from \[a-zA-Z0-9_-.\@\]+.</p>
7 /// <p>Username can include @ only if used in an email format. For example:</p>
8 /// <ul>
9 /// <li>
10 /// <p>Correct: testuser</p></li>
11 /// <li>
12 /// <p>Correct: testuser@example.com</p></li>
13 /// <li>
14 /// <p>Incorrect: testuser@example</p></li>
15 /// </ul>
16 pub username: ::std::option::Option<::std::string::String>,
17 /// <p>The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.</p>
18 pub password: ::std::option::Option<::std::string::String>,
19 /// <p>The information about the identity of the user.</p>
20 pub identity_info: ::std::option::Option<crate::types::UserIdentityInfo>,
21 /// <p>The phone settings for the user.</p>
22 pub phone_config: ::std::option::Option<crate::types::UserPhoneConfig>,
23 /// <p>The identifier of the user account in the directory used for identity management. If Amazon Connect cannot access the directory, you can specify this identifier to authenticate users. If you include the identifier, we assume that Amazon Connect cannot access the directory. Otherwise, the identity information is used to authenticate users from your directory.</p>
24 /// <p>This parameter is required if you are using an existing directory for identity management in Amazon Connect when Amazon Connect cannot access your directory to authenticate users. If you are using SAML for identity management and include this parameter, an error is returned.</p>
25 pub directory_user_id: ::std::option::Option<::std::string::String>,
26 /// <p>The identifier of the security profile for the user.</p>
27 pub security_profile_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
28 /// <p>The identifier of the routing profile for the user.</p>
29 pub routing_profile_id: ::std::option::Option<::std::string::String>,
30 /// <p>The identifier of the hierarchy group for the user.</p>
31 pub hierarchy_group_id: ::std::option::Option<::std::string::String>,
32 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
33 pub instance_id: ::std::option::Option<::std::string::String>,
34 /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
35 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
36}
37impl CreateUserInput {
38 /// <p>The user name for the account. For instances not using SAML for identity management, the user name can include up to 20 characters. If you are using SAML for identity management, the user name can include up to 64 characters from \[a-zA-Z0-9_-.\@\]+.</p>
39 /// <p>Username can include @ only if used in an email format. For example:</p>
40 /// <ul>
41 /// <li>
42 /// <p>Correct: testuser</p></li>
43 /// <li>
44 /// <p>Correct: testuser@example.com</p></li>
45 /// <li>
46 /// <p>Incorrect: testuser@example</p></li>
47 /// </ul>
48 pub fn username(&self) -> ::std::option::Option<&str> {
49 self.username.as_deref()
50 }
51 /// <p>The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.</p>
52 pub fn password(&self) -> ::std::option::Option<&str> {
53 self.password.as_deref()
54 }
55 /// <p>The information about the identity of the user.</p>
56 pub fn identity_info(&self) -> ::std::option::Option<&crate::types::UserIdentityInfo> {
57 self.identity_info.as_ref()
58 }
59 /// <p>The phone settings for the user.</p>
60 pub fn phone_config(&self) -> ::std::option::Option<&crate::types::UserPhoneConfig> {
61 self.phone_config.as_ref()
62 }
63 /// <p>The identifier of the user account in the directory used for identity management. If Amazon Connect cannot access the directory, you can specify this identifier to authenticate users. If you include the identifier, we assume that Amazon Connect cannot access the directory. Otherwise, the identity information is used to authenticate users from your directory.</p>
64 /// <p>This parameter is required if you are using an existing directory for identity management in Amazon Connect when Amazon Connect cannot access your directory to authenticate users. If you are using SAML for identity management and include this parameter, an error is returned.</p>
65 pub fn directory_user_id(&self) -> ::std::option::Option<&str> {
66 self.directory_user_id.as_deref()
67 }
68 /// <p>The identifier of the security profile for the user.</p>
69 ///
70 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_profile_ids.is_none()`.
71 pub fn security_profile_ids(&self) -> &[::std::string::String] {
72 self.security_profile_ids.as_deref().unwrap_or_default()
73 }
74 /// <p>The identifier of the routing profile for the user.</p>
75 pub fn routing_profile_id(&self) -> ::std::option::Option<&str> {
76 self.routing_profile_id.as_deref()
77 }
78 /// <p>The identifier of the hierarchy group for the user.</p>
79 pub fn hierarchy_group_id(&self) -> ::std::option::Option<&str> {
80 self.hierarchy_group_id.as_deref()
81 }
82 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
83 pub fn instance_id(&self) -> ::std::option::Option<&str> {
84 self.instance_id.as_deref()
85 }
86 /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
87 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
88 self.tags.as_ref()
89 }
90}
91impl ::std::fmt::Debug for CreateUserInput {
92 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
93 let mut formatter = f.debug_struct("CreateUserInput");
94 formatter.field("username", &self.username);
95 formatter.field("password", &"*** Sensitive Data Redacted ***");
96 formatter.field("identity_info", &self.identity_info);
97 formatter.field("phone_config", &self.phone_config);
98 formatter.field("directory_user_id", &self.directory_user_id);
99 formatter.field("security_profile_ids", &self.security_profile_ids);
100 formatter.field("routing_profile_id", &self.routing_profile_id);
101 formatter.field("hierarchy_group_id", &self.hierarchy_group_id);
102 formatter.field("instance_id", &self.instance_id);
103 formatter.field("tags", &self.tags);
104 formatter.finish()
105 }
106}
107impl CreateUserInput {
108 /// Creates a new builder-style object to manufacture [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
109 pub fn builder() -> crate::operation::create_user::builders::CreateUserInputBuilder {
110 crate::operation::create_user::builders::CreateUserInputBuilder::default()
111 }
112}
113
114/// A builder for [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
115#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
116#[non_exhaustive]
117pub struct CreateUserInputBuilder {
118 pub(crate) username: ::std::option::Option<::std::string::String>,
119 pub(crate) password: ::std::option::Option<::std::string::String>,
120 pub(crate) identity_info: ::std::option::Option<crate::types::UserIdentityInfo>,
121 pub(crate) phone_config: ::std::option::Option<crate::types::UserPhoneConfig>,
122 pub(crate) directory_user_id: ::std::option::Option<::std::string::String>,
123 pub(crate) security_profile_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
124 pub(crate) routing_profile_id: ::std::option::Option<::std::string::String>,
125 pub(crate) hierarchy_group_id: ::std::option::Option<::std::string::String>,
126 pub(crate) instance_id: ::std::option::Option<::std::string::String>,
127 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
128}
129impl CreateUserInputBuilder {
130 /// <p>The user name for the account. For instances not using SAML for identity management, the user name can include up to 20 characters. If you are using SAML for identity management, the user name can include up to 64 characters from \[a-zA-Z0-9_-.\@\]+.</p>
131 /// <p>Username can include @ only if used in an email format. For example:</p>
132 /// <ul>
133 /// <li>
134 /// <p>Correct: testuser</p></li>
135 /// <li>
136 /// <p>Correct: testuser@example.com</p></li>
137 /// <li>
138 /// <p>Incorrect: testuser@example</p></li>
139 /// </ul>
140 /// This field is required.
141 pub fn username(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.username = ::std::option::Option::Some(input.into());
143 self
144 }
145 /// <p>The user name for the account. For instances not using SAML for identity management, the user name can include up to 20 characters. If you are using SAML for identity management, the user name can include up to 64 characters from \[a-zA-Z0-9_-.\@\]+.</p>
146 /// <p>Username can include @ only if used in an email format. For example:</p>
147 /// <ul>
148 /// <li>
149 /// <p>Correct: testuser</p></li>
150 /// <li>
151 /// <p>Correct: testuser@example.com</p></li>
152 /// <li>
153 /// <p>Incorrect: testuser@example</p></li>
154 /// </ul>
155 pub fn set_username(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.username = input;
157 self
158 }
159 /// <p>The user name for the account. For instances not using SAML for identity management, the user name can include up to 20 characters. If you are using SAML for identity management, the user name can include up to 64 characters from \[a-zA-Z0-9_-.\@\]+.</p>
160 /// <p>Username can include @ only if used in an email format. For example:</p>
161 /// <ul>
162 /// <li>
163 /// <p>Correct: testuser</p></li>
164 /// <li>
165 /// <p>Correct: testuser@example.com</p></li>
166 /// <li>
167 /// <p>Incorrect: testuser@example</p></li>
168 /// </ul>
169 pub fn get_username(&self) -> &::std::option::Option<::std::string::String> {
170 &self.username
171 }
172 /// <p>The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.</p>
173 pub fn password(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174 self.password = ::std::option::Option::Some(input.into());
175 self
176 }
177 /// <p>The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.</p>
178 pub fn set_password(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179 self.password = input;
180 self
181 }
182 /// <p>The password for the user account. A password is required if you are using Amazon Connect for identity management. Otherwise, it is an error to include a password.</p>
183 pub fn get_password(&self) -> &::std::option::Option<::std::string::String> {
184 &self.password
185 }
186 /// <p>The information about the identity of the user.</p>
187 pub fn identity_info(mut self, input: crate::types::UserIdentityInfo) -> Self {
188 self.identity_info = ::std::option::Option::Some(input);
189 self
190 }
191 /// <p>The information about the identity of the user.</p>
192 pub fn set_identity_info(mut self, input: ::std::option::Option<crate::types::UserIdentityInfo>) -> Self {
193 self.identity_info = input;
194 self
195 }
196 /// <p>The information about the identity of the user.</p>
197 pub fn get_identity_info(&self) -> &::std::option::Option<crate::types::UserIdentityInfo> {
198 &self.identity_info
199 }
200 /// <p>The phone settings for the user.</p>
201 /// This field is required.
202 pub fn phone_config(mut self, input: crate::types::UserPhoneConfig) -> Self {
203 self.phone_config = ::std::option::Option::Some(input);
204 self
205 }
206 /// <p>The phone settings for the user.</p>
207 pub fn set_phone_config(mut self, input: ::std::option::Option<crate::types::UserPhoneConfig>) -> Self {
208 self.phone_config = input;
209 self
210 }
211 /// <p>The phone settings for the user.</p>
212 pub fn get_phone_config(&self) -> &::std::option::Option<crate::types::UserPhoneConfig> {
213 &self.phone_config
214 }
215 /// <p>The identifier of the user account in the directory used for identity management. If Amazon Connect cannot access the directory, you can specify this identifier to authenticate users. If you include the identifier, we assume that Amazon Connect cannot access the directory. Otherwise, the identity information is used to authenticate users from your directory.</p>
216 /// <p>This parameter is required if you are using an existing directory for identity management in Amazon Connect when Amazon Connect cannot access your directory to authenticate users. If you are using SAML for identity management and include this parameter, an error is returned.</p>
217 pub fn directory_user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218 self.directory_user_id = ::std::option::Option::Some(input.into());
219 self
220 }
221 /// <p>The identifier of the user account in the directory used for identity management. If Amazon Connect cannot access the directory, you can specify this identifier to authenticate users. If you include the identifier, we assume that Amazon Connect cannot access the directory. Otherwise, the identity information is used to authenticate users from your directory.</p>
222 /// <p>This parameter is required if you are using an existing directory for identity management in Amazon Connect when Amazon Connect cannot access your directory to authenticate users. If you are using SAML for identity management and include this parameter, an error is returned.</p>
223 pub fn set_directory_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224 self.directory_user_id = input;
225 self
226 }
227 /// <p>The identifier of the user account in the directory used for identity management. If Amazon Connect cannot access the directory, you can specify this identifier to authenticate users. If you include the identifier, we assume that Amazon Connect cannot access the directory. Otherwise, the identity information is used to authenticate users from your directory.</p>
228 /// <p>This parameter is required if you are using an existing directory for identity management in Amazon Connect when Amazon Connect cannot access your directory to authenticate users. If you are using SAML for identity management and include this parameter, an error is returned.</p>
229 pub fn get_directory_user_id(&self) -> &::std::option::Option<::std::string::String> {
230 &self.directory_user_id
231 }
232 /// Appends an item to `security_profile_ids`.
233 ///
234 /// To override the contents of this collection use [`set_security_profile_ids`](Self::set_security_profile_ids).
235 ///
236 /// <p>The identifier of the security profile for the user.</p>
237 pub fn security_profile_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238 let mut v = self.security_profile_ids.unwrap_or_default();
239 v.push(input.into());
240 self.security_profile_ids = ::std::option::Option::Some(v);
241 self
242 }
243 /// <p>The identifier of the security profile for the user.</p>
244 pub fn set_security_profile_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
245 self.security_profile_ids = input;
246 self
247 }
248 /// <p>The identifier of the security profile for the user.</p>
249 pub fn get_security_profile_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
250 &self.security_profile_ids
251 }
252 /// <p>The identifier of the routing profile for the user.</p>
253 /// This field is required.
254 pub fn routing_profile_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255 self.routing_profile_id = ::std::option::Option::Some(input.into());
256 self
257 }
258 /// <p>The identifier of the routing profile for the user.</p>
259 pub fn set_routing_profile_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
260 self.routing_profile_id = input;
261 self
262 }
263 /// <p>The identifier of the routing profile for the user.</p>
264 pub fn get_routing_profile_id(&self) -> &::std::option::Option<::std::string::String> {
265 &self.routing_profile_id
266 }
267 /// <p>The identifier of the hierarchy group for the user.</p>
268 pub fn hierarchy_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269 self.hierarchy_group_id = ::std::option::Option::Some(input.into());
270 self
271 }
272 /// <p>The identifier of the hierarchy group for the user.</p>
273 pub fn set_hierarchy_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274 self.hierarchy_group_id = input;
275 self
276 }
277 /// <p>The identifier of the hierarchy group for the user.</p>
278 pub fn get_hierarchy_group_id(&self) -> &::std::option::Option<::std::string::String> {
279 &self.hierarchy_group_id
280 }
281 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
282 /// This field is required.
283 pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
284 self.instance_id = ::std::option::Option::Some(input.into());
285 self
286 }
287 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
288 pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
289 self.instance_id = input;
290 self
291 }
292 /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
293 pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
294 &self.instance_id
295 }
296 /// Adds a key-value pair to `tags`.
297 ///
298 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
299 ///
300 /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
301 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
302 let mut hash_map = self.tags.unwrap_or_default();
303 hash_map.insert(k.into(), v.into());
304 self.tags = ::std::option::Option::Some(hash_map);
305 self
306 }
307 /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
308 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
309 self.tags = input;
310 self
311 }
312 /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
313 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
314 &self.tags
315 }
316 /// Consumes the builder and constructs a [`CreateUserInput`](crate::operation::create_user::CreateUserInput).
317 pub fn build(self) -> ::std::result::Result<crate::operation::create_user::CreateUserInput, ::aws_smithy_types::error::operation::BuildError> {
318 ::std::result::Result::Ok(crate::operation::create_user::CreateUserInput {
319 username: self.username,
320 password: self.password,
321 identity_info: self.identity_info,
322 phone_config: self.phone_config,
323 directory_user_id: self.directory_user_id,
324 security_profile_ids: self.security_profile_ids,
325 routing_profile_id: self.routing_profile_id,
326 hierarchy_group_id: self.hierarchy_group_id,
327 instance_id: self.instance_id,
328 tags: self.tags,
329 })
330 }
331}
332impl ::std::fmt::Debug for CreateUserInputBuilder {
333 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
334 let mut formatter = f.debug_struct("CreateUserInputBuilder");
335 formatter.field("username", &self.username);
336 formatter.field("password", &"*** Sensitive Data Redacted ***");
337 formatter.field("identity_info", &self.identity_info);
338 formatter.field("phone_config", &self.phone_config);
339 formatter.field("directory_user_id", &self.directory_user_id);
340 formatter.field("security_profile_ids", &self.security_profile_ids);
341 formatter.field("routing_profile_id", &self.routing_profile_id);
342 formatter.field("hierarchy_group_id", &self.hierarchy_group_id);
343 formatter.field("instance_id", &self.instance_id);
344 formatter.field("tags", &self.tags);
345 formatter.finish()
346 }
347}