Interface AttachmentVersioningResources


  • public interface AttachmentVersioningResources

    This interface provides methods to access AttachmentVersioning resources.

    Thread Safety: Implementation of this interface must be thread safe.

    • 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 id
        attachentId - the attachment id
        Throws:
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - 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 id
        attachmentId - the attachment id
        parameters - 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 string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - 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 sheet
        attachmentId - the id of the attachment to upload a new version.
        file - the file to attach
        contentType - the content type of the file
        Returns:
        the created attachment
        Throws:
        java.io.FileNotFoundException - the file not found exception
        java.lang.IllegalArgumentException - if any argument is null or empty string
        InvalidRequestException - if there is any problem with the REST API request
        AuthorizationException - if there is any problem with the REST API authorization (access token)
        ResourceNotFoundException - if the resource cannot be found
        ServiceUnavailableException - if the REST API service is not available (possibly due to rate limiting)
        SmartsheetException - if there is any other error during the operation