diff options
author | Ethan Koenig <ethantkoenig@gmail.com> | 2017-11-12 23:02:25 -0800 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2017-11-13 09:02:25 +0200 |
commit | f26f4a7e01f9c380c261fa5bc21bd7e48f2f2f9f (patch) | |
tree | 39c2fc0abc5a10f80f8fa31b3bd57ec3604bf7fd /vendor/code.gitea.io/sdk/gitea/user_email.go | |
parent | 4287d100b39ff89e297ba8945e54fb5911226974 (diff) | |
download | gitea-f26f4a7e01f9c380c261fa5bc21bd7e48f2f2f9f.tar.gz gitea-f26f4a7e01f9c380c261fa5bc21bd7e48f2f2f9f.zip |
Update swagger documentation (#2899)
* Update swagger documentation
Add docs for missing endpoints
Add documentation for request parameters
Make parameter naming consistent
Fix response documentation
* Restore delete comments
Diffstat (limited to 'vendor/code.gitea.io/sdk/gitea/user_email.go')
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/user_email.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/user_email.go b/vendor/code.gitea.io/sdk/gitea/user_email.go index e167b5dfbd..721f52144b 100644 --- a/vendor/code.gitea.io/sdk/gitea/user_email.go +++ b/vendor/code.gitea.io/sdk/gitea/user_email.go @@ -9,8 +9,9 @@ import ( "encoding/json" ) -// Email en email information of user +// Email an email address belonging to a user type Email struct { + // swagger:strfmt email Email string `json:"email"` Verified bool `json:"verified"` Primary bool `json:"primary"` @@ -22,8 +23,9 @@ func (c *Client) ListEmails() ([]*Email, error) { return emails, c.getParsedResponse("GET", "/user/emails", nil, nil, &emails) } -// CreateEmailOption options when create an email +// CreateEmailOption options when creating email addresses type CreateEmailOption struct { + // email addresses to add Emails []string `json:"emails"` } @@ -37,8 +39,14 @@ func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, error) { return emails, c.getParsedResponse("POST", "/user/emails", jsonHeader, bytes.NewReader(body), emails) } +// DeleteEmailOption options when deleting email addresses +type DeleteEmailOption struct { + // email addresses to delete + Emails []string `json:"emails"` +} + // DeleteEmail delete one email of current users' -func (c *Client) DeleteEmail(opt CreateEmailOption) error { +func (c *Client) DeleteEmail(opt DeleteEmailOption) error { body, err := json.Marshal(&opt) if err != nil { return err |