/// <summary> /// <para>Create a sheet (from existing sheet or template) in default "Sheets" collection.</para> /// /// <para>It mirrors To the following Smartsheet REST API method: POST /Sheets</para> /// </summary> /// <param name="sheet"> the sheet To create </param> /// <param name="includes"> used To specify the optional objects To include. </param> /// <returns> the created sheet </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 Sheet CreateSheetFromTemplate(Sheet sheet, IEnumerable<TemplateInclusion> includes) { StringBuilder path = new StringBuilder("sheets"); if (includes != null) { path.Append("?include=" + QueryUtil.GenerateCommaSeparatedList(includes)); } return this.CreateResource(path.ToString(), typeof(Sheet), sheet); }
/// <summary> /// <para>Update a sheet.</para> /// <para>To modify Sheet contents, see Add Row(s), Update Row(s), and Update Column.</para> /// <para>This operation can be used to update an individual user’s sheet settings. /// If the request body contains only the userSettings attribute, /// this operation may be performed even if the user only has read-only access to the sheet /// (i.e. the user has viewer permissions, or the sheet is read-only).</para> /// <para>It mirrors To the following Smartsheet REST API method: PUT /sheets/{sheetId}</para> /// </summary> /// <param name="sheet"> the sheet To update </param> /// <returns> the updated sheet </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 Sheet UpdateSheet(Sheet sheet) { return this.UpdateResource("sheets/" + sheet.Id, typeof(Sheet), sheet); }
/// <summary> /// <para>Create a sheet in default "Sheets" collection.</para> /// /// <para>It mirrors To the following Smartsheet REST API method:<br /> /// POST /Sheets</para> /// </summary> /// <param name="sheet"> the sheet To created </param> /// <returns> the created sheet </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 Sheet CreateSheet(Sheet sheet) { return this.CreateResource("sheets", typeof(Sheet), sheet); }