Package com.smartsheet.api
Interface AttachmentVersioningResources
-
public interface AttachmentVersioningResources
This interface provides methods to access AttachmentVersioning resources.
Thread Safety: Implementation of this interface must be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Attachment
attachNewVersion(long sheetId, long attachmentId, java.io.File file, java.lang.String contentType)
Attach a new version of an attachment.void
deleteAllVersions(long sheetId, long attachentId)
Deletes an attachment, including all of its versions.PagedResult<Attachment>
listAllVersions(long sheetId, long attachmentId, PaginationParameters parameters)
Get all versions of an attachment.
-
-
-
Method Detail
-
deleteAllVersions
void deleteAllVersions(long sheetId, long attachentId) throws SmartsheetException
Deletes an attachment, including all of its versions.
It mirrors to the following Smartsheet REST API method: DELETE /sheets/{sheetId}/attachments/{attachmentId}/versions
- Parameters:
sheetId
- the sheet idattachentId
- the attachment id- 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
-
listAllVersions
PagedResult<Attachment> listAllVersions(long sheetId, long attachmentId, PaginationParameters parameters) throws SmartsheetException
Get all versions of an attachment.
It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/attachments/{attachmentId}/versions
- Parameters:
sheetId
- the idattachmentId
- the attachment idparameters
- the pagination paramaters- Returns:
- the attachment (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
-
attachNewVersion
Attachment attachNewVersion(long sheetId, long attachmentId, java.io.File file, java.lang.String contentType) throws java.io.FileNotFoundException, SmartsheetException
Attach a new version of an attachment.
It mirrors to the following Smartsheet REST API method: POST /attachment/{id}/versions
- Parameters:
sheetId
- the id of the sheetattachmentId
- the id of the attachment to upload a new version.file
- the file to attachcontentType
- the content type of the file- Returns:
- the created attachment
- Throws:
java.io.FileNotFoundException
- the file not found exceptionjava.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
-
-