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

Method actionPickerOptions

internal/cli/actions.go:611–629  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

609}
610
611func (c *cli) actionPickerOptions(ctx context.Context) (pickerOptions, error) {
612 list, err := c.api.Action.List(ctx)
613 if err != nil {
614 return nil, err
615 }
616
617 var opts pickerOptions
618 for _, r := range list.Actions {
619 label := fmt.Sprintf("%s %s", r.GetName(), ansi.Faint("("+r.GetID()+")"))
620
621 opts = append(opts, pickerOption{value: r.GetID(), label: label})
622 }
623
624 if len(opts) == 0 {
625 return nil, errors.New("there are currently no actions to choose from. Create one by running: `auth0 actions create`")
626 }
627
628 return opts, nil
629}
630
631func (c *cli) unDeployedActionPickerOptions(ctx context.Context) (pickerOptions, error) {
632 list, err := c.api.Action.List(ctx, management.Parameter("deployed", "false"))

Callers 1

TestActionsPickerOptionsFunction · 0.95

Calls 3

FaintFunction · 0.92
ListMethod · 0.65
GetNameMethod · 0.65

Tested by 1

TestActionsPickerOptionsFunction · 0.76