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

Method Group

codersdk/groups.go:152–168  ·  view source on GitHub ↗
(ctx context.Context, group uuid.UUID, req GroupRequest)

Source from the content-addressed store, hash-verified

150}
151
152func (c *Client) Group(ctx context.Context, group uuid.UUID, req GroupRequest) (Group, error) {
153 res, err := c.Request(ctx, http.MethodGet,
154 fmt.Sprintf("/api/v2/groups/%s", group.String()),
155 nil,
156 req.asRequestOption(),
157 )
158 if err != nil {
159 return Group{}, xerrors.Errorf("make request: %w", err)
160 }
161 defer res.Body.Close()
162
163 if res.StatusCode != http.StatusOK {
164 return Group{}, ReadBodyAsError(res)
165 }
166 var resp Group
167 return resp, json.NewDecoder(res.Body).Decode(&resp)
168}
169
170func (c *Client) GroupMembers(ctx context.Context, group uuid.UUID, req UsersRequest) (GroupMembersResponse, error) {
171 res, err := c.Request(ctx, http.MethodGet,

Callers 9

NewFunction · 0.45
TestPatchGroupFunction · 0.45
TestGroupFunction · 0.45
TestGroupsFunction · 0.45
TestDeleteGroupFunction · 0.45
TestWorkspaceQuotaFunction · 0.45
aibridgeHandlerFunction · 0.45
NewFunction · 0.45

Calls 6

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65
StringMethod · 0.45
asRequestOptionMethod · 0.45
ErrorfMethod · 0.45

Tested by 6

TestPatchGroupFunction · 0.36
TestGroupFunction · 0.36
TestGroupsFunction · 0.36
TestDeleteGroupFunction · 0.36
TestWorkspaceQuotaFunction · 0.36