Class AddSecondaryEmailResult
- java.lang.Object
-
- com.dropbox.core.v2.team.AddSecondaryEmailResult
-
public final class AddSecondaryEmailResult extends java.lang.ObjectResult 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 occurred.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
OTHERvalue will be used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAddSecondaryEmailResult.TagDiscriminating tag type forAddSecondaryEmailResult.
-
Field Summary
Fields Modifier and Type Field Description static AddSecondaryEmailResultOTHERCatch-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 AddSecondaryEmailResultalreadyOwnedByUser(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER.static AddSecondaryEmailResultalreadyPending(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.ALREADY_PENDING.booleanequals(java.lang.Object obj)java.lang.StringgetAlreadyOwnedByUserValue()Secondary email is already a verified email for the user.java.lang.StringgetAlreadyPendingValue()Secondary email is already a pending email for the user.java.lang.StringgetRateLimitedValue()Too many emails are being sent to this email address.java.lang.StringgetReachedLimitValue()User already has the maximum number of secondary emails allowed.SecondaryEmailgetSuccessValue()Describes a secondary email that was successfully added to a user.java.lang.StringgetTooManyUpdatesValue()An error occurred due to conflicting updates.java.lang.StringgetTransientErrorValue()A transient error occurred.java.lang.StringgetUnavailableValue()Secondary email is not available to be claimed by the user.java.lang.StringgetUnknownErrorValue()An unknown error occurred.inthashCode()booleanisAlreadyOwnedByUser()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER,falseotherwise.booleanisAlreadyPending()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_PENDING,falseotherwise.booleanisOther()booleanisRateLimited()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.RATE_LIMITED,falseotherwise.booleanisReachedLimit()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.REACHED_LIMIT,falseotherwise.booleanisSuccess()booleanisTooManyUpdates()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES,falseotherwise.booleanisTransientError()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TRANSIENT_ERROR,falseotherwise.booleanisUnavailable()booleanisUnknownError()Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.UNKNOWN_ERROR,falseotherwise.static AddSecondaryEmailResultrateLimited(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.RATE_LIMITED.static AddSecondaryEmailResultreachedLimit(java.lang.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.AddSecondaryEmailResult.Tagtag()Returns the tag for this instance.static AddSecondaryEmailResulttooManyUpdates(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES.java.lang.StringtoString()java.lang.StringtoStringMultiline()Returns a String representation of this object formatted for easier readability.static AddSecondaryEmailResulttransientError(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR.static AddSecondaryEmailResultunavailable(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat has its tag set toAddSecondaryEmailResult.Tag.UNAVAILABLE.static AddSecondaryEmailResultunknownError(java.lang.String value)Returns an instance ofAddSecondaryEmailResultthat 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 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
public static AddSecondaryEmailResult success(SecondaryEmail value)
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:
java.lang.IllegalArgumentException- ifvalueisnull.
-
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
SecondaryEmailvalue associated with this instance ifisSuccess()istrue. - Throws:
java.lang.IllegalStateException- IfisSuccess()isfalse.
-
isUnavailable
public boolean isUnavailable()
- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.UNAVAILABLE,falseotherwise.
-
unavailable
public static AddSecondaryEmailResult unavailable(java.lang.String value)
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.UNAVAILABLE. - Throws:
java.lang.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.
-
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
Stringvalue associated with this instance ifisUnavailable()istrue. - Throws:
java.lang.IllegalStateException- IfisUnavailable()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
public static AddSecondaryEmailResult alreadyPending(java.lang.String value)
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:
java.lang.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
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
Stringvalue associated with this instance ifisAlreadyPending()istrue. - Throws:
java.lang.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
public static AddSecondaryEmailResult alreadyOwnedByUser(java.lang.String value)
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:
java.lang.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
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
Stringvalue associated with this instance ifisAlreadyOwnedByUser()istrue. - Throws:
java.lang.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
public static AddSecondaryEmailResult reachedLimit(java.lang.String value)
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:
java.lang.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
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
Stringvalue associated with this instance ifisReachedLimit()istrue. - Throws:
java.lang.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
public static AddSecondaryEmailResult transientError(java.lang.String value)
Returns an instance ofAddSecondaryEmailResultthat 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
AddSecondaryEmailResultwith its tag set toAddSecondaryEmailResult.Tag.TRANSIENT_ERROR. - Throws:
java.lang.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
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
Stringvalue associated with this instance ifisTransientError()istrue. - Throws:
java.lang.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
public static AddSecondaryEmailResult tooManyUpdates(java.lang.String value)
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:
java.lang.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
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
Stringvalue associated with this instance ifisTooManyUpdates()istrue. - Throws:
java.lang.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
public static AddSecondaryEmailResult unknownError(java.lang.String value)
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:
java.lang.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
public java.lang.String 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:
java.lang.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
public static AddSecondaryEmailResult rateLimited(java.lang.String value)
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:
java.lang.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
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
Stringvalue associated with this instance ifisRateLimited()istrue. - Throws:
java.lang.IllegalStateException- IfisRateLimited()isfalse.
-
isOther
public boolean isOther()
- Returns:
trueif this instance is tagged asAddSecondaryEmailResult.Tag.OTHER,falseotherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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
-
-