Class AddSecondaryEmailResult
- java.lang.Object
-
- com.dropbox.core.v2.team.AddSecondaryEmailResult
-
public final class AddSecondaryEmailResult extends java.lang.Object
Result of trying to add a secondary email to a user. 'success' is the only value indicating that a secondary email was successfully added to a user. The other values explain the type of error that occurred, and include the email for which the error occured.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 returntrue
. You can usetag()
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 Classes Modifier and Type Class Description static class
AddSecondaryEmailResult.Tag
Discriminating tag type forAddSecondaryEmailResult
.
-
Field Summary
Fields Modifier and Type Field Description static AddSecondaryEmailResult
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AddSecondaryEmailResult
alreadyOwnedByUser(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
.static AddSecondaryEmailResult
alreadyPending(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.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()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
,false
otherwise.boolean
isAlreadyPending()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_PENDING
,false
otherwise.boolean
isOther()
boolean
isRateLimited()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.RATE_LIMITED
,false
otherwise.boolean
isReachedLimit()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.REACHED_LIMIT
,false
otherwise.boolean
isSuccess()
boolean
isTooManyUpdates()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
,false
otherwise.boolean
isTransientError()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.TRANSIENT_ERROR
,false
otherwise.boolean
isUnavailable()
boolean
isUnknownError()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.UNKNOWN_ERROR
,false
otherwise.static AddSecondaryEmailResult
rateLimited(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.RATE_LIMITED
.static AddSecondaryEmailResult
reachedLimit(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.REACHED_LIMIT
.static AddSecondaryEmailResult
success(SecondaryEmail value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.SUCCESS
.AddSecondaryEmailResult.Tag
tag()
Returns the tag for this instance.static AddSecondaryEmailResult
tooManyUpdates(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.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 ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR
.static AddSecondaryEmailResult
unavailable(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.UNAVAILABLE
.static AddSecondaryEmailResult
unknownError(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.UNKNOWN_ERROR
.
-
-
-
Field Detail
-
OTHER
public static final AddSecondaryEmailResult 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 Detail
-
tag
public AddSecondaryEmailResult.Tag 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 aswitch
statement to properly handle the different values for thisAddSecondaryEmailResult
.If a tag returned by the server is unrecognized by this SDK, the
AddSecondaryEmailResult.Tag.OTHER
value will be used.- Returns:
- the tag for this instance.
-
isSuccess
public boolean isSuccess()
- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.SUCCESS
,false
otherwise.
-
success
public static AddSecondaryEmailResult success(SecondaryEmail value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.SUCCESS
.Describes a secondary email that was successfully added to a user.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.SUCCESS
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getSuccessValue
public SecondaryEmail getSuccessValue()
Describes a secondary email that was successfully added to a user.This instance must be tagged as
AddSecondaryEmailResult.Tag.SUCCESS
.- Returns:
- The
SecondaryEmail
value associated with this instance ifisSuccess()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisSuccess()
isfalse
.
-
isUnavailable
public boolean isUnavailable()
- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.UNAVAILABLE
,false
otherwise.
-
unavailable
public static AddSecondaryEmailResult unavailable(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.UNAVAILABLE
.Secondary email is not available to be claimed by the user.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.UNAVAILABLE
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getUnavailableValue
public java.lang.String getUnavailableValue()
Secondary email is not available to be claimed by the user.This instance must be tagged as
AddSecondaryEmailResult.Tag.UNAVAILABLE
.- Returns:
- The
String
value associated with this instance ifisUnavailable()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisUnavailable()
isfalse
.
-
isAlreadyPending
public boolean isAlreadyPending()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_PENDING
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.ALREADY_PENDING
,false
otherwise.
-
alreadyPending
public static AddSecondaryEmailResult alreadyPending(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.ALREADY_PENDING
.Secondary email is already a pending email for the user.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.ALREADY_PENDING
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getAlreadyPendingValue
public java.lang.String getAlreadyPendingValue()
Secondary email is already a pending email for the user.This instance must be tagged as
AddSecondaryEmailResult.Tag.ALREADY_PENDING
.- Returns:
- The
String
value associated with this instance ifisAlreadyPending()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisAlreadyPending()
isfalse
.
-
isAlreadyOwnedByUser
public boolean isAlreadyOwnedByUser()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
,false
otherwise.
-
alreadyOwnedByUser
public static AddSecondaryEmailResult alreadyOwnedByUser(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
.Secondary email is already a verified email for the user.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getAlreadyOwnedByUserValue
public java.lang.String getAlreadyOwnedByUserValue()
Secondary email is already a verified email for the user.This instance must be tagged as
AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER
.- Returns:
- The
String
value associated with this instance ifisAlreadyOwnedByUser()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisAlreadyOwnedByUser()
isfalse
.
-
isReachedLimit
public boolean isReachedLimit()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.REACHED_LIMIT
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.REACHED_LIMIT
,false
otherwise.
-
reachedLimit
public static AddSecondaryEmailResult reachedLimit(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.REACHED_LIMIT
.User already has the maximum number of secondary emails allowed.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.REACHED_LIMIT
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getReachedLimitValue
public java.lang.String getReachedLimitValue()
User already has the maximum number of secondary emails allowed.This instance must be tagged as
AddSecondaryEmailResult.Tag.REACHED_LIMIT
.- Returns:
- The
String
value associated with this instance ifisReachedLimit()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisReachedLimit()
isfalse
.
-
isTransientError
public boolean isTransientError()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.TRANSIENT_ERROR
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.TRANSIENT_ERROR
,false
otherwise.
-
transientError
public static AddSecondaryEmailResult transientError(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR
.A transient error occurred. Please try again later.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getTransientErrorValue
public java.lang.String getTransientErrorValue()
A transient error occurred. Please try again later.This instance must be tagged as
AddSecondaryEmailResult.Tag.TRANSIENT_ERROR
.- Returns:
- The
String
value associated with this instance ifisTransientError()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisTransientError()
isfalse
.
-
isTooManyUpdates
public boolean isTooManyUpdates()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
,false
otherwise.
-
tooManyUpdates
public static AddSecondaryEmailResult tooManyUpdates(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
.An error occurred due to conflicting updates. Please try again later.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getTooManyUpdatesValue
public java.lang.String getTooManyUpdatesValue()
An error occurred due to conflicting updates. Please try again later.This instance must be tagged as
AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES
.- Returns:
- The
String
value associated with this instance ifisTooManyUpdates()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisTooManyUpdates()
isfalse
.
-
isUnknownError
public boolean isUnknownError()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.UNKNOWN_ERROR
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.UNKNOWN_ERROR
,false
otherwise.
-
unknownError
public static AddSecondaryEmailResult unknownError(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.UNKNOWN_ERROR
.An unknown error occurred.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.UNKNOWN_ERROR
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getUnknownErrorValue
public java.lang.String getUnknownErrorValue()
An unknown error occurred.This instance must be tagged as
AddSecondaryEmailResult.Tag.UNKNOWN_ERROR
.- Returns:
- The
String
value associated with this instance ifisUnknownError()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisUnknownError()
isfalse
.
-
isRateLimited
public boolean isRateLimited()
Returnstrue
if this instance has the tagAddSecondaryEmailResult.Tag.RATE_LIMITED
,false
otherwise.- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.RATE_LIMITED
,false
otherwise.
-
rateLimited
public static AddSecondaryEmailResult rateLimited(java.lang.String value)
Returns an instance ofAddSecondaryEmailResult
that has its tag set toAddSecondaryEmailResult.Tag.RATE_LIMITED
.Too many emails are being sent to this email address. Please try again later.
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResult
with its tag set toAddSecondaryEmailResult.Tag.RATE_LIMITED
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
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 isnull
.
-
getRateLimitedValue
public java.lang.String getRateLimitedValue()
Too many emails are being sent to this email address. Please try again later.This instance must be tagged as
AddSecondaryEmailResult.Tag.RATE_LIMITED
.- Returns:
- The
String
value associated with this instance ifisRateLimited()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisRateLimited()
isfalse
.
-
isOther
public boolean isOther()
- Returns:
true
if this instance is tagged asAddSecondaryEmailResult.Tag.OTHER
,false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toStringMultiline
public java.lang.String 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
-
-