public void GetPublishStatus() { SmartsheetClient ss = HelperFunctions.SetupClient("Get Sight Publish Status"); SightPublish publish = ss.SightResources.GetPublishStatus(812); Assert.IsTrue(publish.ReadOnlyFullEnabled.Value); }
public void SetPublishStatus() { SmartsheetClient ss = HelperFunctions.SetupClient("Set Sight Publish Status"); SightPublish publish = new SightPublish(); publish.ReadOnlyFullEnabled = true; publish.ReadOnlyFullAccessibleBy = "ALL"; ss.SightResources.SetPublishStatus(812, publish); }
/// <summary> /// <para> /// Sets the publish status of a Sight and returns the new status, including the URLs of any enabled publishing. /// </para> /// /// <para>Mirrors to the following Smartsheet REST API method: PUT /sights/{id}/publish</para> /// </summary> /// <param name="sightId"> the Sight Id </param> /// <param name="sightPublish"> the SightPublish object</param> /// <returns> /// The Sight publish status (note that if there is no such resource, this method will /// throw ResourceNotFoundException rather than returning null). /// </returns> /// <exception cref="System.InvalidOperationException"> if any argument is null or an 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 SightPublish SetPublishStatus(long sightId, SightPublish sightPublish) { return(this.UpdateResource <SightPublish>("sights/" + sightId + "/publish", typeof(SightPublish), sightPublish)); }