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

Method Execute

pkg/cli/commands/groups/update.go:18–51  ·  view source on GitHub ↗
(ctx core.CommandContext)

Source from the content-addressed store, hash-verified

16}
17
18func (c *updateCommand) Execute(ctx core.CommandContext) error {
19 organizationID, err := core.ResolveOrganizationID(ctx)
20 if err != nil {
21 return err
22 }
23
24 name, group, err := c.buildGroup(ctx)
25 if err != nil {
26 return err
27 }
28
29 body := openapi_client.GroupsUpdateGroupBody{}
30 domain := core.OrganizationDomainType()
31 body.SetDomainType(domain)
32 body.SetDomainId(organizationID)
33 body.SetGroup(group)
34
35 response, _, err := ctx.API.GroupsAPI.
36 GroupsUpdateGroup(ctx.Context, name).
37 Body(body).
38 Execute()
39 if err != nil {
40 return err
41 }
42
43 updated := response.GetGroup()
44 if !ctx.Renderer.IsText() {
45 return ctx.Renderer.Render(updated)
46 }
47
48 return ctx.Renderer.RenderText(func(stdout io.Writer) error {
49 return renderGroupText(stdout, updated)
50 })
51}
52
53func (c *updateCommand) buildGroup(ctx core.CommandContext) (string, openapi_client.GroupsGroup, error) {
54 filePath := ""

Callers

nothing calls this directly

Calls 9

buildGroupMethod · 0.95
ResolveOrganizationIDFunction · 0.92
OrganizationDomainTypeFunction · 0.92
renderGroupTextFunction · 0.85
IsTextMethod · 0.80
RenderMethod · 0.80
RenderTextMethod · 0.80
ExecuteMethod · 0.65
GetGroupMethod · 0.65

Tested by

no test coverage detected