| 1060 | } |
| 1061 | |
| 1062 | func (c *Client) OrganizationByUserAndName(ctx context.Context, user string, name string) (Organization, error) { |
| 1063 | res, err := c.Request(ctx, http.MethodGet, fmt.Sprintf("/api/v2/users/%s/organizations/%s", user, name), nil) |
| 1064 | if err != nil { |
| 1065 | return Organization{}, err |
| 1066 | } |
| 1067 | defer res.Body.Close() |
| 1068 | if res.StatusCode != http.StatusOK { |
| 1069 | return Organization{}, ReadBodyAsError(res) |
| 1070 | } |
| 1071 | var org Organization |
| 1072 | return org, json.NewDecoder(res.Body).Decode(&org) |
| 1073 | } |
| 1074 | |
| 1075 | // AuthMethods returns types of authentication available to the user. |
| 1076 | func (c *Client) AuthMethods(ctx context.Context) (AuthMethods, error) { |