Commit 0de9a841 authored by Sander van Harmelen's avatar Sander van Harmelen

Add missing fields to issues structs

parent 06b1711a
...@@ -37,38 +37,40 @@ type IssuesService struct { ...@@ -37,38 +37,40 @@ type IssuesService struct {
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html
type Issue struct { type Issue struct {
ID int `json:"id"` ID int `json:"id"`
IID int `json:"iid"` IID int `json:"iid"`
ProjectID int `json:"project_id"` ProjectID int `json:"project_id"`
Title string `json:"title"` Milestone *Milestone `json:"milestone"`
Description string `json:"description"` Author struct {
Labels []string `json:"labels"`
Milestone *Milestone `json:"milestone"`
Assignee struct {
ID int `json:"id"` ID int `json:"id"`
Username string `json:"username"` Username string `json:"username"`
Email string `json:"email"` Email string `json:"email"`
Name string `json:"name"` Name string `json:"name"`
State string `json:"state"` State string `json:"state"`
CreatedAt *time.Time `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
} `json:"assignee"` } `json:"author"`
Author struct { Description string `json:"description"`
State string `json:"state"`
Assignee struct {
ID int `json:"id"` ID int `json:"id"`
Username string `json:"username"` Username string `json:"username"`
Email string `json:"email"` Email string `json:"email"`
Name string `json:"name"` Name string `json:"name"`
State string `json:"state"` State string `json:"state"`
CreatedAt *time.Time `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
} `json:"author"` } `json:"assignee"`
State string `json:"state"` Labels []string `json:"labels"`
UpdatedAt *time.Time `json:"updated_at"` Title string `json:"title"`
CreatedAt *time.Time `json:"created_at"` UpdatedAt *time.Time `json:"updated_at"`
Subscribed bool `json:"subscribed"` CreatedAt *time.Time `json:"created_at"`
UserNotesCount int `json:"user_notes_count"` ClosedAt *time.Time `json:"closed_at"`
Confidential bool `json:"confidential"` Subscribed bool `json:"subscribed"`
DueDate string `json:"due_date"` UserNotesCount int `json:"user_notes_count"`
WebURL string `json:"web_url"` DueDate *ISOTime `json:"due_date"`
TimeStats TimeStats `json:"time_stats"` WebURL string `json:"web_url"`
TimeStats *TimeStats `json:"time_stats"`
Confidential bool `json:"confidential"`
DiscussionLocked bool `json:"discussion_locked"`
} }
func (i Issue) String() string { func (i Issue) String() string {
...@@ -236,12 +238,16 @@ func (s *IssuesService) GetIssue(pid interface{}, issue int, options ...OptionFu ...@@ -236,12 +238,16 @@ func (s *IssuesService) GetIssue(pid interface{}, issue int, options ...OptionFu
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#new-issues // GitLab API docs: https://docs.gitlab.com/ce/api/issues.html#new-issues
type CreateIssueOptions struct { type CreateIssueOptions struct {
Title *string `url:"title,omitempty" json:"title,omitempty"` Title *string `url:"title,omitempty" json:"title,omitempty"`
Description *string `url:"description,omitempty" json:"description,omitempty"` Description *string `url:"description,omitempty" json:"description,omitempty"`
AssigneeID *int `url:"assignee_id,omitempty" json:"assignee_id,omitempty"` Confidential *bool `url:"confidential,omitempty" json:"confidential,omitempty"`
CreatedAt *time.Time `url:"created_at,omitempty" json:"created_at,omitempty"` AssigneeIDs []int `url:"assignee_ids,omitempty" json:"assignee_ids,omitempty"`
MilestoneID *int `url:"milestone_id,omitempty" json:"milestone_id,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"`
DiscussionToResolve *string `url:"discussion_to_resolve,omitempty" json:"discussion_to_resolve,omitempty"`
} }
// CreateIssue creates a new project issue. // CreateIssue creates a new project issue.
......
...@@ -318,7 +318,8 @@ func (s *MergeRequestsService) GetMergeRequestChanges(pid interface{}, mergeRequ ...@@ -318,7 +318,8 @@ func (s *MergeRequestsService) GetMergeRequestChanges(pid interface{}, mergeRequ
return m, resp, err return m, resp, err
} }
// GetIssuesClosedOnMerge Get all the issues that would be closed by merging the provided merge request. // GetIssuesClosedOnMerge gets all the issues that would be closed by merging the
// provided merge request.
// //
// GitLab API docs: // GitLab API docs:
// https://docs.gitlab.com/ce/api/merge_requests.html#list-issues-that-will-close-on-merge // https://docs.gitlab.com/ce/api/merge_requests.html#list-issues-that-will-close-on-merge
...@@ -333,6 +334,7 @@ func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid interface{}, mergeRequ ...@@ -333,6 +334,7 @@ func (s *MergeRequestsService) GetIssuesClosedOnMerge(pid interface{}, mergeRequ
if err != nil { if err != nil {
return nil, nil, err return nil, nil, err
} }
var i []*Issue var i []*Issue
resp, err := s.client.Do(req, &i) resp, err := s.client.Do(req, &i)
if err != nil { if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment