11import pprint
22import re # noqa: F401
3+ from dataclasses import dataclass , field , InitVar
4+ from typing import Dict , List , Optional , Any , ClassVar
35
46import six
7+ from deprecated import deprecated
58
69from conductor .client .http .models import Task
710
1013running_status = ('RUNNING' , 'PAUSED' )
1114
1215
13- class WorkflowRun (object ):
16+ @dataclass
17+ class WorkflowRun :
1418 """NOTE: This class is auto generated by the swagger code generator program.
1519
1620 Do not edit the class manually.
1721 """
18- """
19- Attributes:
20- swagger_types (dict): The key is attribute name
21- and the value is attribute type.
22- attribute_map (dict): The key is attribute name
23- and the value is json key in definition.
24- """
25- swagger_types = {
22+ # Class attributes for swagger
23+ swagger_types : ClassVar [Dict [str , str ]] = {
2624 'correlation_id' : 'str' ,
2725 'create_time' : 'int' ,
2826 'created_by' : 'str' ,
@@ -37,7 +35,7 @@ class WorkflowRun(object):
3735 'workflow_id' : 'str'
3836 }
3937
40- attribute_map = {
38+ attribute_map : ClassVar [ Dict [ str , str ]] = {
4139 'correlation_id' : 'correlationId' ,
4240 'create_time' : 'createTime' ,
4341 'created_by' : 'createdBy' ,
@@ -52,6 +50,38 @@ class WorkflowRun(object):
5250 'workflow_id' : 'workflowId'
5351 }
5452
53+ # Fields for the dataclass
54+ correlation_id : Optional [str ] = field (default = None )
55+ create_time : Optional [int ] = field (default = None )
56+ created_by : Optional [str ] = field (default = None )
57+ input : Optional [Dict [str , Any ]] = field (default = None )
58+ output : Optional [Dict [str , Any ]] = field (default = None )
59+ priority : Optional [int ] = field (default = None )
60+ request_id : Optional [str ] = field (default = None )
61+ status : Optional [str ] = field (default = None )
62+ tasks : Optional [List [Task ]] = field (default = None )
63+ update_time : Optional [int ] = field (default = None )
64+ variables : Optional [Dict [str , Any ]] = field (default = None )
65+ workflow_id : Optional [str ] = field (default = None )
66+
67+ # Additional init parameter (not a dataclass field)
68+ reason_for_incompletion : InitVar [Optional [str ]] = None
69+
70+ # Private backing fields
71+ _correlation_id : Optional [str ] = field (init = False , repr = False )
72+ _create_time : Optional [int ] = field (init = False , repr = False )
73+ _created_by : Optional [str ] = field (init = False , repr = False )
74+ _input : Optional [Dict [str , Any ]] = field (init = False , repr = False )
75+ _output : Optional [Dict [str , Any ]] = field (init = False , repr = False )
76+ _priority : Optional [int ] = field (init = False , repr = False )
77+ _request_id : Optional [str ] = field (init = False , repr = False )
78+ _status : Optional [str ] = field (init = False , repr = False )
79+ _tasks : Optional [List [Task ]] = field (init = False , repr = False )
80+ _update_time : Optional [int ] = field (init = False , repr = False )
81+ _variables : Optional [Dict [str , Any ]] = field (init = False , repr = False )
82+ _workflow_id : Optional [str ] = field (init = False , repr = False )
83+ _reason_for_incompletion : Optional [str ] = field (init = False , repr = False )
84+
5585 def __init__ (self , correlation_id = None , create_time = None , created_by = None , input = None , output = None , priority = None ,
5686 request_id = None , status = None , tasks = None , update_time = None , variables = None , workflow_id = None ,
5787 reason_for_incompletion : str = None ): # noqa: E501
@@ -95,6 +125,22 @@ def __init__(self, correlation_id=None, create_time=None, created_by=None, input
95125 self .workflow_id = workflow_id
96126 self ._reason_for_incompletion = reason_for_incompletion
97127
128+ def __post_init__ (self , reason_for_incompletion : Optional [str ]):
129+ """Initialize private fields after dataclass initialization"""
130+ self ._correlation_id = self .correlation_id
131+ self ._create_time = self .create_time
132+ self ._created_by = self .created_by
133+ self ._input = self .input
134+ self ._output = self .output
135+ self ._priority = self .priority
136+ self ._request_id = self .request_id
137+ self ._status = self .status
138+ self ._tasks = self .tasks
139+ self ._update_time = self .update_time
140+ self ._variables = self .variables
141+ self ._workflow_id = self .workflow_id
142+ self ._reason_for_incompletion = reason_for_incompletion
143+
98144 @property
99145 def correlation_id (self ):
100146 """Gets the correlation_id of this WorkflowRun. # noqa: E501
@@ -442,4 +488,4 @@ def current_task(self) -> Task:
442488 for task in self .tasks :
443489 if task .status == 'SCHEDULED' or task .status == 'IN_PROGRESS' :
444490 current = task
445- return current
491+ return current
0 commit comments