Interface AssetShareResources
-
public interface AssetShareResourcesThis interface provides methods to access Asset Share resources.
Thread Safety: Implementation of this interface must be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType)Delete a share.ShareResponsegetShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType)Get a Share.ListAssetSharesResponse<ShareResponse>listShares(java.lang.String assetId, java.lang.String assetType, java.lang.String lastKey, java.lang.Long maxItems, java.lang.String sharingInclude)List shares of a given asset.java.util.List<ShareResponse>shareTo(java.lang.String assetId, java.lang.String assetType, java.util.List<CreateShareRequest> shareRequests, java.lang.Boolean sendEmail)Shares the asset with the specified Users and Groups.ShareResponseupdateShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType, UpdateShareRequest shareRequest)Update a share.
-
-
-
Method Detail
-
listShares
ListAssetSharesResponse<ShareResponse> listShares(java.lang.String assetId, java.lang.String assetType, java.lang.String lastKey, java.lang.Long maxItems, java.lang.String sharingInclude) throws SmartsheetException
List shares of a given asset.
It mirrors to the following Smartsheet REST API method:
GET /shares?assetId={assetId}&assetType={assetType}
- Parameters:
assetId- the asset idassetType- the asset type (e.g. "sheet", "workspace", "report", "sight", "file", "collection")lastKey- lastKey from previous response to get next page of resultsmaxItems- The maximum amount of items to return in the response. The default and minimum are 100.sharingInclude- defines the scope of the share. Possible values are ITEM or WORKSPACE.- Returns:
- the list of ShareResponse objects (note that an empty list will be returned if there is none).
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
getShare
ShareResponse getShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType) throws SmartsheetException
Get a Share.
It mirrors to the following Smartsheet REST API method:
GET /shares/{shareId}?assetId={assetId}&assetType={assetType}
- Parameters:
shareId- the ID of the shareassetId- the ID of the assetassetType- the type of the asset (e.g. "sheet", "workspace", "report", "sight", "file", "collection")- Returns:
- the share response (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
- Throws:
SmartsheetException- the smartsheet exception
-
shareTo
java.util.List<ShareResponse> shareTo(java.lang.String assetId, java.lang.String assetType, java.util.List<CreateShareRequest> shareRequests, java.lang.Boolean sendEmail) throws SmartsheetException
Shares the asset with the specified Users and Groups.
It mirrors to the following Smartsheet REST API method:
POST /shares?assetId={assetId}&assetType={assetType}
- Parameters:
assetId- the ID of the asset to shareassetType- the type of the asset (e.g. "sheet", "workspace", "report", "sight", "file", "collection")shareRequests- list of create share request objectssendEmail- whether to send email- Returns:
- the created shares
- Throws:
SmartsheetException- the smartsheet exception
-
updateShare
ShareResponse updateShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType, UpdateShareRequest shareRequest) throws SmartsheetException
Update a share.
It mirrors to the following Smartsheet REST API method:
PATCH /shares/{shareId}?assetId={assetId}&assetType={assetType}
- Parameters:
shareId- the ID of the shareassetId- the ID of the assetassetType- the type of the asset (e.g. "sheet", "workspace", "report", "sight", "file", "collection")shareRequest- the update share request- Returns:
- the updated share (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
- Throws:
java.lang.IllegalArgumentException- if any argument is null or empty stringInvalidRequestException- if there is any problem with the REST API requestAuthorizationException- if there is any problem with the REST API authorization (access token)ResourceNotFoundException- if the resource cannot be foundServiceUnavailableException- if the REST API service is not available (possibly due to rate limiting)SmartsheetException- if there is any other error during the operation
-
deleteShare
void deleteShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType) throws SmartsheetExceptionDelete a share.
It mirrors to the following Smartsheet REST API method:
DELETE /shares/{shareId}?assetId={assetId}&assetType={assetType}
- Parameters:
shareId- the ID of the share to deleteassetId- the ID of the assetassetType- the type of the asset (e.g. "sheet", "workspace", "report", "sight", "file", "collection")- Throws:
SmartsheetException- the smartsheet exception
-
-