Class LinkPermissions

java.lang.Object
com.dropbox.core.v2.sharing.LinkPermissions

public class LinkPermissions extends Object
  • Field Details

    • resolvedVisibility

      @Nullable protected final ResolvedVisibility resolvedVisibility
    • requestedVisibility

      @Nullable protected final RequestedVisibility requestedVisibility
    • canRevoke

      protected final boolean canRevoke
    • revokeFailureReason

      @Nullable protected final SharedLinkAccessFailureReason revokeFailureReason
    • effectiveAudience

      @Nullable protected final LinkAudience effectiveAudience
    • linkAccessLevel

      @Nullable protected final LinkAccessLevel linkAccessLevel
    • visibilityPolicies

      @Nonnull protected final 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
    • audienceOptions

      @Nullable protected final List<LinkAudienceOption> audienceOptions
    • canSetPassword

      @Nullable protected final Boolean canSetPassword
    • canRemovePassword

      @Nullable protected final Boolean canRemovePassword
    • requirePassword

      @Nullable protected final Boolean requirePassword
    • canUseExtendedSharingControls

      @Nullable protected final Boolean canUseExtendedSharingControls
    • canSync

      @Nullable protected final Boolean canSync
    • canRequestAccess

      @Nullable protected final Boolean canRequestAccess
    • enforceSharedLinkPasswordPolicy

      @Nullable protected final EnforceLinkPasswordPolicy enforceSharedLinkPasswordPolicy
    • daysToExpirePolicy

      @Nullable protected final DefaultLinkExpirationDaysPolicy daysToExpirePolicy
    • changeSharedLinkExpirationPolicy

      @Nullable protected final ChangeLinkExpirationPolicy changeSharedLinkExpirationPolicy
  • Constructor Details

    • LinkPermissions

      public LinkPermissions(boolean canRevoke, @Nonnull List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments, @Nullable ResolvedVisibility resolvedVisibility, @Nullable RequestedVisibility requestedVisibility, @Nullable SharedLinkAccessFailureReason revokeFailureReason, @Nullable LinkAudience effectiveAudience, @Nullable LinkAccessLevel linkAccessLevel, @Nullable List<LinkAudienceOption> audienceOptions, @Nullable Boolean canSetPassword, @Nullable Boolean canRemovePassword, @Nullable Boolean requirePassword, @Nullable Boolean canUseExtendedSharingControls, @Nullable Boolean canSync, @Nullable Boolean canRequestAccess, @Nullable EnforceLinkPasswordPolicy enforceSharedLinkPasswordPolicy, @Nullable DefaultLinkExpirationDaysPolicy daysToExpirePolicy, @Nullable ChangeLinkExpirationPolicy changeSharedLinkExpirationPolicy)
      Parameters:
      canRevoke - Whether the caller can revoke the shared link.
      visibilityPolicies - A list of policies that the user might be able to set for the visibility. Must not contain a null item and not be null.
      canSetExpiry - Whether the user can set the expiry settings of the link. This refers to the ability to create a new expiry and modify an existing expiry.
      canRemoveExpiry - Whether the user can remove the expiry of the link.
      allowDownload - Whether the link can be downloaded or not.
      canAllowDownload - Whether the user can allow downloads via the link. This refers to the ability to remove a no-download restriction on the link.
      canDisallowDownload - Whether the user can disallow downloads via the link. This refers to the ability to impose a no-download restriction on the link.
      allowComments - Field is deprecated. Whether comments are enabled for the linked file. This takes the team commenting policy into account.
      teamRestrictsComments - Field is deprecated. Whether the team has disabled commenting globally.
      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.
      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 in getResolvedVisibility(). This is shown only if the caller is the link's owner and resolved_visibility is returned instead of effective_audience.
      revokeFailureReason - The failure reason for revoking the link. This field will only be present if the getCanRevoke() is false.
      effectiveAudience - The type of audience who can benefit from the access level specified by the `link_access_level` field.
      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.
      audienceOptions - A list of link audience options the user might be able to set as the new audience. Must not contain a null item.
      canSetPassword - Whether the user can set a password for the link.
      canRemovePassword - Whether the user can remove the password of the link.
      requirePassword - Whether the user is required to provide a password to view the link.
      canUseExtendedSharingControls - Whether the user can use extended sharing controls, based on their account type.
      canSync - Whether a user can save the content to their Dropbox account.
      canRequestAccess - Whether the user can request access to the content.
      enforceSharedLinkPasswordPolicy - Whether the updated externally available shared link must have password set. Not provided if the link is not team owned.
      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.
      changeSharedLinkExpirationPolicy - When owning team's policy getChangeSharedLinkExpirationPolicy() is ChangeLinkExpirationPolicy.NOT_ALLOWED, the updated externally available shared link expiration value cannot be less strict than getDaysToExpirePolicy(). In this case getDaysToExpirePolicy() is expected to be different from `none`. Not provided if the link is not team owned.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • LinkPermissions

      public LinkPermissions(boolean canRevoke, @Nonnull List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments)
      None

      The default values for unset fields will be used.

      Parameters:
      canRevoke - Whether the caller can revoke the shared link.
      visibilityPolicies - A list of policies that the user might be able to set for the visibility. Must not contain a null item and not be null.
      canSetExpiry - Whether the user can set the expiry settings of the link. This refers to the ability to create a new expiry and modify an existing expiry.
      canRemoveExpiry - Whether the user can remove the expiry of the link.
      allowDownload - Whether the link can be downloaded or not.
      canAllowDownload - Whether the user can allow downloads via the link. This refers to the ability to remove a no-download restriction on the link.
      canDisallowDownload - Whether the user can disallow downloads via the link. This refers to the ability to impose a no-download restriction on the link.
      allowComments - Field is deprecated. Whether comments are enabled for the linked file. This takes the team commenting policy into account.
      teamRestrictsComments - Field is deprecated. Whether the team has disabled commenting globally.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
  • Method Details

    • getCanRevoke

      public boolean getCanRevoke()
      Whether the caller can revoke the shared link.
      Returns:
      value for this field.
    • getVisibilityPolicies

      @Nonnull public List<VisibilityPolicy> getVisibilityPolicies()
      A list of policies that the user might be able to set for the visibility.
      Returns:
      value for this field, never null.
    • getCanSetExpiry

      public boolean getCanSetExpiry()
      Whether the user can set the expiry settings of the link. This refers to the ability to create a new expiry and modify an existing expiry.
      Returns:
      value for this field.
    • getCanRemoveExpiry

      public boolean getCanRemoveExpiry()
      Whether the user can remove the expiry of the link.
      Returns:
      value for this field.
    • getAllowDownload

      public boolean getAllowDownload()
      Whether the link can be downloaded or not.
      Returns:
      value for this field.
    • getCanAllowDownload

      public boolean getCanAllowDownload()
      Whether the user can allow downloads via the link. This refers to the ability to remove a no-download restriction on the link.
      Returns:
      value for this field.
    • getCanDisallowDownload

      public boolean getCanDisallowDownload()
      Whether the user can disallow downloads via the link. This refers to the ability to impose a no-download restriction on the link.
      Returns:
      value for this field.
    • getAllowComments

      @Deprecated public boolean getAllowComments()
      Deprecated.
      Field is deprecated. Whether comments are enabled for the linked file. This takes the team commenting policy into account.
      Returns:
      value for this field.
    • getTeamRestrictsComments

      @Deprecated public boolean getTeamRestrictsComments()
      Deprecated.
      Field is deprecated. Whether the team has disabled commenting globally.
      Returns:
      value for this field.
    • getResolvedVisibility

      @Nullable public ResolvedVisibility getResolvedVisibility()
      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:
      value for this field, or null if not present.
    • getRequestedVisibility

      @Nullable public RequestedVisibility getRequestedVisibility()
      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 in getResolvedVisibility(). This is shown only if the caller is the link's owner and resolved_visibility is returned instead of effective_audience.
      Returns:
      value for this field, or null if not present.
    • getRevokeFailureReason

      @Nullable public SharedLinkAccessFailureReason getRevokeFailureReason()
      The failure reason for revoking the link. This field will only be present if the getCanRevoke() is false.
      Returns:
      value for this field, or null if not present.
    • getEffectiveAudience

      @Nullable public LinkAudience getEffectiveAudience()
      The type of audience who can benefit from the access level specified by the `link_access_level` field.
      Returns:
      value for this field, or null if not present.
    • getLinkAccessLevel

      @Nullable public LinkAccessLevel getLinkAccessLevel()
      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:
      value for this field, or null if not present.
    • getAudienceOptions

      @Nullable public List<LinkAudienceOption> getAudienceOptions()
      A list of link audience options the user might be able to set as the new audience.
      Returns:
      value for this field, or null if not present.
    • getCanSetPassword

      @Nullable public Boolean getCanSetPassword()
      Whether the user can set a password for the link.
      Returns:
      value for this field, or null if not present.
    • getCanRemovePassword

      @Nullable public Boolean getCanRemovePassword()
      Whether the user can remove the password of the link.
      Returns:
      value for this field, or null if not present.
    • getRequirePassword

      @Nullable public Boolean getRequirePassword()
      Whether the user is required to provide a password to view the link.
      Returns:
      value for this field, or null if not present.
    • getCanUseExtendedSharingControls

      @Nullable public Boolean getCanUseExtendedSharingControls()
      Whether the user can use extended sharing controls, based on their account type.
      Returns:
      value for this field, or null if not present.
    • getCanSync

      @Nullable public Boolean getCanSync()
      Whether a user can save the content to their Dropbox account.
      Returns:
      value for this field, or null if not present.
    • getCanRequestAccess

      @Nullable public Boolean getCanRequestAccess()
      Whether the user can request access to the content.
      Returns:
      value for this field, or null if not present.
    • getEnforceSharedLinkPasswordPolicy

      @Nullable public EnforceLinkPasswordPolicy getEnforceSharedLinkPasswordPolicy()
      Whether the updated externally available shared link must have password set. Not provided if the link is not team owned.
      Returns:
      value for this field, or null if not present.
    • getDaysToExpirePolicy

      @Nullable public DefaultLinkExpirationDaysPolicy getDaysToExpirePolicy()
      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:
      value for this field, or null if not present.
    • getChangeSharedLinkExpirationPolicy

      @Nullable public ChangeLinkExpirationPolicy getChangeSharedLinkExpirationPolicy()
      When owning team's policy getChangeSharedLinkExpirationPolicy() is ChangeLinkExpirationPolicy.NOT_ALLOWED, the updated externally available shared link expiration value cannot be less strict than getDaysToExpirePolicy(). In this case getDaysToExpirePolicy() is expected to be different from `none`. Not provided if the link is not team owned.
      Returns:
      value for this field, or null if not present.
    • newBuilder

      public static LinkPermissions.Builder newBuilder(boolean canRevoke, List<VisibilityPolicy> visibilityPolicies, boolean canSetExpiry, boolean canRemoveExpiry, boolean allowDownload, boolean canAllowDownload, boolean canDisallowDownload, boolean allowComments, boolean teamRestrictsComments)
      Returns a new builder for creating an instance of this class.
      Parameters:
      canRevoke - Whether the caller can revoke the shared link.
      visibilityPolicies - A list of policies that the user might be able to set for the visibility. Must not contain a null item and not be null.
      canSetExpiry - Whether the user can set the expiry settings of the link. This refers to the ability to create a new expiry and modify an existing expiry.
      canRemoveExpiry - Whether the user can remove the expiry of the link.
      allowDownload - Whether the link can be downloaded or not.
      canAllowDownload - Whether the user can allow downloads via the link. This refers to the ability to remove a no-download restriction on the link.
      canDisallowDownload - Whether the user can disallow downloads via the link. This refers to the ability to impose a no-download restriction on the link.
      allowComments - Field is deprecated. Whether comments are enabled for the linked file. This takes the team commenting policy into account.
      teamRestrictsComments - Field is deprecated. Whether the team has disabled commenting globally.
      Returns:
      builder for this class.
      Throws:
      IllegalArgumentException - If any argument does not meet its preconditions.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toStringMultiline

      public 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