rapidata 2.18.0__py3-none-any.whl → 2.19.0__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.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/__init__.py +2 -0
- rapidata/api_client/__init__.py +7 -5
- rapidata/api_client/api/order_api.py +3 -6
- rapidata/api_client/api/pipeline_api.py +665 -98
- rapidata/api_client/api/validation_set_api.py +6 -6
- rapidata/api_client/models/__init__.py +7 -5
- rapidata/api_client/models/add_user_response_result.py +3 -3
- rapidata/api_client/models/campaign_query_result.py +2 -2
- rapidata/api_client/models/campaign_status.py +2 -1
- rapidata/api_client/models/create_order_model_user_filters_inner.py +39 -9
- rapidata/api_client/models/get_simple_workflow_results_result.py +3 -3
- rapidata/api_client/models/get_validation_rapids_result.py +143 -0
- rapidata/api_client/models/get_validation_rapids_result_asset.py +174 -0
- rapidata/api_client/models/get_validation_rapids_result_paged_result.py +105 -0
- rapidata/api_client/models/get_validation_rapids_result_payload.py +252 -0
- rapidata/api_client/models/get_validation_rapids_result_truth.py +258 -0
- rapidata/api_client/models/not_user_filter_model.py +102 -0
- rapidata/api_client/models/or_user_filter_model.py +106 -0
- rapidata/api_client/models/query_validation_rapids_result.py +9 -9
- rapidata/api_client_README.md +9 -5
- rapidata/rapidata_client/__init__.py +2 -0
- rapidata/rapidata_client/filter/__init__.py +2 -0
- rapidata/rapidata_client/filter/not_filter.py +30 -0
- rapidata/rapidata_client/filter/or_filter.py +30 -0
- rapidata/rapidata_client/filter/rapidata_filters.py +6 -3
- {rapidata-2.18.0.dist-info → rapidata-2.19.0.dist-info}/METADATA +1 -1
- {rapidata-2.18.0.dist-info → rapidata-2.19.0.dist-info}/RECORD +29 -20
- {rapidata-2.18.0.dist-info → rapidata-2.19.0.dist-info}/LICENSE +0 -0
- {rapidata-2.18.0.dist-info → rapidata-2.19.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,105 @@
|
|
|
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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.get_validation_rapids_result import GetValidationRapidsResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetValidationRapidsResultPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetValidationRapidsResultPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[GetValidationRapidsResult]
|
|
34
|
+
total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of GetValidationRapidsResultPagedResult from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
"total_pages",
|
|
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 each item in items (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.items:
|
|
81
|
+
for _item_items in self.items:
|
|
82
|
+
if _item_items:
|
|
83
|
+
_items.append(_item_items.to_dict())
|
|
84
|
+
_dict['items'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of GetValidationRapidsResultPagedResult from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"total": obj.get("total"),
|
|
98
|
+
"page": obj.get("page"),
|
|
99
|
+
"pageSize": obj.get("pageSize"),
|
|
100
|
+
"items": [GetValidationRapidsResult.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
101
|
+
"totalPages": obj.get("totalPages")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
|
@@ -0,0 +1,252 @@
|
|
|
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.bounding_box_payload import BoundingBoxPayload
|
|
21
|
+
from rapidata.api_client.models.classify_payload import ClassifyPayload
|
|
22
|
+
from rapidata.api_client.models.compare_payload import ComparePayload
|
|
23
|
+
from rapidata.api_client.models.free_text_payload import FreeTextPayload
|
|
24
|
+
from rapidata.api_client.models.line_payload import LinePayload
|
|
25
|
+
from rapidata.api_client.models.locate_payload import LocatePayload
|
|
26
|
+
from rapidata.api_client.models.named_entity_payload import NamedEntityPayload
|
|
27
|
+
from rapidata.api_client.models.polygon_payload import PolygonPayload
|
|
28
|
+
from rapidata.api_client.models.scrub_payload import ScrubPayload
|
|
29
|
+
from rapidata.api_client.models.transcription_payload import TranscriptionPayload
|
|
30
|
+
from pydantic import StrictStr, Field
|
|
31
|
+
from typing import Union, List, Set, Optional, Dict
|
|
32
|
+
from typing_extensions import Literal, Self
|
|
33
|
+
|
|
34
|
+
GETVALIDATIONRAPIDSRESULTPAYLOAD_ONE_OF_SCHEMAS = ["BoundingBoxPayload", "ClassifyPayload", "ComparePayload", "FreeTextPayload", "LinePayload", "LocatePayload", "NamedEntityPayload", "PolygonPayload", "ScrubPayload", "TranscriptionPayload"]
|
|
35
|
+
|
|
36
|
+
class GetValidationRapidsResultPayload(BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
GetValidationRapidsResultPayload
|
|
39
|
+
"""
|
|
40
|
+
# data type: TranscriptionPayload
|
|
41
|
+
oneof_schema_1_validator: Optional[TranscriptionPayload] = None
|
|
42
|
+
# data type: ScrubPayload
|
|
43
|
+
oneof_schema_2_validator: Optional[ScrubPayload] = None
|
|
44
|
+
# data type: PolygonPayload
|
|
45
|
+
oneof_schema_3_validator: Optional[PolygonPayload] = None
|
|
46
|
+
# data type: NamedEntityPayload
|
|
47
|
+
oneof_schema_4_validator: Optional[NamedEntityPayload] = None
|
|
48
|
+
# data type: LocatePayload
|
|
49
|
+
oneof_schema_5_validator: Optional[LocatePayload] = None
|
|
50
|
+
# data type: LinePayload
|
|
51
|
+
oneof_schema_6_validator: Optional[LinePayload] = None
|
|
52
|
+
# data type: FreeTextPayload
|
|
53
|
+
oneof_schema_7_validator: Optional[FreeTextPayload] = None
|
|
54
|
+
# data type: ComparePayload
|
|
55
|
+
oneof_schema_8_validator: Optional[ComparePayload] = None
|
|
56
|
+
# data type: ClassifyPayload
|
|
57
|
+
oneof_schema_9_validator: Optional[ClassifyPayload] = None
|
|
58
|
+
# data type: BoundingBoxPayload
|
|
59
|
+
oneof_schema_10_validator: Optional[BoundingBoxPayload] = None
|
|
60
|
+
actual_instance: Optional[Union[BoundingBoxPayload, ClassifyPayload, ComparePayload, FreeTextPayload, LinePayload, LocatePayload, NamedEntityPayload, PolygonPayload, ScrubPayload, TranscriptionPayload]] = None
|
|
61
|
+
one_of_schemas: Set[str] = { "BoundingBoxPayload", "ClassifyPayload", "ComparePayload", "FreeTextPayload", "LinePayload", "LocatePayload", "NamedEntityPayload", "PolygonPayload", "ScrubPayload", "TranscriptionPayload" }
|
|
62
|
+
|
|
63
|
+
model_config = ConfigDict(
|
|
64
|
+
validate_assignment=True,
|
|
65
|
+
protected_namespaces=(),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
73
|
+
if args:
|
|
74
|
+
if len(args) > 1:
|
|
75
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
76
|
+
if kwargs:
|
|
77
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
78
|
+
super().__init__(actual_instance=args[0])
|
|
79
|
+
else:
|
|
80
|
+
super().__init__(**kwargs)
|
|
81
|
+
|
|
82
|
+
@field_validator('actual_instance')
|
|
83
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
84
|
+
instance = GetValidationRapidsResultPayload.model_construct()
|
|
85
|
+
error_messages = []
|
|
86
|
+
match = 0
|
|
87
|
+
# validate data type: TranscriptionPayload
|
|
88
|
+
if not isinstance(v, TranscriptionPayload):
|
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionPayload`")
|
|
90
|
+
else:
|
|
91
|
+
match += 1
|
|
92
|
+
# validate data type: ScrubPayload
|
|
93
|
+
if not isinstance(v, ScrubPayload):
|
|
94
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubPayload`")
|
|
95
|
+
else:
|
|
96
|
+
match += 1
|
|
97
|
+
# validate data type: PolygonPayload
|
|
98
|
+
if not isinstance(v, PolygonPayload):
|
|
99
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonPayload`")
|
|
100
|
+
else:
|
|
101
|
+
match += 1
|
|
102
|
+
# validate data type: NamedEntityPayload
|
|
103
|
+
if not isinstance(v, NamedEntityPayload):
|
|
104
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityPayload`")
|
|
105
|
+
else:
|
|
106
|
+
match += 1
|
|
107
|
+
# validate data type: LocatePayload
|
|
108
|
+
if not isinstance(v, LocatePayload):
|
|
109
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LocatePayload`")
|
|
110
|
+
else:
|
|
111
|
+
match += 1
|
|
112
|
+
# validate data type: LinePayload
|
|
113
|
+
if not isinstance(v, LinePayload):
|
|
114
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LinePayload`")
|
|
115
|
+
else:
|
|
116
|
+
match += 1
|
|
117
|
+
# validate data type: FreeTextPayload
|
|
118
|
+
if not isinstance(v, FreeTextPayload):
|
|
119
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FreeTextPayload`")
|
|
120
|
+
else:
|
|
121
|
+
match += 1
|
|
122
|
+
# validate data type: ComparePayload
|
|
123
|
+
if not isinstance(v, ComparePayload):
|
|
124
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ComparePayload`")
|
|
125
|
+
else:
|
|
126
|
+
match += 1
|
|
127
|
+
# validate data type: ClassifyPayload
|
|
128
|
+
if not isinstance(v, ClassifyPayload):
|
|
129
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ClassifyPayload`")
|
|
130
|
+
else:
|
|
131
|
+
match += 1
|
|
132
|
+
# validate data type: BoundingBoxPayload
|
|
133
|
+
if not isinstance(v, BoundingBoxPayload):
|
|
134
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxPayload`")
|
|
135
|
+
else:
|
|
136
|
+
match += 1
|
|
137
|
+
if match > 1:
|
|
138
|
+
# more than 1 match
|
|
139
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in GetValidationRapidsResultPayload with oneOf schemas: BoundingBoxPayload, ClassifyPayload, ComparePayload, FreeTextPayload, LinePayload, LocatePayload, NamedEntityPayload, PolygonPayload, ScrubPayload, TranscriptionPayload. Details: " + ", ".join(error_messages))
|
|
140
|
+
elif match == 0:
|
|
141
|
+
# no match
|
|
142
|
+
raise ValueError("No match found when setting `actual_instance` in GetValidationRapidsResultPayload with oneOf schemas: BoundingBoxPayload, ClassifyPayload, ComparePayload, FreeTextPayload, LinePayload, LocatePayload, NamedEntityPayload, PolygonPayload, ScrubPayload, TranscriptionPayload. Details: " + ", ".join(error_messages))
|
|
143
|
+
else:
|
|
144
|
+
return v
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
148
|
+
return cls.from_json(json.dumps(obj))
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def from_json(cls, json_str: str) -> Self:
|
|
152
|
+
"""Returns the object represented by the json string"""
|
|
153
|
+
instance = cls.model_construct()
|
|
154
|
+
error_messages = []
|
|
155
|
+
match = 0
|
|
156
|
+
|
|
157
|
+
# deserialize data into TranscriptionPayload
|
|
158
|
+
try:
|
|
159
|
+
instance.actual_instance = TranscriptionPayload.from_json(json_str)
|
|
160
|
+
match += 1
|
|
161
|
+
except (ValidationError, ValueError) as e:
|
|
162
|
+
error_messages.append(str(e))
|
|
163
|
+
# deserialize data into ScrubPayload
|
|
164
|
+
try:
|
|
165
|
+
instance.actual_instance = ScrubPayload.from_json(json_str)
|
|
166
|
+
match += 1
|
|
167
|
+
except (ValidationError, ValueError) as e:
|
|
168
|
+
error_messages.append(str(e))
|
|
169
|
+
# deserialize data into PolygonPayload
|
|
170
|
+
try:
|
|
171
|
+
instance.actual_instance = PolygonPayload.from_json(json_str)
|
|
172
|
+
match += 1
|
|
173
|
+
except (ValidationError, ValueError) as e:
|
|
174
|
+
error_messages.append(str(e))
|
|
175
|
+
# deserialize data into NamedEntityPayload
|
|
176
|
+
try:
|
|
177
|
+
instance.actual_instance = NamedEntityPayload.from_json(json_str)
|
|
178
|
+
match += 1
|
|
179
|
+
except (ValidationError, ValueError) as e:
|
|
180
|
+
error_messages.append(str(e))
|
|
181
|
+
# deserialize data into LocatePayload
|
|
182
|
+
try:
|
|
183
|
+
instance.actual_instance = LocatePayload.from_json(json_str)
|
|
184
|
+
match += 1
|
|
185
|
+
except (ValidationError, ValueError) as e:
|
|
186
|
+
error_messages.append(str(e))
|
|
187
|
+
# deserialize data into LinePayload
|
|
188
|
+
try:
|
|
189
|
+
instance.actual_instance = LinePayload.from_json(json_str)
|
|
190
|
+
match += 1
|
|
191
|
+
except (ValidationError, ValueError) as e:
|
|
192
|
+
error_messages.append(str(e))
|
|
193
|
+
# deserialize data into FreeTextPayload
|
|
194
|
+
try:
|
|
195
|
+
instance.actual_instance = FreeTextPayload.from_json(json_str)
|
|
196
|
+
match += 1
|
|
197
|
+
except (ValidationError, ValueError) as e:
|
|
198
|
+
error_messages.append(str(e))
|
|
199
|
+
# deserialize data into ComparePayload
|
|
200
|
+
try:
|
|
201
|
+
instance.actual_instance = ComparePayload.from_json(json_str)
|
|
202
|
+
match += 1
|
|
203
|
+
except (ValidationError, ValueError) as e:
|
|
204
|
+
error_messages.append(str(e))
|
|
205
|
+
# deserialize data into ClassifyPayload
|
|
206
|
+
try:
|
|
207
|
+
instance.actual_instance = ClassifyPayload.from_json(json_str)
|
|
208
|
+
match += 1
|
|
209
|
+
except (ValidationError, ValueError) as e:
|
|
210
|
+
error_messages.append(str(e))
|
|
211
|
+
# deserialize data into BoundingBoxPayload
|
|
212
|
+
try:
|
|
213
|
+
instance.actual_instance = BoundingBoxPayload.from_json(json_str)
|
|
214
|
+
match += 1
|
|
215
|
+
except (ValidationError, ValueError) as e:
|
|
216
|
+
error_messages.append(str(e))
|
|
217
|
+
|
|
218
|
+
if match > 1:
|
|
219
|
+
# more than 1 match
|
|
220
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into GetValidationRapidsResultPayload with oneOf schemas: BoundingBoxPayload, ClassifyPayload, ComparePayload, FreeTextPayload, LinePayload, LocatePayload, NamedEntityPayload, PolygonPayload, ScrubPayload, TranscriptionPayload. Details: " + ", ".join(error_messages))
|
|
221
|
+
elif match == 0:
|
|
222
|
+
# no match
|
|
223
|
+
raise ValueError("No match found when deserializing the JSON string into GetValidationRapidsResultPayload with oneOf schemas: BoundingBoxPayload, ClassifyPayload, ComparePayload, FreeTextPayload, LinePayload, LocatePayload, NamedEntityPayload, PolygonPayload, ScrubPayload, TranscriptionPayload. Details: " + ", ".join(error_messages))
|
|
224
|
+
else:
|
|
225
|
+
return instance
|
|
226
|
+
|
|
227
|
+
def to_json(self) -> str:
|
|
228
|
+
"""Returns the JSON representation of the actual instance"""
|
|
229
|
+
if self.actual_instance is None:
|
|
230
|
+
return "null"
|
|
231
|
+
|
|
232
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
233
|
+
return self.actual_instance.to_json()
|
|
234
|
+
else:
|
|
235
|
+
return json.dumps(self.actual_instance)
|
|
236
|
+
|
|
237
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], BoundingBoxPayload, ClassifyPayload, ComparePayload, FreeTextPayload, LinePayload, LocatePayload, NamedEntityPayload, PolygonPayload, ScrubPayload, TranscriptionPayload]]:
|
|
238
|
+
"""Returns the dict representation of the actual instance"""
|
|
239
|
+
if self.actual_instance is None:
|
|
240
|
+
return None
|
|
241
|
+
|
|
242
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
243
|
+
return self.actual_instance.to_dict()
|
|
244
|
+
else:
|
|
245
|
+
# primitive type
|
|
246
|
+
return self.actual_instance
|
|
247
|
+
|
|
248
|
+
def to_str(self) -> str:
|
|
249
|
+
"""Returns the string representation of the actual instance"""
|
|
250
|
+
return pprint.pformat(self.model_dump())
|
|
251
|
+
|
|
252
|
+
|
|
@@ -0,0 +1,258 @@
|
|
|
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_truth import AttachCategoryTruth
|
|
21
|
+
from rapidata.api_client.models.bounding_box_truth import BoundingBoxTruth
|
|
22
|
+
from rapidata.api_client.models.compare_truth import CompareTruth
|
|
23
|
+
from rapidata.api_client.models.empty_validation_truth import EmptyValidationTruth
|
|
24
|
+
from rapidata.api_client.models.line_truth import LineTruth
|
|
25
|
+
from rapidata.api_client.models.locate_box_truth import LocateBoxTruth
|
|
26
|
+
from rapidata.api_client.models.named_entity_truth import NamedEntityTruth
|
|
27
|
+
from rapidata.api_client.models.polygon_truth import PolygonTruth
|
|
28
|
+
from rapidata.api_client.models.scrub_truth import ScrubTruth
|
|
29
|
+
from rapidata.api_client.models.transcription_truth import TranscriptionTruth
|
|
30
|
+
from pydantic import StrictStr, Field
|
|
31
|
+
from typing import Union, List, Set, Optional, Dict
|
|
32
|
+
from typing_extensions import Literal, Self
|
|
33
|
+
|
|
34
|
+
GETVALIDATIONRAPIDSRESULTTRUTH_ONE_OF_SCHEMAS = ["AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "TranscriptionTruth"]
|
|
35
|
+
|
|
36
|
+
class GetValidationRapidsResultTruth(BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
GetValidationRapidsResultTruth
|
|
39
|
+
"""
|
|
40
|
+
# data type: TranscriptionTruth
|
|
41
|
+
oneof_schema_1_validator: Optional[TranscriptionTruth] = None
|
|
42
|
+
# data type: ScrubTruth
|
|
43
|
+
oneof_schema_2_validator: Optional[ScrubTruth] = None
|
|
44
|
+
# data type: PolygonTruth
|
|
45
|
+
oneof_schema_3_validator: Optional[PolygonTruth] = None
|
|
46
|
+
# data type: NamedEntityTruth
|
|
47
|
+
oneof_schema_4_validator: Optional[NamedEntityTruth] = None
|
|
48
|
+
# data type: LocateBoxTruth
|
|
49
|
+
oneof_schema_5_validator: Optional[LocateBoxTruth] = None
|
|
50
|
+
# data type: LineTruth
|
|
51
|
+
oneof_schema_6_validator: Optional[LineTruth] = None
|
|
52
|
+
# data type: EmptyValidationTruth
|
|
53
|
+
oneof_schema_7_validator: Optional[EmptyValidationTruth] = None
|
|
54
|
+
# data type: CompareTruth
|
|
55
|
+
oneof_schema_8_validator: Optional[CompareTruth] = None
|
|
56
|
+
# data type: AttachCategoryTruth
|
|
57
|
+
oneof_schema_9_validator: Optional[AttachCategoryTruth] = None
|
|
58
|
+
# data type: BoundingBoxTruth
|
|
59
|
+
oneof_schema_10_validator: Optional[BoundingBoxTruth] = None
|
|
60
|
+
actual_instance: Optional[Union[AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth]] = None
|
|
61
|
+
one_of_schemas: Set[str] = { "AttachCategoryTruth", "BoundingBoxTruth", "CompareTruth", "EmptyValidationTruth", "LineTruth", "LocateBoxTruth", "NamedEntityTruth", "PolygonTruth", "ScrubTruth", "TranscriptionTruth" }
|
|
62
|
+
|
|
63
|
+
model_config = ConfigDict(
|
|
64
|
+
validate_assignment=True,
|
|
65
|
+
protected_namespaces=(),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
73
|
+
if args:
|
|
74
|
+
if len(args) > 1:
|
|
75
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
76
|
+
if kwargs:
|
|
77
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
78
|
+
super().__init__(actual_instance=args[0])
|
|
79
|
+
else:
|
|
80
|
+
super().__init__(**kwargs)
|
|
81
|
+
|
|
82
|
+
@field_validator('actual_instance')
|
|
83
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
84
|
+
if v is None:
|
|
85
|
+
return v
|
|
86
|
+
|
|
87
|
+
instance = GetValidationRapidsResultTruth.model_construct()
|
|
88
|
+
error_messages = []
|
|
89
|
+
match = 0
|
|
90
|
+
# validate data type: TranscriptionTruth
|
|
91
|
+
if not isinstance(v, TranscriptionTruth):
|
|
92
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionTruth`")
|
|
93
|
+
else:
|
|
94
|
+
match += 1
|
|
95
|
+
# validate data type: ScrubTruth
|
|
96
|
+
if not isinstance(v, ScrubTruth):
|
|
97
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubTruth`")
|
|
98
|
+
else:
|
|
99
|
+
match += 1
|
|
100
|
+
# validate data type: PolygonTruth
|
|
101
|
+
if not isinstance(v, PolygonTruth):
|
|
102
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonTruth`")
|
|
103
|
+
else:
|
|
104
|
+
match += 1
|
|
105
|
+
# validate data type: NamedEntityTruth
|
|
106
|
+
if not isinstance(v, NamedEntityTruth):
|
|
107
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityTruth`")
|
|
108
|
+
else:
|
|
109
|
+
match += 1
|
|
110
|
+
# validate data type: LocateBoxTruth
|
|
111
|
+
if not isinstance(v, LocateBoxTruth):
|
|
112
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LocateBoxTruth`")
|
|
113
|
+
else:
|
|
114
|
+
match += 1
|
|
115
|
+
# validate data type: LineTruth
|
|
116
|
+
if not isinstance(v, LineTruth):
|
|
117
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LineTruth`")
|
|
118
|
+
else:
|
|
119
|
+
match += 1
|
|
120
|
+
# validate data type: EmptyValidationTruth
|
|
121
|
+
if not isinstance(v, EmptyValidationTruth):
|
|
122
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `EmptyValidationTruth`")
|
|
123
|
+
else:
|
|
124
|
+
match += 1
|
|
125
|
+
# validate data type: CompareTruth
|
|
126
|
+
if not isinstance(v, CompareTruth):
|
|
127
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareTruth`")
|
|
128
|
+
else:
|
|
129
|
+
match += 1
|
|
130
|
+
# validate data type: AttachCategoryTruth
|
|
131
|
+
if not isinstance(v, AttachCategoryTruth):
|
|
132
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryTruth`")
|
|
133
|
+
else:
|
|
134
|
+
match += 1
|
|
135
|
+
# validate data type: BoundingBoxTruth
|
|
136
|
+
if not isinstance(v, BoundingBoxTruth):
|
|
137
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxTruth`")
|
|
138
|
+
else:
|
|
139
|
+
match += 1
|
|
140
|
+
if match > 1:
|
|
141
|
+
# more than 1 match
|
|
142
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
143
|
+
elif match == 0:
|
|
144
|
+
# no match
|
|
145
|
+
raise ValueError("No match found when setting `actual_instance` in GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
146
|
+
else:
|
|
147
|
+
return v
|
|
148
|
+
|
|
149
|
+
@classmethod
|
|
150
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
151
|
+
return cls.from_json(json.dumps(obj))
|
|
152
|
+
|
|
153
|
+
@classmethod
|
|
154
|
+
def from_json(cls, json_str: Optional[str]) -> Self:
|
|
155
|
+
"""Returns the object represented by the json string"""
|
|
156
|
+
instance = cls.model_construct()
|
|
157
|
+
if json_str is None:
|
|
158
|
+
return instance
|
|
159
|
+
|
|
160
|
+
error_messages = []
|
|
161
|
+
match = 0
|
|
162
|
+
|
|
163
|
+
# deserialize data into TranscriptionTruth
|
|
164
|
+
try:
|
|
165
|
+
instance.actual_instance = TranscriptionTruth.from_json(json_str)
|
|
166
|
+
match += 1
|
|
167
|
+
except (ValidationError, ValueError) as e:
|
|
168
|
+
error_messages.append(str(e))
|
|
169
|
+
# deserialize data into ScrubTruth
|
|
170
|
+
try:
|
|
171
|
+
instance.actual_instance = ScrubTruth.from_json(json_str)
|
|
172
|
+
match += 1
|
|
173
|
+
except (ValidationError, ValueError) as e:
|
|
174
|
+
error_messages.append(str(e))
|
|
175
|
+
# deserialize data into PolygonTruth
|
|
176
|
+
try:
|
|
177
|
+
instance.actual_instance = PolygonTruth.from_json(json_str)
|
|
178
|
+
match += 1
|
|
179
|
+
except (ValidationError, ValueError) as e:
|
|
180
|
+
error_messages.append(str(e))
|
|
181
|
+
# deserialize data into NamedEntityTruth
|
|
182
|
+
try:
|
|
183
|
+
instance.actual_instance = NamedEntityTruth.from_json(json_str)
|
|
184
|
+
match += 1
|
|
185
|
+
except (ValidationError, ValueError) as e:
|
|
186
|
+
error_messages.append(str(e))
|
|
187
|
+
# deserialize data into LocateBoxTruth
|
|
188
|
+
try:
|
|
189
|
+
instance.actual_instance = LocateBoxTruth.from_json(json_str)
|
|
190
|
+
match += 1
|
|
191
|
+
except (ValidationError, ValueError) as e:
|
|
192
|
+
error_messages.append(str(e))
|
|
193
|
+
# deserialize data into LineTruth
|
|
194
|
+
try:
|
|
195
|
+
instance.actual_instance = LineTruth.from_json(json_str)
|
|
196
|
+
match += 1
|
|
197
|
+
except (ValidationError, ValueError) as e:
|
|
198
|
+
error_messages.append(str(e))
|
|
199
|
+
# deserialize data into EmptyValidationTruth
|
|
200
|
+
try:
|
|
201
|
+
instance.actual_instance = EmptyValidationTruth.from_json(json_str)
|
|
202
|
+
match += 1
|
|
203
|
+
except (ValidationError, ValueError) as e:
|
|
204
|
+
error_messages.append(str(e))
|
|
205
|
+
# deserialize data into CompareTruth
|
|
206
|
+
try:
|
|
207
|
+
instance.actual_instance = CompareTruth.from_json(json_str)
|
|
208
|
+
match += 1
|
|
209
|
+
except (ValidationError, ValueError) as e:
|
|
210
|
+
error_messages.append(str(e))
|
|
211
|
+
# deserialize data into AttachCategoryTruth
|
|
212
|
+
try:
|
|
213
|
+
instance.actual_instance = AttachCategoryTruth.from_json(json_str)
|
|
214
|
+
match += 1
|
|
215
|
+
except (ValidationError, ValueError) as e:
|
|
216
|
+
error_messages.append(str(e))
|
|
217
|
+
# deserialize data into BoundingBoxTruth
|
|
218
|
+
try:
|
|
219
|
+
instance.actual_instance = BoundingBoxTruth.from_json(json_str)
|
|
220
|
+
match += 1
|
|
221
|
+
except (ValidationError, ValueError) as e:
|
|
222
|
+
error_messages.append(str(e))
|
|
223
|
+
|
|
224
|
+
if match > 1:
|
|
225
|
+
# more than 1 match
|
|
226
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
227
|
+
elif match == 0:
|
|
228
|
+
# no match
|
|
229
|
+
raise ValueError("No match found when deserializing the JSON string into GetValidationRapidsResultTruth with oneOf schemas: AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth. Details: " + ", ".join(error_messages))
|
|
230
|
+
else:
|
|
231
|
+
return instance
|
|
232
|
+
|
|
233
|
+
def to_json(self) -> str:
|
|
234
|
+
"""Returns the JSON representation of the actual instance"""
|
|
235
|
+
if self.actual_instance is None:
|
|
236
|
+
return "null"
|
|
237
|
+
|
|
238
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
239
|
+
return self.actual_instance.to_json()
|
|
240
|
+
else:
|
|
241
|
+
return json.dumps(self.actual_instance)
|
|
242
|
+
|
|
243
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryTruth, BoundingBoxTruth, CompareTruth, EmptyValidationTruth, LineTruth, LocateBoxTruth, NamedEntityTruth, PolygonTruth, ScrubTruth, TranscriptionTruth]]:
|
|
244
|
+
"""Returns the dict representation of the actual instance"""
|
|
245
|
+
if self.actual_instance is None:
|
|
246
|
+
return None
|
|
247
|
+
|
|
248
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
249
|
+
return self.actual_instance.to_dict()
|
|
250
|
+
else:
|
|
251
|
+
# primitive type
|
|
252
|
+
return self.actual_instance
|
|
253
|
+
|
|
254
|
+
def to_str(self) -> str:
|
|
255
|
+
"""Returns the string representation of the actual instance"""
|
|
256
|
+
return pprint.pformat(self.model_dump())
|
|
257
|
+
|
|
258
|
+
|