10Duke Java Core
Loading...
Searching...
No Matches
tenduke.sdk.core.model.auth.OAuthTokenResponse Class Reference

Detailed Description

Data class that models an OAuth token response.

Public Member Functions

long expiresAt ()
 Calculates the timestamp when the access token will expire.
 
boolean checkIsSuccess ()
 Tests if the token response denotes success.
 
boolean checkIsError ()
 Tests if the token response denotes an error.
 

Static Public Attributes

static final String ERROR_CODE_UNKNOWN_ERROR = "unknown_error"
 Client side definition of an error code.
 

Member Function Documentation

◆ checkIsError()

boolean tenduke.sdk.core.model.auth.OAuthTokenResponse.checkIsError ( )

Tests if the token response denotes an error.

Returns
true for an error response, false otherwise.

◆ checkIsSuccess()

boolean tenduke.sdk.core.model.auth.OAuthTokenResponse.checkIsSuccess ( )

Tests if the token response denotes success.

Returns
true for successful response, false otherwise.

◆ expiresAt()

long tenduke.sdk.core.model.auth.OAuthTokenResponse.expiresAt ( )

Calculates the timestamp when the access token will expire.

The result is produced by summing the responseReceivedAt timestamp and the expiresIn. If the value of expiresIn or responseReceivedAt is less than 1, then 0 is returned.

Returns
the sum of the responseReceivedAt timestamp and the expiresIn value. The sum is calculated only if both expiresIn and responseReceivedAt are both greater than 0. 0 is returned if either field is 0 or less.

Member Data Documentation

◆ ERROR_CODE_UNKNOWN_ERROR

final String tenduke.sdk.core.model.auth.OAuthTokenResponse.ERROR_CODE_UNKNOWN_ERROR = "unknown_error"
static

Client side definition of an error code.

Used for cases where an OAuth flow fails and the response body is empty, is not JSON or does not have an error field.


The documentation for this class was generated from the following file: