Package com.dropbox.core.v2.sharing
Class LinkPermissions.Builder
- java.lang.Object
-
- com.dropbox.core.v2.sharing.LinkPermissions.Builder
-
- Enclosing class:
- LinkPermissions
public static class LinkPermissions.Builder extends java.lang.Object
Builder forLinkPermissions
.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
allowComments
protected boolean
allowDownload
protected java.util.List<LinkAudienceOption>
audienceOptions
protected boolean
canAllowDownload
protected boolean
canDisallowDownload
protected boolean
canRemoveExpiry
protected java.lang.Boolean
canRemovePassword
protected boolean
canRevoke
protected boolean
canSetExpiry
protected java.lang.Boolean
canSetPassword
protected java.lang.Boolean
canUseExtendedSharingControls
protected LinkAudience
effectiveAudience
protected LinkAccessLevel
linkAccessLevel
protected RequestedVisibility
requestedVisibility
protected java.lang.Boolean
requirePassword
protected ResolvedVisibility
resolvedVisibility
protected SharedLinkAccessFailureReason
revokeFailureReason
protected boolean
teamRestrictsComments
protected java.util.List<VisibilityPolicy>
visibilityPolicies
-
Constructor Summary
Constructors Modifier Constructor Description protected
Builder(boolean canRevoke, java.util.List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LinkPermissions
build()
Builds an instance ofLinkPermissions
configured with this builder's valuesLinkPermissions.Builder
withAudienceOptions(java.util.List<LinkAudienceOption> audienceOptions)
Set value for optional field.LinkPermissions.Builder
withCanRemovePassword(java.lang.Boolean canRemovePassword)
Set value for optional field.LinkPermissions.Builder
withCanSetPassword(java.lang.Boolean canSetPassword)
Set value for optional field.LinkPermissions.Builder
withCanUseExtendedSharingControls(java.lang.Boolean canUseExtendedSharingControls)
Set value for optional field.LinkPermissions.Builder
withEffectiveAudience(LinkAudience effectiveAudience)
Set value for optional field.LinkPermissions.Builder
withLinkAccessLevel(LinkAccessLevel linkAccessLevel)
Set value for optional field.LinkPermissions.Builder
withRequestedVisibility(RequestedVisibility requestedVisibility)
Set value for optional field.LinkPermissions.Builder
withRequirePassword(java.lang.Boolean requirePassword)
Set value for optional field.LinkPermissions.Builder
withResolvedVisibility(ResolvedVisibility resolvedVisibility)
Set value for optional field.LinkPermissions.Builder
withRevokeFailureReason(SharedLinkAccessFailureReason revokeFailureReason)
Set value for optional field.
-
-
-
Field Detail
-
canRevoke
protected final boolean canRevoke
-
visibilityPolicies
protected final java.util.List<VisibilityPolicy> visibilityPolicies
-
canSetExpiry
protected final boolean canSetExpiry
-
canRemoveExpiry
protected final boolean canRemoveExpiry
-
allowDownload
protected final boolean allowDownload
-
canAllowDownload
protected final boolean canAllowDownload
-
canDisallowDownload
protected final boolean canDisallowDownload
-
allowComments
protected final boolean allowComments
-
teamRestrictsComments
protected final boolean teamRestrictsComments
-
resolvedVisibility
protected ResolvedVisibility resolvedVisibility
-
requestedVisibility
protected RequestedVisibility requestedVisibility
-
revokeFailureReason
protected SharedLinkAccessFailureReason revokeFailureReason
-
effectiveAudience
protected LinkAudience effectiveAudience
-
linkAccessLevel
protected LinkAccessLevel linkAccessLevel
-
audienceOptions
protected java.util.List<LinkAudienceOption> audienceOptions
-
canSetPassword
protected java.lang.Boolean canSetPassword
-
canRemovePassword
protected java.lang.Boolean canRemovePassword
-
requirePassword
protected java.lang.Boolean requirePassword
-
canUseExtendedSharingControls
protected java.lang.Boolean canUseExtendedSharingControls
-
-
Constructor Detail
-
Builder
protected Builder(boolean canRevoke, java.util.List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments)
-
-
Method Detail
-
withResolvedVisibility
public LinkPermissions.Builder withResolvedVisibility(ResolvedVisibility resolvedVisibility)
Set value for optional field.- Parameters:
resolvedVisibility
- The current visibility of the link after considering the shared links policies of the the team (in case the link's owner is part of a team) and the shared folder (in case the linked file is part of a shared folder). This field is shown only if the caller has access to this info (the link's owner always has access to this data). For some links, an effective_audience value is returned instead.- Returns:
- this builder
-
withRequestedVisibility
public LinkPermissions.Builder withRequestedVisibility(RequestedVisibility requestedVisibility)
Set value for optional field.- Parameters:
requestedVisibility
- The shared link's requested visibility. This can be overridden by the team and shared folder policies. The final visibility, after considering these policies, can be found inLinkPermissions.getResolvedVisibility()
. This is shown only if the caller is the link's owner and resolved_visibility is returned instead of effective_audience.- Returns:
- this builder
-
withRevokeFailureReason
public LinkPermissions.Builder withRevokeFailureReason(SharedLinkAccessFailureReason revokeFailureReason)
Set value for optional field.- Parameters:
revokeFailureReason
- The failure reason for revoking the link. This field will only be present if theLinkPermissions.getCanRevoke()
isfalse
.- Returns:
- this builder
-
withEffectiveAudience
public LinkPermissions.Builder withEffectiveAudience(LinkAudience effectiveAudience)
Set value for optional field.- Parameters:
effectiveAudience
- The type of audience who can benefit from the access level specified by the `link_access_level` field.- Returns:
- this builder
-
withLinkAccessLevel
public LinkPermissions.Builder withLinkAccessLevel(LinkAccessLevel linkAccessLevel)
Set value for optional field.- Parameters:
linkAccessLevel
- The access level that the link will grant to its users. A link can grant additional rights to a user beyond their current access level. For example, if a user was invited as a viewer to a file, and then opens a link with `link_access_level` set to `editor`, then they will gain editor privileges. The `link_access_level` is a property of the link, and does not depend on who is calling this API. In particular, `link_access_level` does not take into account the API caller's current permissions to the content.- Returns:
- this builder
-
withAudienceOptions
public LinkPermissions.Builder withAudienceOptions(java.util.List<LinkAudienceOption> audienceOptions)
Set value for optional field.- Parameters:
audienceOptions
- A list of link audience options the user might be able to set as the new audience. Must not contain anull
item.- Returns:
- this builder
- Throws:
java.lang.IllegalArgumentException
- If any argument does not meet its preconditions.
-
withCanSetPassword
public LinkPermissions.Builder withCanSetPassword(java.lang.Boolean canSetPassword)
Set value for optional field.- Parameters:
canSetPassword
- Whether the user can set a password for the link.- Returns:
- this builder
-
withCanRemovePassword
public LinkPermissions.Builder withCanRemovePassword(java.lang.Boolean canRemovePassword)
Set value for optional field.- Parameters:
canRemovePassword
- Whether the user can remove the password of the link.- Returns:
- this builder
-
withRequirePassword
public LinkPermissions.Builder withRequirePassword(java.lang.Boolean requirePassword)
Set value for optional field.- Parameters:
requirePassword
- Whether the user is required to provide a password to view the link.- Returns:
- this builder
-
withCanUseExtendedSharingControls
public LinkPermissions.Builder withCanUseExtendedSharingControls(java.lang.Boolean canUseExtendedSharingControls)
Set value for optional field.- Parameters:
canUseExtendedSharingControls
- Whether the user can use extended sharing controls, based on their account type.- Returns:
- this builder
-
build
public LinkPermissions build()
Builds an instance ofLinkPermissions
configured with this builder's values- Returns:
- new instance of
LinkPermissions
-
-