(ch *cmdutil.Helper)
| 7 | ) |
| 8 | |
| 9 | func 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 | } |
no test coverage detected