A convenience class To help generate discussion object with the appropriate fields for adding a discussion To a sheet or row.
        public void TestDiscussionResources()
        {
            string accessToken = ConfigurationManager.AppSettings["accessToken"];

            SmartsheetClient smartsheet = new SmartsheetBuilder().SetAccessToken(accessToken).Build(); long sheetId = CreateSheet(smartsheet);

            Discussion discussionToCreate = new Discussion.CreateDiscussionBuilder("A discussion", new Comment.AddCommentBuilder("a comment").Build()).Build();
            Discussion createdDiscussion = smartsheet.SheetResources.DiscussionResources.CreateDiscussion(sheetId, discussionToCreate);
            long createdDiscussionId = createdDiscussion.Id.Value;
            string path = "../../../IntegrationTestSDK/TestFile.txt";
            Discussion createdDiscussionWithFile = smartsheet.SheetResources.DiscussionResources.CreateDiscussionWithAttachment(sheetId, discussionToCreate, path, null);
            Assert.IsTrue(createdDiscussionWithFile.Comments[0].Attachments[0].Name == "TestFile.txt");

            PaginatedResult<Discussion> discussions = smartsheet.SheetResources.DiscussionResources.ListDiscussions(sheetId, new DiscussionInclusion[] { DiscussionInclusion.COMMENTS, DiscussionInclusion.ATTACHMENTS }, null);
            Assert.IsTrue(discussions.TotalCount == 2);
            Assert.IsTrue(discussions.Data.Count == 2);
            Assert.IsTrue(discussions.Data[0].Id.Value == createdDiscussion.Id.Value || discussions.Data[0].Id.Value == createdDiscussionWithFile.Id.Value);
            Assert.IsTrue(discussions.Data[1].Id.Value == createdDiscussion.Id.Value || discussions.Data[1].Id.Value == createdDiscussionWithFile.Id.Value);

            Discussion getDiscussionWithFile = smartsheet.SheetResources.DiscussionResources.GetDiscussion(sheetId, createdDiscussionWithFile.Id.Value);
            Assert.IsTrue(getDiscussionWithFile.Title == "A discussion");
            Assert.IsTrue(getDiscussionWithFile.Comments.Count == 1);
            Assert.IsTrue(getDiscussionWithFile.Comments[0].Attachments.Count == 1);
            Assert.IsTrue(getDiscussionWithFile.Comments[0].Attachments[0].Name == "TestFile.txt");

            Row row = new Row.AddRowBuilder(true, null, null, null, null).Build();
            IList<Row> rows = smartsheet.SheetResources.RowResources.AddRows(sheetId, new Row[] { row });
            Assert.IsTrue(rows.Count == 1);
            Assert.IsTrue(rows[0].Id.HasValue);
            long rowId = rows[0].Id.Value;
            Comment comment = new Comment.AddCommentBuilder("a comment!").Build();
            Discussion discussionToCreateOnRow = new Discussion.CreateDiscussionBuilder("discussion on row", comment).Build();
            Discussion discussionCreatedOnRow = smartsheet.SheetResources.RowResources.DiscussionResources.CreateDiscussionWithAttachment(sheetId, rowId, discussionToCreateOnRow, path, null);
            PaginatedResult<Discussion> discussionsOnRow = smartsheet.SheetResources.RowResources.DiscussionResources
            .ListDiscussions(sheetId, rowId, new DiscussionInclusion[] { DiscussionInclusion.COMMENTS }, null);
            Assert.IsTrue(discussionsOnRow.Data.Count == 1);
            Assert.IsTrue(discussionsOnRow.Data[0].Title == "discussion on row");
            Assert.IsTrue(discussionsOnRow.Data[0].Comments[0].Text == "discussion on row\n\na comment!");
        }
        private long AttachFileAndUrlToComment(SmartsheetClient smartsheet, long sheetId)
        {
            Discussion discussionToCreate = new Discussion.CreateDiscussionBuilder("A Disc", new Comment.AddCommentBuilder("A comm").Build()).Build();
            Discussion discussionCreated = smartsheet.SheetResources.DiscussionResources.CreateDiscussion(sheetId, discussionToCreate);
            long commentId = discussionCreated.Comments[0].Id.Value;
            Attachment attachment = smartsheet.SheetResources.CommentResources.AttachmentResources.AttachFile(sheetId, commentId, path, "text/plain");
            Assert.IsTrue(attachment.AttachmentType == AttachmentType.FILE);
            Assert.IsTrue(attachment.Name == "TestFile.txt");

            Attachment attachToResource = new Attachment.CreateAttachmentBuilder("http://www.google.com", AttachmentType.LINK).Build();
            attachment = smartsheet.SheetResources.CommentResources.AttachmentResources.AttachUrl(sheetId, commentId, attachToResource);
            Assert.IsTrue(attachment.Url == "http://www.google.com");

            return discussionCreated.Id.Value;
        }