aws_sdk_cognitosync/operation/get_identity_pool_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_identity_pool_configuration::_get_identity_pool_configuration_output::GetIdentityPoolConfigurationOutputBuilder;
3
4pub use crate::operation::get_identity_pool_configuration::_get_identity_pool_configuration_input::GetIdentityPoolConfigurationInputBuilder;
5
6impl crate::operation::get_identity_pool_configuration::builders::GetIdentityPoolConfigurationInputBuilder {
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_identity_pool_configuration::GetIdentityPoolConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_identity_pool_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetIdentityPoolConfiguration`.
24///
25/// <p>Gets the configuration settings of an identity pool.</p>
26/// <p>This API can only be called with developer credentials. You cannot call this API with the temporary user credentials provided by Cognito Identity.</p><examples>
27/// <example>
28/// <name>
29/// GetIdentityPoolConfiguration
30/// </name>
31/// <description>
32/// The following examples have been edited for readability.
33/// </description>
34/// <request>
35/// POST / HTTP/1.1 CONTENT-TYPE: application/json X-AMZN-REQUESTID: b1cfdd4b-f620-4fe4-be0f-02024a1d33da X-AMZ-TARGET: com.amazonaws.cognito.sync.model.AWSCognitoSyncService.GetIdentityPoolConfiguration HOST: cognito-sync.us-east-1.amazonaws.com X-AMZ-DATE: 20141004T195722Z AUTHORIZATION: AWS4-HMAC-SHA256 Credential=
36/// <credential>
37/// , SignedHeaders=content-type;content-length;host;x-amz-date;x-amz-target, Signature=
38/// <signature>
39/// { "Operation": "com.amazonaws.cognito.sync.model#GetIdentityPoolConfiguration", "Service": "com.amazonaws.cognito.sync.model#AWSCognitoSyncService", "Input": { "IdentityPoolId": "ID_POOL_ID" } }
40/// </signature>
41/// </credential>
42/// </request>
43/// <response>
44/// 1.1 200 OK x-amzn-requestid: b1cfdd4b-f620-4fe4-be0f-02024a1d33da date: Sat, 04 Oct 2014 19:57:22 GMT content-type: application/json content-length: 332 { "Output": { "__type": "com.amazonaws.cognito.sync.model#GetIdentityPoolConfigurationResponse", "IdentityPoolId": "ID_POOL_ID", "PushSync": { "ApplicationArns": \["PLATFORMARN1", "PLATFORMARN2"\], "RoleArn": "ROLEARN" } }, "Version": "1.0" }
45/// </response>
46/// </example>
47/// </examples>
48#[derive(::std::clone::Clone, ::std::fmt::Debug)]
49pub struct GetIdentityPoolConfigurationFluentBuilder {
50    handle: ::std::sync::Arc<crate::client::Handle>,
51    inner: crate::operation::get_identity_pool_configuration::builders::GetIdentityPoolConfigurationInputBuilder,
52    config_override: ::std::option::Option<crate::config::Builder>,
53}
54impl
55    crate::client::customize::internal::CustomizableSend<
56        crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationOutput,
57        crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationError,
58    > for GetIdentityPoolConfigurationFluentBuilder
59{
60    fn send(
61        self,
62        config_override: crate::config::Builder,
63    ) -> crate::client::customize::internal::BoxFuture<
64        crate::client::customize::internal::SendResult<
65            crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationOutput,
66            crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationError,
67        >,
68    > {
69        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
70    }
71}
72impl GetIdentityPoolConfigurationFluentBuilder {
73    /// Creates a new `GetIdentityPoolConfigurationFluentBuilder`.
74    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
75        Self {
76            handle,
77            inner: ::std::default::Default::default(),
78            config_override: ::std::option::Option::None,
79        }
80    }
81    /// Access the GetIdentityPoolConfiguration as a reference.
82    pub fn as_input(&self) -> &crate::operation::get_identity_pool_configuration::builders::GetIdentityPoolConfigurationInputBuilder {
83        &self.inner
84    }
85    /// Sends the request and returns the response.
86    ///
87    /// If an error occurs, an `SdkError` will be returned with additional details that
88    /// can be matched against.
89    ///
90    /// By default, any retryable failures will be retried twice. Retry behavior
91    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
92    /// set when configuring the client.
93    pub async fn send(
94        self,
95    ) -> ::std::result::Result<
96        crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationOutput,
97        ::aws_smithy_runtime_api::client::result::SdkError<
98            crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationError,
99            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
100        >,
101    > {
102        let input = self
103            .inner
104            .build()
105            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
106        let runtime_plugins = crate::operation::get_identity_pool_configuration::GetIdentityPoolConfiguration::operation_runtime_plugins(
107            self.handle.runtime_plugins.clone(),
108            &self.handle.conf,
109            self.config_override,
110        );
111        crate::operation::get_identity_pool_configuration::GetIdentityPoolConfiguration::orchestrate(&runtime_plugins, input).await
112    }
113
114    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
115    pub fn customize(
116        self,
117    ) -> crate::client::customize::CustomizableOperation<
118        crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationOutput,
119        crate::operation::get_identity_pool_configuration::GetIdentityPoolConfigurationError,
120        Self,
121    > {
122        crate::client::customize::CustomizableOperation::new(self)
123    }
124    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
125        self.set_config_override(::std::option::Option::Some(config_override.into()));
126        self
127    }
128
129    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
130        self.config_override = config_override;
131        self
132    }
133    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool for which to return a configuration.</p>
134    pub fn identity_pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.identity_pool_id(input.into());
136        self
137    }
138    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool for which to return a configuration.</p>
139    pub fn set_identity_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.inner = self.inner.set_identity_pool_id(input);
141        self
142    }
143    /// <p>A name-spaced GUID (for example, us-east-1:23EC4050-6AEA-7089-A2DD-08002EXAMPLE) created by Amazon Cognito. This is the ID of the pool for which to return a configuration.</p>
144    pub fn get_identity_pool_id(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_identity_pool_id()
146    }
147}