001package com.box.sdk.sharedlink; 002 003import com.box.sdk.BoxSharedLink; 004 005/** 006 * Represents request to create shared link with permissions. 007 */ 008public class BoxSharedLinkRequest extends AbstractSharedLinkRequest<BoxSharedLinkRequest> { 009 010 /** 011 * Sets the permissions associated with this shared link. 012 * 013 * @param canDownload whether the shared link can be downloaded. 014 * @param canPreview whether the shared link can be previewed. 015 * @return this request. 016 */ 017 public BoxSharedLinkRequest permissions(boolean canDownload, boolean canPreview) { 018 BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions(); 019 permissions.setCanDownload(canDownload); 020 permissions.setCanPreview(canPreview); 021 getLink().setPermissions(permissions); 022 return this; 023 } 024 025}