コード例 #1
0
 private Issue GetIssue(Issue issue)
 {
     var overrideUrl = String.Format(_issuesIdUrl, issue.local_id);
     return _sharpBucketV1.Get(issue, overrideUrl);
 }
コード例 #2
0
 internal Issue PutIssue(Issue issue)
 {
     var overrideUrl = String.Format(_issuesIdUrl, issue.local_id);
     return _sharpBucketV1.Put(issue, overrideUrl);
 }
コード例 #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
 internal IssueFollowers ListIssueFollowers(Issue issue)
 {
     var overrideUrl = String.Format(_issuesIdUrl + "followers", issue.local_id);
     return _sharpBucketV1.Get(new IssueFollowers(), overrideUrl);
 }
コード例 #5
0
 internal Issue PostIssue(Issue issue)
 {
     return _sharpBucketV1.Post(issue, _issuesUrl);
 }
コード例 #6
0
 internal Comment GetIssueComment(Issue issue, int? commentId)
 {
     var overrideUrl = String.Format(_issuesIdUrl + "comments/{1}", issue.local_id, commentId);
     return _sharpBucketV1.Get(new Comment{comment_id = commentId}, overrideUrl);
 }
コード例 #7
0
 internal List<Comment> ListIssueComments(Issue issue)
 {
     var overrideUrl = String.Format(_issuesIdUrl + "comments", issue.local_id);
     return _sharpBucketV1.Get(new List<Comment>(), overrideUrl);
 }
コード例 #8
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);
        }
コード例 #9
0
 internal Comment DeleteIssueComment(Issue issue, int? commentId)
 {
     return DeleteIssueComment(issue, new Comment{comment_id = commentId});
 }
コード例 #10
0
 /// <summary>
 /// Update a specific comment of an issue.
 /// </summary>
 /// <param name="issue">The issue.</param>
 /// <param name="comment">The comment.</param>
 /// <returns>The response of BitBucket API.</returns>
 internal Comment PutIssueComment(Issue issue, Comment comment)
 {
     return _repositoriesEndPoint.PutIssueComment(issue, comment);
 }
コード例 #11
0
 internal List<Comment> ListIssueComments(Issue issue)
 {
     return _repositoriesEndPoint.ListIssueComments(issue);
 }
コード例 #12
0
 /// <summary>
 /// Get a specific comment of an issue.
 /// </summary>
 /// <param name="issue">The issue.</param>
 /// <param name="commentId">The comment identifier.</param>
 /// <returns></returns>
 internal Comment GetIssueComment(Issue issue, int? commentId)
 {
     return _repositoriesEndPoint.GetIssueComment(issue, commentId);
 }
コード例 #13
0
 /// <summary>
 /// Delete a specific comment of an issue.
 /// </summary>
 /// <param name="issue">The issue.</param>
 /// <param name="comment">The comment.</param>
 /// <returns>The response of BitBucket API.</returns>
 internal Comment DeleteIssueComment(Issue issue, Comment comment)
 {
     return _repositoriesEndPoint.DeleteIssueComment(issue, comment);
 }
コード例 #14
0
 /// <summary>
 /// Updates an existing issue. Updating the title or content fields requires that the caller authenticate as a user with write access. 
 /// For other fields, the caller must authenticate as a user with read access. 
 /// Private repositories or private issue trackers require the caller to authenticate with an account that has appropriate access. 
 /// </summary>
 /// <param name="issue">The issue.</param>
 /// <returns>Response from the BitBucket API.</returns>
 public Issue PutIssue(Issue issue)
 {
     return _repositoriesEndPoint.PutIssue(issue);
 }