aws_sdk_ssooidc/operation/create_token/_create_token_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateTokenInput {
6 /// <p>The unique identifier string for the client or application. This value comes from the result of the <code>RegisterClient</code> API.</p>
7 pub client_id: ::std::option::Option<::std::string::String>,
8 /// <p>A secret string generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API.</p>
9 pub client_secret: ::std::option::Option<::std::string::String>,
10 /// <p>Supports the following OAuth grant types: Authorization Code, Device Code, and Refresh Token. Specify one of the following values, depending on the grant type that you want:</p>
11 /// <p>* Authorization Code - <code>authorization_code</code></p>
12 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
13 /// <p>* Refresh Token - <code>refresh_token</code></p>
14 pub grant_type: ::std::option::Option<::std::string::String>,
15 /// <p>Used only when calling this API for the Device Code grant type. This short-lived code is used to identify this authorization request. This comes from the result of the <code>StartDeviceAuthorization</code> API.</p>
16 pub device_code: ::std::option::Option<::std::string::String>,
17 /// <p>Used only when calling this API for the Authorization Code grant type. The short-lived code is used to identify this authorization request.</p>
18 pub code: ::std::option::Option<::std::string::String>,
19 /// <p>Used only when calling this API for the Refresh Token grant type. This token is used to refresh short-lived tokens, such as the access token, that might expire.</p>
20 /// <p>For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see <i>Considerations for Using this Guide</i> in the <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html">IAM Identity Center OIDC API Reference</a>.</p>
21 pub refresh_token: ::std::option::Option<::std::string::String>,
22 /// <p>The list of scopes for which authorization is requested. This parameter has no effect; the access token will always include all scopes configured during client registration.</p>
23 pub scope: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
24 /// <p>Used only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.</p>
25 pub redirect_uri: ::std::option::Option<::std::string::String>,
26 /// <p>Used only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.</p>
27 pub code_verifier: ::std::option::Option<::std::string::String>,
28}
29impl CreateTokenInput {
30 /// <p>The unique identifier string for the client or application. This value comes from the result of the <code>RegisterClient</code> API.</p>
31 pub fn client_id(&self) -> ::std::option::Option<&str> {
32 self.client_id.as_deref()
33 }
34 /// <p>A secret string generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API.</p>
35 pub fn client_secret(&self) -> ::std::option::Option<&str> {
36 self.client_secret.as_deref()
37 }
38 /// <p>Supports the following OAuth grant types: Authorization Code, Device Code, and Refresh Token. Specify one of the following values, depending on the grant type that you want:</p>
39 /// <p>* Authorization Code - <code>authorization_code</code></p>
40 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
41 /// <p>* Refresh Token - <code>refresh_token</code></p>
42 pub fn grant_type(&self) -> ::std::option::Option<&str> {
43 self.grant_type.as_deref()
44 }
45 /// <p>Used only when calling this API for the Device Code grant type. This short-lived code is used to identify this authorization request. This comes from the result of the <code>StartDeviceAuthorization</code> API.</p>
46 pub fn device_code(&self) -> ::std::option::Option<&str> {
47 self.device_code.as_deref()
48 }
49 /// <p>Used only when calling this API for the Authorization Code grant type. The short-lived code is used to identify this authorization request.</p>
50 pub fn code(&self) -> ::std::option::Option<&str> {
51 self.code.as_deref()
52 }
53 /// <p>Used only when calling this API for the Refresh Token grant type. This token is used to refresh short-lived tokens, such as the access token, that might expire.</p>
54 /// <p>For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see <i>Considerations for Using this Guide</i> in the <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html">IAM Identity Center OIDC API Reference</a>.</p>
55 pub fn refresh_token(&self) -> ::std::option::Option<&str> {
56 self.refresh_token.as_deref()
57 }
58 /// <p>The list of scopes for which authorization is requested. This parameter has no effect; the access token will always include all scopes configured during client registration.</p>
59 ///
60 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.scope.is_none()`.
61 pub fn scope(&self) -> &[::std::string::String] {
62 self.scope.as_deref()
63 .unwrap_or_default()
64 }
65 /// <p>Used only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.</p>
66 pub fn redirect_uri(&self) -> ::std::option::Option<&str> {
67 self.redirect_uri.as_deref()
68 }
69 /// <p>Used only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.</p>
70 pub fn code_verifier(&self) -> ::std::option::Option<&str> {
71 self.code_verifier.as_deref()
72 }
73}
74impl ::std::fmt::Debug for CreateTokenInput {
75 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
76 let mut formatter = f.debug_struct("CreateTokenInput");
77 formatter.field("client_id", &self.client_id);
78 formatter.field("client_secret", &"*** Sensitive Data Redacted ***");
79 formatter.field("grant_type", &self.grant_type);
80 formatter.field("device_code", &self.device_code);
81 formatter.field("code", &self.code);
82 formatter.field("refresh_token", &"*** Sensitive Data Redacted ***");
83 formatter.field("scope", &self.scope);
84 formatter.field("redirect_uri", &self.redirect_uri);
85 formatter.field("code_verifier", &"*** Sensitive Data Redacted ***");
86 formatter.finish()
87 }
88}
89static CREATETOKENINPUT_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ssooidc.synthetic#CreateTokenInput", "com.amazonaws.ssooidc.synthetic", "CreateTokenInput");
90static CREATETOKENINPUT_MEMBER_CLIENT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
91 ::aws_smithy_schema::ShapeId::from_static(
92 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$clientId",
93 "com.amazonaws.ssooidc.synthetic",
94 "CreateTokenInput",
95 ),
96 ::aws_smithy_schema::ShapeType::String,
97 "clientId",
98 0,
99 );
100static CREATETOKENINPUT_MEMBER_CLIENT_SECRET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
101 ::aws_smithy_schema::ShapeId::from_static(
102 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$clientSecret",
103 "com.amazonaws.ssooidc.synthetic",
104 "CreateTokenInput",
105 ),
106 ::aws_smithy_schema::ShapeType::String,
107 "clientSecret",
108 1,
109 );
110static CREATETOKENINPUT_MEMBER_GRANT_TYPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
111 ::aws_smithy_schema::ShapeId::from_static(
112 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$grantType",
113 "com.amazonaws.ssooidc.synthetic",
114 "CreateTokenInput",
115 ),
116 ::aws_smithy_schema::ShapeType::String,
117 "grantType",
118 2,
119 );
120static CREATETOKENINPUT_MEMBER_DEVICE_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
121 ::aws_smithy_schema::ShapeId::from_static(
122 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$deviceCode",
123 "com.amazonaws.ssooidc.synthetic",
124 "CreateTokenInput",
125 ),
126 ::aws_smithy_schema::ShapeType::String,
127 "deviceCode",
128 3,
129 );
130static CREATETOKENINPUT_MEMBER_CODE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
131 ::aws_smithy_schema::ShapeId::from_static(
132 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$code",
133 "com.amazonaws.ssooidc.synthetic",
134 "CreateTokenInput",
135 ),
136 ::aws_smithy_schema::ShapeType::String,
137 "code",
138 4,
139 );
140static CREATETOKENINPUT_MEMBER_REFRESH_TOKEN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
141 ::aws_smithy_schema::ShapeId::from_static(
142 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$refreshToken",
143 "com.amazonaws.ssooidc.synthetic",
144 "CreateTokenInput",
145 ),
146 ::aws_smithy_schema::ShapeType::String,
147 "refreshToken",
148 5,
149 );
150static CREATETOKENINPUT_MEMBER_SCOPE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
151 ::aws_smithy_schema::ShapeId::from_static(
152 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$scope",
153 "com.amazonaws.ssooidc.synthetic",
154 "CreateTokenInput",
155 ),
156 ::aws_smithy_schema::ShapeType::List,
157 "scope",
158 6,
159 );
160static CREATETOKENINPUT_MEMBER_REDIRECT_URI: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
161 ::aws_smithy_schema::ShapeId::from_static(
162 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$redirectUri",
163 "com.amazonaws.ssooidc.synthetic",
164 "CreateTokenInput",
165 ),
166 ::aws_smithy_schema::ShapeType::String,
167 "redirectUri",
168 7,
169 );
170static CREATETOKENINPUT_MEMBER_CODE_VERIFIER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
171 ::aws_smithy_schema::ShapeId::from_static(
172 "com.amazonaws.ssooidc.synthetic#CreateTokenInput$codeVerifier",
173 "com.amazonaws.ssooidc.synthetic",
174 "CreateTokenInput",
175 ),
176 ::aws_smithy_schema::ShapeType::String,
177 "codeVerifier",
178 8,
179 );
180static CREATETOKENINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
181 CREATETOKENINPUT_SCHEMA_ID,
182 ::aws_smithy_schema::ShapeType::Structure,
183 &[&CREATETOKENINPUT_MEMBER_CLIENT_ID, &CREATETOKENINPUT_MEMBER_CLIENT_SECRET, &CREATETOKENINPUT_MEMBER_GRANT_TYPE, &CREATETOKENINPUT_MEMBER_DEVICE_CODE, &CREATETOKENINPUT_MEMBER_CODE, &CREATETOKENINPUT_MEMBER_REFRESH_TOKEN, &CREATETOKENINPUT_MEMBER_SCOPE, &CREATETOKENINPUT_MEMBER_REDIRECT_URI, &CREATETOKENINPUT_MEMBER_CODE_VERIFIER],
184 )
185 .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/token", None));
186impl CreateTokenInput {
187 /// The schema for this shape.
188 pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &CREATETOKENINPUT_SCHEMA;
189 }
190impl ::aws_smithy_schema::serde::SerializableStruct for CreateTokenInput {
191 #[allow(unused_variables, clippy::diverging_sub_expression)]
192 fn serialize_members(&self, ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
193 if let Some(ref val) = self.client_id {
194 ser.write_string(&CREATETOKENINPUT_MEMBER_CLIENT_ID, val)?;
195 }
196if let Some(ref val) = self.client_secret {
197 ser.write_string(&CREATETOKENINPUT_MEMBER_CLIENT_SECRET, val)?;
198 }
199if let Some(ref val) = self.grant_type {
200 ser.write_string(&CREATETOKENINPUT_MEMBER_GRANT_TYPE, val)?;
201 }
202if let Some(ref val) = self.device_code {
203 ser.write_string(&CREATETOKENINPUT_MEMBER_DEVICE_CODE, val)?;
204 }
205if let Some(ref val) = self.code {
206 ser.write_string(&CREATETOKENINPUT_MEMBER_CODE, val)?;
207 }
208if let Some(ref val) = self.refresh_token {
209 ser.write_string(&CREATETOKENINPUT_MEMBER_REFRESH_TOKEN, val)?;
210 }
211if let Some(ref val) = self.scope {
212
213 ser.write_list(&CREATETOKENINPUT_MEMBER_SCOPE, &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
214 for item in val {
215 ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
216 }
217 Ok(())
218 })?;
219
220 }
221if let Some(ref val) = self.redirect_uri {
222 ser.write_string(&CREATETOKENINPUT_MEMBER_REDIRECT_URI, val)?;
223 }
224if let Some(ref val) = self.code_verifier {
225 ser.write_string(&CREATETOKENINPUT_MEMBER_CODE_VERIFIER, val)?;
226 }
227 Ok(())
228 }
229 }
230impl CreateTokenInput {
231 /// Deserializes this structure from a [`ShapeDeserializer`].
232 pub fn deserialize(deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
233 #[allow(unused_variables, unused_mut)]
234 let mut builder = Self::builder();
235 #[allow(unused_variables, unreachable_code, clippy::single_match, clippy::match_single_binding, clippy::diverging_sub_expression)]
236 deserializer.read_struct(&CREATETOKENINPUT_SCHEMA, &mut |member, deser| {
237 match member.member_index() {
238 Some(0) => {
239 builder.client_id = Some(deser.read_string(member)?);
240 }
241Some(1) => {
242 builder.client_secret = Some(deser.read_string(member)?);
243 }
244Some(2) => {
245 builder.grant_type = Some(deser.read_string(member)?);
246 }
247Some(3) => {
248 builder.device_code = Some(deser.read_string(member)?);
249 }
250Some(4) => {
251 builder.code = Some(deser.read_string(member)?);
252 }
253Some(5) => {
254 builder.refresh_token = Some(deser.read_string(member)?);
255 }
256Some(6) => {
257 builder.scope = Some(deser.read_string_list(member)?);
258 }
259Some(7) => {
260 builder.redirect_uri = Some(deser.read_string(member)?);
261 }
262Some(8) => {
263 builder.code_verifier = Some(deser.read_string(member)?);
264 }
265 _ => {}
266 }
267 Ok(())
268 })?;
269 builder.client_id = builder.client_id.or(Some(String::new()));
270builder.client_secret = builder.client_secret.or(Some(String::new()));
271builder.grant_type = builder.grant_type.or(Some(String::new()));
272builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
273 }
274 }
275impl CreateTokenInput {
276 /// Deserializes this structure from a body deserializer and HTTP response.
277 pub fn deserialize_with_response(
278 deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
279 _headers: &::aws_smithy_runtime_api::http::Headers,
280 _status: u16,
281 _body: &[u8],
282 ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
283 Self::deserialize(deserializer)
284 }
285 }
286impl CreateTokenInput {
287 /// Creates a new builder-style object to manufacture [`CreateTokenInput`](crate::operation::create_token::CreateTokenInput).
288 pub fn builder() -> crate::operation::create_token::builders::CreateTokenInputBuilder {
289 crate::operation::create_token::builders::CreateTokenInputBuilder::default()
290 }
291}
292
293/// A builder for [`CreateTokenInput`](crate::operation::create_token::CreateTokenInput).
294#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
295#[non_exhaustive]
296pub struct CreateTokenInputBuilder {
297 pub(crate) client_id: ::std::option::Option<::std::string::String>,
298 pub(crate) client_secret: ::std::option::Option<::std::string::String>,
299 pub(crate) grant_type: ::std::option::Option<::std::string::String>,
300 pub(crate) device_code: ::std::option::Option<::std::string::String>,
301 pub(crate) code: ::std::option::Option<::std::string::String>,
302 pub(crate) refresh_token: ::std::option::Option<::std::string::String>,
303 pub(crate) scope: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
304 pub(crate) redirect_uri: ::std::option::Option<::std::string::String>,
305 pub(crate) code_verifier: ::std::option::Option<::std::string::String>,
306}
307impl CreateTokenInputBuilder {
308 /// <p>The unique identifier string for the client or application. This value comes from the result of the <code>RegisterClient</code> API.</p>
309 /// This field is required.
310 pub fn client_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
311 self.client_id = ::std::option::Option::Some(input.into());
312 self
313 }
314 /// <p>The unique identifier string for the client or application. This value comes from the result of the <code>RegisterClient</code> API.</p>
315 pub fn set_client_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
316 self.client_id = input; self
317 }
318 /// <p>The unique identifier string for the client or application. This value comes from the result of the <code>RegisterClient</code> API.</p>
319 pub fn get_client_id(&self) -> &::std::option::Option<::std::string::String> {
320 &self.client_id
321 }
322 /// <p>A secret string generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API.</p>
323 /// This field is required.
324 pub fn client_secret(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
325 self.client_secret = ::std::option::Option::Some(input.into());
326 self
327 }
328 /// <p>A secret string generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API.</p>
329 pub fn set_client_secret(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
330 self.client_secret = input; self
331 }
332 /// <p>A secret string generated for the client. This value should come from the persisted result of the <code>RegisterClient</code> API.</p>
333 pub fn get_client_secret(&self) -> &::std::option::Option<::std::string::String> {
334 &self.client_secret
335 }
336 /// <p>Supports the following OAuth grant types: Authorization Code, Device Code, and Refresh Token. Specify one of the following values, depending on the grant type that you want:</p>
337 /// <p>* Authorization Code - <code>authorization_code</code></p>
338 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
339 /// <p>* Refresh Token - <code>refresh_token</code></p>
340 /// This field is required.
341 pub fn grant_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
342 self.grant_type = ::std::option::Option::Some(input.into());
343 self
344 }
345 /// <p>Supports the following OAuth grant types: Authorization Code, Device Code, and Refresh Token. Specify one of the following values, depending on the grant type that you want:</p>
346 /// <p>* Authorization Code - <code>authorization_code</code></p>
347 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
348 /// <p>* Refresh Token - <code>refresh_token</code></p>
349 pub fn set_grant_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
350 self.grant_type = input; self
351 }
352 /// <p>Supports the following OAuth grant types: Authorization Code, Device Code, and Refresh Token. Specify one of the following values, depending on the grant type that you want:</p>
353 /// <p>* Authorization Code - <code>authorization_code</code></p>
354 /// <p>* Device Code - <code>urn:ietf:params:oauth:grant-type:device_code</code></p>
355 /// <p>* Refresh Token - <code>refresh_token</code></p>
356 pub fn get_grant_type(&self) -> &::std::option::Option<::std::string::String> {
357 &self.grant_type
358 }
359 /// <p>Used only when calling this API for the Device Code grant type. This short-lived code is used to identify this authorization request. This comes from the result of the <code>StartDeviceAuthorization</code> API.</p>
360 pub fn device_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361 self.device_code = ::std::option::Option::Some(input.into());
362 self
363 }
364 /// <p>Used only when calling this API for the Device Code grant type. This short-lived code is used to identify this authorization request. This comes from the result of the <code>StartDeviceAuthorization</code> API.</p>
365 pub fn set_device_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
366 self.device_code = input; self
367 }
368 /// <p>Used only when calling this API for the Device Code grant type. This short-lived code is used to identify this authorization request. This comes from the result of the <code>StartDeviceAuthorization</code> API.</p>
369 pub fn get_device_code(&self) -> &::std::option::Option<::std::string::String> {
370 &self.device_code
371 }
372 /// <p>Used only when calling this API for the Authorization Code grant type. The short-lived code is used to identify this authorization request.</p>
373 pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
374 self.code = ::std::option::Option::Some(input.into());
375 self
376 }
377 /// <p>Used only when calling this API for the Authorization Code grant type. The short-lived code is used to identify this authorization request.</p>
378 pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
379 self.code = input; self
380 }
381 /// <p>Used only when calling this API for the Authorization Code grant type. The short-lived code is used to identify this authorization request.</p>
382 pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
383 &self.code
384 }
385 /// <p>Used only when calling this API for the Refresh Token grant type. This token is used to refresh short-lived tokens, such as the access token, that might expire.</p>
386 /// <p>For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see <i>Considerations for Using this Guide</i> in the <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html">IAM Identity Center OIDC API Reference</a>.</p>
387 pub fn refresh_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
388 self.refresh_token = ::std::option::Option::Some(input.into());
389 self
390 }
391 /// <p>Used only when calling this API for the Refresh Token grant type. This token is used to refresh short-lived tokens, such as the access token, that might expire.</p>
392 /// <p>For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see <i>Considerations for Using this Guide</i> in the <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html">IAM Identity Center OIDC API Reference</a>.</p>
393 pub fn set_refresh_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
394 self.refresh_token = input; self
395 }
396 /// <p>Used only when calling this API for the Refresh Token grant type. This token is used to refresh short-lived tokens, such as the access token, that might expire.</p>
397 /// <p>For more information about the features and limitations of the current IAM Identity Center OIDC implementation, see <i>Considerations for Using this Guide</i> in the <a href="https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html">IAM Identity Center OIDC API Reference</a>.</p>
398 pub fn get_refresh_token(&self) -> &::std::option::Option<::std::string::String> {
399 &self.refresh_token
400 }
401 /// Appends an item to `scope`.
402 ///
403 /// To override the contents of this collection use [`set_scope`](Self::set_scope).
404 ///
405 /// <p>The list of scopes for which authorization is requested. This parameter has no effect; the access token will always include all scopes configured during client registration.</p>
406 pub fn scope(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
407 let mut v = self.scope.unwrap_or_default();
408 v.push(input.into());
409 self.scope = ::std::option::Option::Some(v);
410 self
411 }
412 /// <p>The list of scopes for which authorization is requested. This parameter has no effect; the access token will always include all scopes configured during client registration.</p>
413 pub fn set_scope(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
414 self.scope = input; self
415 }
416 /// <p>The list of scopes for which authorization is requested. This parameter has no effect; the access token will always include all scopes configured during client registration.</p>
417 pub fn get_scope(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
418 &self.scope
419 }
420 /// <p>Used only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.</p>
421 pub fn redirect_uri(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
422 self.redirect_uri = ::std::option::Option::Some(input.into());
423 self
424 }
425 /// <p>Used only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.</p>
426 pub fn set_redirect_uri(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
427 self.redirect_uri = input; self
428 }
429 /// <p>Used only when calling this API for the Authorization Code grant type. This value specifies the location of the client or application that has registered to receive the authorization code.</p>
430 pub fn get_redirect_uri(&self) -> &::std::option::Option<::std::string::String> {
431 &self.redirect_uri
432 }
433 /// <p>Used only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.</p>
434 pub fn code_verifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
435 self.code_verifier = ::std::option::Option::Some(input.into());
436 self
437 }
438 /// <p>Used only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.</p>
439 pub fn set_code_verifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
440 self.code_verifier = input; self
441 }
442 /// <p>Used only when calling this API for the Authorization Code grant type. This value is generated by the client and presented to validate the original code challenge value the client passed at authorization time.</p>
443 pub fn get_code_verifier(&self) -> &::std::option::Option<::std::string::String> {
444 &self.code_verifier
445 }
446 /// Consumes the builder and constructs a [`CreateTokenInput`](crate::operation::create_token::CreateTokenInput).
447 pub fn build(self) -> ::std::result::Result<crate::operation::create_token::CreateTokenInput, ::aws_smithy_types::error::operation::BuildError> {
448 ::std::result::Result::Ok(
449 crate::operation::create_token::CreateTokenInput {
450 client_id: self.client_id
451 ,
452 client_secret: self.client_secret
453 ,
454 grant_type: self.grant_type
455 ,
456 device_code: self.device_code
457 ,
458 code: self.code
459 ,
460 refresh_token: self.refresh_token
461 ,
462 scope: self.scope
463 ,
464 redirect_uri: self.redirect_uri
465 ,
466 code_verifier: self.code_verifier
467 ,
468 }
469 )
470 }
471}
472impl ::std::fmt::Debug for CreateTokenInputBuilder {
473 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
474 let mut formatter = f.debug_struct("CreateTokenInputBuilder");
475 formatter.field("client_id", &self.client_id);
476 formatter.field("client_secret", &"*** Sensitive Data Redacted ***");
477 formatter.field("grant_type", &self.grant_type);
478 formatter.field("device_code", &self.device_code);
479 formatter.field("code", &self.code);
480 formatter.field("refresh_token", &"*** Sensitive Data Redacted ***");
481 formatter.field("scope", &self.scope);
482 formatter.field("redirect_uri", &self.redirect_uri);
483 formatter.field("code_verifier", &"*** Sensitive Data Redacted ***");
484 formatter.finish()
485 }
486}
487