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

Method CreateGroup

codersdk/groups.go:55–70  ·  view source on GitHub ↗
(ctx context.Context, orgID uuid.UUID, req CreateGroupRequest)

Source from the content-addressed store, hash-verified

53}
54
55func (c *Client) CreateGroup(ctx context.Context, orgID uuid.UUID, req CreateGroupRequest) (Group, error) {
56 res, err := c.Request(ctx, http.MethodPost,
57 fmt.Sprintf("/api/v2/organizations/%s/groups", orgID.String()),
58 req,
59 )
60 if err != nil {
61 return Group{}, xerrors.Errorf("make request: %w", err)
62 }
63 defer res.Body.Close()
64
65 if res.StatusCode != http.StatusCreated {
66 return Group{}, ReadBodyAsError(res)
67 }
68 var resp Group
69 return resp, json.NewDecoder(res.Body).Decode(&resp)
70}
71
72// GroupsByOrganization
73// Deprecated: use Groups with GroupArguments instead.

Callers 15

CreateGroupFunction · 0.80
TestEnterpriseMembersFunction · 0.80
TestUserOIDCFunction · 0.80
TestGroupSyncFunction · 0.80
TestWorkspacesFilteringFunction · 0.80
TestDeleteWorkspaceACLFunction · 0.80
TestWorkspacesSharedWithFunction · 0.80
TestCreateGroupFunction · 0.80
TestPatchGroupFunction · 0.80
TestGroupFunction · 0.80
TestGroupsFunction · 0.80
TestDeleteGroupFunction · 0.80

Calls 5

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

Tested by 15

TestEnterpriseMembersFunction · 0.64
TestUserOIDCFunction · 0.64
TestGroupSyncFunction · 0.64
TestWorkspacesFilteringFunction · 0.64
TestDeleteWorkspaceACLFunction · 0.64
TestWorkspacesSharedWithFunction · 0.64
TestCreateGroupFunction · 0.64
TestPatchGroupFunction · 0.64
TestGroupFunction · 0.64
TestGroupsFunction · 0.64
TestDeleteGroupFunction · 0.64