diff --git a/python_sdk_server_pojo_mapping.json b/python_sdk_server_pojo_mapping.json new file mode 100644 index 000000000..1a583043b --- /dev/null +++ b/python_sdk_server_pojo_mapping.json @@ -0,0 +1,17 @@ +{ + "serverPojoMappings": [ + { + "server": { + "owner": "orkes-io", + "repo": "orkes-conductor", + "module": "server", + "className": "io.orkes.conductor.server.rest.model.requests.AuthorizationRequest" + }, + "sdk": { + "owner": "conductor-sdk", + "repo": "conductor-python", + "className": "conductor.client.http.models.authorization_request.py" + } + } + ] +} \ No newline at end of file diff --git a/src/conductor/client/http/models/action.py b/src/conductor/client/http/models/action.py index 46bf6050d..477b1d674 100644 --- a/src/conductor/client/http/models/action.py +++ b/src/conductor/client/http/models/action.py @@ -1,10 +1,14 @@ import pprint import re # noqa: F401 +from dataclasses import dataclass, field, InitVar +from typing import Optional, Dict, List, Any, Union +from deprecated import deprecated import six -class Action(object): +@dataclass +class Action: """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -16,30 +20,57 @@ class Action(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - swagger_types = { + # Initialize private fields + _action: Optional[str] = field(default=None, init=False) + _start_workflow: Any = field(default=None, init=False) + _complete_task: Any = field(default=None, init=False) + _fail_task: Any = field(default=None, init=False) + _expand_inline_json: Optional[bool] = field(default=None, init=False) + _terminate_workflow: Any = field(default=None, init=False) + _update_workflow_variables: Any = field(default=None, init=False) + + # Init variables for backward compatibility + action: InitVar[Optional[str]] = None + start_workflow: InitVar[Any] = None + complete_task: InitVar[Any] = None + fail_task: InitVar[Any] = None + expand_inline_json: InitVar[Optional[bool]] = None + terminate_workflow: InitVar[Any] = None + update_workflow_variables: InitVar[Any] = None + + # Class variables + swagger_types: Dict[str, str] = field(default_factory=lambda: { 'action': 'str', - 'start_workflow': 'StartWorkflow', + 'start_workflow': 'StartWorkflowRequest', 'complete_task': 'TaskDetails', 'fail_task': 'TaskDetails', - 'expand_inline_json': 'bool' - } + 'expand_inline_json': 'bool', + 'terminate_workflow': 'TerminateWorkflow', + 'update_workflow_variables': 'UpdateWorkflowVariables' + }) - attribute_map = { + attribute_map: Dict[str, str] = field(default_factory=lambda: { 'action': 'action', 'start_workflow': 'start_workflow', 'complete_task': 'complete_task', 'fail_task': 'fail_task', - 'expand_inline_json': 'expandInlineJSON' - } + 'expand_inline_json': 'expandInlineJSON', + 'terminate_workflow': 'terminate_workflow', + 'update_workflow_variables': 'update_workflow_variables' + }) + + discriminator = None def __init__(self, action=None, start_workflow=None, complete_task=None, fail_task=None, - expand_inline_json=None): # noqa: E501 + expand_inline_json=None, terminate_workflow=None, update_workflow_variables=None): # noqa: E501 """Action - a model defined in Swagger""" # noqa: E501 self._action = None self._start_workflow = None self._complete_task = None self._fail_task = None self._expand_inline_json = None + self._terminate_workflow = None + self._update_workflow_variables = None self.discriminator = None if action is not None: self.action = action @@ -51,6 +82,28 @@ def __init__(self, action=None, start_workflow=None, complete_task=None, fail_ta self.fail_task = fail_task if expand_inline_json is not None: self.expand_inline_json = expand_inline_json + if terminate_workflow is not None: + self.terminate_workflow = terminate_workflow + if update_workflow_variables is not None: + self.update_workflow_variables = update_workflow_variables + + def __post_init__(self, action, start_workflow, complete_task, fail_task, + expand_inline_json, terminate_workflow, update_workflow_variables): + """Handle initialization for dataclass compatibility""" + if action is not None: + self.action = action + if start_workflow is not None: + self.start_workflow = start_workflow + if complete_task is not None: + self.complete_task = complete_task + if fail_task is not None: + self.fail_task = fail_task + if expand_inline_json is not None: + self.expand_inline_json = expand_inline_json + if terminate_workflow is not None: + self.terminate_workflow = terminate_workflow + if update_workflow_variables is not None: + self.update_workflow_variables = update_workflow_variables @property def action(self): @@ -70,7 +123,8 @@ def action(self, action): :param action: The action of this Action. # noqa: E501 :type: str """ - allowed_values = ["start_workflow", "complete_task", "fail_task"] # noqa: E501 + allowed_values = ["start_workflow", "complete_task", "fail_task", "terminate_workflow", + "update_workflow_variables"] # noqa: E501 if action not in allowed_values: raise ValueError( "Invalid value for `action` ({0}), must be one of {1}" # noqa: E501 @@ -85,7 +139,7 @@ def start_workflow(self): :return: The start_workflow of this Action. # noqa: E501 - :rtype: StartWorkflow + :rtype: StartWorkflowRequest """ return self._start_workflow @@ -95,7 +149,7 @@ def start_workflow(self, start_workflow): :param start_workflow: The start_workflow of this Action. # noqa: E501 - :type: StartWorkflow + :type: StartWorkflowRequest """ self._start_workflow = start_workflow @@ -163,6 +217,48 @@ def expand_inline_json(self, expand_inline_json): self._expand_inline_json = expand_inline_json + @property + def terminate_workflow(self): + """Gets the terminate_workflow of this Action. # noqa: E501 + + + :return: The terminate_workflow of this Action. # noqa: E501 + :rtype: TerminateWorkflow + """ + return self._terminate_workflow + + @terminate_workflow.setter + def terminate_workflow(self, terminate_workflow): + """Sets the terminate_workflow of this Action. + + + :param terminate_workflow: The terminate_workflow of this Action. # noqa: E501 + :type: TerminateWorkflow + """ + + self._terminate_workflow = terminate_workflow + + @property + def update_workflow_variables(self): + """Gets the update_workflow_variables of this Action. # noqa: E501 + + + :return: The update_workflow_variables of this Action. # noqa: E501 + :rtype: UpdateWorkflowVariables + """ + return self._update_workflow_variables + + @update_workflow_variables.setter + def update_workflow_variables(self, update_workflow_variables): + """Sets the update_workflow_variables of this Action. + + + :param update_workflow_variables: The update_workflow_variables of this Action. # noqa: E501 + :type: UpdateWorkflowVariables + """ + + self._update_workflow_variables = update_workflow_variables + def to_dict(self): """Returns the model properties as a dict""" result = {} @@ -207,4 +303,4 @@ def __eq__(self, other): def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + return not self == other \ No newline at end of file diff --git a/src/conductor/client/http/models/authorization_request.py b/src/conductor/client/http/models/authorization_request.py index c27019d97..59bd0ac58 100644 --- a/src/conductor/client/http/models/authorization_request.py +++ b/src/conductor/client/http/models/authorization_request.py @@ -1,10 +1,13 @@ import pprint import re # noqa: F401 - +from dataclasses import dataclass, field, InitVar +from typing import List, Optional, Dict, Any import six +from deprecated import deprecated -class AuthorizationRequest(object): +@dataclass +class AuthorizationRequest: """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -16,17 +19,34 @@ class AuthorizationRequest(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - swagger_types = { + subject: InitVar[Any] = None + target: InitVar[Any] = None + access: InitVar[List[str]] = None + + _subject = None + _target = None + _access = None + + # Class variables + swagger_types: Dict[str, str] = field(default_factory=lambda: { 'subject': 'SubjectRef', 'target': 'TargetRef', 'access': 'list[str]' - } + }) - attribute_map = { + attribute_map: Dict[str, str] = field(default_factory=lambda: { 'subject': 'subject', 'target': 'target', 'access': 'access' - } + }) + + discriminator = None + + def __post_init__(self, subject, target, access): + """Initialize fields after dataclass initialization""" + self.subject = subject + self.target = target + self.access = access def __init__(self, subject=None, target=None, access=None): # noqa: E501 """AuthorizationRequest - a model defined in Swagger""" # noqa: E501 @@ -152,4 +172,4 @@ def __eq__(self, other): def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + return not self == other \ No newline at end of file diff --git a/src/conductor/client/http/models/bulk_response.py b/src/conductor/client/http/models/bulk_response.py index 85c98039a..06bc30901 100644 --- a/src/conductor/client/http/models/bulk_response.py +++ b/src/conductor/client/http/models/bulk_response.py @@ -1,10 +1,16 @@ import pprint import re # noqa: F401 +from dataclasses import dataclass, field, InitVar +from typing import Dict, List, Optional, Any, TypeVar, Generic, Union import six +from deprecated import deprecated +T = TypeVar('T') -class BulkResponse(object): + +@dataclass +class BulkResponse(Generic[T]): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -18,28 +24,46 @@ class BulkResponse(object): """ swagger_types = { 'bulk_error_results': 'dict(str, str)', - 'bulk_successful_results': 'list[str]' + 'bulk_successful_results': 'list[str]', + 'message': 'str' } attribute_map = { 'bulk_error_results': 'bulkErrorResults', - 'bulk_successful_results': 'bulkSuccessfulResults' + 'bulk_successful_results': 'bulkSuccessfulResults', + 'message': 'message' } + bulk_error_results: InitVar[Optional[Dict[str, str]]] = None + bulk_successful_results: InitVar[Optional[List[T]]] = None + + _bulk_error_results: Optional[Dict[str, str]] = field(default=None, init=False) + _bulk_successful_results: Optional[List[T]] = field(default=None, init=False) + _message: str = field(default="Bulk Request has been processed.", init=False) + def __init__(self, bulk_error_results=None, bulk_successful_results=None): # noqa: E501 """BulkResponse - a model defined in Swagger""" # noqa: E501 self._bulk_error_results = None self._bulk_successful_results = None + self._message = "Bulk Request has been processed." self.discriminator = None if bulk_error_results is not None: self.bulk_error_results = bulk_error_results if bulk_successful_results is not None: self.bulk_successful_results = bulk_successful_results + def __post_init__(self, bulk_error_results, bulk_successful_results): + """Initialize fields after dataclass initialization""" + if bulk_error_results is not None: + self.bulk_error_results = bulk_error_results + if bulk_successful_results is not None: + self.bulk_successful_results = bulk_successful_results + @property - def bulk_error_results(self): + def bulk_error_results(self) -> Optional[Dict[str, str]]: """Gets the bulk_error_results of this BulkResponse. # noqa: E501 + Key - entityId Value - error message processing this entity :return: The bulk_error_results of this BulkResponse. # noqa: E501 :rtype: dict(str, str) @@ -47,9 +71,10 @@ def bulk_error_results(self): return self._bulk_error_results @bulk_error_results.setter - def bulk_error_results(self, bulk_error_results): + def bulk_error_results(self, bulk_error_results: Optional[Dict[str, str]]): """Sets the bulk_error_results of this BulkResponse. + Key - entityId Value - error message processing this entity :param bulk_error_results: The bulk_error_results of this BulkResponse. # noqa: E501 :type: dict(str, str) @@ -58,17 +83,17 @@ def bulk_error_results(self, bulk_error_results): self._bulk_error_results = bulk_error_results @property - def bulk_successful_results(self): + def bulk_successful_results(self) -> Optional[List[T]]: """Gets the bulk_successful_results of this BulkResponse. # noqa: E501 :return: The bulk_successful_results of this BulkResponse. # noqa: E501 - :rtype: list[str] + :rtype: list[T] """ return self._bulk_successful_results @bulk_successful_results.setter - def bulk_successful_results(self, bulk_successful_results): + def bulk_successful_results(self, bulk_successful_results: Optional[List[T]]): """Sets the bulk_successful_results of this BulkResponse. @@ -78,7 +103,36 @@ def bulk_successful_results(self, bulk_successful_results): self._bulk_successful_results = bulk_successful_results - def to_dict(self): + @property + def message(self) -> str: + """Gets the message of this BulkResponse. # noqa: E501 + + + :return: The message of this BulkResponse. # noqa: E501 + :rtype: str + """ + return self._message + + def append_success_response(self, result: T): + """Appends a successful result to bulk_successful_results. # noqa: E501 + + :param result: The result to append to bulk_successful_results + """ + if self._bulk_successful_results is None: + self._bulk_successful_results = [] + self._bulk_successful_results.append(result) + + def append_failed_response(self, id: str, error_message: str): + """Appends a failed result to bulk_error_results. # noqa: E501 + + :param id: The entity ID that failed + :param error_message: The error message for the failed entity + """ + if self._bulk_error_results is None: + self._bulk_error_results = {} + self._bulk_error_results[id] = error_message + + def to_dict(self) -> Dict[str, Any]: """Returns the model properties as a dict""" result = {} @@ -105,21 +159,21 @@ def to_dict(self): return result - def to_str(self): + def to_str(self) -> str: """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) - def __repr__(self): + def __repr__(self) -> str: """For `print` and `pprint`""" return self.to_str() - def __eq__(self, other): + def __eq__(self, other) -> bool: """Returns true if both objects are equal""" if not isinstance(other, BulkResponse): return False return self.__dict__ == other.__dict__ - def __ne__(self, other): + def __ne__(self, other) -> bool: """Returns true if both objects are not equal""" - return not self == other + return not self == other \ No newline at end of file diff --git a/src/conductor/client/http/models/conductor_application.py b/src/conductor/client/http/models/conductor_application.py index 4a7ada0ae..11353d0ef 100644 --- a/src/conductor/client/http/models/conductor_application.py +++ b/src/conductor/client/http/models/conductor_application.py @@ -1,10 +1,14 @@ import pprint import re # noqa: F401 +from dataclasses import dataclass, field, asdict +from typing import Optional, Dict, List, Any import six +from deprecated import deprecated -class ConductorApplication(object): +@dataclass +class ConductorApplication: """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -16,23 +20,41 @@ class ConductorApplication(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - swagger_types = { + _id: Optional[str] = field(default=None, init=False) + _name: Optional[str] = field(default=None, init=False) + _created_by: Optional[str] = field(default=None, init=False) + _create_time: Optional[int] = field(default=None, init=False) + _update_time: Optional[int] = field(default=None, init=False) + _updated_by: Optional[str] = field(default=None, init=False) + + swagger_types: Dict[str, str] = field(default_factory=lambda: { 'id': 'str', 'name': 'str', - 'created_by': 'str' - } + 'created_by': 'str', + 'create_time': 'int', + 'update_time': 'int', + 'updated_by': 'str' + }, init=False) - attribute_map = { + attribute_map: Dict[str, str] = field(default_factory=lambda: { 'id': 'id', 'name': 'name', - 'created_by': 'createdBy' - } + 'created_by': 'createdBy', + 'create_time': 'createTime', + 'update_time': 'updateTime', + 'updated_by': 'updatedBy' + }, init=False) - def __init__(self, id=None, name=None, created_by=None): # noqa: E501 + discriminator: Optional[str] = field(default=None, init=False) + + def __init__(self, id=None, name=None, created_by=None, create_time=None, update_time=None, updated_by=None): # noqa: E501 """ConductorApplication - a model defined in Swagger""" # noqa: E501 self._id = None self._name = None self._created_by = None + self._create_time = None + self._update_time = None + self._updated_by = None self.discriminator = None if id is not None: self.id = id @@ -40,9 +62,25 @@ def __init__(self, id=None, name=None, created_by=None): # noqa: E501 self.name = name if created_by is not None: self.created_by = created_by + if create_time is not None: + self.create_time = create_time + if update_time is not None: + self.update_time = update_time + if updated_by is not None: + self.updated_by = updated_by + + def __post_init__(self): + """Post initialization for dataclass attributes""" + self._id = None + self._name = None + self._created_by = None + self._create_time = None + self._update_time = None + self._updated_by = None + self.discriminator = None @property - def id(self): + def id(self) -> Optional[str]: """Gets the id of this ConductorApplication. # noqa: E501 @@ -52,7 +90,7 @@ def id(self): return self._id @id.setter - def id(self, id): + def id(self, id: Optional[str]): """Sets the id of this ConductorApplication. @@ -63,7 +101,7 @@ def id(self, id): self._id = id @property - def name(self): + def name(self) -> Optional[str]: """Gets the name of this ConductorApplication. # noqa: E501 @@ -73,7 +111,7 @@ def name(self): return self._name @name.setter - def name(self, name): + def name(self, name: Optional[str]): """Sets the name of this ConductorApplication. @@ -84,7 +122,7 @@ def name(self, name): self._name = name @property - def created_by(self): + def created_by(self) -> Optional[str]: """Gets the created_by of this ConductorApplication. # noqa: E501 @@ -94,7 +132,7 @@ def created_by(self): return self._created_by @created_by.setter - def created_by(self, created_by): + def created_by(self, created_by: Optional[str]): """Sets the created_by of this ConductorApplication. @@ -104,7 +142,70 @@ def created_by(self, created_by): self._created_by = created_by - def to_dict(self): + @property + def create_time(self) -> Optional[int]: + """Gets the create_time of this ConductorApplication. # noqa: E501 + + + :return: The create_time of this ConductorApplication. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time: Optional[int]): + """Sets the create_time of this ConductorApplication. + + + :param create_time: The create_time of this ConductorApplication. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def update_time(self) -> Optional[int]: + """Gets the update_time of this ConductorApplication. # noqa: E501 + + + :return: The update_time of this ConductorApplication. # noqa: E501 + :rtype: int + """ + return self._update_time + + @update_time.setter + def update_time(self, update_time: Optional[int]): + """Sets the update_time of this ConductorApplication. + + + :param update_time: The update_time of this ConductorApplication. # noqa: E501 + :type: int + """ + + self._update_time = update_time + + @property + def updated_by(self) -> Optional[str]: + """Gets the updated_by of this ConductorApplication. # noqa: E501 + + + :return: The updated_by of this ConductorApplication. # noqa: E501 + :rtype: str + """ + return self._updated_by + + @updated_by.setter + def updated_by(self, updated_by: Optional[str]): + """Sets the updated_by of this ConductorApplication. + + + :param updated_by: The updated_by of this ConductorApplication. # noqa: E501 + :type: str + """ + + self._updated_by = updated_by + + def to_dict(self) -> Dict[str, Any]: """Returns the model properties as a dict""" result = {} @@ -131,21 +232,21 @@ def to_dict(self): return result - def to_str(self): + def to_str(self) -> str: """Returns the string representation of the model""" return pprint.pformat(self.to_dict()) - def __repr__(self): + def __repr__(self) -> str: """For `print` and `pprint`""" return self.to_str() - def __eq__(self, other): + def __eq__(self, other) -> bool: """Returns true if both objects are equal""" if not isinstance(other, ConductorApplication): return False return self.__dict__ == other.__dict__ - def __ne__(self, other): + def __ne__(self, other) -> bool: """Returns true if both objects are not equal""" - return not self == other + return not self == other \ No newline at end of file diff --git a/src/conductor/client/http/models/conductor_user.py b/src/conductor/client/http/models/conductor_user.py index f7ff89914..1523aea15 100644 --- a/src/conductor/client/http/models/conductor_user.py +++ b/src/conductor/client/http/models/conductor_user.py @@ -1,22 +1,39 @@ import pprint import re # noqa: F401 - +from dataclasses import dataclass, field, InitVar +from typing import List, Optional, Dict, Any, Union +from deprecated import deprecated import six -class ConductorUser(object): +@dataclass +class ConductorUser: """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { + + id: Optional[str] = field(default=None) + name: Optional[str] = field(default=None) + roles: Optional[List['Role']] = field(default=None) + groups: Optional[List['Group']] = field(default=None) + uuid: Optional[str] = field(default=None) + encrypted_id: Optional[bool] = field(default=None) + encrypted_id_display_value: Optional[str] = field(default=None) + application_user: Optional[bool] = field(default=None) + + # Private backing fields + _id: Optional[str] = field(init=False, repr=False) + _name: Optional[str] = field(init=False, repr=False) + _roles: Optional[List['Role']] = field(init=False, repr=False) + _groups: Optional[List['Group']] = field(init=False, repr=False) + _uuid: Optional[str] = field(init=False, repr=False) + _encrypted_id: Optional[bool] = field(init=False, repr=False) + _encrypted_id_display_value: Optional[str] = field(init=False, repr=False) + _application_user: Optional[bool] = field(init=False, repr=False) + + # Keep original swagger_types and attribute_map for backward compatibility + swagger_types: Dict[str, str] = field(init=False, repr=False, default_factory=lambda: { 'id': 'str', 'name': 'str', 'roles': 'list[Role]', @@ -25,9 +42,9 @@ class ConductorUser(object): 'application_user': 'bool', 'encrypted_id': 'bool', 'encrypted_id_display_value': 'str' - } + }) - attribute_map = { + attribute_map: Dict[str, str] = field(init=False, repr=False, default_factory=lambda: { 'id': 'id', 'name': 'name', 'roles': 'roles', @@ -36,7 +53,9 @@ class ConductorUser(object): 'application_user': 'applicationUser', 'encrypted_id': 'encryptedId', 'encrypted_id_display_value': 'encryptedIdDisplayValue' - } + }) + + discriminator: Any = field(init=False, repr=False, default=None) def __init__(self, id=None, name=None, roles=None, groups=None, uuid=None, application_user=None, encrypted_id=None, encrypted_id_display_value=None): # noqa: E501 @@ -67,6 +86,17 @@ def __init__(self, id=None, name=None, roles=None, groups=None, uuid=None, appli if encrypted_id_display_value is not None: self.encrypted_id_display_value = encrypted_id_display_value + def __post_init__(self): + """Initialize private backing fields from dataclass fields""" + self._id = self.id + self._name = self.name + self._roles = self.roles + self._groups = self.groups + self._uuid = self.uuid + self._encrypted_id = self.encrypted_id + self._encrypted_id_display_value = self.encrypted_id_display_value + self._application_user = self.application_user + @property def id(self): """Gets the id of this ConductorUser. # noqa: E501 @@ -173,6 +203,7 @@ def uuid(self, uuid): self._uuid = uuid @property + @deprecated def application_user(self): """Gets the application_user of this ConductorUser. # noqa: E501 @@ -183,6 +214,7 @@ def application_user(self): return self._application_user @application_user.setter + @deprecated def application_user(self, application_user): """Sets the application_user of this ConductorUser. @@ -279,4 +311,4 @@ def __eq__(self, other): def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + return not self == other \ No newline at end of file diff --git a/src/conductor/client/http/models/correlation_ids_search_request.py b/src/conductor/client/http/models/correlation_ids_search_request.py index 36529ae3f..5a1fd4678 100644 --- a/src/conductor/client/http/models/correlation_ids_search_request.py +++ b/src/conductor/client/http/models/correlation_ids_search_request.py @@ -1,14 +1,21 @@ import pprint -import re # noqa: F401 - +from dataclasses import dataclass, field +from typing import List, Optional import six -class CorrelationIdsSearchRequest(object): +@dataclass +class CorrelationIdsSearchRequest: """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ + correlation_ids: List[str] = field(default_factory=list) + workflow_names: List[str] = field(default_factory=list) + + _correlation_ids: List[str] = field(default=None, repr=False, init=False) + _workflow_names: List[str] = field(default=None, repr=False, init=False) + """ Attributes: swagger_types (dict): The key is attribute name @@ -34,6 +41,13 @@ def __init__(self, correlation_ids=None, workflow_names=None): # noqa: E501 self.correlation_ids = correlation_ids self.workflow_names = workflow_names + def __post_init__(self): + """Initialize private fields after dataclass initialization""" + if not hasattr(self, '_correlation_ids') or self._correlation_ids is None: + self._correlation_ids = self.correlation_ids + if not hasattr(self, '_workflow_names') or self._workflow_names is None: + self._workflow_names = self.workflow_names + @property def correlation_ids(self): """Gets the correlation_ids of this CorrelationIdsSearchRequest. # noqa: E501 @@ -118,4 +132,4 @@ def __eq__(self, other): def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + return not self == other \ No newline at end of file diff --git a/src/conductor/client/http/models/workflow_run.py b/src/conductor/client/http/models/workflow_run.py index f310f59f7..acc9f020f 100644 --- a/src/conductor/client/http/models/workflow_run.py +++ b/src/conductor/client/http/models/workflow_run.py @@ -1,7 +1,10 @@ import pprint import re # noqa: F401 +from dataclasses import dataclass, field, InitVar +from typing import Dict, List, Optional, Any, ClassVar import six +from deprecated import deprecated from conductor.client.http.models import Task @@ -10,19 +13,14 @@ running_status = ('RUNNING', 'PAUSED') -class WorkflowRun(object): +@dataclass +class WorkflowRun: """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { + # Class attributes for swagger + swagger_types: ClassVar[Dict[str, str]] = { 'correlation_id': 'str', 'create_time': 'int', 'created_by': 'str', @@ -37,7 +35,7 @@ class WorkflowRun(object): 'workflow_id': 'str' } - attribute_map = { + attribute_map: ClassVar[Dict[str, str]] = { 'correlation_id': 'correlationId', 'create_time': 'createTime', 'created_by': 'createdBy', @@ -52,6 +50,38 @@ class WorkflowRun(object): 'workflow_id': 'workflowId' } + # Fields for the dataclass + correlation_id: Optional[str] = field(default=None) + create_time: Optional[int] = field(default=None) + created_by: Optional[str] = field(default=None) + input: Optional[Dict[str, Any]] = field(default=None) + output: Optional[Dict[str, Any]] = field(default=None) + priority: Optional[int] = field(default=None) + request_id: Optional[str] = field(default=None) + status: Optional[str] = field(default=None) + tasks: Optional[List[Task]] = field(default=None) + update_time: Optional[int] = field(default=None) + variables: Optional[Dict[str, Any]] = field(default=None) + workflow_id: Optional[str] = field(default=None) + + # Additional init parameter (not a dataclass field) + reason_for_incompletion: InitVar[Optional[str]] = None + + # Private backing fields + _correlation_id: Optional[str] = field(init=False, repr=False) + _create_time: Optional[int] = field(init=False, repr=False) + _created_by: Optional[str] = field(init=False, repr=False) + _input: Optional[Dict[str, Any]] = field(init=False, repr=False) + _output: Optional[Dict[str, Any]] = field(init=False, repr=False) + _priority: Optional[int] = field(init=False, repr=False) + _request_id: Optional[str] = field(init=False, repr=False) + _status: Optional[str] = field(init=False, repr=False) + _tasks: Optional[List[Task]] = field(init=False, repr=False) + _update_time: Optional[int] = field(init=False, repr=False) + _variables: Optional[Dict[str, Any]] = field(init=False, repr=False) + _workflow_id: Optional[str] = field(init=False, repr=False) + _reason_for_incompletion: Optional[str] = field(init=False, repr=False) + def __init__(self, correlation_id=None, create_time=None, created_by=None, input=None, output=None, priority=None, request_id=None, status=None, tasks=None, update_time=None, variables=None, workflow_id=None, reason_for_incompletion: str = None): # noqa: E501 @@ -95,6 +125,22 @@ def __init__(self, correlation_id=None, create_time=None, created_by=None, input self.workflow_id = workflow_id self._reason_for_incompletion = reason_for_incompletion + def __post_init__(self, reason_for_incompletion: Optional[str]): + """Initialize private fields after dataclass initialization""" + self._correlation_id = self.correlation_id + self._create_time = self.create_time + self._created_by = self.created_by + self._input = self.input + self._output = self.output + self._priority = self.priority + self._request_id = self.request_id + self._status = self.status + self._tasks = self.tasks + self._update_time = self.update_time + self._variables = self.variables + self._workflow_id = self.workflow_id + self._reason_for_incompletion = reason_for_incompletion + @property def correlation_id(self): """Gets the correlation_id of this WorkflowRun. # noqa: E501 @@ -442,4 +488,4 @@ def current_task(self) -> Task: for task in self.tasks: if task.status == 'SCHEDULED' or task.status == 'IN_PROGRESS': current = task - return current + return current \ No newline at end of file