(ctx context.Context, team string)
| 92 | } |
| 93 | |
| 94 | func (c *Client) GetTeam(ctx context.Context, team string) (*Team, error) { |
| 95 | resp, err := c.api.GetTeamByNameWithResponse(ctx, team) |
| 96 | if err != nil { |
| 97 | return nil, err |
| 98 | } |
| 99 | |
| 100 | if resp.StatusCode() != http.StatusOK || resp.JSON200 == nil { |
| 101 | return nil, fmt.Errorf("failed to get team %q: %w", team, hub.ErrorFromHTTPResponse(resp.HTTPResponse, resp)) |
| 102 | } |
| 103 | |
| 104 | return resp.JSON200, nil |
| 105 | } |
| 106 | |
| 107 | func Names(teams []Team) []string { |
| 108 | names := make([]string, len(teams)) |