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

Method rulePickerOptions

internal/cli/rules.go:538–554  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

536}
537
538func (c *cli) rulePickerOptions(ctx context.Context) (pickerOptions, error) {
539 list, err := c.api.Rule.List(ctx)
540 if err != nil {
541 return nil, err
542 }
543
544 var opts pickerOptions
545 for _, r := range list.Rules {
546 opts = append(opts, pickerOption{value: r.GetID(), label: r.GetName()})
547 }
548
549 if len(opts) == 0 {
550 return nil, errors.New("there are currently no rules to choose from")
551 }
552
553 return opts, nil
554}
555
556func (c *cli) ruleEditorHint() {
557 c.renderer.Infof("%s Once you close the editor, the rule will be saved. To cancel, press CTRL+C.", ansi.Faint("Hint:"))

Callers 1

TestRulesPickerOptionsFunction · 0.95

Calls 2

ListMethod · 0.65
GetNameMethod · 0.65

Tested by 1

TestRulesPickerOptionsFunction · 0.76