Interface ShareResources


  • @Deprecated(since="3.3.0",
                forRemoval=true)
    public interface ShareResources
    Deprecated, for removal: This API element is subject to removal in a future version.
    As of release 2.0. Please use AssetShareResources instead.

    This interface provides methods to access Share resources.

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

    • Method Summary

      All Methods Instance Methods Abstract Methods Deprecated Methods 
      Modifier and Type Method Description
      void deleteShare​(long objectId, java.lang.String shareId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 2.0.
      Share getShare​(long objectId, java.lang.String shareId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 2.0.
      PagedResult<Share> listShares​(long objectId, PaginationParameters parameters)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 2.0.
      PagedResult<Share> listShares​(long objectId, PaginationParameters parameters, java.lang.Boolean includeWorkspaceShares)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 2.0.
      java.util.List<Share> shareTo​(long objectId, java.util.List<Share> shares, java.lang.Boolean sendEmail)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 2.0.
      Share updateShare​(long objectId, Share share)
      Deprecated, for removal: This API element is subject to removal in a future version.
      As of release 2.0.
    • Method Detail

      • listShares

        @Deprecated(since="3.3.0",
                    forRemoval=true)
        PagedResult<Share> listShares​(long objectId,
                                      PaginationParameters parameters)
                               throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.
        As of release 2.0. Please use the other listShares method in this class and pass `includeWorkspaceShares` as `false`

        List shares of a given object.

        It mirrors to the following Smartsheet REST API method:

        GET /workspace/{id}/shares

        GET /sheet/{id}/shares

        Parameters:
        objectId - the object id
        parameters - the pagination parameters
        Returns:
        the list of Share objects (note that an empty list will be returned if there is none).
        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
      • getShare

        @Deprecated(since="3.3.0",
                    forRemoval=true)
        Share getShare​(long objectId,
                       java.lang.String shareId)
                throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.

        Get a Share.

        It mirrors to the following Smartsheet REST API method:

        GET /workspaces/{workspaceId}/shares/{shareId}

        GET /sheets/{sheetId}/shares/{shareId}

        GET /reports/{reportId}/shares

        Exceptions: 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 can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation

        Parameters:
        objectId - the ID of the object to share
        shareId - the ID of the share
        Returns:
        the share (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).
        Throws:
        SmartsheetException - the smartsheet exception
      • shareTo

        @Deprecated(since="3.3.0",
                    forRemoval=true)
        java.util.List<Share> shareTo​(long objectId,
                                      java.util.List<Share> shares,
                                      java.lang.Boolean sendEmail)
                               throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.

        Shares the object with the specified Users and Groups.

        It mirrors to the following Smartsheet REST API method:

        POST /workspaces/{id}/shares

        POST /sheets/{id}/shares

        POST /reports/{reportId}/shares

        Exceptions: IllegalArgumentException : if multiShare is null 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 can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation

        Parameters:
        objectId - the ID of the object to share
        shares - list of share objects
        sendEmail - whether to send email
        Returns:
        the created shares
        Throws:
        SmartsheetException - the smartsheet exception
      • deleteShare

        @Deprecated(since="3.3.0",
                    forRemoval=true)
        void deleteShare​(long objectId,
                         java.lang.String shareId)
                  throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.

        Delete a share.

        It mirrors to the following Smartsheet REST API method:

        DELETE /workspaces/{workspaceId}/shares/{shareId}

        DELETE /sheets/{sheetId}/shares/{shareId}

        DELETE /reports/{reportId}/shares/{shareId}

        Exceptions: 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 can not be found ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting) SmartsheetRestException : if there is any other REST API related error occurred during the operation SmartsheetException : if there is any other error occurred during the operation

        Parameters:
        objectId - the ID of the object to share
        shareId - the ID of the share to delete
        Throws:
        SmartsheetException - the smartsheet exception