Interface WorkspaceResources
- Namespace
- Smartsheet.Api
- Assembly
- smartsheet-csharp-sdk.dll
This interface provides methods to access Workspace resources.
Thread Safety: Implementation of this interface must be thread safe.
public interface WorkspaceResources
Properties
FolderResources
Return the WorkspaceFolderResources object that provides access to Folder resources associated with Workspace resources.
WorkspaceFolderResources FolderResources { get; }
Property Value
- WorkspaceFolderResources
the workspace folder resources
ShareResources
Return the ShareResources object that provides access to Share resources associated with Workspace resources.
ShareResources ShareResources { get; }
Property Value
- ShareResources
the share resources object
SheetResources
Return the WorkspaceFolderResources object that provides access to Folder resources associated with Workspace resources.
WorkspaceSheetResources SheetResources { get; }
Property Value
- WorkspaceSheetResources
the workspace folder resources
Methods
CopyWorkspace(long, ContainerDestination, IEnumerable<WorkspaceCopyInclusion>?, IEnumerable<WorkspaceRemapExclusion>?)
Creates a copy of the specified Workspace.
It mirrors to the following Smartsheet REST API method:
POST /workspaces/{workspaceId}/copy
Workspace CopyWorkspace(long workspaceId, ContainerDestination destination, IEnumerable<WorkspaceCopyInclusion>? include = null, IEnumerable<WorkspaceRemapExclusion>? skipRemap = null)
Parameters
workspaceIdlongthe workspace Id
destinationContainerDestinationthe destination to copy to
includeIEnumerable<WorkspaceCopyInclusion>the elements to copy. Note: Cell history will not be copied, regardless of which include parameter values are specified.
skipRemapIEnumerable<WorkspaceRemapExclusion>the references to NOT re-map for the newly created folder
If "cellLinks" is specified in the skipRemap parameter value, the cell links within the newly created folder will continue to point to the original source sheets. If "reports" is specified in the skipRemap parameter value, the reports within the newly created folder will continue to point to the original source sheets.
Returns
- Workspace
the created workspace
Exceptions
- InvalidOperationException
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
CreateWorkspace(Workspace)
Create a workspace.
It mirrors to the following Smartsheet REST API method: POST /Workspaces
Workspace CreateWorkspace(Workspace workspace)
Parameters
workspaceWorkspacethe workspace to create
Returns
- Workspace
the created workspace
Exceptions
- InvalidOperationException
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(long)
Deletes the specified Workspace (and its contents).
It mirrors to the following Smartsheet REST API method: DELETE /workspaces{workspaceId}
void DeleteWorkspace(long workspaceId)
Parameters
workspaceIdlongthe Id of the workspace
Exceptions
- InvalidOperationException
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
GetWorkspace(long, bool?, IEnumerable<WorkspaceInclusion>?)
Gets the specified Workspace (and lists its contents).
It mirrors to the following Smartsheet REST API method: GET /workspaces/{workspaceid}
By default, this operation only returns the top-level items in the Workspace. To load all of the contents, including nested Folders, include the loadAll query string parameter with a value of true.
If no Folders, Sheets, Reports, or Templates are present in the Workspace, the corresponding attribute (e.g., "folders", "sheets") will not be present in the response object.
[Obsolete("This method is deprecated. Use GetWorkspaceChildren and GetWorkspaceMetadata instead.")]
Workspace GetWorkspace(long workspaceid, bool? loadAll = null, IEnumerable<WorkspaceInclusion>? include = null)
Parameters
workspaceidlongthe workspace id
loadAllbool?Defaults to false. If true, loads all of the contents, including nested Folders.
includeIEnumerable<WorkspaceInclusion>When specified with a value of "source", response will include the source for any sheet that was created from another sheet or template
Returns
- Workspace
the workspace (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
Exceptions
- InvalidOperationException
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
GetWorkspaceChildren(long, IEnumerable<ChildrenResourceType>?, IEnumerable<ChildrenInclusion>?, bool?, int?, string?, int?)
Gets a page of a workspace's children of the specified type.
It mirrors to the following Smartsheet REST API method: GET /workspaces/{workspaceId}/children
TokenPaginatedResult<object> GetWorkspaceChildren(long workspaceId, IEnumerable<ChildrenResourceType>? childrenResourceTypes = null, IEnumerable<ChildrenInclusion>? include = null, bool? numericDates = null, int? accessApiLevel = null, string? lastKey = null, int? maxItems = null)
Parameters
workspaceIdlongthe workspace id
childrenResourceTypesIEnumerable<ChildrenResourceType>A comma-separated list of the child types to include in the response
includeIEnumerable<ChildrenInclusion>A comma-separated list of optional elements to include in the response
numericDatesbool?If true, dates are accepted and returned in Unix epoch time. Default is false, which means ISO-8601 format
accessApiLevelint?Allows COMMENTER access for inputs and return values. For backwards-compatibility, VIEWER is the default
lastKeystringThe lastKey token returned from the previous page of results
maxItemsint?The maximum number of items to return in the response (default: 100, min: 100, max: 500)
Returns
- TokenPaginatedResult<object>
An array of asset references with a pagination token if there are more results
Exceptions
- InvalidOperationException
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
GetWorkspaceMetadata(long, IEnumerable<WorkspaceInclusion>?, bool?, int?)
Gets the metadata of a workspace.
It mirrors to the following Smartsheet REST API method: GET /workspaces/{workspaceId}/metadata
Workspace GetWorkspaceMetadata(long workspaceId, IEnumerable<WorkspaceInclusion>? include = null, bool? numericDates = null, int? accessApiLevel = null)
Parameters
workspaceIdlongthe workspace id
includeIEnumerable<WorkspaceInclusion>A comma-separated list of optional elements to include in the response
numericDatesbool?If true, dates are accepted and returned in Unix epoch time. Default is false, which means ISO-8601 format
accessApiLevelint?Allows COMMENTER access for inputs and return values. For backwards-compatibility, VIEWER is the default
Returns
- Workspace
The metadata of a workspace
Exceptions
- InvalidOperationException
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
ListWorkspaces(ListWorkspacesTokenPaginationParameters?)
List all Workspaces using token-based pagination.
It mirrors to the following Smartsheet REST API method: GET /Workspaces
TokenPaginatedResult<Workspace> ListWorkspaces(ListWorkspacesTokenPaginationParameters? tokenPaging)
Parameters
tokenPagingListWorkspacesTokenPaginationParametersToken-based pagination parameters
Returns
- TokenPaginatedResult<Workspace>
the list of Workspaces with pagination token (note that an empty list will be returned if there are none)
Exceptions
- InvalidOperationException
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
ListWorkspaces(PaginationParameters?)
List all Workspaces.
It mirrors to the following Smartsheet REST API method: GET /Workspaces
PaginatedResult<Workspace> ListWorkspaces(PaginationParameters? paging = null)
Parameters
pagingPaginationParameters
Returns
- PaginatedResult<Workspace>
the list of Workspaces (note that an empty list will be returned if there are none)
Exceptions
- InvalidOperationException
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)
Update a workspace.
It mirrors to the following Smartsheet REST API method: PUT /workspaces/{workspaceId}
Workspace UpdateWorkspace(Workspace workspace)
Parameters
workspaceWorkspacethe workspace to update
Returns
- Workspace
the updated workspace (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
Exceptions
- InvalidOperationException
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