(cli *cli)
| 464 | } |
| 465 | |
| 466 | func verifyCustomDomainCmd(cli *cli) *cobra.Command { |
| 467 | var inputs struct { |
| 468 | ID string |
| 469 | } |
| 470 | |
| 471 | cmd := &cobra.Command{ |
| 472 | Use: "verify", |
| 473 | Args: cobra.MaximumNArgs(1), |
| 474 | Short: "Verify a custom domain", |
| 475 | Long: "Verify a custom domain.\n\n" + |
| 476 | "To verify interactively, use `auth0 domains verify` with no arguments.\n\n" + |
| 477 | "To verify non-interactively, supply the custom domain id.", |
| 478 | Example: ` auth0 domains verify |
| 479 | auth0 domains verify <domain-id>`, |
| 480 | RunE: func(cmd *cobra.Command, args []string) error { |
| 481 | if len(args) == 0 { |
| 482 | if err := customDomainID.Pick(cmd, &inputs.ID, cli.customDomainsPickerOptions); err != nil { |
| 483 | return err |
| 484 | } |
| 485 | } else { |
| 486 | inputs.ID = args[0] |
| 487 | } |
| 488 | |
| 489 | var customDomain *management.CustomDomain |
| 490 | |
| 491 | if err := ansi.Waiting(func() (err error) { |
| 492 | customDomain, err = cli.api.CustomDomain.Verify(cmd.Context(), url.PathEscape(inputs.ID)) |
| 493 | return err |
| 494 | }); err != nil { |
| 495 | return fmt.Errorf("failed to verify custom domain with ID %q: %w", inputs.ID, err) |
| 496 | } |
| 497 | |
| 498 | cli.renderer.CustomDomainShow(customDomain) |
| 499 | |
| 500 | return nil |
| 501 | }, |
| 502 | } |
| 503 | |
| 504 | cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.") |
| 505 | cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.") |
| 506 | |
| 507 | return cmd |
| 508 | } |
| 509 | |
| 510 | func apiProvisioningTypeFor(v string) *string { |
| 511 | switch v { |
no test coverage detected