mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-19 10:12:54 +02:00
Migrate gitea-sdk to v0.12.0 (#133)
Migrate Update code.gitea.io/sdk/gitea to v0.12.0. Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/133 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
16
vendor/code.gitea.io/sdk/gitea/issue_label.go
generated
vendored
16
vendor/code.gitea.io/sdk/gitea/issue_label.go
generated
vendored
@ -20,10 +20,16 @@ type Label struct {
|
||||
URL string `json:"url"`
|
||||
}
|
||||
|
||||
// ListLabelsOptions options for listing repository's labels
|
||||
type ListLabelsOptions struct {
|
||||
ListOptions
|
||||
}
|
||||
|
||||
// ListRepoLabels list labels of one repository
|
||||
func (c *Client) ListRepoLabels(owner, repo string) ([]*Label, error) {
|
||||
labels := make([]*Label, 0, 10)
|
||||
return labels, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/labels", owner, repo), nil, nil, &labels)
|
||||
func (c *Client) ListRepoLabels(owner, repo string, opt ListLabelsOptions) ([]*Label, error) {
|
||||
opt.setDefaults()
|
||||
labels := make([]*Label, 0, opt.PageSize)
|
||||
return labels, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/labels?%s", owner, repo, opt.getURLQuery().Encode()), nil, nil, &labels)
|
||||
}
|
||||
|
||||
// GetRepoLabel get one label of repository by repo it
|
||||
@ -77,9 +83,9 @@ func (c *Client) DeleteLabel(owner, repo string, id int64) error {
|
||||
}
|
||||
|
||||
// GetIssueLabels get labels of one issue via issue id
|
||||
func (c *Client) GetIssueLabels(owner, repo string, index int64) ([]*Label, error) {
|
||||
func (c *Client) GetIssueLabels(owner, repo string, index int64, opts ListLabelsOptions) ([]*Label, error) {
|
||||
labels := make([]*Label, 0, 5)
|
||||
return labels, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/%d/labels", owner, repo, index), nil, nil, &labels)
|
||||
return labels, c.getParsedResponse("GET", fmt.Sprintf("/repos/%s/%s/issues/%d/labels?%s", owner, repo, index, opts.getURLQuery().Encode()), nil, nil, &labels)
|
||||
}
|
||||
|
||||
// IssueLabelsOption a collection of labels
|
||||
|
Reference in New Issue
Block a user