aws_sdk_cognitoidentity/operation/get_id/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_id::_get_id_output::GetIdOutputBuilder;
3
4pub use crate::operation::get_id::_get_id_input::GetIdInputBuilder;
5
6impl crate::operation::get_id::builders::GetIdInputBuilder {
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::get_id::GetIdOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_id::GetIdError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_id();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetId`.
24///
25/// <p>Generates (or retrieves) IdentityID. Supplying multiple logins will create an implicit linked account.</p>
26/// <p>This is a public API. You do not need any credentials to call this API.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct GetIdFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::get_id::builders::GetIdInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl crate::client::customize::internal::CustomizableSend<crate::operation::get_id::GetIdOutput, crate::operation::get_id::GetIdError>
34    for GetIdFluentBuilder
35{
36    fn send(
37        self,
38        config_override: crate::config::Builder,
39    ) -> crate::client::customize::internal::BoxFuture<
40        crate::client::customize::internal::SendResult<crate::operation::get_id::GetIdOutput, crate::operation::get_id::GetIdError>,
41    > {
42        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
43    }
44}
45impl GetIdFluentBuilder {
46    /// Creates a new `GetIdFluentBuilder`.
47    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
48        Self {
49            handle,
50            inner: ::std::default::Default::default(),
51            config_override: ::std::option::Option::None,
52        }
53    }
54    /// Access the GetId as a reference.
55    pub fn as_input(&self) -> &crate::operation::get_id::builders::GetIdInputBuilder {
56        &self.inner
57    }
58    /// Sends the request and returns the response.
59    ///
60    /// If an error occurs, an `SdkError` will be returned with additional details that
61    /// can be matched against.
62    ///
63    /// By default, any retryable failures will be retried twice. Retry behavior
64    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
65    /// set when configuring the client.
66    pub async fn send(
67        self,
68    ) -> ::std::result::Result<
69        crate::operation::get_id::GetIdOutput,
70        ::aws_smithy_runtime_api::client::result::SdkError<
71            crate::operation::get_id::GetIdError,
72            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
73        >,
74    > {
75        let input = self
76            .inner
77            .build()
78            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
79        let runtime_plugins =
80            crate::operation::get_id::GetId::operation_runtime_plugins(self.handle.runtime_plugins.clone(), &self.handle.conf, self.config_override);
81        crate::operation::get_id::GetId::orchestrate(&runtime_plugins, input).await
82    }
83
84    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
85    pub fn customize(
86        self,
87    ) -> crate::client::customize::CustomizableOperation<crate::operation::get_id::GetIdOutput, crate::operation::get_id::GetIdError, Self> {
88        crate::client::customize::CustomizableOperation::new(self)
89    }
90    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
91        self.set_config_override(::std::option::Option::Some(config_override.into()));
92        self
93    }
94
95    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
96        self.config_override = config_override;
97        self
98    }
99    /// <p>A standard Amazon Web Services account ID (9+ digits).</p>
100    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.inner = self.inner.account_id(input.into());
102        self
103    }
104    /// <p>A standard Amazon Web Services account ID (9+ digits).</p>
105    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.inner = self.inner.set_account_id(input);
107        self
108    }
109    /// <p>A standard Amazon Web Services account ID (9+ digits).</p>
110    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
111        self.inner.get_account_id()
112    }
113    /// <p>An identity pool ID in the format REGION:GUID.</p>
114    pub fn identity_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.identity_pool_id(input.into());
116        self
117    }
118    /// <p>An identity pool ID in the format REGION:GUID.</p>
119    pub fn set_identity_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_identity_pool_id(input);
121        self
122    }
123    /// <p>An identity pool ID in the format REGION:GUID.</p>
124    pub fn get_identity_pool_id(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_identity_pool_id()
126    }
127    ///
128    /// Adds a key-value pair to `Logins`.
129    ///
130    /// To override the contents of this collection use [`set_logins`](Self::set_logins).
131    ///
132    /// <p>A set of optional name-value pairs that map provider names to provider tokens. The available provider names for <code>Logins</code> are as follows:</p>
133    /// <ul>
134    /// <li>
135    /// <p>Facebook: <code>graph.facebook.com</code></p></li>
136    /// <li>
137    /// <p>Amazon Cognito user pool: <code>cognito-idp.<region>
138    /// .amazonaws.com/
139    /// <your_user_pool_id></your_user_pool_id>
140    /// </region></code>, for example, <code>cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789</code>.</p></li>
141    /// <li>
142    /// <p>Google: <code>accounts.google.com</code></p></li>
143    /// <li>
144    /// <p>Amazon: <code>www.amazon.com</code></p></li>
145    /// <li>
146    /// <p>Twitter: <code>api.twitter.com</code></p></li>
147    /// <li>
148    /// <p>Digits: <code>www.digits.com</code></p></li>
149    /// </ul>
150    pub fn logins(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.logins(k.into(), v.into());
152        self
153    }
154    /// <p>A set of optional name-value pairs that map provider names to provider tokens. The available provider names for <code>Logins</code> are as follows:</p>
155    /// <ul>
156    /// <li>
157    /// <p>Facebook: <code>graph.facebook.com</code></p></li>
158    /// <li>
159    /// <p>Amazon Cognito user pool: <code>cognito-idp.<region>
160    /// .amazonaws.com/
161    /// <your_user_pool_id></your_user_pool_id>
162    /// </region></code>, for example, <code>cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789</code>.</p></li>
163    /// <li>
164    /// <p>Google: <code>accounts.google.com</code></p></li>
165    /// <li>
166    /// <p>Amazon: <code>www.amazon.com</code></p></li>
167    /// <li>
168    /// <p>Twitter: <code>api.twitter.com</code></p></li>
169    /// <li>
170    /// <p>Digits: <code>www.digits.com</code></p></li>
171    /// </ul>
172    pub fn set_logins(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
173        self.inner = self.inner.set_logins(input);
174        self
175    }
176    /// <p>A set of optional name-value pairs that map provider names to provider tokens. The available provider names for <code>Logins</code> are as follows:</p>
177    /// <ul>
178    /// <li>
179    /// <p>Facebook: <code>graph.facebook.com</code></p></li>
180    /// <li>
181    /// <p>Amazon Cognito user pool: <code>cognito-idp.<region>
182    /// .amazonaws.com/
183    /// <your_user_pool_id></your_user_pool_id>
184    /// </region></code>, for example, <code>cognito-idp.us-east-1.amazonaws.com/us-east-1_123456789</code>.</p></li>
185    /// <li>
186    /// <p>Google: <code>accounts.google.com</code></p></li>
187    /// <li>
188    /// <p>Amazon: <code>www.amazon.com</code></p></li>
189    /// <li>
190    /// <p>Twitter: <code>api.twitter.com</code></p></li>
191    /// <li>
192    /// <p>Digits: <code>www.digits.com</code></p></li>
193    /// </ul>
194    pub fn get_logins(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195        self.inner.get_logins()
196    }
197}