(ctx context.Context, client *scalingo.Client, app, email string)
| 38 | } |
| 39 | |
| 40 | func getFromEmail(ctx context.Context, client *scalingo.Client, app, email string) (scalingo.Collaborator, error) { |
| 41 | collaborators, err := client.CollaboratorsList(ctx, app) |
| 42 | if err != nil { |
| 43 | return scalingo.Collaborator{}, errors.Wrap(ctx, err, "list collaborators") |
| 44 | } |
| 45 | for _, collaborator := range collaborators { |
| 46 | if collaborator.Email == email { |
| 47 | return collaborator, nil |
| 48 | } |
| 49 | } |
| 50 | return scalingo.Collaborator{}, errNotFound |
| 51 | } |