Smartsheet.Api.Internal.WorkspaceResourcesImpl.UpdateWorkspace C# (CSharp) Method

UpdateWorkspace() public method

Update a workspace.

It mirrors To the following Smartsheet REST API method: PUT /workspaces/{workspaceId}

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public UpdateWorkspace ( Api.Models.Workspace workspace ) : Api.Models.Workspace
workspace Api.Models.Workspace the workspace To update
return Api.Models.Workspace
        public virtual Workspace UpdateWorkspace(Workspace workspace)
        {
            return this.UpdateResource<Workspace>("workspaces/" + workspace.Id, typeof(Workspace), workspace);
        }

Usage Example

        public virtual void TestUpdateWorkspace()
        {
            server.setResponseBody("../../../TestSDK/resources/updateWorkspace.json");

            Workspace workspace    = new Workspace.UpdateWorkspaceBuilder(32434534, "Updated workspace").Build();
            Workspace newWorkspace = workspaceResources.UpdateWorkspace(workspace);

            Assert.AreEqual(7960873114331012, (long)newWorkspace.Id);
            Assert.AreEqual("Updated workspace", newWorkspace.Name);
            Assert.AreEqual(AccessLevel.OWNER, newWorkspace.AccessLevel);
            Assert.AreEqual("https://app.smartsheet.com/b/home?lx=rBU8QqUVPCJ3geRgl7L8yQ", newWorkspace.Permalink);
        }
All Usage Examples Of Smartsheet.Api.Internal.WorkspaceResourcesImpl::UpdateWorkspace