Class PermissionDeniedReason
- java.lang.Object
-
- com.dropbox.core.v2.sharing.PermissionDeniedReason
-
public final class PermissionDeniedReason extends java.lang.Object
Possible reasons the user is denied a permission.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
PermissionDeniedReason.Tag
Discriminating tag type forPermissionDeniedReason
.
-
Field Summary
Fields Modifier and Type Field Description static PermissionDeniedReason
FOLDER_IS_INSIDE_SHARED_FOLDER
Folder is inside of another shared folder.static PermissionDeniedReason
FOLDER_IS_LIMITED_TEAM_FOLDER
Folder is team folder for a limited team.static PermissionDeniedReason
OTHER
Catch-all used for unknown tag values returned by the Dropbox servers.static PermissionDeniedReason
OWNER_NOT_ON_TEAM
The content owner needs to be on a Dropbox team to perform this action.static PermissionDeniedReason
PERMISSION_DENIED
The user does not have permission to perform this action on the link.static PermissionDeniedReason
RESTRICTED_BY_PARENT_FOLDER
Policy cannot be changed due to restrictions from parent folder.static PermissionDeniedReason
RESTRICTED_BY_TEAM
The user's team policy prevents performing this action on the link.static PermissionDeniedReason
TARGET_IS_INDIRECT_MEMBER
Target is indirectly a member of the folder, for example by being part of a group.static PermissionDeniedReason
TARGET_IS_OWNER
Target is the owner of the folder.static PermissionDeniedReason
TARGET_IS_SELF
Target is the user itself.static PermissionDeniedReason
TARGET_NOT_ACTIVE
Target is not an active member of the team.static PermissionDeniedReason
USER_ACCOUNT_TYPE
The user's account type does not support this action.static PermissionDeniedReason
USER_NOT_ALLOWED_BY_OWNER
User is prohibited by the owner from taking the action.static PermissionDeniedReason
USER_NOT_ON_TEAM
The user needs to be on a Dropbox team to perform this action.static PermissionDeniedReason
USER_NOT_SAME_TEAM_AS_OWNER
User is not on the same team as the folder owner.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
InsufficientPlan
getInsufficientPlanValue()
This instance must be tagged asPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
.int
hashCode()
static PermissionDeniedReason
insufficientPlan(InsufficientPlan value)
Returns an instance ofPermissionDeniedReason
that has its tag set toPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
.boolean
isFolderIsInsideSharedFolder()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.FOLDER_IS_INSIDE_SHARED_FOLDER
,false
otherwise.boolean
isFolderIsLimitedTeamFolder()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.FOLDER_IS_LIMITED_TEAM_FOLDER
,false
otherwise.boolean
isInsufficientPlan()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
,false
otherwise.boolean
isOther()
boolean
isOwnerNotOnTeam()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.OWNER_NOT_ON_TEAM
,false
otherwise.boolean
isPermissionDenied()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.PERMISSION_DENIED
,false
otherwise.boolean
isRestrictedByParentFolder()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.RESTRICTED_BY_PARENT_FOLDER
,false
otherwise.boolean
isRestrictedByTeam()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.RESTRICTED_BY_TEAM
,false
otherwise.boolean
isTargetIsIndirectMember()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_IS_INDIRECT_MEMBER
,false
otherwise.boolean
isTargetIsOwner()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_IS_OWNER
,false
otherwise.boolean
isTargetIsSelf()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_IS_SELF
,false
otherwise.boolean
isTargetNotActive()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_NOT_ACTIVE
,false
otherwise.boolean
isUserAccountType()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_ACCOUNT_TYPE
,false
otherwise.boolean
isUserNotAllowedByOwner()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_NOT_ALLOWED_BY_OWNER
,false
otherwise.boolean
isUserNotOnTeam()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_NOT_ON_TEAM
,false
otherwise.boolean
isUserNotSameTeamAsOwner()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_NOT_SAME_TEAM_AS_OWNER
,false
otherwise.PermissionDeniedReason.Tag
tag()
Returns the tag for this instance.java.lang.String
toString()
java.lang.String
toStringMultiline()
Returns a String representation of this object formatted for easier readability.
-
-
-
Field Detail
-
USER_NOT_SAME_TEAM_AS_OWNER
public static final PermissionDeniedReason USER_NOT_SAME_TEAM_AS_OWNER
User is not on the same team as the folder owner.
-
USER_NOT_ALLOWED_BY_OWNER
public static final PermissionDeniedReason USER_NOT_ALLOWED_BY_OWNER
User is prohibited by the owner from taking the action.
-
TARGET_IS_INDIRECT_MEMBER
public static final PermissionDeniedReason TARGET_IS_INDIRECT_MEMBER
Target is indirectly a member of the folder, for example by being part of a group.
-
TARGET_IS_OWNER
public static final PermissionDeniedReason TARGET_IS_OWNER
Target is the owner of the folder.
-
TARGET_IS_SELF
public static final PermissionDeniedReason TARGET_IS_SELF
Target is the user itself.
-
TARGET_NOT_ACTIVE
public static final PermissionDeniedReason TARGET_NOT_ACTIVE
Target is not an active member of the team.
-
FOLDER_IS_LIMITED_TEAM_FOLDER
public static final PermissionDeniedReason FOLDER_IS_LIMITED_TEAM_FOLDER
Folder is team folder for a limited team.
-
OWNER_NOT_ON_TEAM
public static final PermissionDeniedReason OWNER_NOT_ON_TEAM
The content owner needs to be on a Dropbox team to perform this action.
-
PERMISSION_DENIED
public static final PermissionDeniedReason PERMISSION_DENIED
The user does not have permission to perform this action on the link.
-
RESTRICTED_BY_TEAM
public static final PermissionDeniedReason RESTRICTED_BY_TEAM
The user's team policy prevents performing this action on the link.
-
USER_ACCOUNT_TYPE
public static final PermissionDeniedReason USER_ACCOUNT_TYPE
The user's account type does not support this action.
-
USER_NOT_ON_TEAM
public static final PermissionDeniedReason USER_NOT_ON_TEAM
The user needs to be on a Dropbox team to perform this action.
-
FOLDER_IS_INSIDE_SHARED_FOLDER
public static final PermissionDeniedReason FOLDER_IS_INSIDE_SHARED_FOLDER
Folder is inside of another shared folder.
-
RESTRICTED_BY_PARENT_FOLDER
public static final PermissionDeniedReason RESTRICTED_BY_PARENT_FOLDER
Policy cannot be changed due to restrictions from parent folder.
-
OTHER
public static final PermissionDeniedReason 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 PermissionDeniedReason.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 thisPermissionDeniedReason
.If a tag returned by the server is unrecognized by this SDK, the
PermissionDeniedReason.Tag.OTHER
value will be used.- Returns:
- the tag for this instance.
-
isUserNotSameTeamAsOwner
public boolean isUserNotSameTeamAsOwner()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_NOT_SAME_TEAM_AS_OWNER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.USER_NOT_SAME_TEAM_AS_OWNER
,false
otherwise.
-
isUserNotAllowedByOwner
public boolean isUserNotAllowedByOwner()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_NOT_ALLOWED_BY_OWNER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.USER_NOT_ALLOWED_BY_OWNER
,false
otherwise.
-
isTargetIsIndirectMember
public boolean isTargetIsIndirectMember()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_IS_INDIRECT_MEMBER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.TARGET_IS_INDIRECT_MEMBER
,false
otherwise.
-
isTargetIsOwner
public boolean isTargetIsOwner()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_IS_OWNER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.TARGET_IS_OWNER
,false
otherwise.
-
isTargetIsSelf
public boolean isTargetIsSelf()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_IS_SELF
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.TARGET_IS_SELF
,false
otherwise.
-
isTargetNotActive
public boolean isTargetNotActive()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.TARGET_NOT_ACTIVE
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.TARGET_NOT_ACTIVE
,false
otherwise.
-
isFolderIsLimitedTeamFolder
public boolean isFolderIsLimitedTeamFolder()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.FOLDER_IS_LIMITED_TEAM_FOLDER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.FOLDER_IS_LIMITED_TEAM_FOLDER
,false
otherwise.
-
isOwnerNotOnTeam
public boolean isOwnerNotOnTeam()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.OWNER_NOT_ON_TEAM
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.OWNER_NOT_ON_TEAM
,false
otherwise.
-
isPermissionDenied
public boolean isPermissionDenied()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.PERMISSION_DENIED
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.PERMISSION_DENIED
,false
otherwise.
-
isRestrictedByTeam
public boolean isRestrictedByTeam()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.RESTRICTED_BY_TEAM
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.RESTRICTED_BY_TEAM
,false
otherwise.
-
isUserAccountType
public boolean isUserAccountType()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_ACCOUNT_TYPE
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.USER_ACCOUNT_TYPE
,false
otherwise.
-
isUserNotOnTeam
public boolean isUserNotOnTeam()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.USER_NOT_ON_TEAM
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.USER_NOT_ON_TEAM
,false
otherwise.
-
isFolderIsInsideSharedFolder
public boolean isFolderIsInsideSharedFolder()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.FOLDER_IS_INSIDE_SHARED_FOLDER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.FOLDER_IS_INSIDE_SHARED_FOLDER
,false
otherwise.
-
isRestrictedByParentFolder
public boolean isRestrictedByParentFolder()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.RESTRICTED_BY_PARENT_FOLDER
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.RESTRICTED_BY_PARENT_FOLDER
,false
otherwise.
-
isInsufficientPlan
public boolean isInsufficientPlan()
Returnstrue
if this instance has the tagPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
,false
otherwise.- Returns:
true
if this instance is tagged asPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
,false
otherwise.
-
insufficientPlan
public static PermissionDeniedReason insufficientPlan(InsufficientPlan value)
Returns an instance ofPermissionDeniedReason
that has its tag set toPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
.None
- Parameters:
value
- value to assign to this instance.- Returns:
- Instance of
PermissionDeniedReason
with its tag set toPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
. - Throws:
java.lang.IllegalArgumentException
- ifvalue
isnull
.
-
getInsufficientPlanValue
public InsufficientPlan getInsufficientPlanValue()
This instance must be tagged asPermissionDeniedReason.Tag.INSUFFICIENT_PLAN
.- Returns:
- The
InsufficientPlan
value associated with this instance ifisInsufficientPlan()
istrue
. - Throws:
java.lang.IllegalStateException
- IfisInsufficientPlan()
isfalse
.
-
isOther
public boolean isOther()
- Returns:
true
if this instance is tagged asPermissionDeniedReason.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
-
-