aws_sdk_identitystore/operation/create_user/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_user::_create_user_output::CreateUserOutputBuilder;
3
4pub use crate::operation::create_user::_create_user_input::CreateUserInputBuilder;
5
6impl crate::operation::create_user::builders::CreateUserInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_user::CreateUserOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_user::CreateUserError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_user();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateUser`.
24///
25/// <p>Creates a user within the specified identity store.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateUserFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_user::builders::CreateUserInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_user::CreateUserOutput,
35        crate::operation::create_user::CreateUserError,
36    > for CreateUserFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_user::CreateUserOutput,
44            crate::operation::create_user::CreateUserError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateUserFluentBuilder {
51    /// Creates a new `CreateUserFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateUser as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_user::builders::CreateUserInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_user::CreateUserOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_user::CreateUserError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_user::CreateUser::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_user::CreateUser::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_user::CreateUserOutput,
97        crate::operation::create_user::CreateUserError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The globally unique identifier for the identity store.</p>
112    pub fn identity_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.identity_store_id(input.into());
114        self
115    }
116    /// <p>The globally unique identifier for the identity store.</p>
117    pub fn set_identity_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_identity_store_id(input);
119        self
120    }
121    /// <p>The globally unique identifier for the identity store.</p>
122    pub fn get_identity_store_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_identity_store_id()
124    }
125    /// <p>A unique string used to identify the user. The length limit is 128 characters. This value can consist of letters, accented characters, symbols, numbers, and punctuation. This value is specified at the time the user is created and stored as an attribute of the user object in the identity store. <code>Administrator</code> and <code>AWSAdministrators</code> are reserved names and can't be used for users or groups.</p>
126    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.user_name(input.into());
128        self
129    }
130    /// <p>A unique string used to identify the user. The length limit is 128 characters. This value can consist of letters, accented characters, symbols, numbers, and punctuation. This value is specified at the time the user is created and stored as an attribute of the user object in the identity store. <code>Administrator</code> and <code>AWSAdministrators</code> are reserved names and can't be used for users or groups.</p>
131    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_user_name(input);
133        self
134    }
135    /// <p>A unique string used to identify the user. The length limit is 128 characters. This value can consist of letters, accented characters, symbols, numbers, and punctuation. This value is specified at the time the user is created and stored as an attribute of the user object in the identity store. <code>Administrator</code> and <code>AWSAdministrators</code> are reserved names and can't be used for users or groups.</p>
136    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_user_name()
138    }
139    /// <p>An object containing the name of the user. When used in IAM Identity Center, this parameter is required.</p>
140    pub fn name(mut self, input: crate::types::Name) -> Self {
141        self.inner = self.inner.name(input);
142        self
143    }
144    /// <p>An object containing the name of the user. When used in IAM Identity Center, this parameter is required.</p>
145    pub fn set_name(mut self, input: ::std::option::Option<crate::types::Name>) -> Self {
146        self.inner = self.inner.set_name(input);
147        self
148    }
149    /// <p>An object containing the name of the user. When used in IAM Identity Center, this parameter is required.</p>
150    pub fn get_name(&self) -> &::std::option::Option<crate::types::Name> {
151        self.inner.get_name()
152    }
153    /// <p>A string containing the name of the user. This value is typically formatted for display when the user is referenced. For example, "John Doe." When used in IAM Identity Center, this parameter is required.</p>
154    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.display_name(input.into());
156        self
157    }
158    /// <p>A string containing the name of the user. This value is typically formatted for display when the user is referenced. For example, "John Doe." When used in IAM Identity Center, this parameter is required.</p>
159    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_display_name(input);
161        self
162    }
163    /// <p>A string containing the name of the user. This value is typically formatted for display when the user is referenced. For example, "John Doe." When used in IAM Identity Center, this parameter is required.</p>
164    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_display_name()
166    }
167    /// <p>A string containing an alternate name for the user.</p>
168    pub fn nick_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169        self.inner = self.inner.nick_name(input.into());
170        self
171    }
172    /// <p>A string containing an alternate name for the user.</p>
173    pub fn set_nick_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174        self.inner = self.inner.set_nick_name(input);
175        self
176    }
177    /// <p>A string containing an alternate name for the user.</p>
178    pub fn get_nick_name(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_nick_name()
180    }
181    /// <p>A string containing a URL that might be associated with the user.</p>
182    pub fn profile_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.profile_url(input.into());
184        self
185    }
186    /// <p>A string containing a URL that might be associated with the user.</p>
187    pub fn set_profile_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_profile_url(input);
189        self
190    }
191    /// <p>A string containing a URL that might be associated with the user.</p>
192    pub fn get_profile_url(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_profile_url()
194    }
195    ///
196    /// Appends an item to `Emails`.
197    ///
198    /// To override the contents of this collection use [`set_emails`](Self::set_emails).
199    ///
200    /// <p>A list of <code>Email</code> objects containing email addresses associated with the user.</p>
201    pub fn emails(mut self, input: crate::types::Email) -> Self {
202        self.inner = self.inner.emails(input);
203        self
204    }
205    /// <p>A list of <code>Email</code> objects containing email addresses associated with the user.</p>
206    pub fn set_emails(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Email>>) -> Self {
207        self.inner = self.inner.set_emails(input);
208        self
209    }
210    /// <p>A list of <code>Email</code> objects containing email addresses associated with the user.</p>
211    pub fn get_emails(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Email>> {
212        self.inner.get_emails()
213    }
214    ///
215    /// Appends an item to `Addresses`.
216    ///
217    /// To override the contents of this collection use [`set_addresses`](Self::set_addresses).
218    ///
219    /// <p>A list of <code>Address</code> objects containing addresses associated with the user.</p>
220    pub fn addresses(mut self, input: crate::types::Address) -> Self {
221        self.inner = self.inner.addresses(input);
222        self
223    }
224    /// <p>A list of <code>Address</code> objects containing addresses associated with the user.</p>
225    pub fn set_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Address>>) -> Self {
226        self.inner = self.inner.set_addresses(input);
227        self
228    }
229    /// <p>A list of <code>Address</code> objects containing addresses associated with the user.</p>
230    pub fn get_addresses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Address>> {
231        self.inner.get_addresses()
232    }
233    ///
234    /// Appends an item to `PhoneNumbers`.
235    ///
236    /// To override the contents of this collection use [`set_phone_numbers`](Self::set_phone_numbers).
237    ///
238    /// <p>A list of <code>PhoneNumber</code> objects containing phone numbers associated with the user.</p>
239    pub fn phone_numbers(mut self, input: crate::types::PhoneNumber) -> Self {
240        self.inner = self.inner.phone_numbers(input);
241        self
242    }
243    /// <p>A list of <code>PhoneNumber</code> objects containing phone numbers associated with the user.</p>
244    pub fn set_phone_numbers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PhoneNumber>>) -> Self {
245        self.inner = self.inner.set_phone_numbers(input);
246        self
247    }
248    /// <p>A list of <code>PhoneNumber</code> objects containing phone numbers associated with the user.</p>
249    pub fn get_phone_numbers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PhoneNumber>> {
250        self.inner.get_phone_numbers()
251    }
252    /// <p>A string indicating the type of user. Possible values are left unspecified. The value can vary based on your specific use case.</p>
253    pub fn user_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
254        self.inner = self.inner.user_type(input.into());
255        self
256    }
257    /// <p>A string indicating the type of user. Possible values are left unspecified. The value can vary based on your specific use case.</p>
258    pub fn set_user_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
259        self.inner = self.inner.set_user_type(input);
260        self
261    }
262    /// <p>A string indicating the type of user. Possible values are left unspecified. The value can vary based on your specific use case.</p>
263    pub fn get_user_type(&self) -> &::std::option::Option<::std::string::String> {
264        self.inner.get_user_type()
265    }
266    /// <p>A string containing the title of the user. Possible values are left unspecified. The value can vary based on your specific use case.</p>
267    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268        self.inner = self.inner.title(input.into());
269        self
270    }
271    /// <p>A string containing the title of the user. Possible values are left unspecified. The value can vary based on your specific use case.</p>
272    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
273        self.inner = self.inner.set_title(input);
274        self
275    }
276    /// <p>A string containing the title of the user. Possible values are left unspecified. The value can vary based on your specific use case.</p>
277    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
278        self.inner.get_title()
279    }
280    /// <p>A string containing the preferred language of the user. For example, "American English" or "en-us."</p>
281    pub fn preferred_language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282        self.inner = self.inner.preferred_language(input.into());
283        self
284    }
285    /// <p>A string containing the preferred language of the user. For example, "American English" or "en-us."</p>
286    pub fn set_preferred_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287        self.inner = self.inner.set_preferred_language(input);
288        self
289    }
290    /// <p>A string containing the preferred language of the user. For example, "American English" or "en-us."</p>
291    pub fn get_preferred_language(&self) -> &::std::option::Option<::std::string::String> {
292        self.inner.get_preferred_language()
293    }
294    /// <p>A string containing the geographical region or location of the user.</p>
295    pub fn locale(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296        self.inner = self.inner.locale(input.into());
297        self
298    }
299    /// <p>A string containing the geographical region or location of the user.</p>
300    pub fn set_locale(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301        self.inner = self.inner.set_locale(input);
302        self
303    }
304    /// <p>A string containing the geographical region or location of the user.</p>
305    pub fn get_locale(&self) -> &::std::option::Option<::std::string::String> {
306        self.inner.get_locale()
307    }
308    /// <p>A string containing the time zone of the user.</p>
309    pub fn timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
310        self.inner = self.inner.timezone(input.into());
311        self
312    }
313    /// <p>A string containing the time zone of the user.</p>
314    pub fn set_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315        self.inner = self.inner.set_timezone(input);
316        self
317    }
318    /// <p>A string containing the time zone of the user.</p>
319    pub fn get_timezone(&self) -> &::std::option::Option<::std::string::String> {
320        self.inner.get_timezone()
321    }
322    ///
323    /// Appends an item to `Photos`.
324    ///
325    /// To override the contents of this collection use [`set_photos`](Self::set_photos).
326    ///
327    /// <p>A list of photos associated with the user. You can add up to 3 photos per user. Each photo can include a value, type, display name, and primary designation.</p>
328    pub fn photos(mut self, input: crate::types::Photo) -> Self {
329        self.inner = self.inner.photos(input);
330        self
331    }
332    /// <p>A list of photos associated with the user. You can add up to 3 photos per user. Each photo can include a value, type, display name, and primary designation.</p>
333    pub fn set_photos(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Photo>>) -> Self {
334        self.inner = self.inner.set_photos(input);
335        self
336    }
337    /// <p>A list of photos associated with the user. You can add up to 3 photos per user. Each photo can include a value, type, display name, and primary designation.</p>
338    pub fn get_photos(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Photo>> {
339        self.inner.get_photos()
340    }
341    /// <p>The user's personal website or blog URL. This field allows users to provide a link to their personal or professional website.</p>
342    pub fn website(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
343        self.inner = self.inner.website(input.into());
344        self
345    }
346    /// <p>The user's personal website or blog URL. This field allows users to provide a link to their personal or professional website.</p>
347    pub fn set_website(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
348        self.inner = self.inner.set_website(input);
349        self
350    }
351    /// <p>The user's personal website or blog URL. This field allows users to provide a link to their personal or professional website.</p>
352    pub fn get_website(&self) -> &::std::option::Option<::std::string::String> {
353        self.inner.get_website()
354    }
355    /// <p>The user's birthdate in YYYY-MM-DD format. This field supports standard date format for storing personal information.</p>
356    pub fn birthdate(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
357        self.inner = self.inner.birthdate(input.into());
358        self
359    }
360    /// <p>The user's birthdate in YYYY-MM-DD format. This field supports standard date format for storing personal information.</p>
361    pub fn set_birthdate(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
362        self.inner = self.inner.set_birthdate(input);
363        self
364    }
365    /// <p>The user's birthdate in YYYY-MM-DD format. This field supports standard date format for storing personal information.</p>
366    pub fn get_birthdate(&self) -> &::std::option::Option<::std::string::String> {
367        self.inner.get_birthdate()
368    }
369}