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

Function createGroupWithMembers

enterprise/cli/sharing_test.go:370–387  ·  view source on GitHub ↗
(ctx context.Context, client *codersdk.Client, orgID uuid.UUID, name string, memberIDs []uuid.UUID)

Source from the content-addressed store, hash-verified

368}
369
370func createGroupWithMembers(ctx context.Context, client *codersdk.Client, orgID uuid.UUID, name string, memberIDs []uuid.UUID) (codersdk.Group, error) {
371 group, err := client.CreateGroup(ctx, orgID, codersdk.CreateGroupRequest{
372 Name: name,
373 DisplayName: name,
374 })
375 if err != nil {
376 return codersdk.Group{}, err
377 }
378
379 ids := make([]string, len(memberIDs))
380 for i, id := range memberIDs {
381 ids[i] = id.String()
382 }
383
384 return client.PatchGroup(ctx, group.ID, codersdk.PatchGroupRequest{
385 AddUsers: ids,
386 })
387}

Callers 3

TestSharingShareFunction · 0.85
TestSharingStatusFunction · 0.85
TestSharingRemoveFunction · 0.85

Calls 3

CreateGroupMethod · 0.80
PatchGroupMethod · 0.80
StringMethod · 0.45

Tested by

no test coverage detected