コード例 #1
0
 private Comment GetIssueComment(int issueId, Comment comment)
 {
     var overrideUrl = String.Format(_issuesIdUrl + "comments/{1}", issueId, comment.comment_id);
     return _sharpBucketV1.Get(comment, overrideUrl);
 }
コード例 #2
0
 internal Comment PostIssueComment(int issueId, Comment comment)
 {
     return PostIssueComment(new Issue{local_id = issueId}, comment);
 }
コード例 #3
0
 internal Comment PutIssueComment(Issue issue, Comment comment)
 {
     var overrideUrl = String.Format(_issuesIdUrl + "comments/{1}", issue.local_id, comment.comment_id);
     return _sharpBucketV1.Put(comment, overrideUrl);
 }
コード例 #4
0
ファイル: Program.cs プロジェクト: 0x1mason/SharpBucket
        private static void TestIssuesEndPoint(SharpBucketV1 sharpBucket)
        {
            var issuesResource = sharpBucket.RepositoriesEndPoint(accountName, repository).IssuesResource();

            int ISSUE_ID = 5;
            // Issues
            var issues = issuesResource.ListIssues();
            var newIssue = new Issue{title = "Let's add a new issue", content = "Some issue content", status = "new", priority = "trivial", kind = "bug"};
            var newIssueResult = issuesResource.PostIssue(newIssue);
            var issue = issuesResource.GetIssue(newIssueResult.local_id);
            var changedIssue = new Issue{title = "Completely new title", content = "Hi!", status = "new", local_id = issue.local_id};
            var changedIssueResult = issuesResource.PutIssue(changedIssue);
            issuesResource.DeleteIssue(changedIssueResult.local_id);

            // Issue comments
            var issueResource = issuesResource.IssueResource(ISSUE_ID);
            var issueComments = issueResource.ListComments();
            var newComment = new Comment{content = "This bug is really annoying!"};
            var newCommentResult = issueResource.PostComment(newComment);
            var comment = issueResource.GetIssueComment(newCommentResult.comment_id);
            comment.content = "The bug is still annoying";
            var updatedCommentRes = issueResource.PutIssueComment(comment);
            issueResource.DeleteIssueComment(updatedCommentRes.comment_id);

            // Issue followers
            var issueFollowers = issueResource.ListFollowers();

            // Components
            var components = issuesResource.ListComponents();
            var newComponent = new Component{name = "Awesome component"};
            var newComponentRes = issuesResource.PostComponent(newComponent);
            var component = issuesResource.GetComponent(newComponentRes.id);
            component.name = "Even more awesome component";
            var updatedComponent = issuesResource.PutComponent(component);
            issuesResource.DeleteComponent(updatedComponent.id);

            // Milestones
            var milestones = issuesResource.ListMilestones();
            var newMilestone = new Milestone{name = "Awesome milestone"};
            var newMilestoneRes = issuesResource.PostMilestone(newMilestone);
            var milestone = issuesResource.GetMilestone(newMilestoneRes.id);
            milestone.name = "Even more awesome milestone";
            var updatedMilestone = issuesResource.PutMilestone(milestone);
            issuesResource.DeleteMilestone(updatedMilestone.id);

            // Versions
            var versions = issuesResource.ListVersions();
            var newVersion = new Version{name = "Awesome version"};
            var newVersionRes = issuesResource.PostVersion(newVersion);
            var version = issuesResource.GetVersion(newVersionRes.id);
            version.name = "Even more awesome version";
            var updatedversion = issuesResource.PutVersion(version);
            issuesResource.DeleteVersion(updatedversion.id);
        }
コード例 #5
0
 internal Comment DeleteIssueComment(int? issueId, Comment comment)
 {
     return DeleteIssueComment(new Issue{local_id = issueId}, comment);
 }
コード例 #6
0
ファイル: IssueResource.cs プロジェクト: 0x1mason/SharpBucket
 /// <summary>
 /// Update a comment of the current issue.
 /// </summary>
 /// <param name="comment">The comment that you wish to update.</param>
 /// <returns>Response from the BitBucket API.</returns>
 public Comment PutIssueComment(Comment comment)
 {
     return _repositoriesEndPoint.PutIssueComment(_issueId, comment);
 }
コード例 #7
0
        private static void TestIssuesEndPoint(SharpBucketV1 sharpBucket)
        {
            var issuesResource = sharpBucket.RepositoriesEndPoint(accountName, repository).IssuesResource();

            int ISSUE_ID = 5;
            // Issues
            var issues   = issuesResource.ListIssues();
            var newIssue = new Issue {
                title = "Let's add a new issue", content = "Some issue content", status = "new", priority = "trivial", kind = "bug"
            };
            var newIssueResult = issuesResource.PostIssue(newIssue);
            var issue          = issuesResource.GetIssue(newIssueResult.local_id);
            var changedIssue   = new Issue {
                title = "Completely new title", content = "Hi!", status = "new", local_id = issue.local_id
            };
            var changedIssueResult = issuesResource.PutIssue(changedIssue);

            issuesResource.DeleteIssue(changedIssueResult.local_id);

            // Issue comments
            var issueResource = issuesResource.IssueResource(ISSUE_ID);
            var issueComments = issueResource.ListComments();
            var newComment    = new Comment {
                content = "This bug is really annoying!"
            };
            var newCommentResult = issueResource.PostComment(newComment);
            var comment          = issueResource.GetIssueComment(newCommentResult.comment_id);

            comment.content = "The bug is still annoying";
            var updatedCommentRes = issueResource.PutIssueComment(comment);

            issueResource.DeleteIssueComment(updatedCommentRes.comment_id);

            // Issue followers
            var issueFollowers = issueResource.ListFollowers();

            // Components
            var components   = issuesResource.ListComponents();
            var newComponent = new Component {
                name = "Awesome component"
            };
            var newComponentRes = issuesResource.PostComponent(newComponent);
            var component       = issuesResource.GetComponent(newComponentRes.id);

            component.name = "Even more awesome component";
            var updatedComponent = issuesResource.PutComponent(component);

            issuesResource.DeleteComponent(updatedComponent.id);

            // Milestones
            var milestones   = issuesResource.ListMilestones();
            var newMilestone = new Milestone {
                name = "Awesome milestone"
            };
            var newMilestoneRes = issuesResource.PostMilestone(newMilestone);
            var milestone       = issuesResource.GetMilestone(newMilestoneRes.id);

            milestone.name = "Even more awesome milestone";
            var updatedMilestone = issuesResource.PutMilestone(milestone);

            issuesResource.DeleteMilestone(updatedMilestone.id);

            // Versions
            var versions   = issuesResource.ListVersions();
            var newVersion = new Version {
                name = "Awesome version"
            };
            var newVersionRes = issuesResource.PostVersion(newVersion);
            var version       = issuesResource.GetVersion(newVersionRes.id);

            version.name = "Even more awesome version";
            var updatedversion = issuesResource.PutVersion(version);

            issuesResource.DeleteVersion(updatedversion.id);
        }
コード例 #8
0
 /// <summary>
 /// Update a specific comment of an issue.
 /// </summary>
 /// <param name="issueId">The issue identifier.</param>
 /// <param name="comment">The comment.</param>
 /// <returns>The response of BitBucket API.</returns>
 internal Comment PutIssueComment(int issueId, Comment comment)
 {
     return _repositoriesEndPoint.PutIssueComment(issueId, comment);
 }
コード例 #9
0
 /// <summary>
 /// Post a comment to the selected issue.
 /// </summary>
 /// <param name="issue">The issue.</param>
 /// <param name="comment">The comment.</param>
 /// <returns>Response from the BitBucket API.</returns>
 internal Comment PostIssueComment(Issue issue, Comment comment)
 {
     return _repositoriesEndPoint.PostIssueComment(issue, comment);
 }
コード例 #10
0
 /// <summary>
 /// Delete a specific comment of an issue.
 /// </summary>
 /// <param name="issueId">The issue identifier.</param>
 /// <param name="comment">The comment.</param>
 /// <returns>The response of BitBucket API.</returns>
 internal Comment DeleteIssueComment(int? issueId, Comment comment)
 {
     return _repositoriesEndPoint.DeleteIssueComment(issueId, comment);
 }