@@ -270,6 +270,35 @@ var monitorsDelete = cli.Command{
270270 HideHelpCommand : true ,
271271}
272272
273+ var monitorsGetCreditUsage = cli.Command {
274+ Name : "get-credit-usage" ,
275+ Usage : "Returns credits charged per monitor over an optional [since, until] window,\n newest spenders first." ,
276+ Suggest : true ,
277+ Flags : []cli.Flag {
278+ & requestflag.Flag [any ]{
279+ Name : "since" ,
280+ Usage : "Only include items at or after this ISO 8601 timestamp." ,
281+ QueryPath : "since" ,
282+ },
283+ & requestflag.Flag [any ]{
284+ Name : "until" ,
285+ Usage : "Only include items before this ISO 8601 timestamp." ,
286+ QueryPath : "until" ,
287+ },
288+ },
289+ Action : handleMonitorsGetCreditUsage ,
290+ HideHelpCommand : true ,
291+ }
292+
293+ var monitorsGetLimits = cli.Command {
294+ Name : "get-limits" ,
295+ Usage : "Returns how many monitors the account has and the maximum it allows." ,
296+ Suggest : true ,
297+ Flags : []cli.Flag {},
298+ Action : handleMonitorsGetLimits ,
299+ HideHelpCommand : true ,
300+ }
301+
273302var monitorsListAccountChanges = cli.Command {
274303 Name : "list-account-changes" ,
275304 Usage : "Returns an account-wide feed of detected changes across monitors." ,
@@ -660,6 +689,86 @@ func handleMonitorsDelete(ctx context.Context, cmd *cli.Command) error {
660689 })
661690}
662691
692+ func handleMonitorsGetCreditUsage (ctx context.Context , cmd * cli.Command ) error {
693+ client := contextdev .NewClient (getDefaultRequestOptions (cmd )... )
694+ unusedArgs := cmd .Args ().Slice ()
695+
696+ if len (unusedArgs ) > 0 {
697+ return fmt .Errorf ("Unexpected extra arguments: %v" , unusedArgs )
698+ }
699+
700+ options , err := flagOptions (
701+ cmd ,
702+ apiquery .NestedQueryFormatBrackets ,
703+ apiquery .ArrayQueryFormatComma ,
704+ EmptyBody ,
705+ false ,
706+ )
707+ if err != nil {
708+ return err
709+ }
710+
711+ params := contextdev.MonitorGetCreditUsageParams {}
712+
713+ var res []byte
714+ options = append (options , option .WithResponseBodyInto (& res ))
715+ _ , err = client .Monitors .GetCreditUsage (ctx , params , options ... )
716+ if err != nil {
717+ return err
718+ }
719+
720+ obj := gjson .ParseBytes (res )
721+ format := cmd .Root ().String ("format" )
722+ explicitFormat := cmd .Root ().IsSet ("format" )
723+ transform := cmd .Root ().String ("transform" )
724+ return ShowJSON (obj , ShowJSONOpts {
725+ ExplicitFormat : explicitFormat ,
726+ Format : format ,
727+ RawOutput : cmd .Root ().Bool ("raw-output" ),
728+ Title : "monitors get-credit-usage" ,
729+ Transform : transform ,
730+ })
731+ }
732+
733+ func handleMonitorsGetLimits (ctx context.Context , cmd * cli.Command ) error {
734+ client := contextdev .NewClient (getDefaultRequestOptions (cmd )... )
735+ unusedArgs := cmd .Args ().Slice ()
736+
737+ if len (unusedArgs ) > 0 {
738+ return fmt .Errorf ("Unexpected extra arguments: %v" , unusedArgs )
739+ }
740+
741+ options , err := flagOptions (
742+ cmd ,
743+ apiquery .NestedQueryFormatBrackets ,
744+ apiquery .ArrayQueryFormatComma ,
745+ EmptyBody ,
746+ false ,
747+ )
748+ if err != nil {
749+ return err
750+ }
751+
752+ var res []byte
753+ options = append (options , option .WithResponseBodyInto (& res ))
754+ _ , err = client .Monitors .GetLimits (ctx , options ... )
755+ if err != nil {
756+ return err
757+ }
758+
759+ obj := gjson .ParseBytes (res )
760+ format := cmd .Root ().String ("format" )
761+ explicitFormat := cmd .Root ().IsSet ("format" )
762+ transform := cmd .Root ().String ("transform" )
763+ return ShowJSON (obj , ShowJSONOpts {
764+ ExplicitFormat : explicitFormat ,
765+ Format : format ,
766+ RawOutput : cmd .Root ().Bool ("raw-output" ),
767+ Title : "monitors get-limits" ,
768+ Transform : transform ,
769+ })
770+ }
771+
663772func handleMonitorsListAccountChanges (ctx context.Context , cmd * cli.Command ) error {
664773 client := contextdev .NewClient (getDefaultRequestOptions (cmd )... )
665774 unusedArgs := cmd .Args ().Slice ()
0 commit comments