Class TokenResponse
- java.lang.Object
-
- java.util.AbstractMap<java.lang.String,java.lang.Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.client.auth.oauth2.TokenResponse
-
- All Implemented Interfaces:
java.lang.Cloneable,java.util.Map<java.lang.String,java.lang.Object>
- Direct Known Subclasses:
IdTokenResponse
public class TokenResponse extends com.google.api.client.json.GenericJsonOAuth 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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringaccessTokenAccess token issued by the authorization server.private java.lang.LongexpiresInSecondsLifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.private java.lang.StringrefreshTokenRefresh token which can be used to obtain new access tokens usingRefreshTokenRequestornullfor none.private java.lang.StringscopeScope of the access token as specified in Access Token Scope ornullfor none.private java.lang.StringtokenTypeToken type (as specified in Access Token Types).
-
Constructor Summary
Constructors Constructor Description TokenResponse()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenResponseclone()java.lang.StringgetAccessToken()Returns the access token issued by the authorization server.java.lang.LonggetExpiresInSeconds()Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.java.lang.StringgetRefreshToken()Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.java.lang.StringgetScope()Returns the scope of the access token ornullfor none.java.lang.StringgetTokenType()Returns the token type (as specified in Access Token Types).TokenResponseset(java.lang.String fieldName, java.lang.Object value)TokenResponsesetAccessToken(java.lang.String accessToken)Sets the access token issued by the authorization server.TokenResponsesetExpiresInSeconds(java.lang.Long expiresInSeconds)Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.TokenResponsesetRefreshToken(java.lang.String refreshToken)Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.TokenResponsesetScope(java.lang.String scope)Sets the scope of the access token ornullfor none.TokenResponsesetTokenType(java.lang.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
-
-
-
-
Field Detail
-
accessToken
private java.lang.String accessToken
Access token issued by the authorization server.
-
tokenType
private java.lang.String tokenType
Token type (as specified in Access Token Types).
-
expiresInSeconds
private java.lang.Long expiresInSeconds
Lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.
-
refreshToken
private java.lang.String refreshToken
Refresh token which can be used to obtain new access tokens usingRefreshTokenRequestornullfor none.
-
scope
private java.lang.String scope
Scope of the access token as specified in Access Token Scope ornullfor none.
-
-
Method Detail
-
getAccessToken
public final java.lang.String getAccessToken()
Returns the access token issued by the authorization server.
-
setAccessToken
public TokenResponse setAccessToken(java.lang.String accessToken)
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
public final java.lang.String getTokenType()
Returns the token type (as specified in Access Token Types).
-
setTokenType
public TokenResponse setTokenType(java.lang.String tokenType)
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
public final java.lang.Long getExpiresInSeconds()
Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.
-
setExpiresInSeconds
public TokenResponse setExpiresInSeconds(java.lang.Long expiresInSeconds)
Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getRefreshToken
public final java.lang.String getRefreshToken()
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.
-
setRefreshToken
public TokenResponse setRefreshToken(java.lang.String refreshToken)
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getScope
public final java.lang.String getScope()
Returns the scope of the access token ornullfor none.
-
setScope
public TokenResponse setScope(java.lang.String scope)
Sets the scope of the access token ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
set
public TokenResponse set(java.lang.String fieldName, java.lang.Object value)
- Overrides:
setin classcom.google.api.client.json.GenericJson
-
clone
public TokenResponse clone()
- Overrides:
clonein classcom.google.api.client.json.GenericJson
-
-