Class TokenResponse
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
com.google.api.client.auth.oauth2.TokenResponse
- Direct Known Subclasses:
IdTokenResponse
public class TokenResponse
extends com.google.api.client.json.GenericJson
OAuth 2.0 JSON model for a successful access token response as specified in Successful Response.
Implementation is not thread-safe.
- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.Flags
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Access token issued by the authorization server.private Long
Lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none.private String
Refresh token which can be used to obtain new access tokens usingRefreshTokenRequest
ornull
for none.private String
Scope of the access token as specified in Access Token Scope ornull
for none.private String
Token type (as specified in Access Token Types). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
final String
Returns the access token issued by the authorization server.final Long
Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none.final String
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornull
for none.final String
getScope()
Returns the scope of the access token ornull
for none.final String
Returns the token type (as specified in Access Token Types).setAccessToken
(String accessToken) Sets the access token issued by the authorization server.setExpiresInSeconds
(Long expiresInSeconds) Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none.setRefreshToken
(String refreshToken) Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornull
for none.Sets the scope of the access token ornull
for none.setTokenType
(String tokenType) Sets the token type (as specified in Access Token Types).Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
accessToken
Access token issued by the authorization server. -
tokenType
Token type (as specified in Access Token Types). -
expiresInSeconds
Lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none. -
refreshToken
Refresh token which can be used to obtain new access tokens usingRefreshTokenRequest
ornull
for none. -
scope
Scope of the access token as specified in Access Token Scope ornull
for none.
-
-
Constructor Details
-
TokenResponse
public TokenResponse()
-
-
Method Details
-
getAccessToken
Returns the access token issued by the authorization server. -
setAccessToken
Sets the access token issued by the authorization server.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getTokenType
Returns the token type (as specified in Access Token Types). -
setTokenType
Sets the token type (as specified in Access Token Types).Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getExpiresInSeconds
Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none. -
setExpiresInSeconds
Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getRefreshToken
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornull
for none. -
setRefreshToken
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getScope
Returns the scope of the access token ornull
for none. -
setScope
Sets the scope of the access token ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
set
- Overrides:
set
in classcom.google.api.client.json.GenericJson
-
clone
- Overrides:
clone
in classcom.google.api.client.json.GenericJson
-