aws_sdk_cognitoidentityprovider/operation/create_user_pool_domain/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_user_pool_domain::_create_user_pool_domain_output::CreateUserPoolDomainOutputBuilder;
3
4pub use crate::operation::create_user_pool_domain::_create_user_pool_domain_input::CreateUserPoolDomainInputBuilder;
5
6impl crate::operation::create_user_pool_domain::builders::CreateUserPoolDomainInputBuilder {
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_pool_domain::CreateUserPoolDomainOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_user_pool_domain::CreateUserPoolDomainError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_user_pool_domain();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateUserPoolDomain`.
24///
25/// <p>A user pool domain hosts managed login, an authorization server and web server for authentication in your application. This operation creates a new user pool prefix domain or custom domain and sets the managed login branding version. Set the branding version to <code>1</code> for hosted UI (classic) or <code>2</code> for managed login. When you choose a custom domain, you must provide an SSL certificate in the US East (N. Virginia) Amazon Web Services Region in your request.</p>
26/// <p>Your prefix domain might take up to one minute to take effect. Your custom domain is online within five minutes, but it can take up to one hour to distribute your SSL certificate.</p>
27/// <p>For more information about adding a custom domain to your user pool, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html">Configuring a user pool domain</a>.</p><note>
28/// <p>Amazon Cognito evaluates Identity and Access Management (IAM) policies in requests for this API operation. For this operation, you must use IAM credentials to authorize requests, and you must grant yourself the corresponding IAM permission in a policy.</p>
29/// <p class="title"><b>Learn more</b></p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-signing.html">Signing Amazon Web Services API Requests</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/cognito/latest/developerguide/user-pools-API-operations.html">Using the Amazon Cognito user pools API and user pool endpoints</a></p></li>
35/// </ul>
36/// </note>
37#[derive(::std::clone::Clone, ::std::fmt::Debug)]
38pub struct CreateUserPoolDomainFluentBuilder {
39 handle: ::std::sync::Arc<crate::client::Handle>,
40 inner: crate::operation::create_user_pool_domain::builders::CreateUserPoolDomainInputBuilder,
41 config_override: ::std::option::Option<crate::config::Builder>,
42}
43impl
44 crate::client::customize::internal::CustomizableSend<
45 crate::operation::create_user_pool_domain::CreateUserPoolDomainOutput,
46 crate::operation::create_user_pool_domain::CreateUserPoolDomainError,
47 > for CreateUserPoolDomainFluentBuilder
48{
49 fn send(
50 self,
51 config_override: crate::config::Builder,
52 ) -> crate::client::customize::internal::BoxFuture<
53 crate::client::customize::internal::SendResult<
54 crate::operation::create_user_pool_domain::CreateUserPoolDomainOutput,
55 crate::operation::create_user_pool_domain::CreateUserPoolDomainError,
56 >,
57 > {
58 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
59 }
60}
61impl CreateUserPoolDomainFluentBuilder {
62 /// Creates a new `CreateUserPoolDomainFluentBuilder`.
63 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
64 Self {
65 handle,
66 inner: ::std::default::Default::default(),
67 config_override: ::std::option::Option::None,
68 }
69 }
70 /// Access the CreateUserPoolDomain as a reference.
71 pub fn as_input(&self) -> &crate::operation::create_user_pool_domain::builders::CreateUserPoolDomainInputBuilder {
72 &self.inner
73 }
74 /// Sends the request and returns the response.
75 ///
76 /// If an error occurs, an `SdkError` will be returned with additional details that
77 /// can be matched against.
78 ///
79 /// By default, any retryable failures will be retried twice. Retry behavior
80 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
81 /// set when configuring the client.
82 pub async fn send(
83 self,
84 ) -> ::std::result::Result<
85 crate::operation::create_user_pool_domain::CreateUserPoolDomainOutput,
86 ::aws_smithy_runtime_api::client::result::SdkError<
87 crate::operation::create_user_pool_domain::CreateUserPoolDomainError,
88 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
89 >,
90 > {
91 let input = self
92 .inner
93 .build()
94 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
95 let runtime_plugins = crate::operation::create_user_pool_domain::CreateUserPoolDomain::operation_runtime_plugins(
96 self.handle.runtime_plugins.clone(),
97 &self.handle.conf,
98 self.config_override,
99 );
100 crate::operation::create_user_pool_domain::CreateUserPoolDomain::orchestrate(&runtime_plugins, input).await
101 }
102
103 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
104 pub fn customize(
105 self,
106 ) -> crate::client::customize::CustomizableOperation<
107 crate::operation::create_user_pool_domain::CreateUserPoolDomainOutput,
108 crate::operation::create_user_pool_domain::CreateUserPoolDomainError,
109 Self,
110 > {
111 crate::client::customize::CustomizableOperation::new(self)
112 }
113 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
114 self.set_config_override(::std::option::Option::Some(config_override.into()));
115 self
116 }
117
118 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
119 self.config_override = config_override;
120 self
121 }
122 /// <p>The domain string. For custom domains, this is the fully-qualified domain name, such as <code>auth.example.com</code>. For prefix domains, this is the prefix alone, such as <code>myprefix</code>. A prefix value of <code>myprefix</code> for a user pool in the <code>us-east-1</code> Region results in a domain of <code>myprefix.auth.us-east-1.amazoncognito.com</code>.</p>
123 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.inner = self.inner.domain(input.into());
125 self
126 }
127 /// <p>The domain string. For custom domains, this is the fully-qualified domain name, such as <code>auth.example.com</code>. For prefix domains, this is the prefix alone, such as <code>myprefix</code>. A prefix value of <code>myprefix</code> for a user pool in the <code>us-east-1</code> Region results in a domain of <code>myprefix.auth.us-east-1.amazoncognito.com</code>.</p>
128 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.inner = self.inner.set_domain(input);
130 self
131 }
132 /// <p>The domain string. For custom domains, this is the fully-qualified domain name, such as <code>auth.example.com</code>. For prefix domains, this is the prefix alone, such as <code>myprefix</code>. A prefix value of <code>myprefix</code> for a user pool in the <code>us-east-1</code> Region results in a domain of <code>myprefix.auth.us-east-1.amazoncognito.com</code>.</p>
133 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
134 self.inner.get_domain()
135 }
136 /// <p>The ID of the user pool where you want to add a domain.</p>
137 pub fn user_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.inner = self.inner.user_pool_id(input.into());
139 self
140 }
141 /// <p>The ID of the user pool where you want to add a domain.</p>
142 pub fn set_user_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.inner = self.inner.set_user_pool_id(input);
144 self
145 }
146 /// <p>The ID of the user pool where you want to add a domain.</p>
147 pub fn get_user_pool_id(&self) -> &::std::option::Option<::std::string::String> {
148 self.inner.get_user_pool_id()
149 }
150 /// <p>The version of managed login branding that you want to apply to your domain. A value of <code>1</code> indicates hosted UI (classic) and a version of <code>2</code> indicates managed login.</p>
151 /// <p>Managed login requires that your user pool be configured for any <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-sign-in-feature-plans.html">feature plan</a> other than <code>Lite</code>.</p>
152 pub fn managed_login_version(mut self, input: i32) -> Self {
153 self.inner = self.inner.managed_login_version(input);
154 self
155 }
156 /// <p>The version of managed login branding that you want to apply to your domain. A value of <code>1</code> indicates hosted UI (classic) and a version of <code>2</code> indicates managed login.</p>
157 /// <p>Managed login requires that your user pool be configured for any <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-sign-in-feature-plans.html">feature plan</a> other than <code>Lite</code>.</p>
158 pub fn set_managed_login_version(mut self, input: ::std::option::Option<i32>) -> Self {
159 self.inner = self.inner.set_managed_login_version(input);
160 self
161 }
162 /// <p>The version of managed login branding that you want to apply to your domain. A value of <code>1</code> indicates hosted UI (classic) and a version of <code>2</code> indicates managed login.</p>
163 /// <p>Managed login requires that your user pool be configured for any <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-sign-in-feature-plans.html">feature plan</a> other than <code>Lite</code>.</p>
164 pub fn get_managed_login_version(&self) -> &::std::option::Option<i32> {
165 self.inner.get_managed_login_version()
166 }
167 /// <p>The configuration for a custom domain. Configures your domain with an Certificate Manager certificate in the <code>us-east-1</code> Region.</p>
168 /// <p>Provide this parameter only if you want to use a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html">custom domain</a> for your user pool. Otherwise, you can omit this parameter and use a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-assign-domain-prefix.html">prefix domain</a> instead.</p>
169 /// <p>When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain.</p>
170 pub fn custom_domain_config(mut self, input: crate::types::CustomDomainConfigType) -> Self {
171 self.inner = self.inner.custom_domain_config(input);
172 self
173 }
174 /// <p>The configuration for a custom domain. Configures your domain with an Certificate Manager certificate in the <code>us-east-1</code> Region.</p>
175 /// <p>Provide this parameter only if you want to use a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html">custom domain</a> for your user pool. Otherwise, you can omit this parameter and use a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-assign-domain-prefix.html">prefix domain</a> instead.</p>
176 /// <p>When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain.</p>
177 pub fn set_custom_domain_config(mut self, input: ::std::option::Option<crate::types::CustomDomainConfigType>) -> Self {
178 self.inner = self.inner.set_custom_domain_config(input);
179 self
180 }
181 /// <p>The configuration for a custom domain. Configures your domain with an Certificate Manager certificate in the <code>us-east-1</code> Region.</p>
182 /// <p>Provide this parameter only if you want to use a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-add-custom-domain.html">custom domain</a> for your user pool. Otherwise, you can omit this parameter and use a <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-assign-domain-prefix.html">prefix domain</a> instead.</p>
183 /// <p>When you create a custom domain, the passkey RP ID defaults to the custom domain. If you had a prefix domain active, this will cause passkey integration for your prefix domain to stop working due to a mismatch in RP ID. To keep the prefix domain passkey integration working, you can explicitly set RP ID to the prefix domain.</p>
184 pub fn get_custom_domain_config(&self) -> &::std::option::Option<crate::types::CustomDomainConfigType> {
185 self.inner.get_custom_domain_config()
186 }
187}