aws_sdk_appstream/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 new user in the user pool.</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 email address of the user.</p><note>
112    /// <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>
113    /// </note>
114    pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.user_name(input.into());
116        self
117    }
118    /// <p>The email address of the user.</p><note>
119    /// <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>
120    /// </note>
121    pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_user_name(input);
123        self
124    }
125    /// <p>The email address of the user.</p><note>
126    /// <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>
127    /// </note>
128    pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_user_name()
130    }
131    /// <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>
132    /// <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>
133    /// </note>
134    pub fn message_action(mut self, input: crate::types::MessageAction) -> Self {
135        self.inner = self.inner.message_action(input);
136        self
137    }
138    /// <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>
139    /// <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>
140    /// </note>
141    pub fn set_message_action(mut self, input: ::std::option::Option<crate::types::MessageAction>) -> Self {
142        self.inner = self.inner.set_message_action(input);
143        self
144    }
145    /// <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>
146    /// <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>
147    /// </note>
148    pub fn get_message_action(&self) -> &::std::option::Option<crate::types::MessageAction> {
149        self.inner.get_message_action()
150    }
151    /// <p>The first name, or given name, of the user.</p>
152    pub fn first_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.first_name(input.into());
154        self
155    }
156    /// <p>The first name, or given name, of the user.</p>
157    pub fn set_first_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_first_name(input);
159        self
160    }
161    /// <p>The first name, or given name, of the user.</p>
162    pub fn get_first_name(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_first_name()
164    }
165    /// <p>The last name, or surname, of the user.</p>
166    pub fn last_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.last_name(input.into());
168        self
169    }
170    /// <p>The last name, or surname, of the user.</p>
171    pub fn set_last_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_last_name(input);
173        self
174    }
175    /// <p>The last name, or surname, of the user.</p>
176    pub fn get_last_name(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_last_name()
178    }
179    /// <p>The authentication type for the user. You must specify USERPOOL.</p>
180    pub fn authentication_type(mut self, input: crate::types::AuthenticationType) -> Self {
181        self.inner = self.inner.authentication_type(input);
182        self
183    }
184    /// <p>The authentication type for the user. You must specify USERPOOL.</p>
185    pub fn set_authentication_type(mut self, input: ::std::option::Option<crate::types::AuthenticationType>) -> Self {
186        self.inner = self.inner.set_authentication_type(input);
187        self
188    }
189    /// <p>The authentication type for the user. You must specify USERPOOL.</p>
190    pub fn get_authentication_type(&self) -> &::std::option::Option<crate::types::AuthenticationType> {
191        self.inner.get_authentication_type()
192    }
193}