Interface WorkspaceResources


  • public interface WorkspaceResources

    This interface provides methods to access Workspace resources.

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

    • Method Detail

      • getWorkspace

        Workspace getWorkspace​(long id,
                               java.lang.Boolean loadAll,
                               java.util.EnumSet<SourceInclusion> includes)
                        throws SmartsheetException

        Get a workspace.

        It mirrors to the following Smartsheet REST API method: GET /workspace/{id}

        Parameters:
        id - the id
        includes - the include parameters
        loadAll - the loadAll boolean value
        Returns:
        the workspace (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
      • updateWorkspace

        Workspace updateWorkspace​(Workspace workspace)
                           throws SmartsheetException

        Update a workspace.

        It mirrors to the following Smartsheet REST API method: PUT /workspace/{id}

        Parameters:
        workspace - the workspace to update
        Returns:
        the updated workspace (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
      • deleteWorkspace

        void deleteWorkspace​(long id)
                      throws SmartsheetException

        Delete a workspace.

        It mirrors to the following Smartsheet REST API method: DELETE /workspace{id}

        Parameters:
        id - the id of the workspace
        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
      • copyWorkspace

        Workspace copyWorkspace​(long workspaceId,
                                ContainerDestination containerDestination,
                                java.util.EnumSet<WorkspaceCopyInclusion> includes,
                                java.util.EnumSet<WorkspaceRemapExclusion> skipRemap)
                         throws SmartsheetException

        Creates a copy of the specified workspace.

        It mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/copy

        Exceptions: IllegalArgumentException : if folder 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) 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:
        workspaceId - the folder id
        containerDestination - describes the destination container
        includes - optional parameters to include
        skipRemap - optional parameters to exclude
        Returns:
        the folder
        Throws:
        SmartsheetException - the smartsheet exception
      • copyWorkspace

        @Deprecated(since="2.0.0",
                    forRemoval=true)
        Workspace copyWorkspace​(long workspaceId,
                                ContainerDestination containerDestination,
                                java.util.EnumSet<WorkspaceCopyInclusion> includes,
                                java.util.EnumSet<WorkspaceRemapExclusion> skipRemap,
                                java.util.EnumSet<CopyExclusion> excludes)
                         throws SmartsheetException
        Deprecated, for removal: This API element is subject to removal in a future version.
        As of release 2.0. `excludes` param is deprecated. Please use the `copyWorkspace` method with `includes` instead.

        Creates a copy of the specified workspace.

        It mirrors to the following Smartsheet REST API method: POST /workspaces/{workspaceId}/copy

        Exceptions: IllegalArgumentException : if folder 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) 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:
        workspaceId - the folder id
        containerDestination - describes the destination container
        includes - optional parameters to include
        skipRemap - optional parameters to NOT re-map in the new folder
        excludes - optional parameters to exclude
        Returns:
        the folder
        Throws:
        SmartsheetException - the smartsheet exception
      • folderResources

        WorkspaceFolderResources folderResources()

        Return the WorkspaceFolderResources object that provides access to Folder resources associated with Workspace resources.

        Returns:
        the workspace folder resources
      • shareResources

        ShareResources shareResources()

        Return the ShareResources object that provides access to Share resources associated with Workspace resources.

        Returns:
        the share resources object