(cli *cli)
| 177 | } |
| 178 | |
| 179 | func showCustomDomainCmd(cli *cli) *cobra.Command { |
| 180 | var inputs struct { |
| 181 | ID string |
| 182 | } |
| 183 | |
| 184 | cmd := &cobra.Command{ |
| 185 | Use: "show", |
| 186 | Args: cobra.MaximumNArgs(1), |
| 187 | Short: "Show a custom domain", |
| 188 | Long: "Display information about a custom domain.", |
| 189 | Example: ` auth0 domains show |
| 190 | auth0 domains show <domain-id> |
| 191 | auth0 domains show <domain-id> --json |
| 192 | auth0 domains show <domain-id> --json-compact`, |
| 193 | RunE: func(cmd *cobra.Command, args []string) error { |
| 194 | if len(args) == 0 { |
| 195 | if err := customDomainID.Pick(cmd, &inputs.ID, cli.customDomainsPickerOptions); err != nil { |
| 196 | return err |
| 197 | } |
| 198 | } else { |
| 199 | inputs.ID = args[0] |
| 200 | } |
| 201 | |
| 202 | var customDomain *management.CustomDomain |
| 203 | |
| 204 | if err := ansi.Waiting(func() (err error) { |
| 205 | customDomain, err = cli.api.CustomDomain.Read(cmd.Context(), url.PathEscape(inputs.ID)) |
| 206 | return err |
| 207 | }); err != nil { |
| 208 | return fmt.Errorf("failed to read custom domain with ID %q: %w", inputs.ID, err) |
| 209 | } |
| 210 | |
| 211 | cli.renderer.CustomDomainShow(customDomain) |
| 212 | |
| 213 | return nil |
| 214 | }, |
| 215 | } |
| 216 | |
| 217 | cmd.Flags().BoolVar(&cli.json, "json", false, "Output in json format.") |
| 218 | cmd.Flags().BoolVar(&cli.jsonCompact, "json-compact", false, "Output in compact json format.") |
| 219 | |
| 220 | return cmd |
| 221 | } |
| 222 | |
| 223 | func createCustomDomainCmd(cli *cli) *cobra.Command { |
| 224 | var inputs struct { |
no test coverage detected