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 SummaryNested Classes Modifier and Type Class Description static classAddSecondaryEmailResult.TagDiscriminating tag type forAddSecondaryEmailResult.
 - 
Field SummaryFields Modifier and Type Field Description static AddSecondaryEmailResultOTHERCatch-all used for unknown tag values returned by the Dropbox servers.
 - 
Method SummaryAll 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- 
OTHERpublic 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- 
tagpublic 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.
 
 - 
isSuccesspublic boolean isSuccess() - Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.SUCCESS,- falseotherwise.
 
 - 
successpublic 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- if- valueis- null.
 
 - 
getSuccessValuepublic 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- If- isSuccess()is- false.
 
 - 
isUnavailablepublic boolean isUnavailable() - Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.UNAVAILABLE,- falseotherwise.
 
 - 
unavailablepublic 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- if- valueis 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.
 
 - 
getUnavailableValuepublic 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- If- isUnavailable()is- false.
 
 - 
isAlreadyPendingpublic boolean isAlreadyPending() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_PENDING,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.ALREADY_PENDING,- falseotherwise.
 
 - 
alreadyPendingpublic 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- if- valueis 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.
 
 - 
getAlreadyPendingValuepublic 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- If- isAlreadyPending()is- false.
 
 - 
isAlreadyOwnedByUserpublic boolean isAlreadyOwnedByUser() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.ALREADY_OWNED_BY_USER,- falseotherwise.
 
 - 
alreadyOwnedByUserpublic 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- if- valueis 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.
 
 - 
getAlreadyOwnedByUserValuepublic 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- If- isAlreadyOwnedByUser()is- false.
 
 - 
isReachedLimitpublic boolean isReachedLimit() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.REACHED_LIMIT,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.REACHED_LIMIT,- falseotherwise.
 
 - 
reachedLimitpublic 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- if- valueis 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.
 
 - 
getReachedLimitValuepublic 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- If- isReachedLimit()is- false.
 
 - 
isTransientErrorpublic boolean isTransientError() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TRANSIENT_ERROR,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.TRANSIENT_ERROR,- falseotherwise.
 
 - 
transientErrorpublic 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- if- valueis 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.
 
 - 
getTransientErrorValuepublic 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- If- isTransientError()is- false.
 
 - 
isTooManyUpdatespublic boolean isTooManyUpdates() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.TOO_MANY_UPDATES,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.TOO_MANY_UPDATES,- falseotherwise.
 
 - 
tooManyUpdatespublic 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- if- valueis 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.
 
 - 
getTooManyUpdatesValuepublic 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- If- isTooManyUpdates()is- false.
 
 - 
isUnknownErrorpublic boolean isUnknownError() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.UNKNOWN_ERROR,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.UNKNOWN_ERROR,- falseotherwise.
 
 - 
unknownErrorpublic 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- if- valueis 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.
 
 - 
getUnknownErrorValuepublic 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- If- isUnknownError()is- false.
 
 - 
isRateLimitedpublic boolean isRateLimited() Returnstrueif this instance has the tagAddSecondaryEmailResult.Tag.RATE_LIMITED,falseotherwise.- Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.RATE_LIMITED,- falseotherwise.
 
 - 
rateLimitedpublic 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- if- valueis 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.
 
 - 
getRateLimitedValuepublic 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- If- isRateLimited()is- false.
 
 - 
isOtherpublic boolean isOther() - Returns:
- trueif this instance is tagged as- AddSecondaryEmailResult.Tag.OTHER,- falseotherwise.
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object obj) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 - 
toStringMultilinepublic 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
 
 
- 
 
-