MCPcopy Index your code
hub / github.com/coder/coder / OrganizationByUserAndName

Method OrganizationByUserAndName

codersdk/users.go:1062–1073  ·  view source on GitHub ↗
(ctx context.Context, user string, name string)

Source from the content-addressed store, hash-verified

1060}
1061
1062func (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.
1076func (c *Client) AuthMethods(ctx context.Context) (AuthMethods, error) {

Callers 2

TestOrganizationsByUserFunction · 0.80

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65

Tested by 2

TestOrganizationsByUserFunction · 0.64