aws_sdk_workspacesweb/operation/create_identity_provider/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_identity_provider::_create_identity_provider_output::CreateIdentityProviderOutputBuilder;
3
4pub use crate::operation::create_identity_provider::_create_identity_provider_input::CreateIdentityProviderInputBuilder;
5
6impl crate::operation::create_identity_provider::builders::CreateIdentityProviderInputBuilder {
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_provider::CreateIdentityProviderOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_identity_provider::CreateIdentityProviderError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_identity_provider();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateIdentityProvider`.
24///
25/// <p>Creates an identity provider resource that is then associated with a web portal.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateIdentityProviderFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_identity_provider::builders::CreateIdentityProviderInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_identity_provider::CreateIdentityProviderOutput,
35        crate::operation::create_identity_provider::CreateIdentityProviderError,
36    > for CreateIdentityProviderFluentBuilder
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_identity_provider::CreateIdentityProviderOutput,
44            crate::operation::create_identity_provider::CreateIdentityProviderError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateIdentityProviderFluentBuilder {
51    /// Creates a new `CreateIdentityProviderFluentBuilder`.
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 CreateIdentityProvider as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_identity_provider::builders::CreateIdentityProviderInputBuilder {
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_identity_provider::CreateIdentityProviderOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_identity_provider::CreateIdentityProviderError,
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_identity_provider::CreateIdentityProvider::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_identity_provider::CreateIdentityProvider::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_identity_provider::CreateIdentityProviderOutput,
97        crate::operation::create_identity_provider::CreateIdentityProviderError,
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 ARN of the web portal.</p>
112    pub fn portal_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.portal_arn(input.into());
114        self
115    }
116    /// <p>The ARN of the web portal.</p>
117    pub fn set_portal_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_portal_arn(input);
119        self
120    }
121    /// <p>The ARN of the web portal.</p>
122    pub fn get_portal_arn(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_portal_arn()
124    }
125    /// <p>The identity provider name.</p>
126    pub fn identity_provider_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.identity_provider_name(input.into());
128        self
129    }
130    /// <p>The identity provider name.</p>
131    pub fn set_identity_provider_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_identity_provider_name(input);
133        self
134    }
135    /// <p>The identity provider name.</p>
136    pub fn get_identity_provider_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_identity_provider_name()
138    }
139    /// <p>The identity provider type.</p>
140    pub fn identity_provider_type(mut self, input: crate::types::IdentityProviderType) -> Self {
141        self.inner = self.inner.identity_provider_type(input);
142        self
143    }
144    /// <p>The identity provider type.</p>
145    pub fn set_identity_provider_type(mut self, input: ::std::option::Option<crate::types::IdentityProviderType>) -> Self {
146        self.inner = self.inner.set_identity_provider_type(input);
147        self
148    }
149    /// <p>The identity provider type.</p>
150    pub fn get_identity_provider_type(&self) -> &::std::option::Option<crate::types::IdentityProviderType> {
151        self.inner.get_identity_provider_type()
152    }
153    ///
154    /// Adds a key-value pair to `identityProviderDetails`.
155    ///
156    /// To override the contents of this collection use [`set_identity_provider_details`](Self::set_identity_provider_details).
157    ///
158    /// <p>The identity provider details. The following list describes the provider detail keys for each identity provider type.</p>
159    /// <ul>
160    /// <li>
161    /// <p>For Google and Login with Amazon:</p>
162    /// <ul>
163    /// <li>
164    /// <p><code>client_id</code></p></li>
165    /// <li>
166    /// <p><code>client_secret</code></p></li>
167    /// <li>
168    /// <p><code>authorize_scopes</code></p></li>
169    /// </ul></li>
170    /// <li>
171    /// <p>For Facebook:</p>
172    /// <ul>
173    /// <li>
174    /// <p><code>client_id</code></p></li>
175    /// <li>
176    /// <p><code>client_secret</code></p></li>
177    /// <li>
178    /// <p><code>authorize_scopes</code></p></li>
179    /// <li>
180    /// <p><code>api_version</code></p></li>
181    /// </ul></li>
182    /// <li>
183    /// <p>For Sign in with Apple:</p>
184    /// <ul>
185    /// <li>
186    /// <p><code>client_id</code></p></li>
187    /// <li>
188    /// <p><code>team_id</code></p></li>
189    /// <li>
190    /// <p><code>key_id</code></p></li>
191    /// <li>
192    /// <p><code>private_key</code></p></li>
193    /// <li>
194    /// <p><code>authorize_scopes</code></p></li>
195    /// </ul></li>
196    /// <li>
197    /// <p>For OIDC providers:</p>
198    /// <ul>
199    /// <li>
200    /// <p><code>client_id</code></p></li>
201    /// <li>
202    /// <p><code>client_secret</code></p></li>
203    /// <li>
204    /// <p><code>attributes_request_method</code></p></li>
205    /// <li>
206    /// <p><code>oidc_issuer</code></p></li>
207    /// <li>
208    /// <p><code>authorize_scopes</code></p></li>
209    /// <li>
210    /// <p><code>authorize_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
211    /// <li>
212    /// <p><code>token_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
213    /// <li>
214    /// <p><code>attributes_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
215    /// <li>
216    /// <p><code>jwks_uri</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
217    /// </ul></li>
218    /// <li>
219    /// <p>For SAML providers:</p>
220    /// <ul>
221    /// <li>
222    /// <p><code>MetadataFile</code> OR <code>MetadataURL</code></p></li>
223    /// <li>
224    /// <p><code>IDPSignout</code> (boolean) <i>optional</i></p></li>
225    /// <li>
226    /// <p><code>IDPInit</code> (boolean) <i>optional</i></p></li>
227    /// <li>
228    /// <p><code>RequestSigningAlgorithm</code> (string) <i>optional</i> - Only accepts <code>rsa-sha256</code></p></li>
229    /// <li>
230    /// <p><code>EncryptedResponses</code> (boolean) <i>optional</i></p></li>
231    /// </ul></li>
232    /// </ul>
233    pub fn identity_provider_details(
234        mut self,
235        k: impl ::std::convert::Into<::std::string::String>,
236        v: impl ::std::convert::Into<::std::string::String>,
237    ) -> Self {
238        self.inner = self.inner.identity_provider_details(k.into(), v.into());
239        self
240    }
241    /// <p>The identity provider details. The following list describes the provider detail keys for each identity provider type.</p>
242    /// <ul>
243    /// <li>
244    /// <p>For Google and Login with Amazon:</p>
245    /// <ul>
246    /// <li>
247    /// <p><code>client_id</code></p></li>
248    /// <li>
249    /// <p><code>client_secret</code></p></li>
250    /// <li>
251    /// <p><code>authorize_scopes</code></p></li>
252    /// </ul></li>
253    /// <li>
254    /// <p>For Facebook:</p>
255    /// <ul>
256    /// <li>
257    /// <p><code>client_id</code></p></li>
258    /// <li>
259    /// <p><code>client_secret</code></p></li>
260    /// <li>
261    /// <p><code>authorize_scopes</code></p></li>
262    /// <li>
263    /// <p><code>api_version</code></p></li>
264    /// </ul></li>
265    /// <li>
266    /// <p>For Sign in with Apple:</p>
267    /// <ul>
268    /// <li>
269    /// <p><code>client_id</code></p></li>
270    /// <li>
271    /// <p><code>team_id</code></p></li>
272    /// <li>
273    /// <p><code>key_id</code></p></li>
274    /// <li>
275    /// <p><code>private_key</code></p></li>
276    /// <li>
277    /// <p><code>authorize_scopes</code></p></li>
278    /// </ul></li>
279    /// <li>
280    /// <p>For OIDC providers:</p>
281    /// <ul>
282    /// <li>
283    /// <p><code>client_id</code></p></li>
284    /// <li>
285    /// <p><code>client_secret</code></p></li>
286    /// <li>
287    /// <p><code>attributes_request_method</code></p></li>
288    /// <li>
289    /// <p><code>oidc_issuer</code></p></li>
290    /// <li>
291    /// <p><code>authorize_scopes</code></p></li>
292    /// <li>
293    /// <p><code>authorize_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
294    /// <li>
295    /// <p><code>token_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
296    /// <li>
297    /// <p><code>attributes_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
298    /// <li>
299    /// <p><code>jwks_uri</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
300    /// </ul></li>
301    /// <li>
302    /// <p>For SAML providers:</p>
303    /// <ul>
304    /// <li>
305    /// <p><code>MetadataFile</code> OR <code>MetadataURL</code></p></li>
306    /// <li>
307    /// <p><code>IDPSignout</code> (boolean) <i>optional</i></p></li>
308    /// <li>
309    /// <p><code>IDPInit</code> (boolean) <i>optional</i></p></li>
310    /// <li>
311    /// <p><code>RequestSigningAlgorithm</code> (string) <i>optional</i> - Only accepts <code>rsa-sha256</code></p></li>
312    /// <li>
313    /// <p><code>EncryptedResponses</code> (boolean) <i>optional</i></p></li>
314    /// </ul></li>
315    /// </ul>
316    pub fn set_identity_provider_details(
317        mut self,
318        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
319    ) -> Self {
320        self.inner = self.inner.set_identity_provider_details(input);
321        self
322    }
323    /// <p>The identity provider details. The following list describes the provider detail keys for each identity provider type.</p>
324    /// <ul>
325    /// <li>
326    /// <p>For Google and Login with Amazon:</p>
327    /// <ul>
328    /// <li>
329    /// <p><code>client_id</code></p></li>
330    /// <li>
331    /// <p><code>client_secret</code></p></li>
332    /// <li>
333    /// <p><code>authorize_scopes</code></p></li>
334    /// </ul></li>
335    /// <li>
336    /// <p>For Facebook:</p>
337    /// <ul>
338    /// <li>
339    /// <p><code>client_id</code></p></li>
340    /// <li>
341    /// <p><code>client_secret</code></p></li>
342    /// <li>
343    /// <p><code>authorize_scopes</code></p></li>
344    /// <li>
345    /// <p><code>api_version</code></p></li>
346    /// </ul></li>
347    /// <li>
348    /// <p>For Sign in with Apple:</p>
349    /// <ul>
350    /// <li>
351    /// <p><code>client_id</code></p></li>
352    /// <li>
353    /// <p><code>team_id</code></p></li>
354    /// <li>
355    /// <p><code>key_id</code></p></li>
356    /// <li>
357    /// <p><code>private_key</code></p></li>
358    /// <li>
359    /// <p><code>authorize_scopes</code></p></li>
360    /// </ul></li>
361    /// <li>
362    /// <p>For OIDC providers:</p>
363    /// <ul>
364    /// <li>
365    /// <p><code>client_id</code></p></li>
366    /// <li>
367    /// <p><code>client_secret</code></p></li>
368    /// <li>
369    /// <p><code>attributes_request_method</code></p></li>
370    /// <li>
371    /// <p><code>oidc_issuer</code></p></li>
372    /// <li>
373    /// <p><code>authorize_scopes</code></p></li>
374    /// <li>
375    /// <p><code>authorize_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
376    /// <li>
377    /// <p><code>token_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
378    /// <li>
379    /// <p><code>attributes_url</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
380    /// <li>
381    /// <p><code>jwks_uri</code> <i>if not available from discovery URL specified by <code>oidc_issuer</code> key</i></p></li>
382    /// </ul></li>
383    /// <li>
384    /// <p>For SAML providers:</p>
385    /// <ul>
386    /// <li>
387    /// <p><code>MetadataFile</code> OR <code>MetadataURL</code></p></li>
388    /// <li>
389    /// <p><code>IDPSignout</code> (boolean) <i>optional</i></p></li>
390    /// <li>
391    /// <p><code>IDPInit</code> (boolean) <i>optional</i></p></li>
392    /// <li>
393    /// <p><code>RequestSigningAlgorithm</code> (string) <i>optional</i> - Only accepts <code>rsa-sha256</code></p></li>
394    /// <li>
395    /// <p><code>EncryptedResponses</code> (boolean) <i>optional</i></p></li>
396    /// </ul></li>
397    /// </ul>
398    pub fn get_identity_provider_details(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
399        self.inner.get_identity_provider_details()
400    }
401    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
402    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
403    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
404        self.inner = self.inner.client_token(input.into());
405        self
406    }
407    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
408    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
409    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
410        self.inner = self.inner.set_client_token(input);
411        self
412    }
413    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request.</p>
414    /// <p>If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.</p>
415    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
416        self.inner.get_client_token()
417    }
418    ///
419    /// Appends an item to `tags`.
420    ///
421    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
422    ///
423    /// <p>The tags to add to the identity provider resource. A tag is a key-value pair.</p>
424    pub fn tags(mut self, input: crate::types::Tag) -> Self {
425        self.inner = self.inner.tags(input);
426        self
427    }
428    /// <p>The tags to add to the identity provider resource. A tag is a key-value pair.</p>
429    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
430        self.inner = self.inner.set_tags(input);
431        self
432    }
433    /// <p>The tags to add to the identity provider resource. A tag is a key-value pair.</p>
434    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
435        self.inner.get_tags()
436    }
437}