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