Commit ee48e93a authored by Sander van Harmelen's avatar Sander van Harmelen

Fixup the `MergeRequest` and `MergeCommentEvent` structs

parent b0143419
...@@ -213,7 +213,6 @@ type MergeCommentEvent struct { ...@@ -213,7 +213,6 @@ type MergeCommentEvent struct {
WebURL string `json:"web_url"` WebURL string `json:"web_url"`
Visibility VisibilityValue `json:"visibility"` Visibility VisibilityValue `json:"visibility"`
} `json:"project"` } `json:"project"`
Repository *Repository `json:"repository"`
ObjectAttributes struct { ObjectAttributes struct {
ID int `json:"id"` ID int `json:"id"`
Note string `json:"note"` Note string `json:"note"`
...@@ -230,57 +229,53 @@ type MergeCommentEvent struct { ...@@ -230,57 +229,53 @@ type MergeCommentEvent struct {
StDiff *Diff `json:"st_diff"` StDiff *Diff `json:"st_diff"`
URL string `json:"url"` URL string `json:"url"`
} `json:"object_attributes"` } `json:"object_attributes"`
Repository *Repository `json:"repository"`
MergeRequest struct { MergeRequest struct {
ID int `json:"id"` ID int `json:"id"`
TargetBranch string `json:"target_branch"` TargetBranch string `json:"target_branch"`
SourceBranch string `json:"source_branch"` SourceBranch string `json:"source_branch"`
SourceProjectID int `json:"source_project_id"` SourceProjectID int `json:"source_project_id"`
AuthorID int `json:"author_id"` AuthorID int `json:"author_id"`
AssigneeID int `json:"assignee_id"` AssigneeID int `json:"assignee_id"`
Title string `json:"title"` Title string `json:"title"`
CreatedAt string `json:"created_at"` // Should be *time.Time (see Gitlab issue #21468) CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"` // Should be *time.Time (see Gitlab issue #21468) UpdatedAt string `json:"updated_at"`
StCommits []*Commit `json:"st_commits"` MilestoneID int `json:"milestone_id"`
StDiffs []*Diff `json:"st_diffs"` State string `json:"state"`
MilestoneID int `json:"milestone_id"` MergeStatus string `json:"merge_status"`
State string `json:"state"` TargetProjectID int `json:"target_project_id"`
MergeStatus string `json:"merge_status"` IID int `json:"iid"`
TargetProjectID int `json:"target_project_id"` Description string `json:"description"`
Iid int `json:"iid"` Position int `json:"position"`
Description string `json:"description"` LockedAt string `json:"locked_at"`
Position int `json:"position"` UpdatedByID int `json:"updated_by_id"`
LockedAt string `json:"locked_at"` MergeError string `json:"merge_error"`
UpdatedByID int `json:"updated_by_id"`
MergeError string `json:"merge_error"`
MergeParams struct { MergeParams struct {
ForceRemoveSourceBranch string `json:"force_remove_source_branch"` ForceRemoveSourceBranch string `json:"force_remove_source_branch"`
} `json:"merge_params"` } `json:"merge_params"`
MergeWhenBuildSucceeds bool `json:"merge_when_build_succeeds"` MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
MergeUserID int `json:"merge_user_id"` MergeUserID int `json:"merge_user_id"`
MergeCommitSha string `json:"merge_commit_sha"` MergeCommitSha string `json:"merge_commit_sha"`
DeletedAt string `json:"deleted_at"` DeletedAt string `json:"deleted_at"`
ApprovalsBeforeMerge string `json:"approvals_before_merge"` InProgressMergeCommitSha string `json:"in_progress_merge_commit_sha"`
RebaseCommitSha string `json:"rebase_commit_sha"` LockVersion int `json:"lock_version"`
InProgressMergeCommitSha string `json:"in_progress_merge_commit_sha"` ApprovalsBeforeMerge string `json:"approvals_before_merge"`
LockVersion int `json:"lock_version"` RebaseCommitSha string `json:"rebase_commit_sha"`
TimeEstimate int `json:"time_estimate"` TimeEstimate int `json:"time_estimate"`
Source *Repository `json:"source"` Squash bool `json:"squash"`
Target *Repository `json:"target"` LastEditedAt string `json:"last_edited_at"`
LastCommit struct { LastEditedByID int `json:"last_edited_by_id"`
Source *Repository `json:"source"`
Target *Repository `json:"target"`
LastCommit struct {
ID string `json:"id"` ID string `json:"id"`
Message string `json:"message"` Message string `json:"message"`
Timestamp *time.Time `json:"timestamp"` Timestamp *time.Time `json:"timestamp"`
URL string `json:"url"` URL string `json:"url"`
Author *Author `json:"author"` Author *Author `json:"author"`
} `json:"last_commit"` } `json:"last_commit"`
WorkInProgress bool `json:"work_in_progress"` WorkInProgress bool `json:"work_in_progress"`
URL string `json:"url"` TotalTimeSpent int `json:"total_time_spent"`
Action string `json:"action"`
Assignee struct {
Name string `json:"name"`
Username string `json:"username"`
AvatarURL string `json:"avatar_url"`
} `json:"assignee"`
} `json:"merge_request"` } `json:"merge_request"`
} }
......
...@@ -35,39 +35,39 @@ type MergeRequestsService struct { ...@@ -35,39 +35,39 @@ type MergeRequestsService struct {
// //
// GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html // GitLab API docs: https://docs.gitlab.com/ce/api/merge_requests.html
type MergeRequest struct { type MergeRequest struct {
ID int `json:"id"` ID int `json:"id"`
IID int `json:"iid"` IID int `json:"iid"`
ProjectID int `json:"project_id"` TargetBranch string `json:"target_branch"`
Title string `json:"title"` SourceBranch string `json:"source_branch"`
Description string `json:"description"` ProjectID int `json:"project_id"`
WorkInProgress bool `json:"work_in_progress"` Title string `json:"title"`
State string `json:"state"` State string `json:"state"`
CreatedAt string `json:"created_at"` CreatedAt *time.Time `json:"created_at"`
UpdatedAt string `json:"updated_at"` UpdatedAt *time.Time `json:"updated_at"`
TargetBranch string `json:"target_branch"` Upvotes int `json:"upvotes"`
SourceBranch string `json:"source_branch"` Downvotes int `json:"downvotes"`
Upvotes int `json:"upvotes"` Author struct {
Downvotes int `json:"downvotes"` ID int `json:"id"`
Author struct { Username string `json:"username"`
Name string `json:"name"` Name string `json:"name"`
Username string `json:"username"` State string `json:"state"`
ID int `json:"id"` CreatedAt *time.Time `json:"created_at"`
State string `json:"state"`
AvatarURL string `json:"avatar_url"`
} `json:"author"` } `json:"author"`
Assignee struct { Assignee struct {
Name string `json:"name"` ID int `json:"id"`
Username string `json:"username"` Username string `json:"username"`
ID int `json:"id"` Name string `json:"name"`
State string `json:"state"` State string `json:"state"`
AvatarURL string `json:"avatar_url"` CreatedAt *time.Time `json:"created_at"`
} `json:"assignee"` } `json:"assignee"`
SourceProjectID int `json:"source_project_id"` SourceProjectID int `json:"source_project_id"`
TargetProjectID int `json:"target_project_id"` TargetProjectID int `json:"target_project_id"`
Labels []string `json:"labels"` Labels []string `json:"labels"`
Description string `json:"description"`
WorkInProgress bool `json:"work_in_progress"`
Milestone struct { Milestone 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"` Title string `json:"title"`
Description string `json:"description"` Description string `json:"description"`
...@@ -78,11 +78,15 @@ type MergeRequest struct { ...@@ -78,11 +78,15 @@ type MergeRequest struct {
} `json:"milestone"` } `json:"milestone"`
MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"` MergeWhenPipelineSucceeds bool `json:"merge_when_pipeline_succeeds"`
MergeStatus string `json:"merge_status"` MergeStatus string `json:"merge_status"`
SHA string `json:"sha"`
Subscribed bool `json:"subscribed"` Subscribed bool `json:"subscribed"`
SHA string `json:"sha"`
MergeCommitShaSHA string `json:"merge_commit_sha"`
UserNotesCount int `json:"user_notes_count"` UserNotesCount int `json:"user_notes_count"`
ChangesCount int `json:"changes_count"`
SouldRemoveSourceBranch bool `json:"should_remove_source_branch"` SouldRemoveSourceBranch bool `json:"should_remove_source_branch"`
ForceRemoveSourceBranch bool `json:"force_remove_source_branch"` ForceRemoveSourceBranch bool `json:"force_remove_source_branch"`
WebURL string `json:"web_url"`
DiscussionLocked bool `json:"discussion_locked"`
Changes []struct { Changes []struct {
OldPath string `json:"old_path"` OldPath string `json:"old_path"`
NewPath string `json:"new_path"` NewPath string `json:"new_path"`
...@@ -93,7 +97,6 @@ type MergeRequest struct { ...@@ -93,7 +97,6 @@ type MergeRequest struct {
RenamedFile bool `json:"renamed_file"` RenamedFile bool `json:"renamed_file"`
DeletedFile bool `json:"deleted_file"` DeletedFile bool `json:"deleted_file"`
} `json:"changes"` } `json:"changes"`
WebURL string `json:"web_url"`
} }
func (m MergeRequest) String() string { func (m MergeRequest) String() string {
......
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