(teams []Team, name string)
| 43 | } |
| 44 | |
| 45 | func (*Client) FindTeam(teams []Team, name string) (*Team, error) { |
| 46 | for _, t := range teams { |
| 47 | if t.Name == name { |
| 48 | return &t, nil |
| 49 | } |
| 50 | } |
| 51 | teamNames := make([]string, 0, len(teams)) |
| 52 | for _, t := range teams { |
| 53 | teamNames = append(teamNames, t.Name) |
| 54 | } |
| 55 | return nil, fmt.Errorf("team %q not found. Teams available to you: %v", name, strings.Join(teamNames, ", ")) |
| 56 | } |
| 57 | |
| 58 | func (c *Client) ListAllTeams(ctx context.Context) ([]Team, error) { |
| 59 | page := cloudquery_api.Page(1) |
no test coverage detected