MCPcopy
hub / github.com/superplanehq/superplane / Execute

Method Execute

pkg/cli/commands/groups/members_list.go:11–34  ·  view source on GitHub ↗
(ctx core.CommandContext)

Source from the content-addressed store, hash-verified

9type membersListCommand struct{}
10
11func (c *membersListCommand) Execute(ctx core.CommandContext) error {
12 organizationID, err := core.ResolveOrganizationID(ctx)
13 if err != nil {
14 return err
15 }
16
17 response, _, err := ctx.API.GroupsAPI.
18 GroupsListGroupUsers(ctx.Context, ctx.Args[0]).
19 DomainType(string(core.OrganizationDomainType())).
20 DomainId(organizationID).
21 Execute()
22 if err != nil {
23 return err
24 }
25
26 users := response.GetUsers()
27 if !ctx.Renderer.IsText() {
28 return ctx.Renderer.Render(users)
29 }
30
31 return ctx.Renderer.RenderText(func(stdout io.Writer) error {
32 return renderGroupUsersText(stdout, users)
33 })
34}

Callers

nothing calls this directly

Calls 7

ResolveOrganizationIDFunction · 0.92
OrganizationDomainTypeFunction · 0.92
renderGroupUsersTextFunction · 0.85
IsTextMethod · 0.80
RenderMethod · 0.80
RenderTextMethod · 0.80
ExecuteMethod · 0.65

Tested by

no test coverage detected