diff options
author | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2016-11-29 09:09:17 +0100 |
---|---|---|
committer | Kim "BKC" Carlbäcker <kim.carlbacker@gmail.com> | 2016-11-29 11:50:22 +0100 |
commit | 57dc9efaaef3756f5b432b030973295934634544 (patch) | |
tree | 07b5ccbda7bc00cc683886a4368432a4201204a5 /vendor/code.gitea.io/sdk/gitea/org.go | |
parent | f3645224680e7a3f5477c0804aa2690d6262779f (diff) | |
download | gitea-57dc9efaaef3756f5b432b030973295934634544.tar.gz gitea-57dc9efaaef3756f5b432b030973295934634544.zip |
Update gitea/sdk vendor
Diffstat (limited to 'vendor/code.gitea.io/sdk/gitea/org.go')
-rw-r--r-- | vendor/code.gitea.io/sdk/gitea/org.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/vendor/code.gitea.io/sdk/gitea/org.go b/vendor/code.gitea.io/sdk/gitea/org.go index 70d872cf51..103674a701 100644 --- a/vendor/code.gitea.io/sdk/gitea/org.go +++ b/vendor/code.gitea.io/sdk/gitea/org.go @@ -10,31 +10,36 @@ import ( "fmt" ) +// Organization a group of some repositories, users and teams type Organization struct { ID int64 `json:"id"` UserName string `json:"username"` FullName string `json:"full_name"` - AvatarUrl string `json:"avatar_url"` + AvatarURL string `json:"avatar_url"` Description string `json:"description"` Website string `json:"website"` Location string `json:"location"` } +// ListMyOrgs list all of current user's organizations func (c *Client) ListMyOrgs() ([]*Organization, error) { orgs := make([]*Organization, 0, 5) return orgs, c.getParsedResponse("GET", "/user/orgs", nil, nil, &orgs) } +// ListUserOrgs list all of some user's organizations func (c *Client) ListUserOrgs(user string) ([]*Organization, error) { orgs := make([]*Organization, 0, 5) return orgs, c.getParsedResponse("GET", fmt.Sprintf("/users/%s/orgs", user), nil, nil, &orgs) } +// GetOrg get one organization by name func (c *Client) GetOrg(orgname string) (*Organization, error) { org := new(Organization) return org, c.getParsedResponse("GET", fmt.Sprintf("/orgs/%s", orgname), nil, nil, org) } +// CreateOrgOption create one organization options type CreateOrgOption struct { UserName string `json:"username" binding:"Required"` FullName string `json:"full_name"` @@ -43,6 +48,7 @@ type CreateOrgOption struct { Location string `json:"location"` } +// EditOrgOption edit one organization options type EditOrgOption struct { FullName string `json:"full_name"` Description string `json:"description"` @@ -50,6 +56,7 @@ type EditOrgOption struct { Location string `json:"location"` } +// EditOrg modify one organization via options func (c *Client) EditOrg(orgname string, opt EditOrgOption) error { body, err := json.Marshal(&opt) if err != nil { |