MCPcopy Create free account
hub / github.com/Scalingo/cli / Update

Function Update

collaborators/update.go:12–33  ·  view source on GitHub ↗
(ctx context.Context, app, email string, params scalingo.CollaboratorUpdateParams)

Source from the content-addressed store, hash-verified

10)
11
12func Update(ctx context.Context, app, email string, params scalingo.CollaboratorUpdateParams) error {
13 c, err := config.ScalingoClient(ctx)
14 if err != nil {
15 return errors.Wrap(ctx, err, "get Scalingo client")
16 }
17
18 collaborator, err := getFromEmail(ctx, c, app, email)
19 if errors.Is(err, errNotFound) {
20 io.Error(email + " is not a collaborator of " + app + ".")
21 return nil
22 } else if err != nil {
23 return errors.Wrap(ctx, err, "get from email")
24 }
25
26 collaborator, err = c.CollaboratorUpdate(ctx, app, collaborator.ID, params)
27 if err != nil {
28 return errors.Wrap(ctx, err, "update collaborator")
29 }
30
31 io.Status(collaborator.Email, "role has been updated for", app)
32 return nil
33}

Callers 1

collaborators.goFile · 0.92

Calls 4

ScalingoClientFunction · 0.92
ErrorFunction · 0.92
StatusFunction · 0.92
getFromEmailFunction · 0.85

Tested by

no test coverage detected