code.gitea.io/sdk/gitea v0.14.0 -> v0.15.1 (#18186)
This commit is contained in:
parent
8760af752a
commit
ec6cc38c6c
29 changed files with 695 additions and 133 deletions
48
vendor/code.gitea.io/sdk/gitea/issue.go
generated
vendored
48
vendor/code.gitea.io/sdk/gitea/issue.go
generated
vendored
|
@ -42,10 +42,7 @@ type Issue struct {
|
|||
Ref string `json:"ref"`
|
||||
Labels []*Label `json:"labels"`
|
||||
Milestone *Milestone `json:"milestone"`
|
||||
// deprecated
|
||||
// TODO: rm on sdk 0.15.0
|
||||
Assignee *User `json:"assignee"`
|
||||
Assignees []*User `json:"assignees"`
|
||||
Assignees []*User `json:"assignees"`
|
||||
// Whether the issue is open or closed
|
||||
State StateType `json:"state"`
|
||||
IsLocked bool `json:"is_locked"`
|
||||
|
@ -66,6 +63,14 @@ type ListIssueOption struct {
|
|||
Labels []string
|
||||
Milestones []string
|
||||
KeyWord string
|
||||
Since time.Time
|
||||
Before time.Time
|
||||
// filter by created by username
|
||||
CreatedBy string
|
||||
// filter by assigned to username
|
||||
AssignedBy string
|
||||
// filter by username mentioned
|
||||
MentionedBy string
|
||||
}
|
||||
|
||||
// StateType issue state type
|
||||
|
@ -114,6 +119,23 @@ func (opt *ListIssueOption) QueryEncode() string {
|
|||
query.Add("milestones", strings.Join(opt.Milestones, ","))
|
||||
}
|
||||
|
||||
if !opt.Since.IsZero() {
|
||||
query.Add("since", opt.Since.Format(time.RFC3339))
|
||||
}
|
||||
if !opt.Before.IsZero() {
|
||||
query.Add("before", opt.Before.Format(time.RFC3339))
|
||||
}
|
||||
|
||||
if len(opt.CreatedBy) > 0 {
|
||||
query.Add("created_by", opt.CreatedBy)
|
||||
}
|
||||
if len(opt.AssignedBy) > 0 {
|
||||
query.Add("assigned_by", opt.AssignedBy)
|
||||
}
|
||||
if len(opt.MentionedBy) > 0 {
|
||||
query.Add("mentioned_by", opt.MentionedBy)
|
||||
}
|
||||
|
||||
return query.Encode()
|
||||
}
|
||||
|
||||
|
@ -178,12 +200,9 @@ func (c *Client) GetIssue(owner, repo string, index int64) (*Issue, *Response, e
|
|||
|
||||
// CreateIssueOption options to create one issue
|
||||
type CreateIssueOption struct {
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
Ref string `json:"ref"`
|
||||
// deprecated
|
||||
// TODO: rm on sdk 0.15.0
|
||||
Assignee string `json:"assignee"`
|
||||
Title string `json:"title"`
|
||||
Body string `json:"body"`
|
||||
Ref string `json:"ref"`
|
||||
Assignees []string `json:"assignees"`
|
||||
Deadline *time.Time `json:"due_date"`
|
||||
// milestone id
|
||||
|
@ -222,12 +241,9 @@ func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue,
|
|||
|
||||
// EditIssueOption options for editing an issue
|
||||
type EditIssueOption struct {
|
||||
Title string `json:"title"`
|
||||
Body *string `json:"body"`
|
||||
Ref *string `json:"ref"`
|
||||
// deprecated
|
||||
// TODO: rm on sdk 0.15.0
|
||||
Assignee *string `json:"assignee"`
|
||||
Title string `json:"title"`
|
||||
Body *string `json:"body"`
|
||||
Ref *string `json:"ref"`
|
||||
Assignees []string `json:"assignees"`
|
||||
Milestone *int64 `json:"milestone"`
|
||||
State *StateType `json:"state"`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue