neops_workflow_engine_client 0.41.7__tar.gz → 0.41.10__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/PKG-INFO +5 -2
  2. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/README.md +4 -1
  3. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/__init__.py +4 -1
  4. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api_client.py +1 -1
  5. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/configuration.py +1 -1
  6. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/__init__.py +3 -0
  7. neops_workflow_engine_client-0.41.7/neops_workflow_engine_client/models/workflow_config.py → neops_workflow_engine_client-0.41.10/neops_workflow_engine_client/models/acquires.py +9 -13
  8. neops_workflow_engine_client-0.41.10/neops_workflow_engine_client/models/cron_configuration.py +103 -0
  9. neops_workflow_engine_client-0.41.10/neops_workflow_engine_client/models/crontab_configuration.py +99 -0
  10. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/root_workflow.py +12 -4
  11. neops_workflow_engine_client-0.41.10/neops_workflow_engine_client/models/workflow_config.py +111 -0
  12. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/pyproject.toml +1 -1
  13. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/__init__.py +0 -0
  14. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/blackboard_api.py +0 -0
  15. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/cms_client_api.py +0 -0
  16. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/default_api.py +0 -0
  17. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/function_block_api.py +0 -0
  18. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/health_api.py +0 -0
  19. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api/workflows_api.py +0 -0
  20. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/api_response.py +0 -0
  21. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/exceptions.py +0 -0
  22. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/create_workflow_definition_dto.py +0 -0
  23. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/device_dto.py +0 -0
  24. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/devices_response_dto.py +0 -0
  25. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/execute_workflow_dto.py +0 -0
  26. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/health_response.py +0 -0
  27. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/job_definition_dto.py +0 -0
  28. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/job_result_dto.py +0 -0
  29. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/login_response_dto.py +0 -0
  30. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/parametrized_function_block.py +0 -0
  31. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/register_function_block_dto.py +0 -0
  32. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/repeat_configuration.py +0 -0
  33. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/retry_configuration.py +0 -0
  34. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/workflow.py +0 -0
  35. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/workflow_execution_parameters.py +0 -0
  36. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/workflow_reference.py +0 -0
  37. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/models/workflow_steps_inner.py +0 -0
  38. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/py.typed +0 -0
  39. {neops_workflow_engine_client-0.41.7 → neops_workflow_engine_client-0.41.10}/neops_workflow_engine_client/rest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: neops_workflow_engine_client
3
- Version: 0.41.7
3
+ Version: 0.41.10
4
4
  Summary: Neops Workflow Engine
5
5
  License: NoLicense
6
6
  Keywords: OpenAPI,OpenAPI-Generator,Neops Workflow Engine
@@ -28,7 +28,7 @@ Neops workflow engine API documentation
28
28
  This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
29
29
 
30
30
  - API version: 1.0
31
- - Package version: 0.41.7
31
+ - Package version: 0.41.10
32
32
  - Generator version: 7.9.0
33
33
  - Build package: org.openapitools.codegen.languages.PythonClientCodegen
34
34
 
@@ -132,7 +132,10 @@ Class | Method | HTTP request | Description
132
132
 
133
133
  ## Documentation For Models
134
134
 
135
+ - [Acquires](docs/Acquires.md)
135
136
  - [CreateWorkflowDefinitionDto](docs/CreateWorkflowDefinitionDto.md)
137
+ - [CronConfiguration](docs/CronConfiguration.md)
138
+ - [CrontabConfiguration](docs/CrontabConfiguration.md)
136
139
  - [DeviceDto](docs/DeviceDto.md)
137
140
  - [DevicesResponseDto](docs/DevicesResponseDto.md)
138
141
  - [ExecuteWorkflowDto](docs/ExecuteWorkflowDto.md)
@@ -4,7 +4,7 @@ Neops workflow engine API documentation
4
4
  This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5
5
 
6
6
  - API version: 1.0
7
- - Package version: 0.41.7
7
+ - Package version: 0.41.10
8
8
  - Generator version: 7.9.0
9
9
  - Build package: org.openapitools.codegen.languages.PythonClientCodegen
10
10
 
@@ -108,7 +108,10 @@ Class | Method | HTTP request | Description
108
108
 
109
109
  ## Documentation For Models
110
110
 
111
+ - [Acquires](docs/Acquires.md)
111
112
  - [CreateWorkflowDefinitionDto](docs/CreateWorkflowDefinitionDto.md)
113
+ - [CronConfiguration](docs/CronConfiguration.md)
114
+ - [CrontabConfiguration](docs/CrontabConfiguration.md)
112
115
  - [DeviceDto](docs/DeviceDto.md)
113
116
  - [DevicesResponseDto](docs/DevicesResponseDto.md)
114
117
  - [ExecuteWorkflowDto](docs/ExecuteWorkflowDto.md)
@@ -14,7 +14,7 @@
14
14
  """ # noqa: E501
15
15
 
16
16
 
17
- __version__ = "0.41.7"
17
+ __version__ = "0.41.10"
18
18
 
19
19
  # import apis into sdk package
20
20
  from neops_workflow_engine_client.api.blackboard_api import BlackboardApi
@@ -36,7 +36,10 @@ from neops_workflow_engine_client.exceptions import ApiAttributeError
36
36
  from neops_workflow_engine_client.exceptions import ApiException
37
37
 
38
38
  # import models into sdk package
39
+ from neops_workflow_engine_client.models.acquires import Acquires
39
40
  from neops_workflow_engine_client.models.create_workflow_definition_dto import CreateWorkflowDefinitionDto
41
+ from neops_workflow_engine_client.models.cron_configuration import CronConfiguration
42
+ from neops_workflow_engine_client.models.crontab_configuration import CrontabConfiguration
40
43
  from neops_workflow_engine_client.models.device_dto import DeviceDto
41
44
  from neops_workflow_engine_client.models.devices_response_dto import DevicesResponseDto
42
45
  from neops_workflow_engine_client.models.execute_workflow_dto import ExecuteWorkflowDto
@@ -90,7 +90,7 @@ class ApiClient:
90
90
  self.default_headers[header_name] = header_value
91
91
  self.cookie = cookie
92
92
  # Set default User-Agent.
93
- self.user_agent = 'OpenAPI-Generator/0.41.7/python'
93
+ self.user_agent = 'OpenAPI-Generator/0.41.10/python'
94
94
  self.client_side_validation = configuration.client_side_validation
95
95
 
96
96
  def __enter__(self):
@@ -393,7 +393,7 @@ class Configuration:
393
393
  "OS: {env}\n"\
394
394
  "Python Version: {pyversion}\n"\
395
395
  "Version of the API: 1.0\n"\
396
- "SDK Package Version: 0.41.7".\
396
+ "SDK Package Version: 0.41.10".\
397
397
  format(env=sys.platform, pyversion=sys.version)
398
398
 
399
399
  def get_host_settings(self):
@@ -14,7 +14,10 @@
14
14
 
15
15
 
16
16
  # import models into model package
17
+ from neops_workflow_engine_client.models.acquires import Acquires
17
18
  from neops_workflow_engine_client.models.create_workflow_definition_dto import CreateWorkflowDefinitionDto
19
+ from neops_workflow_engine_client.models.cron_configuration import CronConfiguration
20
+ from neops_workflow_engine_client.models.crontab_configuration import CrontabConfiguration
18
21
  from neops_workflow_engine_client.models.device_dto import DeviceDto
19
22
  from neops_workflow_engine_client.models.devices_response_dto import DevicesResponseDto
20
23
  from neops_workflow_engine_client.models.execute_workflow_dto import ExecuteWorkflowDto
@@ -22,15 +22,13 @@ from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
24
 
25
- class WorkflowConfig(BaseModel):
25
+ class Acquires(BaseModel):
26
26
  """
27
- WorkflowConfig
27
+ Acquires
28
28
  """ # noqa: E501
29
- execution_strategy: Dict[str, Any] = Field(alias="executionStrategy")
30
- parameters: Dict[str, Any]
31
- run_on: Dict[str, Any] = Field(alias="runOn")
32
- acquire: List[StrictStr]
33
- __properties: ClassVar[List[str]] = ["executionStrategy", "parameters", "runOn", "acquire"]
29
+ entity_type: StrictStr = Field(alias="entityType")
30
+ query: StrictStr
31
+ __properties: ClassVar[List[str]] = ["entityType", "query"]
34
32
 
35
33
  model_config = ConfigDict(
36
34
  populate_by_name=True,
@@ -50,7 +48,7 @@ class WorkflowConfig(BaseModel):
50
48
 
51
49
  @classmethod
52
50
  def from_json(cls, json_str: str) -> Optional[Self]:
53
- """Create an instance of WorkflowConfig from a JSON string"""
51
+ """Create an instance of Acquires from a JSON string"""
54
52
  return cls.from_dict(json.loads(json_str))
55
53
 
56
54
  def to_dict(self) -> Dict[str, Any]:
@@ -75,7 +73,7 @@ class WorkflowConfig(BaseModel):
75
73
 
76
74
  @classmethod
77
75
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
- """Create an instance of WorkflowConfig from a dict"""
76
+ """Create an instance of Acquires from a dict"""
79
77
  if obj is None:
80
78
  return None
81
79
 
@@ -83,10 +81,8 @@ class WorkflowConfig(BaseModel):
83
81
  return cls.model_validate(obj)
84
82
 
85
83
  _obj = cls.model_validate({
86
- "executionStrategy": obj.get("executionStrategy"),
87
- "parameters": obj.get("parameters"),
88
- "runOn": obj.get("runOn"),
89
- "acquire": obj.get("acquire")
84
+ "entityType": obj.get("entityType"),
85
+ "query": obj.get("query")
90
86
  })
91
87
  return _obj
92
88
 
@@ -0,0 +1,103 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neops Workflow Engine
5
+
6
+ Neops workflow engine API documentation
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from neops_workflow_engine_client.models.crontab_configuration import CrontabConfiguration
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CronConfiguration(BaseModel):
27
+ """
28
+ CronConfiguration
29
+ """ # noqa: E501
30
+ description: StrictStr
31
+ query: StrictStr
32
+ parameters: Dict[str, Any]
33
+ crontab: CrontabConfiguration
34
+ concurrency: StrictBool
35
+ enabled: StrictBool
36
+ condition: StrictStr
37
+ __properties: ClassVar[List[str]] = ["description", "query", "parameters", "crontab", "concurrency", "enabled", "condition"]
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of CronConfiguration from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of crontab
79
+ if self.crontab:
80
+ _dict['crontab'] = self.crontab.to_dict()
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of CronConfiguration from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "description": obj.get("description"),
94
+ "query": obj.get("query"),
95
+ "parameters": obj.get("parameters"),
96
+ "crontab": CrontabConfiguration.from_dict(obj["crontab"]) if obj.get("crontab") is not None else None,
97
+ "concurrency": obj.get("concurrency"),
98
+ "enabled": obj.get("enabled"),
99
+ "condition": obj.get("condition")
100
+ })
101
+ return _obj
102
+
103
+
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neops Workflow Engine
5
+
6
+ Neops workflow engine API documentation
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CrontabConfiguration(BaseModel):
26
+ """
27
+ CrontabConfiguration
28
+ """ # noqa: E501
29
+ second: StrictStr
30
+ minute: StrictStr
31
+ hour: StrictStr
32
+ day_of_month: StrictStr = Field(alias="dayOfMonth")
33
+ month: StrictStr
34
+ day_of_week: StrictStr = Field(alias="dayOfWeek")
35
+ timezone: StrictStr
36
+ __properties: ClassVar[List[str]] = ["second", "minute", "hour", "dayOfMonth", "month", "dayOfWeek", "timezone"]
37
+
38
+ model_config = ConfigDict(
39
+ populate_by_name=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
52
+ return json.dumps(self.to_dict())
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of CrontabConfiguration from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of CrontabConfiguration from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "second": obj.get("second"),
90
+ "minute": obj.get("minute"),
91
+ "hour": obj.get("hour"),
92
+ "dayOfMonth": obj.get("dayOfMonth"),
93
+ "month": obj.get("month"),
94
+ "dayOfWeek": obj.get("dayOfWeek"),
95
+ "timezone": obj.get("timezone")
96
+ })
97
+ return _obj
98
+
99
+
@@ -19,6 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from neops_workflow_engine_client.models.cron_configuration import CronConfiguration
22
23
  from neops_workflow_engine_client.models.retry_configuration import RetryConfiguration
23
24
  from neops_workflow_engine_client.models.workflow_config import WorkflowConfig
24
25
  from neops_workflow_engine_client.models.workflow_steps_inner import WorkflowStepsInner
@@ -39,9 +40,9 @@ class RootWorkflow(BaseModel):
39
40
  config: WorkflowConfig
40
41
  steps: List[WorkflowStepsInner]
41
42
  version: StrictStr
42
- description: StrictStr
43
- cron: List[StrictStr]
44
- hide_for_execution: StrictBool = Field(alias="hideForExecution")
43
+ description: Optional[StrictStr] = None
44
+ cron: Optional[List[CronConfiguration]] = None
45
+ hide_for_execution: Optional[StrictBool] = Field(default=None, alias="hideForExecution")
45
46
  __properties: ClassVar[List[str]] = ["id", "name", "retryConfig", "condition", "continueOnError", "delay", "type", "config", "steps", "version", "description", "cron", "hideForExecution"]
46
47
 
47
48
  model_config = ConfigDict(
@@ -96,6 +97,13 @@ class RootWorkflow(BaseModel):
96
97
  if _item_steps:
97
98
  _items.append(_item_steps.to_dict())
98
99
  _dict['steps'] = _items
100
+ # override the default output from pydantic by calling `to_dict()` of each item in cron (list)
101
+ _items = []
102
+ if self.cron:
103
+ for _item_cron in self.cron:
104
+ if _item_cron:
105
+ _items.append(_item_cron.to_dict())
106
+ _dict['cron'] = _items
99
107
  return _dict
100
108
 
101
109
  @classmethod
@@ -119,7 +127,7 @@ class RootWorkflow(BaseModel):
119
127
  "steps": [WorkflowStepsInner.from_dict(_item) for _item in obj["steps"]] if obj.get("steps") is not None else None,
120
128
  "version": obj.get("version"),
121
129
  "description": obj.get("description"),
122
- "cron": obj.get("cron"),
130
+ "cron": [CronConfiguration.from_dict(_item) for _item in obj["cron"]] if obj.get("cron") is not None else None,
123
131
  "hideForExecution": obj.get("hideForExecution")
124
132
  })
125
133
  return _obj
@@ -0,0 +1,111 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Neops Workflow Engine
5
+
6
+ Neops workflow engine API documentation
7
+
8
+ The version of the OpenAPI document: 1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from neops_workflow_engine_client.models.acquires import Acquires
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class WorkflowConfig(BaseModel):
27
+ """
28
+ WorkflowConfig
29
+ """ # noqa: E501
30
+ execution_strategy: Dict[str, Any] = Field(alias="executionStrategy")
31
+ parameters: Dict[str, Any]
32
+ run_on: Optional[StrictStr] = Field(default=None, alias="runOn")
33
+ acquire: Optional[List[Acquires]] = None
34
+ __properties: ClassVar[List[str]] = ["executionStrategy", "parameters", "runOn", "acquire"]
35
+
36
+ @field_validator('run_on')
37
+ def run_on_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value is None:
40
+ return value
41
+
42
+ if value not in set(['global', 'device', 'client', 'interface', 'group']):
43
+ raise ValueError("must be one of enum values ('global', 'device', 'client', 'interface', 'group')")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of WorkflowConfig from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # override the default output from pydantic by calling `to_dict()` of each item in acquire (list)
86
+ _items = []
87
+ if self.acquire:
88
+ for _item_acquire in self.acquire:
89
+ if _item_acquire:
90
+ _items.append(_item_acquire.to_dict())
91
+ _dict['acquire'] = _items
92
+ return _dict
93
+
94
+ @classmethod
95
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
96
+ """Create an instance of WorkflowConfig from a dict"""
97
+ if obj is None:
98
+ return None
99
+
100
+ if not isinstance(obj, dict):
101
+ return cls.model_validate(obj)
102
+
103
+ _obj = cls.model_validate({
104
+ "executionStrategy": obj.get("executionStrategy"),
105
+ "parameters": obj.get("parameters"),
106
+ "runOn": obj.get("runOn"),
107
+ "acquire": [Acquires.from_dict(_item) for _item in obj["acquire"]] if obj.get("acquire") is not None else None
108
+ })
109
+ return _obj
110
+
111
+
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "neops_workflow_engine_client"
3
- version = "0.41.7"
3
+ version = "0.41.10"
4
4
  description = "Neops Workflow Engine"
5
5
  authors = ["OpenAPI Generator Community <team@openapitools.org>"]
6
6
  license = "NoLicense"