aws_sdk_cognitoidentity/operation/create_identity_pool/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_identity_pool::_create_identity_pool_output::CreateIdentityPoolOutputBuilder;
3
4pub use crate::operation::create_identity_pool::_create_identity_pool_input::CreateIdentityPoolInputBuilder;
5
6impl crate::operation::create_identity_pool::builders::CreateIdentityPoolInputBuilder {
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_identity_pool::CreateIdentityPoolOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_identity_pool::CreateIdentityPoolError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_identity_pool();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateIdentityPool`.
24///
25/// <p>Creates a new identity pool. The identity pool is a store of user identity information that is specific to your Amazon Web Services account. The keys for <code>SupportedLoginProviders</code> are as follows:</p>
26/// <ul>
27/// <li>
28/// <p>Facebook: <code>graph.facebook.com</code></p></li>
29/// <li>
30/// <p>Google: <code>accounts.google.com</code></p></li>
31/// <li>
32/// <p>Sign in With Apple: <code>appleid.apple.com</code></p></li>
33/// <li>
34/// <p>Amazon: <code>www.amazon.com</code></p></li>
35/// <li>
36/// <p>Twitter: <code>api.twitter.com</code></p></li>
37/// <li>
38/// <p>Digits: <code>www.digits.com</code></p></li>
39/// </ul><important>
40/// <p>If you don't provide a value for a parameter, Amazon Cognito sets it to its default value.</p>
41/// </important>
42/// <p>You must use Amazon Web Services developer credentials to call this operation.</p>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct CreateIdentityPoolFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::create_identity_pool::builders::CreateIdentityPoolInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50    crate::client::customize::internal::CustomizableSend<
51        crate::operation::create_identity_pool::CreateIdentityPoolOutput,
52        crate::operation::create_identity_pool::CreateIdentityPoolError,
53    > for CreateIdentityPoolFluentBuilder
54{
55    fn send(
56        self,
57        config_override: crate::config::Builder,
58    ) -> crate::client::customize::internal::BoxFuture<
59        crate::client::customize::internal::SendResult<
60            crate::operation::create_identity_pool::CreateIdentityPoolOutput,
61            crate::operation::create_identity_pool::CreateIdentityPoolError,
62        >,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl CreateIdentityPoolFluentBuilder {
68    /// Creates a new `CreateIdentityPoolFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the CreateIdentityPool as a reference.
77    pub fn as_input(&self) -> &crate::operation::create_identity_pool::builders::CreateIdentityPoolInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::create_identity_pool::CreateIdentityPoolOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::create_identity_pool::CreateIdentityPoolError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::create_identity_pool::CreateIdentityPool::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::create_identity_pool::CreateIdentityPool::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::create_identity_pool::CreateIdentityPoolOutput,
114        crate::operation::create_identity_pool::CreateIdentityPoolError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>A string that you provide.</p>
129    pub fn identity_pool_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.identity_pool_name(input.into());
131        self
132    }
133    /// <p>A string that you provide.</p>
134    pub fn set_identity_pool_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_identity_pool_name(input);
136        self
137    }
138    /// <p>A string that you provide.</p>
139    pub fn get_identity_pool_name(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_identity_pool_name()
141    }
142    /// <p>TRUE if the identity pool supports unauthenticated logins.</p>
143    pub fn allow_unauthenticated_identities(mut self, input: bool) -> Self {
144        self.inner = self.inner.allow_unauthenticated_identities(input);
145        self
146    }
147    /// <p>TRUE if the identity pool supports unauthenticated logins.</p>
148    pub fn set_allow_unauthenticated_identities(mut self, input: ::std::option::Option<bool>) -> Self {
149        self.inner = self.inner.set_allow_unauthenticated_identities(input);
150        self
151    }
152    /// <p>TRUE if the identity pool supports unauthenticated logins.</p>
153    pub fn get_allow_unauthenticated_identities(&self) -> &::std::option::Option<bool> {
154        self.inner.get_allow_unauthenticated_identities()
155    }
156    /// <p>Enables or disables the Basic (Classic) authentication flow. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html">Identity Pools (Federated Identities) Authentication Flow</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
157    pub fn allow_classic_flow(mut self, input: bool) -> Self {
158        self.inner = self.inner.allow_classic_flow(input);
159        self
160    }
161    /// <p>Enables or disables the Basic (Classic) authentication flow. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html">Identity Pools (Federated Identities) Authentication Flow</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
162    pub fn set_allow_classic_flow(mut self, input: ::std::option::Option<bool>) -> Self {
163        self.inner = self.inner.set_allow_classic_flow(input);
164        self
165    }
166    /// <p>Enables or disables the Basic (Classic) authentication flow. For more information, see <a href="https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html">Identity Pools (Federated Identities) Authentication Flow</a> in the <i>Amazon Cognito Developer Guide</i>.</p>
167    pub fn get_allow_classic_flow(&self) -> &::std::option::Option<bool> {
168        self.inner.get_allow_classic_flow()
169    }
170    ///
171    /// Adds a key-value pair to `SupportedLoginProviders`.
172    ///
173    /// To override the contents of this collection use [`set_supported_login_providers`](Self::set_supported_login_providers).
174    ///
175    /// <p>Optional key:value pairs mapping provider names to provider app IDs.</p>
176    pub fn supported_login_providers(
177        mut self,
178        k: impl ::std::convert::Into<::std::string::String>,
179        v: impl ::std::convert::Into<::std::string::String>,
180    ) -> Self {
181        self.inner = self.inner.supported_login_providers(k.into(), v.into());
182        self
183    }
184    /// <p>Optional key:value pairs mapping provider names to provider app IDs.</p>
185    pub fn set_supported_login_providers(
186        mut self,
187        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
188    ) -> Self {
189        self.inner = self.inner.set_supported_login_providers(input);
190        self
191    }
192    /// <p>Optional key:value pairs mapping provider names to provider app IDs.</p>
193    pub fn get_supported_login_providers(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
194        self.inner.get_supported_login_providers()
195    }
196    /// <p>The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider. For the <code>DeveloperProviderName</code>, you can use letters as well as period (<code>.</code>), underscore (<code>_</code>), and dash (<code>-</code>).</p>
197    /// <p>Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.</p>
198    pub fn developer_provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199        self.inner = self.inner.developer_provider_name(input.into());
200        self
201    }
202    /// <p>The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider. For the <code>DeveloperProviderName</code>, you can use letters as well as period (<code>.</code>), underscore (<code>_</code>), and dash (<code>-</code>).</p>
203    /// <p>Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.</p>
204    pub fn set_developer_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205        self.inner = self.inner.set_developer_provider_name(input);
206        self
207    }
208    /// <p>The "domain" by which Cognito will refer to your users. This name acts as a placeholder that allows your backend and the Cognito service to communicate about the developer provider. For the <code>DeveloperProviderName</code>, you can use letters as well as period (<code>.</code>), underscore (<code>_</code>), and dash (<code>-</code>).</p>
209    /// <p>Once you have set a developer provider name, you cannot change it. Please take care in setting this parameter.</p>
210    pub fn get_developer_provider_name(&self) -> &::std::option::Option<::std::string::String> {
211        self.inner.get_developer_provider_name()
212    }
213    ///
214    /// Appends an item to `OpenIdConnectProviderARNs`.
215    ///
216    /// To override the contents of this collection use [`set_open_id_connect_provider_arns`](Self::set_open_id_connect_provider_arns).
217    ///
218    /// <p>The Amazon Resource Names (ARN) of the OpenID Connect providers.</p>
219    pub fn open_id_connect_provider_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.inner = self.inner.open_id_connect_provider_arns(input.into());
221        self
222    }
223    /// <p>The Amazon Resource Names (ARN) of the OpenID Connect providers.</p>
224    pub fn set_open_id_connect_provider_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
225        self.inner = self.inner.set_open_id_connect_provider_arns(input);
226        self
227    }
228    /// <p>The Amazon Resource Names (ARN) of the OpenID Connect providers.</p>
229    pub fn get_open_id_connect_provider_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
230        self.inner.get_open_id_connect_provider_arns()
231    }
232    ///
233    /// Appends an item to `CognitoIdentityProviders`.
234    ///
235    /// To override the contents of this collection use [`set_cognito_identity_providers`](Self::set_cognito_identity_providers).
236    ///
237    /// <p>An array of Amazon Cognito user pools and their client IDs.</p>
238    pub fn cognito_identity_providers(mut self, input: crate::types::CognitoIdentityProvider) -> Self {
239        self.inner = self.inner.cognito_identity_providers(input);
240        self
241    }
242    /// <p>An array of Amazon Cognito user pools and their client IDs.</p>
243    pub fn set_cognito_identity_providers(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CognitoIdentityProvider>>) -> Self {
244        self.inner = self.inner.set_cognito_identity_providers(input);
245        self
246    }
247    /// <p>An array of Amazon Cognito user pools and their client IDs.</p>
248    pub fn get_cognito_identity_providers(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CognitoIdentityProvider>> {
249        self.inner.get_cognito_identity_providers()
250    }
251    ///
252    /// Appends an item to `SamlProviderARNs`.
253    ///
254    /// To override the contents of this collection use [`set_saml_provider_arns`](Self::set_saml_provider_arns).
255    ///
256    /// <p>An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.</p>
257    pub fn saml_provider_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258        self.inner = self.inner.saml_provider_arns(input.into());
259        self
260    }
261    /// <p>An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.</p>
262    pub fn set_saml_provider_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
263        self.inner = self.inner.set_saml_provider_arns(input);
264        self
265    }
266    /// <p>An array of Amazon Resource Names (ARNs) of the SAML provider for your identity pool.</p>
267    pub fn get_saml_provider_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
268        self.inner.get_saml_provider_arns()
269    }
270    ///
271    /// Adds a key-value pair to `IdentityPoolTags`.
272    ///
273    /// To override the contents of this collection use [`set_identity_pool_tags`](Self::set_identity_pool_tags).
274    ///
275    /// <p>Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.</p>
276    pub fn identity_pool_tags(
277        mut self,
278        k: impl ::std::convert::Into<::std::string::String>,
279        v: impl ::std::convert::Into<::std::string::String>,
280    ) -> Self {
281        self.inner = self.inner.identity_pool_tags(k.into(), v.into());
282        self
283    }
284    /// <p>Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.</p>
285    pub fn set_identity_pool_tags(
286        mut self,
287        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
288    ) -> Self {
289        self.inner = self.inner.set_identity_pool_tags(input);
290        self
291    }
292    /// <p>Tags to assign to the identity pool. A tag is a label that you can apply to identity pools to categorize and manage them in different ways, such as by purpose, owner, environment, or other criteria.</p>
293    pub fn get_identity_pool_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
294        self.inner.get_identity_pool_tags()
295    }
296}