rapidata 0.4.1__py3-none-any.whl → 0.5.1__py3-none-any.whl
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.
- rapidata/__init__.py +4 -3
- rapidata/api_client/__init__.py +22 -12
- rapidata/api_client/api/__init__.py +2 -0
- rapidata/api_client/api/campaign_api.py +1044 -0
- rapidata/api_client/api/order_api.py +0 -556
- rapidata/api_client/api/pipeline_api.py +843 -0
- rapidata/api_client/models/__init__.py +20 -12
- rapidata/api_client/models/add_campaign_artifact_result.py +87 -0
- rapidata/api_client/models/add_campaign_model.py +149 -0
- rapidata/api_client/models/campaign_artifact_model.py +98 -0
- rapidata/api_client/models/campaign_query_model.py +105 -0
- rapidata/api_client/models/campaign_query_model_paged_result.py +105 -0
- rapidata/api_client/models/campaign_status.py +39 -0
- rapidata/api_client/models/compare_workflow_config.py +2 -12
- rapidata/api_client/models/compare_workflow_config_model.py +138 -0
- rapidata/api_client/models/conditional_validation_selection.py +106 -0
- rapidata/api_client/models/create_order_model_selections_inner.py +26 -12
- rapidata/api_client/models/dataset_artifact_model.py +98 -0
- rapidata/api_client/models/demographic_rapid_selection_config.py +7 -5
- rapidata/api_client/models/demographic_selection.py +7 -5
- rapidata/api_client/models/file_artifact_model.py +98 -0
- rapidata/api_client/models/get_pipeline_by_id_result.py +100 -0
- rapidata/api_client/models/get_pipeline_by_id_result_artifacts_value.py +182 -0
- rapidata/api_client/models/query_campaigns_model.py +112 -0
- rapidata/api_client/models/simple_workflow_config.py +2 -12
- rapidata/api_client/models/simple_workflow_config_model.py +132 -0
- rapidata/api_client/models/simple_workflow_config_model_blueprint.py +238 -0
- rapidata/api_client/models/update_workflow_config_request.py +107 -0
- rapidata/api_client/models/update_workflow_config_request_config.py +140 -0
- rapidata/api_client/models/workflow_artifact_model.py +98 -0
- rapidata/api_client/models/workflow_config_artifact_model.py +102 -0
- rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +140 -0
- rapidata/api_client_README.md +31 -21
- rapidata/rapidata_client/__init__.py +6 -1
- rapidata/rapidata_client/selection/__init__.py +1 -0
- rapidata/rapidata_client/selection/conditional_validation_selection.py +37 -0
- rapidata/rapidata_client/selection/demographic_selection.py +3 -5
- {rapidata-0.4.1.dist-info → rapidata-0.5.1.dist-info}/METADATA +1 -1
- {rapidata-0.4.1.dist-info → rapidata-0.5.1.dist-info}/RECORD +41 -18
- {rapidata-0.4.1.dist-info → rapidata-0.5.1.dist-info}/LICENSE +0 -0
- {rapidata-0.4.1.dist-info → rapidata-0.5.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
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 json
|
|
17
|
+
import pprint
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
+
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.attach_category_rapid_blueprint import AttachCategoryRapidBlueprint
|
|
21
|
+
from rapidata.api_client.models.bounding_box_rapid_blueprint import BoundingBoxRapidBlueprint
|
|
22
|
+
from rapidata.api_client.models.compare_rapid_blueprint import CompareRapidBlueprint
|
|
23
|
+
from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBlueprint
|
|
24
|
+
from rapidata.api_client.models.line_rapid_blueprint import LineRapidBlueprint
|
|
25
|
+
from rapidata.api_client.models.locate_rapid_blueprint import LocateRapidBlueprint
|
|
26
|
+
from rapidata.api_client.models.named_entity_rapid_blueprint import NamedEntityRapidBlueprint
|
|
27
|
+
from rapidata.api_client.models.polygon_rapid_blueprint import PolygonRapidBlueprint
|
|
28
|
+
from rapidata.api_client.models.transcription_rapid_blueprint import TranscriptionRapidBlueprint
|
|
29
|
+
from pydantic import StrictStr, Field
|
|
30
|
+
from typing import Union, List, Set, Optional, Dict
|
|
31
|
+
from typing_extensions import Literal, Self
|
|
32
|
+
|
|
33
|
+
SIMPLEWORKFLOWCONFIGMODELBLUEPRINT_ONE_OF_SCHEMAS = ["AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "CompareRapidBlueprint", "FreeTextRapidBlueprint", "LineRapidBlueprint", "LocateRapidBlueprint", "NamedEntityRapidBlueprint", "PolygonRapidBlueprint", "TranscriptionRapidBlueprint"]
|
|
34
|
+
|
|
35
|
+
class SimpleWorkflowConfigModelBlueprint(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
The blueprint to use when creating rapids for this workflow. The blueprint determines what kind of rapids will be created and what data they will contain.
|
|
38
|
+
"""
|
|
39
|
+
# data type: TranscriptionRapidBlueprint
|
|
40
|
+
oneof_schema_1_validator: Optional[TranscriptionRapidBlueprint] = None
|
|
41
|
+
# data type: PolygonRapidBlueprint
|
|
42
|
+
oneof_schema_2_validator: Optional[PolygonRapidBlueprint] = None
|
|
43
|
+
# data type: NamedEntityRapidBlueprint
|
|
44
|
+
oneof_schema_3_validator: Optional[NamedEntityRapidBlueprint] = None
|
|
45
|
+
# data type: LocateRapidBlueprint
|
|
46
|
+
oneof_schema_4_validator: Optional[LocateRapidBlueprint] = None
|
|
47
|
+
# data type: LineRapidBlueprint
|
|
48
|
+
oneof_schema_5_validator: Optional[LineRapidBlueprint] = None
|
|
49
|
+
# data type: FreeTextRapidBlueprint
|
|
50
|
+
oneof_schema_6_validator: Optional[FreeTextRapidBlueprint] = None
|
|
51
|
+
# data type: CompareRapidBlueprint
|
|
52
|
+
oneof_schema_7_validator: Optional[CompareRapidBlueprint] = None
|
|
53
|
+
# data type: AttachCategoryRapidBlueprint
|
|
54
|
+
oneof_schema_8_validator: Optional[AttachCategoryRapidBlueprint] = None
|
|
55
|
+
# data type: BoundingBoxRapidBlueprint
|
|
56
|
+
oneof_schema_9_validator: Optional[BoundingBoxRapidBlueprint] = None
|
|
57
|
+
actual_instance: Optional[Union[AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, TranscriptionRapidBlueprint]] = None
|
|
58
|
+
one_of_schemas: Set[str] = { "AttachCategoryRapidBlueprint", "BoundingBoxRapidBlueprint", "CompareRapidBlueprint", "FreeTextRapidBlueprint", "LineRapidBlueprint", "LocateRapidBlueprint", "NamedEntityRapidBlueprint", "PolygonRapidBlueprint", "TranscriptionRapidBlueprint" }
|
|
59
|
+
|
|
60
|
+
model_config = ConfigDict(
|
|
61
|
+
validate_assignment=True,
|
|
62
|
+
protected_namespaces=(),
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
70
|
+
if args:
|
|
71
|
+
if len(args) > 1:
|
|
72
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
73
|
+
if kwargs:
|
|
74
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
75
|
+
super().__init__(actual_instance=args[0])
|
|
76
|
+
else:
|
|
77
|
+
super().__init__(**kwargs)
|
|
78
|
+
|
|
79
|
+
@field_validator('actual_instance')
|
|
80
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
81
|
+
instance = SimpleWorkflowConfigModelBlueprint.model_construct()
|
|
82
|
+
error_messages = []
|
|
83
|
+
match = 0
|
|
84
|
+
# validate data type: TranscriptionRapidBlueprint
|
|
85
|
+
if not isinstance(v, TranscriptionRapidBlueprint):
|
|
86
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionRapidBlueprint`")
|
|
87
|
+
else:
|
|
88
|
+
match += 1
|
|
89
|
+
# validate data type: PolygonRapidBlueprint
|
|
90
|
+
if not isinstance(v, PolygonRapidBlueprint):
|
|
91
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonRapidBlueprint`")
|
|
92
|
+
else:
|
|
93
|
+
match += 1
|
|
94
|
+
# validate data type: NamedEntityRapidBlueprint
|
|
95
|
+
if not isinstance(v, NamedEntityRapidBlueprint):
|
|
96
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityRapidBlueprint`")
|
|
97
|
+
else:
|
|
98
|
+
match += 1
|
|
99
|
+
# validate data type: LocateRapidBlueprint
|
|
100
|
+
if not isinstance(v, LocateRapidBlueprint):
|
|
101
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LocateRapidBlueprint`")
|
|
102
|
+
else:
|
|
103
|
+
match += 1
|
|
104
|
+
# validate data type: LineRapidBlueprint
|
|
105
|
+
if not isinstance(v, LineRapidBlueprint):
|
|
106
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LineRapidBlueprint`")
|
|
107
|
+
else:
|
|
108
|
+
match += 1
|
|
109
|
+
# validate data type: FreeTextRapidBlueprint
|
|
110
|
+
if not isinstance(v, FreeTextRapidBlueprint):
|
|
111
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FreeTextRapidBlueprint`")
|
|
112
|
+
else:
|
|
113
|
+
match += 1
|
|
114
|
+
# validate data type: CompareRapidBlueprint
|
|
115
|
+
if not isinstance(v, CompareRapidBlueprint):
|
|
116
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareRapidBlueprint`")
|
|
117
|
+
else:
|
|
118
|
+
match += 1
|
|
119
|
+
# validate data type: AttachCategoryRapidBlueprint
|
|
120
|
+
if not isinstance(v, AttachCategoryRapidBlueprint):
|
|
121
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryRapidBlueprint`")
|
|
122
|
+
else:
|
|
123
|
+
match += 1
|
|
124
|
+
# validate data type: BoundingBoxRapidBlueprint
|
|
125
|
+
if not isinstance(v, BoundingBoxRapidBlueprint):
|
|
126
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxRapidBlueprint`")
|
|
127
|
+
else:
|
|
128
|
+
match += 1
|
|
129
|
+
if match > 1:
|
|
130
|
+
# more than 1 match
|
|
131
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in SimpleWorkflowConfigModelBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
132
|
+
elif match == 0:
|
|
133
|
+
# no match
|
|
134
|
+
raise ValueError("No match found when setting `actual_instance` in SimpleWorkflowConfigModelBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
135
|
+
else:
|
|
136
|
+
return v
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
140
|
+
return cls.from_json(json.dumps(obj))
|
|
141
|
+
|
|
142
|
+
@classmethod
|
|
143
|
+
def from_json(cls, json_str: str) -> Self:
|
|
144
|
+
"""Returns the object represented by the json string"""
|
|
145
|
+
instance = cls.model_construct()
|
|
146
|
+
error_messages = []
|
|
147
|
+
match = 0
|
|
148
|
+
|
|
149
|
+
# deserialize data into TranscriptionRapidBlueprint
|
|
150
|
+
try:
|
|
151
|
+
instance.actual_instance = TranscriptionRapidBlueprint.from_json(json_str)
|
|
152
|
+
match += 1
|
|
153
|
+
except (ValidationError, ValueError) as e:
|
|
154
|
+
error_messages.append(str(e))
|
|
155
|
+
# deserialize data into PolygonRapidBlueprint
|
|
156
|
+
try:
|
|
157
|
+
instance.actual_instance = PolygonRapidBlueprint.from_json(json_str)
|
|
158
|
+
match += 1
|
|
159
|
+
except (ValidationError, ValueError) as e:
|
|
160
|
+
error_messages.append(str(e))
|
|
161
|
+
# deserialize data into NamedEntityRapidBlueprint
|
|
162
|
+
try:
|
|
163
|
+
instance.actual_instance = NamedEntityRapidBlueprint.from_json(json_str)
|
|
164
|
+
match += 1
|
|
165
|
+
except (ValidationError, ValueError) as e:
|
|
166
|
+
error_messages.append(str(e))
|
|
167
|
+
# deserialize data into LocateRapidBlueprint
|
|
168
|
+
try:
|
|
169
|
+
instance.actual_instance = LocateRapidBlueprint.from_json(json_str)
|
|
170
|
+
match += 1
|
|
171
|
+
except (ValidationError, ValueError) as e:
|
|
172
|
+
error_messages.append(str(e))
|
|
173
|
+
# deserialize data into LineRapidBlueprint
|
|
174
|
+
try:
|
|
175
|
+
instance.actual_instance = LineRapidBlueprint.from_json(json_str)
|
|
176
|
+
match += 1
|
|
177
|
+
except (ValidationError, ValueError) as e:
|
|
178
|
+
error_messages.append(str(e))
|
|
179
|
+
# deserialize data into FreeTextRapidBlueprint
|
|
180
|
+
try:
|
|
181
|
+
instance.actual_instance = FreeTextRapidBlueprint.from_json(json_str)
|
|
182
|
+
match += 1
|
|
183
|
+
except (ValidationError, ValueError) as e:
|
|
184
|
+
error_messages.append(str(e))
|
|
185
|
+
# deserialize data into CompareRapidBlueprint
|
|
186
|
+
try:
|
|
187
|
+
instance.actual_instance = CompareRapidBlueprint.from_json(json_str)
|
|
188
|
+
match += 1
|
|
189
|
+
except (ValidationError, ValueError) as e:
|
|
190
|
+
error_messages.append(str(e))
|
|
191
|
+
# deserialize data into AttachCategoryRapidBlueprint
|
|
192
|
+
try:
|
|
193
|
+
instance.actual_instance = AttachCategoryRapidBlueprint.from_json(json_str)
|
|
194
|
+
match += 1
|
|
195
|
+
except (ValidationError, ValueError) as e:
|
|
196
|
+
error_messages.append(str(e))
|
|
197
|
+
# deserialize data into BoundingBoxRapidBlueprint
|
|
198
|
+
try:
|
|
199
|
+
instance.actual_instance = BoundingBoxRapidBlueprint.from_json(json_str)
|
|
200
|
+
match += 1
|
|
201
|
+
except (ValidationError, ValueError) as e:
|
|
202
|
+
error_messages.append(str(e))
|
|
203
|
+
|
|
204
|
+
if match > 1:
|
|
205
|
+
# more than 1 match
|
|
206
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into SimpleWorkflowConfigModelBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
207
|
+
elif match == 0:
|
|
208
|
+
# no match
|
|
209
|
+
raise ValueError("No match found when deserializing the JSON string into SimpleWorkflowConfigModelBlueprint with oneOf schemas: AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, TranscriptionRapidBlueprint. Details: " + ", ".join(error_messages))
|
|
210
|
+
else:
|
|
211
|
+
return instance
|
|
212
|
+
|
|
213
|
+
def to_json(self) -> str:
|
|
214
|
+
"""Returns the JSON representation of the actual instance"""
|
|
215
|
+
if self.actual_instance is None:
|
|
216
|
+
return "null"
|
|
217
|
+
|
|
218
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
219
|
+
return self.actual_instance.to_json()
|
|
220
|
+
else:
|
|
221
|
+
return json.dumps(self.actual_instance)
|
|
222
|
+
|
|
223
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryRapidBlueprint, BoundingBoxRapidBlueprint, CompareRapidBlueprint, FreeTextRapidBlueprint, LineRapidBlueprint, LocateRapidBlueprint, NamedEntityRapidBlueprint, PolygonRapidBlueprint, TranscriptionRapidBlueprint]]:
|
|
224
|
+
"""Returns the dict representation of the actual instance"""
|
|
225
|
+
if self.actual_instance is None:
|
|
226
|
+
return None
|
|
227
|
+
|
|
228
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
229
|
+
return self.actual_instance.to_dict()
|
|
230
|
+
else:
|
|
231
|
+
# primitive type
|
|
232
|
+
return self.actual_instance
|
|
233
|
+
|
|
234
|
+
def to_str(self) -> str:
|
|
235
|
+
"""Returns the string representation of the actual instance"""
|
|
236
|
+
return pprint.pformat(self.model_dump())
|
|
237
|
+
|
|
238
|
+
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
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, Optional
|
|
22
|
+
from rapidata.api_client.models.update_workflow_config_request_config import UpdateWorkflowConfigRequestConfig
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class UpdateWorkflowConfigRequest(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
A request to update the workflow configuration.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
pipeline_id: StrictStr = Field(description="The id of the pipeline to update.", alias="pipelineId")
|
|
31
|
+
artifact_id: Optional[StrictStr] = Field(description="The id of the workflow config artifact to update.", alias="artifactId")
|
|
32
|
+
config: UpdateWorkflowConfigRequestConfig
|
|
33
|
+
campaign_artifact_id: Optional[StrictStr] = Field(default=None, description="The id of the campaign artifact to update.", alias="campaignArtifactId")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["pipelineId", "artifactId", "config", "campaignArtifactId"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of UpdateWorkflowConfigRequest from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of config
|
|
76
|
+
if self.config:
|
|
77
|
+
_dict['config'] = self.config.to_dict()
|
|
78
|
+
# set to None if artifact_id (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.artifact_id is None and "artifact_id" in self.model_fields_set:
|
|
81
|
+
_dict['artifactId'] = None
|
|
82
|
+
|
|
83
|
+
# set to None if campaign_artifact_id (nullable) is None
|
|
84
|
+
# and model_fields_set contains the field
|
|
85
|
+
if self.campaign_artifact_id is None and "campaign_artifact_id" in self.model_fields_set:
|
|
86
|
+
_dict['campaignArtifactId'] = None
|
|
87
|
+
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of UpdateWorkflowConfigRequest from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"pipelineId": obj.get("pipelineId"),
|
|
101
|
+
"artifactId": obj.get("artifactId"),
|
|
102
|
+
"config": UpdateWorkflowConfigRequestConfig.from_dict(obj["config"]) if obj.get("config") is not None else None,
|
|
103
|
+
"campaignArtifactId": obj.get("campaignArtifactId")
|
|
104
|
+
})
|
|
105
|
+
return _obj
|
|
106
|
+
|
|
107
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
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 json
|
|
17
|
+
import pprint
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
+
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.compare_workflow_config_model import CompareWorkflowConfigModel
|
|
21
|
+
from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
UPDATEWORKFLOWCONFIGREQUESTCONFIG_ONE_OF_SCHEMAS = ["CompareWorkflowConfigModel", "SimpleWorkflowConfigModel"]
|
|
27
|
+
|
|
28
|
+
class UpdateWorkflowConfigRequestConfig(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The new workflow configuration.
|
|
31
|
+
"""
|
|
32
|
+
# data type: CompareWorkflowConfigModel
|
|
33
|
+
oneof_schema_1_validator: Optional[CompareWorkflowConfigModel] = None
|
|
34
|
+
# data type: SimpleWorkflowConfigModel
|
|
35
|
+
oneof_schema_2_validator: Optional[SimpleWorkflowConfigModel] = None
|
|
36
|
+
actual_instance: Optional[Union[CompareWorkflowConfigModel, SimpleWorkflowConfigModel]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "CompareWorkflowConfigModel", "SimpleWorkflowConfigModel" }
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
49
|
+
if args:
|
|
50
|
+
if len(args) > 1:
|
|
51
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
52
|
+
if kwargs:
|
|
53
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
54
|
+
super().__init__(actual_instance=args[0])
|
|
55
|
+
else:
|
|
56
|
+
super().__init__(**kwargs)
|
|
57
|
+
|
|
58
|
+
@field_validator('actual_instance')
|
|
59
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
60
|
+
instance = UpdateWorkflowConfigRequestConfig.model_construct()
|
|
61
|
+
error_messages = []
|
|
62
|
+
match = 0
|
|
63
|
+
# validate data type: CompareWorkflowConfigModel
|
|
64
|
+
if not isinstance(v, CompareWorkflowConfigModel):
|
|
65
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareWorkflowConfigModel`")
|
|
66
|
+
else:
|
|
67
|
+
match += 1
|
|
68
|
+
# validate data type: SimpleWorkflowConfigModel
|
|
69
|
+
if not isinstance(v, SimpleWorkflowConfigModel):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowConfigModel`")
|
|
71
|
+
else:
|
|
72
|
+
match += 1
|
|
73
|
+
if match > 1:
|
|
74
|
+
# more than 1 match
|
|
75
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in UpdateWorkflowConfigRequestConfig with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
76
|
+
elif match == 0:
|
|
77
|
+
# no match
|
|
78
|
+
raise ValueError("No match found when setting `actual_instance` in UpdateWorkflowConfigRequestConfig with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
79
|
+
else:
|
|
80
|
+
return v
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
84
|
+
return cls.from_json(json.dumps(obj))
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_json(cls, json_str: str) -> Self:
|
|
88
|
+
"""Returns the object represented by the json string"""
|
|
89
|
+
instance = cls.model_construct()
|
|
90
|
+
error_messages = []
|
|
91
|
+
match = 0
|
|
92
|
+
|
|
93
|
+
# deserialize data into CompareWorkflowConfigModel
|
|
94
|
+
try:
|
|
95
|
+
instance.actual_instance = CompareWorkflowConfigModel.from_json(json_str)
|
|
96
|
+
match += 1
|
|
97
|
+
except (ValidationError, ValueError) as e:
|
|
98
|
+
error_messages.append(str(e))
|
|
99
|
+
# deserialize data into SimpleWorkflowConfigModel
|
|
100
|
+
try:
|
|
101
|
+
instance.actual_instance = SimpleWorkflowConfigModel.from_json(json_str)
|
|
102
|
+
match += 1
|
|
103
|
+
except (ValidationError, ValueError) as e:
|
|
104
|
+
error_messages.append(str(e))
|
|
105
|
+
|
|
106
|
+
if match > 1:
|
|
107
|
+
# more than 1 match
|
|
108
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into UpdateWorkflowConfigRequestConfig with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
109
|
+
elif match == 0:
|
|
110
|
+
# no match
|
|
111
|
+
raise ValueError("No match found when deserializing the JSON string into UpdateWorkflowConfigRequestConfig with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
|
|
112
|
+
else:
|
|
113
|
+
return instance
|
|
114
|
+
|
|
115
|
+
def to_json(self) -> str:
|
|
116
|
+
"""Returns the JSON representation of the actual instance"""
|
|
117
|
+
if self.actual_instance is None:
|
|
118
|
+
return "null"
|
|
119
|
+
|
|
120
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
121
|
+
return self.actual_instance.to_json()
|
|
122
|
+
else:
|
|
123
|
+
return json.dumps(self.actual_instance)
|
|
124
|
+
|
|
125
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowConfigModel, SimpleWorkflowConfigModel]]:
|
|
126
|
+
"""Returns the dict representation of the actual instance"""
|
|
127
|
+
if self.actual_instance is None:
|
|
128
|
+
return None
|
|
129
|
+
|
|
130
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
131
|
+
return self.actual_instance.to_dict()
|
|
132
|
+
else:
|
|
133
|
+
# primitive type
|
|
134
|
+
return self.actual_instance
|
|
135
|
+
|
|
136
|
+
def to_str(self) -> str:
|
|
137
|
+
"""Returns the string representation of the actual instance"""
|
|
138
|
+
return pprint.pformat(self.model_dump())
|
|
139
|
+
|
|
140
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
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
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class WorkflowArtifactModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
WorkflowArtifactModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for WorkflowArtifactModel", alias="_t")
|
|
30
|
+
workflow_id: StrictStr = Field(alias="workflowId")
|
|
31
|
+
identifier: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "workflowId", "identifier"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['WorkflowArtifactModel']):
|
|
38
|
+
raise ValueError("must be one of enum values ('WorkflowArtifactModel')")
|
|
39
|
+
return value
|
|
40
|
+
|
|
41
|
+
model_config = ConfigDict(
|
|
42
|
+
populate_by_name=True,
|
|
43
|
+
validate_assignment=True,
|
|
44
|
+
protected_namespaces=(),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def to_str(self) -> str:
|
|
49
|
+
"""Returns the string representation of the model using alias"""
|
|
50
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
51
|
+
|
|
52
|
+
def to_json(self) -> str:
|
|
53
|
+
"""Returns the JSON representation of the model using alias"""
|
|
54
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
55
|
+
return json.dumps(self.to_dict())
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
+
"""Create an instance of WorkflowArtifactModel from a JSON string"""
|
|
60
|
+
return cls.from_dict(json.loads(json_str))
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
63
|
+
"""Return the dictionary representation of the model using alias.
|
|
64
|
+
|
|
65
|
+
This has the following differences from calling pydantic's
|
|
66
|
+
`self.model_dump(by_alias=True)`:
|
|
67
|
+
|
|
68
|
+
* `None` is only added to the output dict for nullable fields that
|
|
69
|
+
were set at model initialization. Other fields with value `None`
|
|
70
|
+
are ignored.
|
|
71
|
+
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
75
|
+
_dict = self.model_dump(
|
|
76
|
+
by_alias=True,
|
|
77
|
+
exclude=excluded_fields,
|
|
78
|
+
exclude_none=True,
|
|
79
|
+
)
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of WorkflowArtifactModel from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'WorkflowArtifactModel',
|
|
93
|
+
"workflowId": obj.get("workflowId"),
|
|
94
|
+
"identifier": obj.get("identifier")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
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
|
|
22
|
+
from rapidata.api_client.models.workflow_config_artifact_model_workflow_config import WorkflowConfigArtifactModelWorkflowConfig
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class WorkflowConfigArtifactModel(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
WorkflowConfigArtifactModel
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for WorkflowConfigArtifactModel", alias="_t")
|
|
31
|
+
workflow_config: WorkflowConfigArtifactModelWorkflowConfig = Field(alias="workflowConfig")
|
|
32
|
+
identifier: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "workflowConfig", "identifier"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['WorkflowConfigArtifactModel']):
|
|
39
|
+
raise ValueError("must be one of enum values ('WorkflowConfigArtifactModel')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of WorkflowConfigArtifactModel from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of workflow_config
|
|
82
|
+
if self.workflow_config:
|
|
83
|
+
_dict['workflowConfig'] = self.workflow_config.to_dict()
|
|
84
|
+
return _dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
88
|
+
"""Create an instance of WorkflowConfigArtifactModel from a dict"""
|
|
89
|
+
if obj is None:
|
|
90
|
+
return None
|
|
91
|
+
|
|
92
|
+
if not isinstance(obj, dict):
|
|
93
|
+
return cls.model_validate(obj)
|
|
94
|
+
|
|
95
|
+
_obj = cls.model_validate({
|
|
96
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'WorkflowConfigArtifactModel',
|
|
97
|
+
"workflowConfig": WorkflowConfigArtifactModelWorkflowConfig.from_dict(obj["workflowConfig"]) if obj.get("workflowConfig") is not None else None,
|
|
98
|
+
"identifier": obj.get("identifier")
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|