public final class AddSecondaryEmailResult
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 |
AddSecondaryEmailResult.Tag
Discriminating tag type for
AddSecondaryEmailResult . |
Modifier and Type | Field and Description |
---|---|
static AddSecondaryEmailResult |
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.
|
Modifier and Type | Method and Description |
---|---|
static AddSecondaryEmailResult |
alreadyOwnedByUser(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER . |
static AddSecondaryEmailResult |
alreadyPending(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.ALREADY_PENDING . |
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getAlreadyOwnedByUserValue()
Secondary email is already a verified email for the user.
|
java.lang.String |
getAlreadyPendingValue()
Secondary email is already a pending email for the user.
|
java.lang.String |
getRateLimitedValue()
Too many emails are being sent to this email address.
|
java.lang.String |
getReachedLimitValue()
User already has the maximum number of secondary emails allowed.
|
SecondaryEmail |
getSuccessValue()
Describes a secondary email that was successfully added to a user.
|
java.lang.String |
getTooManyUpdatesValue()
An error occurred due to conflicting updates.
|
java.lang.String |
getTransientErrorValue()
A transient error occurred.
|
java.lang.String |
getUnavailableValue()
Secondary email is not available to be claimed by the user.
|
java.lang.String |
getUnknownErrorValue()
An unknown error occurred.
|
int |
hashCode() |
boolean |
isAlreadyOwnedByUser()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER , false otherwise. |
boolean |
isAlreadyPending()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.ALREADY_PENDING , false otherwise. |
boolean |
isOther()
|
boolean |
isRateLimited()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.RATE_LIMITED , false otherwise. |
boolean |
isReachedLimit()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.REACHED_LIMIT , false otherwise. |
boolean |
isSuccess()
|
boolean |
isTooManyUpdates()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES , false otherwise. |
boolean |
isTransientError()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.TRANSIENT_ERROR , false otherwise. |
boolean |
isUnavailable()
|
boolean |
isUnknownError()
Returns
true if this instance has the tag AddSecondaryEmailResult.Tag.UNKNOWN_ERROR , false otherwise. |
static AddSecondaryEmailResult |
rateLimited(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.RATE_LIMITED . |
static AddSecondaryEmailResult |
reachedLimit(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.REACHED_LIMIT . |
static AddSecondaryEmailResult |
success(SecondaryEmail value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.SUCCESS . |
AddSecondaryEmailResult.Tag |
tag()
Returns the tag for this instance.
|
static AddSecondaryEmailResult |
tooManyUpdates(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES . |
java.lang.String |
toString() |
java.lang.String |
toStringMultiline()
Returns a String representation of this object formatted for easier
readability.
|
static AddSecondaryEmailResult |
transientError(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.TRANSIENT_ERROR . |
static AddSecondaryEmailResult |
unavailable(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.UNAVAILABLE . |
static AddSecondaryEmailResult |
unknownError(java.lang.String value)
Returns an instance of
AddSecondaryEmailResult that has its tag
set to AddSecondaryEmailResult.Tag.UNKNOWN_ERROR . |
public static final AddSecondaryEmailResult 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 AddSecondaryEmailResult.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 AddSecondaryEmailResult
.
If a tag returned by the server is unrecognized by this SDK, the
AddSecondaryEmailResult.Tag.OTHER
value will be used.
public boolean isSuccess()
true
if this instance is tagged as AddSecondaryEmailResult.Tag.SUCCESS
,
false
otherwise.public static AddSecondaryEmailResult success(SecondaryEmail value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.SUCCESS
.
Describes a secondary email that was successfully added to a user.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.SUCCESS
.java.lang.IllegalArgumentException
- if value
is null
.public SecondaryEmail getSuccessValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.SUCCESS
.
SecondaryEmail
value associated with this instance if
isSuccess()
is true
.java.lang.IllegalStateException
- If isSuccess()
is false
.public boolean isUnavailable()
true
if this instance is tagged as AddSecondaryEmailResult.Tag.UNAVAILABLE
, false
otherwise.public static AddSecondaryEmailResult unavailable(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.UNAVAILABLE
.
Secondary email is not available to be claimed by the user.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.UNAVAILABLE
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getUnavailableValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.UNAVAILABLE
.
String
value associated with this instance if isUnavailable()
is true
.java.lang.IllegalStateException
- If isUnavailable()
is false
.public boolean isAlreadyPending()
true
if this instance has the tag AddSecondaryEmailResult.Tag.ALREADY_PENDING
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.ALREADY_PENDING
, false
otherwise.public static AddSecondaryEmailResult alreadyPending(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.ALREADY_PENDING
.
Secondary email is already a pending email for the user.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.ALREADY_PENDING
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getAlreadyPendingValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.ALREADY_PENDING
.
String
value associated with this instance if isAlreadyPending()
is true
.java.lang.IllegalStateException
- If isAlreadyPending()
is false
.public boolean isAlreadyOwnedByUser()
true
if this instance has the tag AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
, false
otherwise.public static AddSecondaryEmailResult alreadyOwnedByUser(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
.
Secondary email is already a verified email for the user.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getAlreadyOwnedByUserValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
.
String
value associated with this instance if isAlreadyOwnedByUser()
is true
.java.lang.IllegalStateException
- If isAlreadyOwnedByUser()
is false
.public boolean isReachedLimit()
true
if this instance has the tag AddSecondaryEmailResult.Tag.REACHED_LIMIT
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.REACHED_LIMIT
, false
otherwise.public static AddSecondaryEmailResult reachedLimit(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.REACHED_LIMIT
.
User already has the maximum number of secondary emails allowed.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.REACHED_LIMIT
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getReachedLimitValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.REACHED_LIMIT
.
String
value associated with this instance if isReachedLimit()
is true
.java.lang.IllegalStateException
- If isReachedLimit()
is false
.public boolean isTransientError()
true
if this instance has the tag AddSecondaryEmailResult.Tag.TRANSIENT_ERROR
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.TRANSIENT_ERROR
, false
otherwise.public static AddSecondaryEmailResult transientError(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.TRANSIENT_ERROR
.
A transient error occurred. Please try again later.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.TRANSIENT_ERROR
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getTransientErrorValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.TRANSIENT_ERROR
.
String
value associated with this instance if isTransientError()
is true
.java.lang.IllegalStateException
- If isTransientError()
is false
.public boolean isTooManyUpdates()
true
if this instance has the tag AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
, false
otherwise.public static AddSecondaryEmailResult tooManyUpdates(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
.
An error occurred due to conflicting updates. Please try again later.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getTooManyUpdatesValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
.
String
value associated with this instance if isTooManyUpdates()
is true
.java.lang.IllegalStateException
- If isTooManyUpdates()
is false
.public boolean isUnknownError()
true
if this instance has the tag AddSecondaryEmailResult.Tag.UNKNOWN_ERROR
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.UNKNOWN_ERROR
, false
otherwise.public static AddSecondaryEmailResult unknownError(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.UNKNOWN_ERROR
.
An unknown error occurred.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.UNKNOWN_ERROR
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getUnknownErrorValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.UNKNOWN_ERROR
.
String
value associated with this instance if isUnknownError()
is true
.java.lang.IllegalStateException
- If isUnknownError()
is false
.public boolean isRateLimited()
true
if this instance has the tag AddSecondaryEmailResult.Tag.RATE_LIMITED
, false
otherwise.true
if this instance is tagged as AddSecondaryEmailResult.Tag.RATE_LIMITED
, false
otherwise.public static AddSecondaryEmailResult rateLimited(java.lang.String value)
AddSecondaryEmailResult
that has its tag
set to AddSecondaryEmailResult.Tag.RATE_LIMITED
.
Too many emails are being sent to this email address. Please try again later.
value
- value to assign to this instance.AddSecondaryEmailResult
with its tag set to
AddSecondaryEmailResult.Tag.RATE_LIMITED
.java.lang.IllegalArgumentException
- if value
is longer than 255,
does not match pattern "^['&A-Za-z0-9._%+-]+@[A-Za-z0-9-][A-Za-z0-9.-]\*\.[A-Za-z]{2,15}$
",
or is null
.public java.lang.String getRateLimitedValue()
This instance must be tagged as AddSecondaryEmailResult.Tag.RATE_LIMITED
.
String
value associated with this instance if isRateLimited()
is true
.java.lang.IllegalStateException
- If isRateLimited()
is false
.public boolean isOther()
true
if this instance is tagged as AddSecondaryEmailResult.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.