Interface WorkspaceResources
-
public interface WorkspaceResources
This interface provides methods to access Workspace 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 Workspace
copyWorkspace(long workspaceId, ContainerDestination containerDestination, java.util.EnumSet<WorkspaceCopyInclusion> includes, java.util.EnumSet<WorkspaceRemapExclusion> skipRemap)
Creates a copy of the specified workspace.Workspace
copyWorkspace(long workspaceId, ContainerDestination containerDestination, java.util.EnumSet<WorkspaceCopyInclusion> includes, java.util.EnumSet<WorkspaceRemapExclusion> skipRemap, java.util.EnumSet<CopyExclusion> excludes)
Deprecated, for removal: This API element is subject to removal in a future version.As of release 2.0.Workspace
createWorkspace(Workspace workspace)
Create a workspace.void
deleteWorkspace(long id)
Delete a workspace.WorkspaceFolderResources
folderResources()
Return the WorkspaceFolderResources object that provides access to Folder resources associated with Workspace resources.Workspace
getWorkspace(long id, java.lang.Boolean loadAll, java.util.EnumSet<SourceInclusion> includes)
Get a workspace.PagedResult<Workspace>
listWorkspaces(PaginationParameters parameters)
List all workspaces.ShareResources
shareResources()
Return the ShareResources object that provides access to Share resources associated with Workspace resources.Workspace
updateWorkspace(Workspace workspace)
Update a workspace.
-
-
-
Method Detail
-
listWorkspaces
PagedResult<Workspace> listWorkspaces(PaginationParameters parameters) throws SmartsheetException
List all workspaces.
It mirrors to the following Smartsheet REST API method: GET /workspaces
- Parameters:
parameters
- the object containing the pagination parameters- Returns:
- the list of workspaces (note that an empty list will be returned if there are none)
- 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
-
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 idincludes
- the include parametersloadAll
- 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 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
-
createWorkspace
Workspace createWorkspace(Workspace workspace) throws SmartsheetException
Create a workspace.
It mirrors to the following Smartsheet REST API method: POST /workspaces
- Parameters:
workspace
- the workspace to create- Returns:
- the created workspace
- 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
-
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 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
-
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 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
-
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 idcontainerDestination
- describes the destination containerincludes
- optional parameters to includeskipRemap
- 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 idcontainerDestination
- describes the destination containerincludes
- optional parameters to includeskipRemap
- optional parameters to NOT re-map in the new folderexcludes
- 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
-
-