Smartsheet.Api.Internal.SheetResourcesImpl.UpdatePublishStatus C# (CSharp) Method

UpdatePublishStatus() public method

Sets the publish Status of a sheet and returns the new Status, including the URLs of any enabled publishings.

It mirrors To the following Smartsheet REST API method: PUT /sheets/{sheetId}/publish

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 UpdatePublishStatus ( long id, Api.Models.SheetPublish publish ) : Api.Models.SheetPublish
id long the sheetId
publish Api.Models.SheetPublish the SheetPublish object limited.
return Api.Models.SheetPublish
        public virtual SheetPublish UpdatePublishStatus(long id, SheetPublish publish)
        {
            return this.UpdateResource("sheets/" + id + "/publish", typeof(SheetPublish), publish);
        }

Usage Example

Example #1
0
        public virtual void TestUpdatePublishStatus()
        {
            server.setResponseBody("../../../TestSDK/resources/setPublishStatus.json");

            SheetPublish publish = new SheetPublish();

            publish.IcalEnabled         = true;
            publish.ReadOnlyFullEnabled = true;
            publish.ReadOnlyLiteEnabled = true;
            publish.ReadWriteEnabled    = true;
            publish.IcalUrl             = "http://somedomain.com";
            SheetPublish newPublish = sheetResource.UpdatePublishStatus(1234L, publish);

            Assert.Null(newPublish.IcalUrl);
            Assert.NotNull(newPublish.ReadOnlyFullUrl);
            Assert.NotNull(newPublish.ReadOnlyLiteUrl);
            Assert.NotNull(newPublish.ReadWriteUrl);
        }