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

Method PatchGroup

codersdk/groups.go:198–213  ·  view source on GitHub ↗
(ctx context.Context, group uuid.UUID, req PatchGroupRequest)

Source from the content-addressed store, hash-verified

196}
197
198func (c *Client) PatchGroup(ctx context.Context, group uuid.UUID, req PatchGroupRequest) (Group, error) {
199 res, err := c.Request(ctx, http.MethodPatch,
200 fmt.Sprintf("/api/v2/groups/%s", group.String()),
201 req,
202 )
203 if err != nil {
204 return Group{}, xerrors.Errorf("make request: %w", err)
205 }
206 defer res.Body.Close()
207
208 if res.StatusCode != http.StatusOK {
209 return Group{}, ReadBodyAsError(res)
210 }
211 var resp Group
212 return resp, json.NewDecoder(res.Body).Decode(&resp)
213}
214
215func (c *Client) DeleteGroup(ctx context.Context, group uuid.UUID) error {
216 res, err := c.Request(ctx, http.MethodDelete,

Callers 15

CreateGroupFunction · 0.80
TestEnterpriseMembersFunction · 0.80
TestGroupSyncFunction · 0.80
TestDeleteWorkspaceACLFunction · 0.80
TestPatchGroupFunction · 0.80
TestGroupFunction · 0.80
TestGroupsFunction · 0.80
TestWorkspaceQuotaFunction · 0.80
TestUpdateTemplateACLFunction · 0.80

Calls 5

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

Tested by 14

TestEnterpriseMembersFunction · 0.64
TestGroupSyncFunction · 0.64
TestDeleteWorkspaceACLFunction · 0.64
TestPatchGroupFunction · 0.64
TestGroupFunction · 0.64
TestGroupsFunction · 0.64
TestWorkspaceQuotaFunction · 0.64
TestUpdateTemplateACLFunction · 0.64
TestTemplateAccessFunction · 0.64