Class AuthError
This class is an open tagged union. Tagged unions instances are always
associated to a specific tag. This means only one of the isAbc()
methods will return true. You can use tag() to determine the
tag associated with this instance.
Open unions may be extended in the future with additional tags. If a new
tag is introduced that this SDK does not recognized, the OTHER value
will be used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor internal use only.static enumDiscriminating tag type forAuthError. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthErrorThe access token has expired.static final AuthErrorThe access token is invalid.static final AuthErrorThe user specified in 'Dropbox-API-Select-Admin' is not a Dropbox Business team admin.static final AuthErrorThe user specified in 'Dropbox-API-Select-User' is no longer on the team.static final AuthErrorCatch-all used for unknown tag values returned by the Dropbox servers.static final AuthErrorThe route is not available to public.static final AuthErrorThe user has been suspended. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe access token does not have the required scope to access the route.inthashCode()booleanbooleanbooleanbooleanbooleanbooleanisOther()booleanbooleanstatic AuthErrormissingScope(TokenScopeError value) Returns an instance ofAuthErrorthat has its tag set toAuthError.Tag.MISSING_SCOPE.tag()Returns the tag for this instance.toString()Returns a String representation of this object formatted for easier readability.
-
Field Details
-
INVALID_ACCESS_TOKEN
The access token is invalid. -
INVALID_SELECT_USER
The user specified in 'Dropbox-API-Select-User' is no longer on the team. -
INVALID_SELECT_ADMIN
The user specified in 'Dropbox-API-Select-Admin' is not a Dropbox Business team admin. -
USER_SUSPENDED
The user has been suspended. -
EXPIRED_ACCESS_TOKEN
The access token has expired. -
ROUTE_ACCESS_DENIED
The route is not available to public. -
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.Receiving a catch-all value typically indicates this SDK version is not up to date. Consider updating your SDK version to handle the new tags.
-
-
Method Details
-
tag
Returns the tag for this instance.This class is a tagged union. Tagged unions instances are always associated to a specific tag. This means only one of the
isXyz()methods will returntrue. Callers are recommended to use the tag value in aswitchstatement to properly handle the different values for thisAuthError.If a tag returned by the server is unrecognized by this SDK, the
AuthError.Tag.OTHERvalue will be used.- Returns:
- the tag for this instance.
-
isInvalidAccessToken
public boolean isInvalidAccessToken()- Returns:
trueif this instance is tagged asAuthError.Tag.INVALID_ACCESS_TOKEN,falseotherwise.
-
isInvalidSelectUser
public boolean isInvalidSelectUser()- Returns:
trueif this instance is tagged asAuthError.Tag.INVALID_SELECT_USER,falseotherwise.
-
isInvalidSelectAdmin
public boolean isInvalidSelectAdmin()- Returns:
trueif this instance is tagged asAuthError.Tag.INVALID_SELECT_ADMIN,falseotherwise.
-
isUserSuspended
public boolean isUserSuspended()- Returns:
trueif this instance is tagged asAuthError.Tag.USER_SUSPENDED,falseotherwise.
-
isExpiredAccessToken
public boolean isExpiredAccessToken()- Returns:
trueif this instance is tagged asAuthError.Tag.EXPIRED_ACCESS_TOKEN,falseotherwise.
-
isMissingScope
public boolean isMissingScope()- Returns:
trueif this instance is tagged asAuthError.Tag.MISSING_SCOPE,falseotherwise.
-
missingScope
Returns an instance ofAuthErrorthat has its tag set toAuthError.Tag.MISSING_SCOPE.The access token does not have the required scope to access the route.
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
AuthErrorwith its tag set toAuthError.Tag.MISSING_SCOPE. - Throws:
IllegalArgumentException- ifvalueisnull.
-
getMissingScopeValue
The access token does not have the required scope to access the route.This instance must be tagged as
AuthError.Tag.MISSING_SCOPE.- Returns:
- The
TokenScopeErrorvalue associated with this instance ifisMissingScope()istrue. - Throws:
IllegalStateException- IfisMissingScope()isfalse.
-
isRouteAccessDenied
public boolean isRouteAccessDenied()- Returns:
trueif this instance is tagged asAuthError.Tag.ROUTE_ACCESS_DENIED,falseotherwise.
-
isOther
public boolean isOther()- Returns:
trueif this instance is tagged asAuthError.Tag.OTHER,falseotherwise.
-
hashCode
public int hashCode() -
equals
-
toString
-
toStringMultiline
Returns a String representation of this object formatted for easier readability.The returned String may contain newlines.
- Returns:
- Formatted, multiline String representation of this object
-