MCPcopy Create free account
hub / github.com/auth0/auth0-cli / fetchImportData

Function fetchImportData

internal/cli/terraform.go:261–285  ·  view source on GitHub ↗
(ctx context.Context, cli *cli, fetchers ...resourceDataFetcher)

Source from the content-addressed store, hash-verified

259}
260
261func fetchImportData(ctx context.Context, cli *cli, fetchers ...resourceDataFetcher) (importDataList, error) {
262 var importData importDataList
263
264 for _, fetcher := range fetchers {
265 data, err := fetcher.FetchData(ctx)
266 if err != nil {
267 // Checking for the forbidden scenario and skip.
268 if strings.Contains(err.Error(), "403 Forbidden") {
269 cli.renderer.Warnf("Skipping resource due to forbidden access: %s", err.Error())
270 continue
271 }
272
273 if strings.Contains(err.Error(), "402 Payment Required") {
274 cli.renderer.Warnf("Skipping resource due to payment required: %s", err.Error())
275 continue
276 }
277
278 return nil, err
279 }
280
281 importData = append(importData, data...)
282 }
283
284 return deduplicateResourceNames(importData), nil
285}
286
287func generateTerraformImportConfig(inputs *terraformInputs, data importDataList) error {
288 if len(data) == 0 {

Callers 2

TestFetchImportDataFunction · 0.85
generateTerraformCmdRunFunction · 0.85

Calls 4

deduplicateResourceNamesFunction · 0.85
WarnfMethod · 0.80
FetchDataMethod · 0.65
ErrorMethod · 0.45

Tested by 1

TestFetchImportDataFunction · 0.68