aws_sdk_ssooidc/operation/create_token/_create_token_output.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 CreateTokenOutput {
6 /// <p>A bearer token to access Amazon Web Services accounts and applications assigned to a user.</p>
7 pub access_token: ::std::option::Option<::std::string::String>,
8 /// <p>Used to notify the client that the returned token is an access token. The supported token type is <code>Bearer</code>.</p>
9 pub token_type: ::std::option::Option<::std::string::String>,
10 /// <p>Indicates the time in seconds when an access token will expire.</p>
11 pub expires_in: i32,
12 /// <p>A token that, if present, can be used to refresh a previously issued access token that might have expired.</p>
13 /// <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>
14 pub refresh_token: ::std::option::Option<::std::string::String>,
15 /// <p>The <code>idToken</code> is not implemented or supported. 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>
16 /// <p>A JSON Web Token (JWT) that identifies who is associated with the issued access token.</p>
17 pub id_token: ::std::option::Option<::std::string::String>,
18 _request_id: Option<String>,
19}
20impl CreateTokenOutput {
21 /// <p>A bearer token to access Amazon Web Services accounts and applications assigned to a user.</p>
22 pub fn access_token(&self) -> ::std::option::Option<&str> {
23 self.access_token.as_deref()
24 }
25 /// <p>Used to notify the client that the returned token is an access token. The supported token type is <code>Bearer</code>.</p>
26 pub fn token_type(&self) -> ::std::option::Option<&str> {
27 self.token_type.as_deref()
28 }
29 /// <p>Indicates the time in seconds when an access token will expire.</p>
30 pub fn expires_in(&self) -> i32 {
31 self.expires_in
32 }
33 /// <p>A token that, if present, can be used to refresh a previously issued access token that might have expired.</p>
34 /// <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>
35 pub fn refresh_token(&self) -> ::std::option::Option<&str> {
36 self.refresh_token.as_deref()
37 }
38 /// <p>The <code>idToken</code> is not implemented or supported. 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>
39 /// <p>A JSON Web Token (JWT) that identifies who is associated with the issued access token.</p>
40 pub fn id_token(&self) -> ::std::option::Option<&str> {
41 self.id_token.as_deref()
42 }
43}
44impl ::std::fmt::Debug for CreateTokenOutput {
45 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
46 let mut formatter = f.debug_struct("CreateTokenOutput");
47 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
48 formatter.field("token_type", &self.token_type);
49 formatter.field("expires_in", &self.expires_in);
50 formatter.field("refresh_token", &"*** Sensitive Data Redacted ***");
51 formatter.field("id_token", &"*** Sensitive Data Redacted ***");
52 formatter.field("_request_id", &self._request_id);
53 formatter.finish()
54 }
55}
56impl ::aws_types::request_id::RequestId for CreateTokenOutput {
57 fn request_id(&self) -> Option<&str> {
58 self._request_id.as_deref()
59 }
60 }
61impl CreateTokenOutput {
62 /// Creates a new builder-style object to manufacture [`CreateTokenOutput`](crate::operation::create_token::CreateTokenOutput).
63 pub fn builder() -> crate::operation::create_token::builders::CreateTokenOutputBuilder {
64 crate::operation::create_token::builders::CreateTokenOutputBuilder::default()
65 }
66}
67
68/// A builder for [`CreateTokenOutput`](crate::operation::create_token::CreateTokenOutput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
70#[non_exhaustive]
71pub struct CreateTokenOutputBuilder {
72 pub(crate) access_token: ::std::option::Option<::std::string::String>,
73 pub(crate) token_type: ::std::option::Option<::std::string::String>,
74 pub(crate) expires_in: ::std::option::Option<i32>,
75 pub(crate) refresh_token: ::std::option::Option<::std::string::String>,
76 pub(crate) id_token: ::std::option::Option<::std::string::String>,
77 _request_id: Option<String>,
78}
79impl CreateTokenOutputBuilder {
80 /// <p>A bearer token to access Amazon Web Services accounts and applications assigned to a user.</p>
81 pub fn access_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82 self.access_token = ::std::option::Option::Some(input.into());
83 self
84 }
85 /// <p>A bearer token to access Amazon Web Services accounts and applications assigned to a user.</p>
86 pub fn set_access_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87 self.access_token = input; self
88 }
89 /// <p>A bearer token to access Amazon Web Services accounts and applications assigned to a user.</p>
90 pub fn get_access_token(&self) -> &::std::option::Option<::std::string::String> {
91 &self.access_token
92 }
93 /// <p>Used to notify the client that the returned token is an access token. The supported token type is <code>Bearer</code>.</p>
94 pub fn token_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95 self.token_type = ::std::option::Option::Some(input.into());
96 self
97 }
98 /// <p>Used to notify the client that the returned token is an access token. The supported token type is <code>Bearer</code>.</p>
99 pub fn set_token_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.token_type = input; self
101 }
102 /// <p>Used to notify the client that the returned token is an access token. The supported token type is <code>Bearer</code>.</p>
103 pub fn get_token_type(&self) -> &::std::option::Option<::std::string::String> {
104 &self.token_type
105 }
106 /// <p>Indicates the time in seconds when an access token will expire.</p>
107 pub fn expires_in(mut self, input: i32) -> Self {
108 self.expires_in = ::std::option::Option::Some(input);
109 self
110 }
111 /// <p>Indicates the time in seconds when an access token will expire.</p>
112 pub fn set_expires_in(mut self, input: ::std::option::Option<i32>) -> Self {
113 self.expires_in = input; self
114 }
115 /// <p>Indicates the time in seconds when an access token will expire.</p>
116 pub fn get_expires_in(&self) -> &::std::option::Option<i32> {
117 &self.expires_in
118 }
119 /// <p>A token that, if present, can be used to refresh a previously issued access token that might have expired.</p>
120 /// <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>
121 pub fn refresh_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.refresh_token = ::std::option::Option::Some(input.into());
123 self
124 }
125 /// <p>A token that, if present, can be used to refresh a previously issued access token that might have expired.</p>
126 /// <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>
127 pub fn set_refresh_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.refresh_token = input; self
129 }
130 /// <p>A token that, if present, can be used to refresh a previously issued access token that might have expired.</p>
131 /// <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>
132 pub fn get_refresh_token(&self) -> &::std::option::Option<::std::string::String> {
133 &self.refresh_token
134 }
135 /// <p>The <code>idToken</code> is not implemented or supported. 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>
136 /// <p>A JSON Web Token (JWT) that identifies who is associated with the issued access token.</p>
137 pub fn id_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.id_token = ::std::option::Option::Some(input.into());
139 self
140 }
141 /// <p>The <code>idToken</code> is not implemented or supported. 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>
142 /// <p>A JSON Web Token (JWT) that identifies who is associated with the issued access token.</p>
143 pub fn set_id_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144 self.id_token = input; self
145 }
146 /// <p>The <code>idToken</code> is not implemented or supported. 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>
147 /// <p>A JSON Web Token (JWT) that identifies who is associated with the issued access token.</p>
148 pub fn get_id_token(&self) -> &::std::option::Option<::std::string::String> {
149 &self.id_token
150 }
151 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
152 self._request_id = Some(request_id.into());
153 self
154 }
155
156 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
157 self._request_id = request_id;
158 self
159 }
160 /// Consumes the builder and constructs a [`CreateTokenOutput`](crate::operation::create_token::CreateTokenOutput).
161 pub fn build(self) -> crate::operation::create_token::CreateTokenOutput {
162 crate::operation::create_token::CreateTokenOutput {
163 access_token: self.access_token
164 ,
165 token_type: self.token_type
166 ,
167 expires_in: self.expires_in
168 .unwrap_or_default()
169 ,
170 refresh_token: self.refresh_token
171 ,
172 id_token: self.id_token
173 ,
174 _request_id: self._request_id,
175 }
176 }
177}
178impl ::std::fmt::Debug for CreateTokenOutputBuilder {
179 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
180 let mut formatter = f.debug_struct("CreateTokenOutputBuilder");
181 formatter.field("access_token", &"*** Sensitive Data Redacted ***");
182 formatter.field("token_type", &self.token_type);
183 formatter.field("expires_in", &self.expires_in);
184 formatter.field("refresh_token", &"*** Sensitive Data Redacted ***");
185 formatter.field("id_token", &"*** Sensitive Data Redacted ***");
186 formatter.field("_request_id", &self._request_id);
187 formatter.finish()
188 }
189}
190