private void TestPublishSheetDefaults() { SheetPublish sheetPublish = new SheetPublish.PublishStatusBuilder(true, true, true, false).Build(); SheetPublish newSheetPublish = smartsheet.SheetResources.UpdatePublishStatus(newSheetHome.Id.Value, sheetPublish); Assert.IsTrue(newSheetPublish.ReadWriteShowToolbar.Value); }
private static void UpdatePublishSheetStatus(SmartsheetClient smartsheet, long sheetId) { SheetPublish sheetPublish = smartsheet.SheetResources.UpdatePublishStatus(sheetId, new SheetPublish.PublishStatusBuilder(true, false, false, false).Build()); Assert.IsTrue(sheetPublish.ReadOnlyLiteEnabled.Value); Assert.IsTrue(!sheetPublish.ReadOnlyFullEnabled.Value); }
public virtual void TestGetPublishStatus() { server.setResponseBody("../../../TestSDK/resources/getPublishStatus.json"); SheetPublish publishStatus = sheetResource.GetPublishStatus(1234L); if (publishStatus == null || publishStatus.ReadOnlyFullEnabled != false || publishStatus.IcalEnabled != false || publishStatus.ReadOnlyLiteEnabled != false || publishStatus.ReadWriteEnabled != false) { Assert.Fail("Issue creating the publish status object"); } }
private void TestPublishSheet() { SheetPublish sheetPublish = new SheetPublish(); sheetPublish.IcalEnabled = false; sheetPublish.ReadOnlyFullEnabled = true; sheetPublish.ReadWriteEnabled = true; sheetPublish.ReadOnlyLiteEnabled = true; sheetPublish.ReadWriteShowToolbar = false; sheetPublish.ReadOnlyFullShowToolbar = false; SheetPublish newSheetPublish = smartsheet.SheetResources.UpdatePublishStatus(newSheetHome.Id.Value, sheetPublish); Assert.IsFalse(newSheetPublish.ReadWriteShowToolbar.Value); Assert.IsFalse(newSheetPublish.ReadOnlyFullShowToolbar.Value); }
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); }
/// <summary> /// <para>Sets the publish Status of a sheet and returns the new Status, including the URLs of any enabled publishings.</para> /// /// <para>It mirrors To the following Smartsheet REST API method: PUT /sheets/{sheetId}/publish</para> /// </summary> /// <param name="id"> the sheetId </param> /// <param name="publish"> the SheetPublish object limited. </param> /// <returns> the update SheetPublish object (note that if there is no such resource, this method will throw a /// ResourceNotFoundException rather than returning null). </returns> /// <exception cref="System.InvalidOperationException"> if any argument is null or empty string </exception> /// <exception cref="InvalidRequestException"> if there is any problem with the REST API request </exception> /// <exception cref="AuthorizationException"> if there is any problem with the REST API authorization (access token) </exception> /// <exception cref="ResourceNotFoundException"> if the resource cannot be found </exception> /// <exception cref="ServiceUnavailableException"> if the REST API service is not available (possibly due To rate limiting) </exception> /// <exception cref="SmartsheetException"> if there is any other error during the operation </exception> public virtual SheetPublish UpdatePublishStatus(long id, SheetPublish publish) { return(this.UpdateResource("sheets/" + id + "/publish", typeof(SheetPublish), publish)); }
private void TestGetPublishStatus() { SheetPublish sheetPublish = smartsheet.SheetResources.GetPublishStatus(newSheetHome.Id.Value); Assert.IsNotNull(sheetPublish); }