Class AddSecondaryEmailResult
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 enumDiscriminating tag type forAddSecondaryEmailResult. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AddSecondaryEmailResultCatch-all used for unknown tag values returned by the Dropbox servers. -
Method Summary
Modifier and TypeMethodDescriptionstatic AddSecondaryEmailResultalreadyOwnedByUser(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER.static AddSecondaryEmailResultalreadyPending(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.ALREADY_PENDING.booleanSecondary email is already a verified email for the user.Secondary email is already a pending email for the user.Too many emails are being sent to this email address.User already has the maximum number of secondary emails allowed.Describes a secondary email that was successfully added to a user.An error occurred due to conflicting updates.Field is deprecated.Secondary email is not available to be claimed by the user.An unknown error occurred.inthashCode()booleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER,falseotherwise.booleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_PENDING,falseotherwise.booleanisOther()booleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.RATE_LIMITED,falseotherwise.booleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.REACHED_LIMIT,falseotherwise.booleanbooleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES,falseotherwise.booleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TRANSIENT_ERROR,falseotherwise.booleanbooleanReturnstrueif this instance has the tagAddSecondaryEmailResult.Tag.UNKNOWN_ERROR,falseotherwise.static AddSecondaryEmailResultrateLimited(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.RATE_LIMITED.static AddSecondaryEmailResultreachedLimit(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.REACHED_LIMIT.static AddSecondaryEmailResultsuccess(SecondaryEmail value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.SUCCESS.tag()Returns the tag for this instance.static AddSecondaryEmailResulttooManyUpdates(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES.toString()Returns a String representation of this object formatted for easier readability.static AddSecondaryEmailResulttransientError(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR.static AddSecondaryEmailResultunavailable(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.UNAVAILABLE.static AddSecondaryEmailResultunknownError(String value) Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.UNKNOWN_ERROR.
-
Field Details
-
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 thisAddSecondaryEmailResult.If a tag returned by the server is unrecognized by this SDK, the
AddSecondaryEmailResult.Tag.OTHERvalue will be used.- Returns:
- the tag for this instance.
-
isSuccess
public boolean isSuccess()- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.SUCCESS,falseotherwise.
-
success
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.SUCCESS. - Throws:
IllegalArgumentException- ifvalueisnull.
-
getSuccessValue
Describes a secondary email that was successfully added to a user.This instance must be tagged as
AddSecondaryEmailResult.Tag.SUCCESS.- Returns:
- The
SecondaryEmailvalue associated with this instance ifisSuccess()istrue. - Throws:
IllegalStateException- IfisSuccess()isfalse.
-
isAlreadyPending
public boolean isAlreadyPending()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_PENDING,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.ALREADY_PENDING,falseotherwise.
-
alreadyPending
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.ALREADY_PENDING. - Throws:
IllegalArgumentException- ifvalueis 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
Secondary email is already a pending email for the user.This instance must be tagged as
AddSecondaryEmailResult.Tag.ALREADY_PENDING.- Returns:
- The
Stringvalue associated with this instance ifisAlreadyPending()istrue. - Throws:
IllegalStateException- IfisAlreadyPending()isfalse.
-
isAlreadyOwnedByUser
public boolean isAlreadyOwnedByUser()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER,falseotherwise.
-
alreadyOwnedByUser
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER. - Throws:
IllegalArgumentException- ifvalueis 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
Secondary email is already a verified email for the user.This instance must be tagged as
AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER.- Returns:
- The
Stringvalue associated with this instance ifisAlreadyOwnedByUser()istrue. - Throws:
IllegalStateException- IfisAlreadyOwnedByUser()isfalse.
-
isReachedLimit
public boolean isReachedLimit()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.REACHED_LIMIT,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.REACHED_LIMIT,falseotherwise.
-
reachedLimit
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.REACHED_LIMIT. - Throws:
IllegalArgumentException- ifvalueis 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
User already has the maximum number of secondary emails allowed.This instance must be tagged as
AddSecondaryEmailResult.Tag.REACHED_LIMIT.- Returns:
- The
Stringvalue associated with this instance ifisReachedLimit()istrue. - Throws:
IllegalStateException- IfisReachedLimit()isfalse.
-
isTransientError
public boolean isTransientError()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TRANSIENT_ERROR,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.TRANSIENT_ERROR,falseotherwise.
-
transientError
Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR.Field is deprecated. A transient error occurred. Please try again later.
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR. - Throws:
IllegalArgumentException- ifvalueis 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
Field is deprecated. A transient error occurred. Please try again later.This instance must be tagged as
AddSecondaryEmailResult.Tag.TRANSIENT_ERROR.- Returns:
- The
Stringvalue associated with this instance ifisTransientError()istrue. - Throws:
IllegalStateException- IfisTransientError()isfalse.
-
isTooManyUpdates
public boolean isTooManyUpdates()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES,falseotherwise.
-
tooManyUpdates
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES. - Throws:
IllegalArgumentException- ifvalueis 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
An error occurred due to conflicting updates. Please try again later.This instance must be tagged as
AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES.- Returns:
- The
Stringvalue associated with this instance ifisTooManyUpdates()istrue. - Throws:
IllegalStateException- IfisTooManyUpdates()isfalse.
-
isUnknownError
public boolean isUnknownError()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.UNKNOWN_ERROR,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.UNKNOWN_ERROR,falseotherwise.
-
unknownError
Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.UNKNOWN_ERROR.An unknown error occurred.
- Parameters:
value- value to assign to this instance.- Returns:
- Instance of
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.UNKNOWN_ERROR. - Throws:
IllegalArgumentException- ifvalueis 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
An unknown error occurred.This instance must be tagged as
AddSecondaryEmailResult.Tag.UNKNOWN_ERROR.- Returns:
- The
Stringvalue associated with this instance ifisUnknownError()istrue. - Throws:
IllegalStateException- IfisUnknownError()isfalse.
-
isRateLimited
public boolean isRateLimited()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.RATE_LIMITED,falseotherwise.- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.RATE_LIMITED,falseotherwise.
-
rateLimited
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.RATE_LIMITED. - Throws:
IllegalArgumentException- ifvalueis 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
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
Stringvalue associated with this instance ifisRateLimited()istrue. - Throws:
IllegalStateException- IfisRateLimited()isfalse.
-
isOther
public boolean isOther()- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.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
-