11import csv
22import json
33import sys
4- from typing import Tuple
54
65import typer
76from rich import print
1918def get (
2019 ctx : typer .Context ,
2120 task_id : str = typer .Argument (..., show_default = False , help = "The ID of the task." ),
22- output_format : OutputFormat = typer .Option (
23- OutputFormat .pretty , "--format" , "-f" , help = "Output format"
24- ),
21+ output_format : OutputFormat = typer .Option (OutputFormat .pretty , "--format" , "-f" , help = "Output format" ),
2522):
2623 """Get a task."""
2724 configure_api (ctx )
@@ -52,17 +49,15 @@ def create(
5249 ctx : typer .Context ,
5350 name : str = typer .Argument (..., show_default = False , help = "The task name." ),
5451 monitor_id : str = typer .Option (None , help = "Associate this task with a monitor." ),
55- action_def : Tuple [str , str , str ] = typer .Option (
52+ action_def : tuple [str , str , str ] = typer .Option (
5653 (None , None , None ),
5754 "--action" ,
5855 "-a" ,
5956 metavar = "<trigger integration config>" ,
6057 show_default = False ,
6158 help = "Action definition e.g. 'success,error email to:me@email.com'" ,
6259 ),
63- status : StatusEnum = typer .Option (
64- StatusEnum .PROCESSING , help = "The initial status of the task."
65- ),
60+ status : StatusEnum = typer .Option (StatusEnum .PROCESSING , help = "The initial status of the task." ),
6661 value_max : int = typer .Option (100 , help = "The maximum value for the task." ),
6762 metadata : list [str ] = typer .Option (
6863 None ,
@@ -74,9 +69,7 @@ def create(
7469 show_default = False ,
7570 help = "Metadata to associate with the task. Must be valid JSON." ,
7671 ),
77- quiet : bool = typer .Option (
78- False , "--quiet" , "-q" , help = "Minimal output. Only the Task ID."
79- ),
72+ quiet : bool = typer .Option (False , "--quiet" , "-q" , help = "Minimal output. Only the Task ID." ),
8073):
8174 """Create a task."""
8275 configure_api (ctx )
@@ -103,29 +96,19 @@ def create(
10396
10497def update (
10598 ctx : typer .Context ,
106- task_id : str = typer .Argument (
107- ..., show_default = False , help = "The ID of the task to update."
108- ),
109- name : str = typer .Option (
110- None , show_default = False , help = "Update the name of the task."
111- ),
112- action_def : Tuple [str , str , str ] = typer .Option (
99+ task_id : str = typer .Argument (..., show_default = False , help = "The ID of the task to update." ),
100+ name : str = typer .Option (None , show_default = False , help = "Update the name of the task." ),
101+ action_def : tuple [str , str , str ] = typer .Option (
113102 (None , None , None ),
114103 "--action" ,
115104 "-a" ,
116105 metavar = "<trigger integration config>" ,
117106 show_default = False ,
118107 help = "Action definition e.g. 'success,error email to:me@email.com'" ,
119108 ),
120- status : StatusEnum = typer .Option (
121- StatusEnum .PROCESSING , help = "The status of the task."
122- ),
123- value : int = typer .Option (
124- None , show_default = False , help = "The current task value (progress)."
125- ),
126- value_max : int = typer .Option (
127- None , show_default = False , help = "The maximum value for the task."
128- ),
109+ status : StatusEnum = typer .Option (StatusEnum .PROCESSING , help = "The status of the task." ),
110+ value : int = typer .Option (None , show_default = False , help = "The current task value (progress)." ),
111+ value_max : int = typer .Option (None , show_default = False , help = "The maximum value for the task." ),
129112 metadata : list [str ] = typer .Option (
130113 None ,
131114 show_default = False ,
0 commit comments