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 public client with IAM Identity Center. This allows clients to perform authorization using the authorization code grant with Proof Key for Code Exchange (PKCE) or the device code grant.</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. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
183 /// <p>* Authorization Code - <code>authorization_code</code></p>
184 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
185 /// <p>* Refresh Token - <code>refresh_token</code></p>
186 pub fn grant_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187 self.inner = self.inner.grant_types(input.into());
188 self
189 }
190 /// <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. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
191 /// <p>* Authorization Code - <code>authorization_code</code></p>
192 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
193 /// <p>* Refresh Token - <code>refresh_token</code></p>
194 pub fn set_grant_types(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
195 self.inner = self.inner.set_grant_types(input);
196 self
197 }
198 /// <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. Supports the following OAuth 2.0 grant types: Authorization Code, Device Code, and Refresh Token.</p>
199 /// <p>* Authorization Code - <code>authorization_code</code></p>
200 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
201 /// <p>* Refresh Token - <code>refresh_token</code></p>
202 pub fn get_grant_types(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
203 self.inner.get_grant_types()
204 }
205 /// <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>
206 pub fn issuer_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207 self.inner = self.inner.issuer_url(input.into());
208 self
209 }
210 /// <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>
211 pub fn set_issuer_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212 self.inner = self.inner.set_issuer_url(input);
213 self
214 }
215 /// <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>
216 pub fn get_issuer_url(&self) -> &::std::option::Option<::std::string::String> {
217 self.inner.get_issuer_url()
218 }
219 /// <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>
220 pub fn entitled_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221 self.inner = self.inner.entitled_application_arn(input.into());
222 self
223 }
224 /// <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>
225 pub fn set_entitled_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226 self.inner = self.inner.set_entitled_application_arn(input);
227 self
228 }
229 /// <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>
230 pub fn get_entitled_application_arn(&self) -> &::std::option::Option<::std::string::String> {
231 self.inner.get_entitled_application_arn()
232 }
233}