aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/xanzy/go-gitlab/issues.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-03 13:29:29 +0000
committerGitHub <noreply@github.com>2019-11-03 13:29:29 +0000
commit16bd116971bb7abc7308e95c474b433512672432 (patch)
tree9ff0abe956baed511f47b456f94863fec2e08cf3 /vendor/github.com/xanzy/go-gitlab/issues.go
parent8c7c9880b1adcf876ad63ea39e46e62bd7ebde5d (diff)
parent4666763d4dfc5623ee2b2423a759de50aad151b7 (diff)
downloadgit-bug-16bd116971bb7abc7308e95c474b433512672432.tar.gz
Merge pull request #234 from MichaelMure/dependabot/dep/github.com/xanzy/go-gitlab-0.21.0
build(deps): bump github.com/xanzy/go-gitlab from 0.20.0 to 0.21.0
Diffstat (limited to 'vendor/github.com/xanzy/go-gitlab/issues.go')
-rw-r--r--vendor/github.com/xanzy/go-gitlab/issues.go38
1 files changed, 35 insertions, 3 deletions
diff --git a/vendor/github.com/xanzy/go-gitlab/issues.go b/vendor/github.com/xanzy/go-gitlab/issues.go
index ed9c2bf0..70a1255d 100644
--- a/vendor/github.com/xanzy/go-gitlab/issues.go
+++ b/vendor/github.com/xanzy/go-gitlab/issues.go
@@ -75,7 +75,7 @@ type Issue struct {
Assignee *IssueAssignee `json:"assignee"`
Upvotes int `json:"upvotes"`
Downvotes int `json:"downvotes"`
- Labels []string `json:"labels"`
+ Labels Labels `json:"labels"`
Title string `json:"title"`
UpdatedAt *time.Time `json:"updated_at"`
CreatedAt *time.Time `json:"created_at"`
@@ -280,7 +280,7 @@ type CreateIssueOptions struct {
Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"`
AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
- Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"`
DueDate *ISOTime `url:"due_date,omitempty" json:"due_date,omitempty"`
MergeRequestToResolveDiscussionsOf *int `url:"merge_request_to_resolve_discussions_of,omitempty" json:"merge_request_to_resolve_discussions_of,omitempty"`
@@ -321,7 +321,7 @@ type UpdateIssueOptions struct {
Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"`
AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,omitempty"`
- Labels Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
+ Labels *Labels `url:"labels,comma,omitempty" json:"labels,omitempty"`
StateEvent *string `url:"state_event,omitempty" json:"state_event,omitempty"`
UpdatedAt *time.Time `url:"updated_at,omitempty" json:"updated_at,omitempty"`
DueDate *ISOTime `url:"due_date,omitempty" json:"due_date,omitempty"`
@@ -372,6 +372,38 @@ func (s *IssuesService) DeleteIssue(pid interface{}, issue int, options ...Optio
return s.client.Do(req, nil)
}
+// MoveIssueOptions represents the available MoveIssue() options.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/issues.html#move-an-issue
+type MoveIssueOptions struct {
+ ToProjectID *int `url:"to_project_id,omitempty" json:"to_project_id,omitempty"`
+}
+
+// MoveIssue updates an existing project issue. This function is also used
+// to mark an issue as closed.
+//
+// GitLab API docs: https://docs.gitlab.com/ee/api/issues.html#move-an-issue
+func (s *IssuesService) MoveIssue(pid interface{}, issue int, opt *MoveIssueOptions, options ...OptionFunc) (*Issue, *Response, error) {
+ project, err := parseID(pid)
+ if err != nil {
+ return nil, nil, err
+ }
+ u := fmt.Sprintf("projects/%s/issues/%d/move", pathEscape(project), issue)
+
+ req, err := s.client.NewRequest("POST", u, opt, options)
+ if err != nil {
+ return nil, nil, err
+ }
+
+ i := new(Issue)
+ resp, err := s.client.Do(req, i)
+ if err != nil {
+ return nil, resp, err
+ }
+
+ return i, resp, err
+}
+
// SubscribeToIssue subscribes the authenticated user to the given issue to
// receive notifications. If the user is already subscribed to the issue, the
// status code 304 is returned.