Interface WorkspaceResources
-
public interface WorkspaceResourcesThis 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 WorkspacecopyWorkspace(long workspaceId, ContainerDestination containerDestination, java.util.EnumSet<WorkspaceCopyInclusion> includes, java.util.EnumSet<WorkspaceRemapExclusion> skipRemap)Creates a copy of the specified workspace.WorkspacecopyWorkspace(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.WorkspacecreateWorkspace(Workspace workspace)Create a workspace.voiddeleteWorkspace(long id)Delete a workspace.WorkspaceFolderResourcesfolderResources()Return the WorkspaceFolderResources object that provides access to Folder resources associated with Workspace resources.WorkspacegetWorkspace(long id, java.lang.Boolean loadAll, java.util.EnumSet<SourceInclusion> includes)Deprecated, for removal: This API element is subject to removal in a future version.TokenPaginatedResult<java.lang.Object>getWorkspaceChildren(long workspaceId, java.util.EnumSet<ChildrenResourceType> childrenResourceTypes, java.util.EnumSet<GetWorkspaceChildrenInclusion> includes, java.lang.String lastKey, java.lang.Integer maxItems)Get children of a workspace.WorkspacegetWorkspaceMetadata(long workspaceId, java.util.EnumSet<GetWorkspaceMetadataInclusion> includes)Get metadata of a workspace.PagedResult<Workspace>listWorkspaces(PaginationParameters parameters)List all workspaces.ShareResourcesshareResources()Return the ShareResources object that provides access to Share resources associated with Workspace resources.WorkspaceupdateWorkspace(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
@Deprecated(since="3.4.0", forRemoval=true) Workspace getWorkspace(long id, java.lang.Boolean loadAll, java.util.EnumSet<SourceInclusion> includes) throws SmartsheetExceptionDeprecated, for removal: This API element is subject to removal in a future version.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 SmartsheetExceptionDelete 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 SmartsheetExceptionDeprecated, 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
-
getWorkspaceMetadata
Workspace getWorkspaceMetadata(long workspaceId, java.util.EnumSet<GetWorkspaceMetadataInclusion> includes) throws SmartsheetException
Get metadata of a workspace.
It mirrors to the following Smartsheet REST API method: GET /workspaces/{workspaceId}/metadata
- Parameters:
workspaceId- the workspace idincludes- the include parameters- Returns:
- the workspace metadata (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
-
getWorkspaceChildren
TokenPaginatedResult<java.lang.Object> getWorkspaceChildren(long workspaceId, java.util.EnumSet<ChildrenResourceType> childrenResourceTypes, java.util.EnumSet<GetWorkspaceChildrenInclusion> includes, java.lang.String lastKey, java.lang.Integer maxItems) throws SmartsheetException
Get children of a workspace.
It mirrors to the following Smartsheet REST API method: GET /workspaces/{workspaceId}/children
- Parameters:
workspaceId- the workspace idchildrenResourceTypes- the resource types to filter by (optional)includes- the include parameters (optional)lastKey- the last key for pagination (optional)maxItems- the maximum number of items to return (optional)- Returns:
- the paginated children response
- 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
-
-