public final class AuthError
extends java.lang.Object
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.
Modifier and Type | Class and Description |
---|---|
static class |
AuthError.Serializer
For internal use only.
|
static class |
AuthError.Tag
Discriminating tag type for
AuthError . |
Modifier and Type | Field and Description |
---|---|
static AuthError |
EXPIRED_ACCESS_TOKEN
The access token has expired.
|
static AuthError |
INVALID_ACCESS_TOKEN
The access token is invalid.
|
static AuthError |
INVALID_SELECT_ADMIN
The user specified in 'Dropbox-API-Select-Admin' is not a Dropbox
Business team admin.
|
static AuthError |
INVALID_SELECT_USER
The user specified in 'Dropbox-API-Select-User' is no longer on the team.
|
static AuthError |
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.
|
static AuthError |
ROUTE_ACCESS_DENIED
The route is not available to public.
|
static AuthError |
USER_SUSPENDED
The user has been suspended.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
TokenScopeError |
getMissingScopeValue()
The access token does not have the required scope to access the route.
|
int |
hashCode() |
boolean |
isExpiredAccessToken()
|
boolean |
isInvalidAccessToken()
|
boolean |
isInvalidSelectAdmin()
|
boolean |
isInvalidSelectUser()
|
boolean |
isMissingScope()
|
boolean |
isOther()
|
boolean |
isRouteAccessDenied()
|
boolean |
isUserSuspended()
|
static AuthError |
missingScope(TokenScopeError value)
Returns an instance of
AuthError that has its tag set to AuthError.Tag.MISSING_SCOPE . |
AuthError.Tag |
tag()
Returns the tag for this instance.
|
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
public static final AuthError INVALID_ACCESS_TOKEN
public static final AuthError INVALID_SELECT_USER
public static final AuthError INVALID_SELECT_ADMIN
public static final AuthError USER_SUSPENDED
public static final AuthError EXPIRED_ACCESS_TOKEN
public static final AuthError ROUTE_ACCESS_DENIED
public static final AuthError OTHER
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.
public AuthError.Tag tag()
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 return true
. Callers are recommended to use the tag
value in a switch
statement to properly handle the different
values for this AuthError
.
If a tag returned by the server is unrecognized by this SDK, the
AuthError.Tag.OTHER
value will be used.
public boolean isInvalidAccessToken()
true
if this instance is tagged as AuthError.Tag.INVALID_ACCESS_TOKEN
, false
otherwise.public boolean isInvalidSelectUser()
true
if this instance is tagged as AuthError.Tag.INVALID_SELECT_USER
, false
otherwise.public boolean isInvalidSelectAdmin()
true
if this instance is tagged as AuthError.Tag.INVALID_SELECT_ADMIN
, false
otherwise.public boolean isUserSuspended()
true
if this instance is tagged as AuthError.Tag.USER_SUSPENDED
, false
otherwise.public boolean isExpiredAccessToken()
true
if this instance is tagged as AuthError.Tag.EXPIRED_ACCESS_TOKEN
, false
otherwise.public boolean isMissingScope()
true
if this instance is tagged as AuthError.Tag.MISSING_SCOPE
, false
otherwise.public static AuthError missingScope(TokenScopeError value)
AuthError
that has its tag set to AuthError.Tag.MISSING_SCOPE
.
The access token does not have the required scope to access the route.
value
- value to assign to this instance.AuthError
with its tag set to AuthError.Tag.MISSING_SCOPE
.java.lang.IllegalArgumentException
- if value
is null
.public TokenScopeError getMissingScopeValue()
This instance must be tagged as AuthError.Tag.MISSING_SCOPE
.
TokenScopeError
value associated with this instance
if isMissingScope()
is true
.java.lang.IllegalStateException
- If isMissingScope()
is false
.public boolean isRouteAccessDenied()
true
if this instance is tagged as AuthError.Tag.ROUTE_ACCESS_DENIED
, false
otherwise.public boolean isOther()
true
if this instance is tagged as AuthError.Tag.OTHER
,
false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringMultiline()
The returned String may contain newlines.