Interface AssetShareResources
-
public interface AssetShareResources
This 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 void
deleteShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType)
Delete a share.ShareResponse
getShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType)
Get a Share.PagedResult<ShareResponse>
listShares(java.lang.String assetId, java.lang.String assetType, PaginationParameters parameters, java.lang.Boolean includeWorkspaceShares)
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.ShareResponse
updateShare(java.lang.String shareId, java.lang.String assetId, java.lang.String assetType, UpdateShareRequest shareRequest)
Update a share.
-
-
-
Method Detail
-
listShares
PagedResult<ShareResponse> listShares(java.lang.String assetId, java.lang.String assetType, PaginationParameters parameters, java.lang.Boolean includeWorkspaceShares) 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")parameters
- the pagination parametersincludeWorkspaceShares
- include workspace shares in enumeration- 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 SmartsheetException
Delete 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
-
-