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:
13
vendor/code.gitea.io/sdk/gitea/user_email.go
generated
vendored
13
vendor/code.gitea.io/sdk/gitea/user_email.go
generated
vendored
@ -7,6 +7,7 @@ package gitea
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Email an email address belonging to a user
|
||||
@ -16,10 +17,16 @@ type Email struct {
|
||||
Primary bool `json:"primary"`
|
||||
}
|
||||
|
||||
// ListEmailsOptions options for listing current's user emails
|
||||
type ListEmailsOptions struct {
|
||||
ListOptions
|
||||
}
|
||||
|
||||
// ListEmails all the email addresses of user
|
||||
func (c *Client) ListEmails() ([]*Email, error) {
|
||||
emails := make([]*Email, 0, 3)
|
||||
return emails, c.getParsedResponse("GET", "/user/emails", nil, nil, &emails)
|
||||
func (c *Client) ListEmails(opt ListEmailsOptions) ([]*Email, error) {
|
||||
opt.setDefaults()
|
||||
emails := make([]*Email, 0, opt.PageSize)
|
||||
return emails, c.getParsedResponse("GET", fmt.Sprintf("/user/emails?%s", opt.getURLQuery().Encode()), nil, nil, &emails)
|
||||
}
|
||||
|
||||
// CreateEmailOption options when creating email addresses
|
||||
|
Reference in New Issue
Block a user