Package com.dropbox.core.v2.sharing
Class LinkPermissions.Builder
java.lang.Object
com.dropbox.core.v2.sharing.LinkPermissions.Builder
- Enclosing class:
LinkPermissions
Builder for
LinkPermissions.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final booleanprotected List<LinkAudienceOption> protected final booleanprotected final booleanprotected final booleanprotected Booleanprotected Booleanprotected final booleanprotected final booleanprotected Booleanprotected Booleanprotected Booleanprotected ChangeLinkExpirationPolicyprotected DefaultLinkExpirationDaysPolicyprotected LinkAudienceprotected EnforceLinkPasswordPolicyprotected LinkAccessLevelprotected RequestedVisibilityprotected Booleanprotected ResolvedVisibilityprotected SharedLinkAccessFailureReasonprotected final booleanprotected final List<VisibilityPolicy> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBuilder(boolean canRevoke, List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments) -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds an instance ofLinkPermissionsconfigured with this builder's valueswithAudienceOptions(List<LinkAudienceOption> audienceOptions) Set value for optional field.withCanRemovePassword(Boolean canRemovePassword) Set value for optional field.withCanRequestAccess(Boolean canRequestAccess) Set value for optional field.withCanSetPassword(Boolean canSetPassword) Set value for optional field.withCanSync(Boolean canSync) Set value for optional field.withCanUseExtendedSharingControls(Boolean canUseExtendedSharingControls) Set value for optional field.withChangeSharedLinkExpirationPolicy(ChangeLinkExpirationPolicy changeSharedLinkExpirationPolicy) Set value for optional field.withDaysToExpirePolicy(DefaultLinkExpirationDaysPolicy daysToExpirePolicy) Set value for optional field.withEffectiveAudience(LinkAudience effectiveAudience) Set value for optional field.withEnforceSharedLinkPasswordPolicy(EnforceLinkPasswordPolicy enforceSharedLinkPasswordPolicy) Set value for optional field.withLinkAccessLevel(LinkAccessLevel linkAccessLevel) Set value for optional field.withRequestedVisibility(RequestedVisibility requestedVisibility) Set value for optional field.withRequirePassword(Boolean requirePassword) Set value for optional field.withResolvedVisibility(ResolvedVisibility resolvedVisibility) Set value for optional field.withRevokeFailureReason(SharedLinkAccessFailureReason revokeFailureReason) Set value for optional field.
-
Field Details
-
canRevoke
protected final boolean canRevoke -
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
-
requestedVisibility
-
revokeFailureReason
-
effectiveAudience
-
linkAccessLevel
-
audienceOptions
-
canSetPassword
-
canRemovePassword
-
requirePassword
-
canUseExtendedSharingControls
-
canSync
-
canRequestAccess
-
daysToExpirePolicy
-
-
Constructor Details
-
Builder
protected Builder(boolean canRevoke, List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments)
-
-
Method Details
-
withResolvedVisibility
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
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
-
withEffectiveAudience
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
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
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 anullitem.- Returns:
- this builder
- Throws:
IllegalArgumentException- If any argument does not meet its preconditions.
-
withCanSetPassword
Set value for optional field.- Parameters:
canSetPassword- Whether the user can set a password for the link.- Returns:
- this builder
-
withCanRemovePassword
Set value for optional field.- Parameters:
canRemovePassword- Whether the user can remove the password of the link.- Returns:
- this builder
-
withRequirePassword
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(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
-
withCanSync
Set value for optional field.- Parameters:
canSync- Whether a user can save the content to their Dropbox account.- Returns:
- this builder
-
withCanRequestAccess
Set value for optional field.- Parameters:
canRequestAccess- Whether the user can request access to the content.- Returns:
- this builder
-
withDaysToExpirePolicy
public LinkPermissions.Builder withDaysToExpirePolicy(DefaultLinkExpirationDaysPolicy daysToExpirePolicy) Set value for optional field.- Parameters:
daysToExpirePolicy- Existing owning team's policy for default number of days from today to link's expiration. Not provided if the link is not team owned.- Returns:
- this builder
-
build
Builds an instance ofLinkPermissionsconfigured with this builder's values- Returns:
- new instance of
LinkPermissions
-