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 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 id
        assetType - the asset type (e.g. "sheet", "workspace", "report", "sight", "file", "collection")
        parameters - the pagination parameters
        includeWorkspaceShares - 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 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

        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 share
        assetId - the ID of the asset
        assetType - 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 share
        assetType - the type of the asset (e.g. "sheet", "workspace", "report", "sight", "file", "collection")
        shareRequests - list of create share request objects
        sendEmail - 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 share
        assetId - the ID of the asset
        assetType - 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 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
      • 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 delete
        assetId - the ID of the asset
        assetType - the type of the asset (e.g. "sheet", "workspace", "report", "sight", "file", "collection")
        Throws:
        SmartsheetException - the smartsheet exception