MCPcopy Create free account
hub / github.com/rilldata/rill / ListIssuesCmd

Function ListIssuesCmd

cli/cmd/billing/list_issues.go:9–45  ·  view source on GitHub ↗
(ch *cmdutil.Helper)

Source from the content-addressed store, hash-verified

7)
8
9func ListIssuesCmd(ch *cmdutil.Helper) *cobra.Command {
10 var force bool
11
12 listCmd := &cobra.Command{
13 Use: "list-issues",
14 Short: "List billing issues for an organization",
15 Args: cobra.NoArgs,
16 RunE: func(cmd *cobra.Command, args []string) error {
17 client, err := ch.Client()
18 if err != nil {
19 return err
20 }
21
22 resp, err := client.ListOrganizationBillingIssues(cmd.Context(), &adminv1.ListOrganizationBillingIssuesRequest{
23 Org: ch.Org,
24 SuperuserForceAccess: force,
25 })
26 if err != nil {
27 return err
28 }
29
30 if len(resp.Issues) == 0 {
31 ch.PrintfSuccess("No billing issues for organization %q.\n", ch.Org)
32 return nil
33 }
34
35 ch.PrintBillingIssues(resp.Issues)
36 return nil
37 },
38 }
39
40 listCmd.Flags().BoolVar(&force, "force", false, "Allows superusers to bypass certain checks")
41 _ = listCmd.Flags().MarkHidden("force")
42
43 listCmd.Flags().StringVar(&ch.Org, "org", ch.Org, "Organization Name")
44 return listCmd
45}

Callers 1

BillingCmdFunction · 0.85

Calls 5

PrintfSuccessMethod · 0.80
PrintBillingIssuesMethod · 0.80
ContextMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected