aws_sdk_ssooidc/operation/register_client/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::register_client::_register_client_output::RegisterClientOutputBuilder;
3
4pub use crate::operation::register_client::_register_client_input::RegisterClientInputBuilder;
5
6impl crate::operation::register_client::builders::RegisterClientInputBuilder {
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::register_client::RegisterClientOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::register_client::RegisterClientError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.register_client();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RegisterClient`.
24///
25/// <p>Registers a client with IAM Identity Center. This allows clients to initiate device authorization. The output should be persisted for reuse through many authentication requests.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct RegisterClientFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::register_client::builders::RegisterClientInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::register_client::RegisterClientOutput,
35        crate::operation::register_client::RegisterClientError,
36    > for RegisterClientFluentBuilder
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::register_client::RegisterClientOutput,
44            crate::operation::register_client::RegisterClientError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl RegisterClientFluentBuilder {
51    /// Creates a new `RegisterClientFluentBuilder`.
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 RegisterClient as a reference.
60    pub fn as_input(&self) -> &crate::operation::register_client::builders::RegisterClientInputBuilder {
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::register_client::RegisterClientOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::register_client::RegisterClientError,
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::register_client::RegisterClient::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::register_client::RegisterClient::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::register_client::RegisterClientOutput,
97        crate::operation::register_client::RegisterClientError,
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 friendly name of the client.</p>
112    pub fn client_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.client_name(input.into());
114        self
115    }
116    /// <p>The friendly name of the client.</p>
117    pub fn set_client_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_client_name(input);
119        self
120    }
121    /// <p>The friendly name of the client.</p>
122    pub fn get_client_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_client_name()
124    }
125    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
126    pub fn client_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.client_type(input.into());
128        self
129    }
130    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
131    pub fn set_client_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_client_type(input);
133        self
134    }
135    /// <p>The type of client. The service supports only <code>public</code> as a client type. Anything other than public will be rejected by the service.</p>
136    pub fn get_client_type(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_client_type()
138    }
139    ///
140    /// Appends an item to `scopes`.
141    ///
142    /// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
143    ///
144    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
145    pub fn scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.scopes(input.into());
147        self
148    }
149    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
150    pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
151        self.inner = self.inner.set_scopes(input);
152        self
153    }
154    /// <p>The list of scopes that are defined by the client. Upon authorization, this list is used to restrict permissions when granting an access token.</p>
155    pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156        self.inner.get_scopes()
157    }
158    ///
159    /// Appends an item to `redirectUris`.
160    ///
161    /// To override the contents of this collection use [`set_redirect_uris`](Self::set_redirect_uris).
162    ///
163    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
164    pub fn redirect_uris(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.inner = self.inner.redirect_uris(input.into());
166        self
167    }
168    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
169    pub fn set_redirect_uris(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
170        self.inner = self.inner.set_redirect_uris(input);
171        self
172    }
173    /// <p>The list of redirect URI that are defined by the client. At completion of authorization, this list is used to restrict what locations the user agent can be redirected back to.</p>
174    pub fn get_redirect_uris(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
175        self.inner.get_redirect_uris()
176    }
177    ///
178    /// Appends an item to `grantTypes`.
179    ///
180    /// To override the contents of this collection use [`set_grant_types`](Self::set_grant_types).
181    ///
182    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client.</p>
183    pub fn grant_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.grant_types(input.into());
185        self
186    }
187    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client.</p>
188    pub fn set_grant_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
189        self.inner = self.inner.set_grant_types(input);
190        self
191    }
192    /// <p>The list of OAuth 2.0 grant types that are defined by the client. This list is used to restrict the token granting flows available to the client.</p>
193    pub fn get_grant_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
194        self.inner.get_grant_types()
195    }
196    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
197    pub fn issuer_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.issuer_url(input.into());
199        self
200    }
201    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
202    pub fn set_issuer_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
203        self.inner = self.inner.set_issuer_url(input);
204        self
205    }
206    /// <p>The IAM Identity Center Issuer URL associated with an instance of IAM Identity Center. This value is needed for user access to resources through the client.</p>
207    pub fn get_issuer_url(&self) -> &::std::option::Option<::std::string::String> {
208        self.inner.get_issuer_url()
209    }
210    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
211    pub fn entitled_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.entitled_application_arn(input.into());
213        self
214    }
215    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
216    pub fn set_entitled_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
217        self.inner = self.inner.set_entitled_application_arn(input);
218        self
219    }
220    /// <p>This IAM Identity Center application ARN is used to define administrator-managed configuration for public client access to resources. At authorization, the scopes, grants, and redirect URI available to this client will be restricted by this application resource.</p>
221    pub fn get_entitled_application_arn(&self) -> &::std::option::Option<::std::string::String> {
222        self.inner.get_entitled_application_arn()
223    }
224}