(ctx context.Context, cl *cloudquery_api.ClientWithResponses, teamName string)
| 498 | } |
| 499 | |
| 500 | func activeTenants(ctx context.Context, cl *cloudquery_api.ClientWithResponses, teamName string) ([]cloudquery_api.PlatformTenantSummary, error) { |
| 501 | ctx, cancel := context.WithTimeout(ctx, requestTimeout) |
| 502 | defer cancel() |
| 503 | |
| 504 | resp, err := cl.ListUserPlatformTenantsWithResponse(ctx) |
| 505 | if err != nil { |
| 506 | return nil, err |
| 507 | } |
| 508 | if resp.JSON200 == nil { |
| 509 | return nil, fmt.Errorf("unexpected status %d listing platform tenants: %s", resp.StatusCode(), strings.TrimSpace(string(resp.Body))) |
| 510 | } |
| 511 | active := make([]cloudquery_api.PlatformTenantSummary, 0, len(resp.JSON200.Items)) |
| 512 | for _, t := range resp.JSON200.Items { |
| 513 | if t.TeamName == teamName && slices.Contains(injectableStatuses, t.Status) { |
| 514 | active = append(active, t) |
| 515 | } |
| 516 | } |
| 517 | return active, nil |
| 518 | } |
| 519 | |
| 520 | func mintSession(ctx context.Context, cl *cloudquery_api.ClientWithResponses, tenant cloudquery_api.PlatformTenantSummary) (session *cloudquery_api.CreatePlatformDestinationSession201Response, pluginVersion string, err error) { |
| 521 | ctx, cancel := context.WithTimeout(ctx, requestTimeout) |
no test coverage detected