Files
m8sh/modules/structs/pull.go
T

96 lines
2.9 KiB
Go
Raw Normal View History

2016-11-07 14:53:13 +01:00
// Copyright 2016 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
2019-05-11 18:21:34 +08:00
package structs
2016-11-07 14:53:13 +01:00
import (
"time"
)
2017-11-12 23:02:25 -08:00
// PullRequest represents a pull request
2016-11-07 14:53:13 +01:00
type PullRequest struct {
ID int64 `json:"id"`
2017-02-22 20:53:33 -03:00
URL string `json:"url"`
2016-11-07 14:53:13 +01:00
Index int64 `json:"number"`
Poster *User `json:"user"`
Title string `json:"title"`
Body string `json:"body"`
Labels []*Label `json:"labels"`
Milestone *Milestone `json:"milestone"`
Assignee *User `json:"assignee"`
2018-05-01 21:05:28 +02:00
Assignees []*User `json:"assignees"`
2016-11-07 14:53:13 +01:00
State StateType `json:"state"`
IsLocked bool `json:"is_locked"`
2016-11-07 14:53:13 +01:00
Comments int `json:"comments"`
2016-11-29 09:09:17 +01:00
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
2016-11-07 14:53:13 +01:00
2018-03-06 02:22:16 +01:00
Mergeable bool `json:"mergeable"`
HasMerged bool `json:"merged"`
2017-11-12 23:02:25 -08:00
// swagger:strfmt date-time
2016-11-07 14:53:13 +01:00
Merged *time.Time `json:"merged_at"`
MergedCommitID *string `json:"merge_commit_sha"`
MergedBy *User `json:"merged_by"`
2016-11-29 09:09:17 +01:00
Base *PRBranchInfo `json:"base"`
Head *PRBranchInfo `json:"head"`
MergeBase string `json:"merge_base"`
2018-05-01 21:05:28 +02:00
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
2017-11-12 23:02:25 -08:00
// swagger:strfmt date-time
Created *time.Time `json:"created_at"`
2017-11-12 23:02:25 -08:00
// swagger:strfmt date-time
Updated *time.Time `json:"updated_at"`
2018-05-01 21:05:28 +02:00
// swagger:strfmt date-time
Closed *time.Time `json:"closed_at"`
2016-11-29 09:09:17 +01:00
}
2017-11-12 23:02:25 -08:00
// PRBranchInfo information about a branch
2016-11-29 09:09:17 +01:00
type PRBranchInfo struct {
Name string `json:"label"`
Ref string `json:"ref"`
Sha string `json:"sha"`
RepoID int64 `json:"repo_id"`
Repository *Repository `json:"repo"`
}
2017-11-12 23:02:25 -08:00
// ListPullRequestsOptions options for listing pull requests
2016-11-29 09:09:17 +01:00
type ListPullRequestsOptions struct {
Page int `json:"page"`
State string `json:"state"`
}
// CreatePullRequestOption options when creating a pull request
type CreatePullRequestOption struct {
Head string `json:"head" binding:"Required"`
Base string `json:"base" binding:"Required"`
Title string `json:"title" binding:"Required"`
Body string `json:"body"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
2018-05-01 21:05:28 +02:00
// swagger:strfmt date-time
Deadline *time.Time `json:"due_date"`
2016-11-29 09:09:17 +01:00
}
// EditPullRequestOption options when modify pull request
type EditPullRequestOption struct {
Title string `json:"title"`
Body string `json:"body"`
Base string `json:"base"`
Assignee string `json:"assignee"`
Assignees []string `json:"assignees"`
Milestone int64 `json:"milestone"`
Labels []int64 `json:"labels"`
State *string `json:"state"`
2018-05-01 21:05:28 +02:00
// swagger:strfmt date-time
2019-11-03 15:46:32 +01:00
Deadline *time.Time `json:"due_date"`
RemoveDeadline *bool `json:"unset_due_date"`
2016-11-29 09:09:17 +01:00
}