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(self, client: &crate::Client) -> ::std::result::Result<
9 crate::operation::register_client::RegisterClientOutput,
10 ::aws_smithy_runtime_api::client::result::SdkError<
11 crate::operation::register_client::RegisterClientError,
12 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13 >
14 > {
15 let mut fluent_builder = client.register_client();
16 fluent_builder.inner = self;
17 fluent_builder.send().await
18 }
19 }
20/// Fluent builder constructing a request to `RegisterClient`.
21///
22/// <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>
23#[derive(::std::clone::Clone, ::std::fmt::Debug)]
24pub struct RegisterClientFluentBuilder {
25 handle: ::std::sync::Arc<crate::client::Handle>,
26 inner: crate::operation::register_client::builders::RegisterClientInputBuilder,
27config_override: ::std::option::Option<crate::config::Builder>,
28 }
29impl
30 crate::client::customize::internal::CustomizableSend<
31 crate::operation::register_client::RegisterClientOutput,
32 crate::operation::register_client::RegisterClientError,
33 > for RegisterClientFluentBuilder
34 {
35 fn send(
36 self,
37 config_override: crate::config::Builder,
38 ) -> crate::client::customize::internal::BoxFuture<
39 crate::client::customize::internal::SendResult<
40 crate::operation::register_client::RegisterClientOutput,
41 crate::operation::register_client::RegisterClientError,
42 >,
43 > {
44 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
45 }
46 }
47impl RegisterClientFluentBuilder {
48 /// Creates a new `RegisterClientFluentBuilder`.
49 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
50 Self {
51 handle,
52 inner: ::std::default::Default::default(),
53 config_override: ::std::option::Option::None,
54 }
55 }
56 /// Access the RegisterClient as a reference.
57 pub fn as_input(&self) -> &crate::operation::register_client::builders::RegisterClientInputBuilder {
58 &self.inner
59 }
60 /// Sends the request and returns the response.
61 ///
62 /// If an error occurs, an `SdkError` will be returned with additional details that
63 /// can be matched against.
64 ///
65 /// By default, any retryable failures will be retried twice. Retry behavior
66 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
67 /// set when configuring the client.
68 pub async fn send(self) -> ::std::result::Result<crate::operation::register_client::RegisterClientOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::register_client::RegisterClientError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
69 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
70 let runtime_plugins = crate::operation::register_client::RegisterClient::operation_runtime_plugins(
71 self.handle.runtime_plugins.clone(),
72 &self.handle.conf,
73 self.config_override,
74 );
75 crate::operation::register_client::RegisterClient::orchestrate(&runtime_plugins, input).await
76 }
77
78 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
79 pub fn customize(
80 self,
81 ) -> crate::client::customize::CustomizableOperation<crate::operation::register_client::RegisterClientOutput, crate::operation::register_client::RegisterClientError, Self> {
82 crate::client::customize::CustomizableOperation::new(self)
83 }
84 pub(crate) fn config_override(
85 mut self,
86 config_override: impl ::std::convert::Into<crate::config::Builder>,
87 ) -> Self {
88 self.set_config_override(::std::option::Option::Some(config_override.into()));
89 self
90 }
91
92 pub(crate) fn set_config_override(
93 &mut self,
94 config_override: ::std::option::Option<crate::config::Builder>,
95 ) -> &mut Self {
96 self.config_override = config_override;
97 self
98 }
99 /// <p>The friendly name of the client.</p>
100 pub fn client_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101 self.inner = self.inner.client_name(input.into());
102 self
103 }
104 /// <p>The friendly name of the client.</p>
105 pub fn set_client_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.inner = self.inner.set_client_name(input);
107 self
108 }
109 /// <p>The friendly name of the client.</p>
110 pub fn get_client_name(&self) -> &::std::option::Option<::std::string::String> {
111 self.inner.get_client_name()
112 }
113 /// <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>
114 pub fn client_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115 self.inner = self.inner.client_type(input.into());
116 self
117 }
118 /// <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>
119 pub fn set_client_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_client_type(input);
121 self
122 }
123 /// <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>
124 pub fn get_client_type(&self) -> &::std::option::Option<::std::string::String> {
125 self.inner.get_client_type()
126 }
127 ///
128 /// Appends an item to `scopes`.
129 ///
130 /// To override the contents of this collection use [`set_scopes`](Self::set_scopes).
131 ///
132 /// <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>
133 pub fn scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134 self.inner = self.inner.scopes(input.into());
135 self
136 }
137 /// <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>
138 pub fn set_scopes(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
139 self.inner = self.inner.set_scopes(input);
140 self
141 }
142 /// <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>
143 pub fn get_scopes(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
144 self.inner.get_scopes()
145 }
146 ///
147 /// Appends an item to `redirectUris`.
148 ///
149 /// To override the contents of this collection use [`set_redirect_uris`](Self::set_redirect_uris).
150 ///
151 /// <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>
152 pub fn redirect_uris(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153 self.inner = self.inner.redirect_uris(input.into());
154 self
155 }
156 /// <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>
157 pub fn set_redirect_uris(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
158 self.inner = self.inner.set_redirect_uris(input);
159 self
160 }
161 /// <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>
162 pub fn get_redirect_uris(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
163 self.inner.get_redirect_uris()
164 }
165 ///
166 /// Appends an item to `grantTypes`.
167 ///
168 /// To override the contents of this collection use [`set_grant_types`](Self::set_grant_types).
169 ///
170 /// <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>
171 pub fn grant_types(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172 self.inner = self.inner.grant_types(input.into());
173 self
174 }
175 /// <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>
176 pub fn set_grant_types(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
177 self.inner = self.inner.set_grant_types(input);
178 self
179 }
180 /// <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>
181 pub fn get_grant_types(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
182 self.inner.get_grant_types()
183 }
184 /// <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>
185 pub fn issuer_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.inner = self.inner.issuer_url(input.into());
187 self
188 }
189 /// <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>
190 pub fn set_issuer_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
191 self.inner = self.inner.set_issuer_url(input);
192 self
193 }
194 /// <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>
195 pub fn get_issuer_url(&self) -> &::std::option::Option<::std::string::String> {
196 self.inner.get_issuer_url()
197 }
198 /// <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>
199 pub fn entitled_application_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
200 self.inner = self.inner.entitled_application_arn(input.into());
201 self
202 }
203 /// <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>
204 pub fn set_entitled_application_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
205 self.inner = self.inner.set_entitled_application_arn(input);
206 self
207 }
208 /// <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>
209 pub fn get_entitled_application_arn(&self) -> &::std::option::Option<::std::string::String> {
210 self.inner.get_entitled_application_arn()
211 }
212}
213