/// <summary> /// Builds the. /// </summary> /// <returns> the discussion </returns> public virtual Discussion Build() { if (title == null || comment == null) { throw new MemberAccessException("A title and comment is required."); } Discussion discussion = new Discussion(); discussion.title = title; discussion.comment = comment; return(discussion); }
/// <summary> /// <para>Creates a new Discussion on a Row.</para> /// <para>It mirrors To the following Smartsheet REST API method:<br /> /// POST /sheets/{sheetId}/rows/{rowId}/discussions</para> /// </summary> /// <param name="sheetId"> the id of the sheet </param> /// <param name="rowId"> the id of the row </param> /// <param name="discussion"> the discussion to add </param> /// <returns> the created discussion </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 Discussion CreateDiscussion(long sheetId, long rowId, Discussion discussion) { return this.CreateResource("sheets/" + sheetId + "/rows/" + rowId + "/discussions", typeof(Discussion), discussion); }
/// <summary> /// <para>Creates a new Discussion attached with an Attachment on a Row.</para> /// <para>It mirrors To the following Smartsheet REST API method:<br /> /// POST /sheets/{sheetId}/rows/{rowId}/discussions</para> /// </summary> /// <param name="sheetId"> the id of the sheet </param> /// <param name="rowId"> the id of the row </param> /// <param name="discussion"> the discussion to add </param> /// <param name="file"> the file path </param> /// <param name="fileType"> the file type, can be null </param> /// <returns> the created discussion </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 Discussion CreateDiscussionWithAttachment(long sheetId, long rowId, Discussion discussion, string file, string fileType) { return this.CreateResourceWithAttachment("sheets/" + sheetId + "/rows/" + rowId + "/discussions", discussion, "discussion", file, fileType); }
/// <summary> /// Builds the. /// </summary> /// <returns> the discussion </returns> public virtual Discussion Build() { //if (title == null || comment == null) //{ // throw new MemberAccessException("A title and comment is required."); //} Discussion discussion = new Discussion(); discussion.title = title; discussion.comment = comment; return discussion; }