rapidata 0.1.18__py3-none-any.whl → 0.1.20__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.
Files changed (54) hide show
  1. rapidata/api_client/__init__.py +26 -0
  2. rapidata/api_client/api/__init__.py +1 -0
  3. rapidata/api_client/api/rapid_api.py +1370 -0
  4. rapidata/api_client/api/validation_api.py +15 -5
  5. rapidata/api_client/models/__init__.py +25 -0
  6. rapidata/api_client/models/add_validation_rapid_result.py +87 -0
  7. rapidata/api_client/models/attach_category_result.py +98 -0
  8. rapidata/api_client/models/bounding_box_result.py +106 -0
  9. rapidata/api_client/models/classification_metadata.py +0 -10
  10. rapidata/api_client/models/compare_result.py +98 -0
  11. rapidata/api_client/models/coordinate.py +108 -0
  12. rapidata/api_client/models/count_metadata.py +0 -10
  13. rapidata/api_client/models/create_demographic_rapid_model.py +93 -0
  14. rapidata/api_client/models/create_order_model_referee.py +22 -8
  15. rapidata/api_client/models/early_stopping_referee_model.py +98 -0
  16. rapidata/api_client/models/free_text_result.py +98 -0
  17. rapidata/api_client/models/image_dimension_metadata.py +0 -10
  18. rapidata/api_client/models/line.py +106 -0
  19. rapidata/api_client/models/line_point.py +98 -0
  20. rapidata/api_client/models/line_result.py +106 -0
  21. rapidata/api_client/models/locate_coordinate.py +98 -0
  22. rapidata/api_client/models/locate_result.py +106 -0
  23. rapidata/api_client/models/location_metadata.py +0 -10
  24. rapidata/api_client/models/named_entity_result.py +106 -0
  25. rapidata/api_client/models/order_query_get200_response.py +12 -12
  26. rapidata/api_client/models/original_filename_metadata.py +0 -10
  27. rapidata/api_client/models/polygon_result.py +106 -0
  28. rapidata/api_client/models/prompt_metadata.py +0 -10
  29. rapidata/api_client/models/query_model.py +112 -0
  30. rapidata/api_client/models/query_validation_rapids_result.py +98 -0
  31. rapidata/api_client/models/query_validation_rapids_result_asset.py +174 -0
  32. rapidata/api_client/models/query_validation_rapids_result_paged_result.py +105 -0
  33. rapidata/api_client/models/rapid_result_model.py +93 -0
  34. rapidata/api_client/models/rapid_result_model_result.py +252 -0
  35. rapidata/api_client/models/rapid_skipped_model.py +89 -0
  36. rapidata/api_client/models/shape.py +104 -0
  37. rapidata/api_client/models/skip_result.py +96 -0
  38. rapidata/api_client/models/text_metadata.py +0 -7
  39. rapidata/api_client/models/transcription_metadata.py +0 -7
  40. rapidata/api_client/models/transcription_result.py +106 -0
  41. rapidata/rapidata_client/config.py +9 -0
  42. rapidata/rapidata_client/dataset/rapidata_dataset.py +1 -2
  43. rapidata/rapidata_client/dataset/rapidata_validation_set.py +1 -2
  44. rapidata/rapidata_client/dataset/validation_rapid_parts.py +1 -2
  45. rapidata/rapidata_client/order/rapidata_order_builder.py +4 -4
  46. rapidata/rapidata_client/rapidata_client.py +5 -0
  47. rapidata/rapidata_client/utils/__init__.py +0 -0
  48. rapidata/rapidata_client/utils/utils.py +22 -0
  49. rapidata/service/openapi_service.py +6 -2
  50. {rapidata-0.1.18.dist-info → rapidata-0.1.20.dist-info}/METADATA +3 -2
  51. {rapidata-0.1.18.dist-info → rapidata-0.1.20.dist-info}/RECORD +53 -25
  52. rapidata/rapidata_client/types/__init__.py +0 -1
  53. {rapidata-0.1.18.dist-info → rapidata-0.1.20.dist-info}/LICENSE +0 -0
  54. {rapidata-0.1.18.dist-info → rapidata-0.1.20.dist-info}/WHEEL +0 -0
@@ -0,0 +1,93 @@
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
22
+ from rapidata.api_client.models.rapid_result_model_result import RapidResultModelResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class RapidResultModel(BaseModel):
27
+ """
28
+ The model for a Rapid result.
29
+ """ # noqa: E501
30
+ session_index: StrictInt = Field(description="The index of the session when the result was submitted.", alias="sessionIndex")
31
+ result: RapidResultModelResult
32
+ __properties: ClassVar[List[str]] = ["sessionIndex", "result"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of RapidResultModel from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of result
74
+ if self.result:
75
+ _dict['result'] = self.result.to_dict()
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of RapidResultModel from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "sessionIndex": obj.get("sessionIndex"),
89
+ "result": RapidResultModelResult.from_dict(obj["result"]) if obj.get("result") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -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.attach_category_result import AttachCategoryResult
21
+ from rapidata.api_client.models.bounding_box_result import BoundingBoxResult
22
+ from rapidata.api_client.models.compare_result import CompareResult
23
+ from rapidata.api_client.models.free_text_result import FreeTextResult
24
+ from rapidata.api_client.models.line_result import LineResult
25
+ from rapidata.api_client.models.locate_result import LocateResult
26
+ from rapidata.api_client.models.named_entity_result import NamedEntityResult
27
+ from rapidata.api_client.models.polygon_result import PolygonResult
28
+ from rapidata.api_client.models.skip_result import SkipResult
29
+ from rapidata.api_client.models.transcription_result import TranscriptionResult
30
+ from pydantic import StrictStr, Field
31
+ from typing import Union, List, Set, Optional, Dict
32
+ from typing_extensions import Literal, Self
33
+
34
+ RAPIDRESULTMODELRESULT_ONE_OF_SCHEMAS = ["AttachCategoryResult", "BoundingBoxResult", "CompareResult", "FreeTextResult", "LineResult", "LocateResult", "NamedEntityResult", "PolygonResult", "SkipResult", "TranscriptionResult"]
35
+
36
+ class RapidResultModelResult(BaseModel):
37
+ """
38
+ The guess that was submitted.
39
+ """
40
+ # data type: TranscriptionResult
41
+ oneof_schema_1_validator: Optional[TranscriptionResult] = None
42
+ # data type: PolygonResult
43
+ oneof_schema_2_validator: Optional[PolygonResult] = None
44
+ # data type: NamedEntityResult
45
+ oneof_schema_3_validator: Optional[NamedEntityResult] = None
46
+ # data type: LocateResult
47
+ oneof_schema_4_validator: Optional[LocateResult] = None
48
+ # data type: LineResult
49
+ oneof_schema_5_validator: Optional[LineResult] = None
50
+ # data type: FreeTextResult
51
+ oneof_schema_6_validator: Optional[FreeTextResult] = None
52
+ # data type: CompareResult
53
+ oneof_schema_7_validator: Optional[CompareResult] = None
54
+ # data type: SkipResult
55
+ oneof_schema_8_validator: Optional[SkipResult] = None
56
+ # data type: AttachCategoryResult
57
+ oneof_schema_9_validator: Optional[AttachCategoryResult] = None
58
+ # data type: BoundingBoxResult
59
+ oneof_schema_10_validator: Optional[BoundingBoxResult] = None
60
+ actual_instance: Optional[Union[AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, SkipResult, TranscriptionResult]] = None
61
+ one_of_schemas: Set[str] = { "AttachCategoryResult", "BoundingBoxResult", "CompareResult", "FreeTextResult", "LineResult", "LocateResult", "NamedEntityResult", "PolygonResult", "SkipResult", "TranscriptionResult" }
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 = RapidResultModelResult.model_construct()
85
+ error_messages = []
86
+ match = 0
87
+ # validate data type: TranscriptionResult
88
+ if not isinstance(v, TranscriptionResult):
89
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionResult`")
90
+ else:
91
+ match += 1
92
+ # validate data type: PolygonResult
93
+ if not isinstance(v, PolygonResult):
94
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonResult`")
95
+ else:
96
+ match += 1
97
+ # validate data type: NamedEntityResult
98
+ if not isinstance(v, NamedEntityResult):
99
+ error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityResult`")
100
+ else:
101
+ match += 1
102
+ # validate data type: LocateResult
103
+ if not isinstance(v, LocateResult):
104
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LocateResult`")
105
+ else:
106
+ match += 1
107
+ # validate data type: LineResult
108
+ if not isinstance(v, LineResult):
109
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LineResult`")
110
+ else:
111
+ match += 1
112
+ # validate data type: FreeTextResult
113
+ if not isinstance(v, FreeTextResult):
114
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FreeTextResult`")
115
+ else:
116
+ match += 1
117
+ # validate data type: CompareResult
118
+ if not isinstance(v, CompareResult):
119
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompareResult`")
120
+ else:
121
+ match += 1
122
+ # validate data type: SkipResult
123
+ if not isinstance(v, SkipResult):
124
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SkipResult`")
125
+ else:
126
+ match += 1
127
+ # validate data type: AttachCategoryResult
128
+ if not isinstance(v, AttachCategoryResult):
129
+ error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryResult`")
130
+ else:
131
+ match += 1
132
+ # validate data type: BoundingBoxResult
133
+ if not isinstance(v, BoundingBoxResult):
134
+ error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxResult`")
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 RapidResultModelResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, SkipResult, TranscriptionResult. Details: " + ", ".join(error_messages))
140
+ elif match == 0:
141
+ # no match
142
+ raise ValueError("No match found when setting `actual_instance` in RapidResultModelResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, SkipResult, TranscriptionResult. 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 TranscriptionResult
158
+ try:
159
+ instance.actual_instance = TranscriptionResult.from_json(json_str)
160
+ match += 1
161
+ except (ValidationError, ValueError) as e:
162
+ error_messages.append(str(e))
163
+ # deserialize data into PolygonResult
164
+ try:
165
+ instance.actual_instance = PolygonResult.from_json(json_str)
166
+ match += 1
167
+ except (ValidationError, ValueError) as e:
168
+ error_messages.append(str(e))
169
+ # deserialize data into NamedEntityResult
170
+ try:
171
+ instance.actual_instance = NamedEntityResult.from_json(json_str)
172
+ match += 1
173
+ except (ValidationError, ValueError) as e:
174
+ error_messages.append(str(e))
175
+ # deserialize data into LocateResult
176
+ try:
177
+ instance.actual_instance = LocateResult.from_json(json_str)
178
+ match += 1
179
+ except (ValidationError, ValueError) as e:
180
+ error_messages.append(str(e))
181
+ # deserialize data into LineResult
182
+ try:
183
+ instance.actual_instance = LineResult.from_json(json_str)
184
+ match += 1
185
+ except (ValidationError, ValueError) as e:
186
+ error_messages.append(str(e))
187
+ # deserialize data into FreeTextResult
188
+ try:
189
+ instance.actual_instance = FreeTextResult.from_json(json_str)
190
+ match += 1
191
+ except (ValidationError, ValueError) as e:
192
+ error_messages.append(str(e))
193
+ # deserialize data into CompareResult
194
+ try:
195
+ instance.actual_instance = CompareResult.from_json(json_str)
196
+ match += 1
197
+ except (ValidationError, ValueError) as e:
198
+ error_messages.append(str(e))
199
+ # deserialize data into SkipResult
200
+ try:
201
+ instance.actual_instance = SkipResult.from_json(json_str)
202
+ match += 1
203
+ except (ValidationError, ValueError) as e:
204
+ error_messages.append(str(e))
205
+ # deserialize data into AttachCategoryResult
206
+ try:
207
+ instance.actual_instance = AttachCategoryResult.from_json(json_str)
208
+ match += 1
209
+ except (ValidationError, ValueError) as e:
210
+ error_messages.append(str(e))
211
+ # deserialize data into BoundingBoxResult
212
+ try:
213
+ instance.actual_instance = BoundingBoxResult.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 RapidResultModelResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, SkipResult, TranscriptionResult. Details: " + ", ".join(error_messages))
221
+ elif match == 0:
222
+ # no match
223
+ raise ValueError("No match found when deserializing the JSON string into RapidResultModelResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, SkipResult, TranscriptionResult. 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], AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, SkipResult, TranscriptionResult]]:
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,89 @@
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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class RapidSkippedModel(BaseModel):
26
+ """
27
+ The model for a Rapid skipped.
28
+ """ # noqa: E501
29
+ rapid_id: StrictStr = Field(description="The ID of the Rapid that was skipped.", alias="rapidId")
30
+ session_index: StrictInt = Field(description="The index of the session when the Rapid was skipped.", alias="sessionIndex")
31
+ __properties: ClassVar[List[str]] = ["rapidId", "sessionIndex"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of RapidSkippedModel from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of RapidSkippedModel from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "rapidId": obj.get("rapidId"),
85
+ "sessionIndex": obj.get("sessionIndex")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,104 @@
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.coordinate import Coordinate
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class Shape(BaseModel):
27
+ """
28
+ Shape
29
+ """ # noqa: E501
30
+ t: StrictStr = Field(description="Discriminator value for Shape", alias="_t")
31
+ edges: List[Coordinate]
32
+ __properties: ClassVar[List[str]] = ["_t", "edges"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['Shape']):
38
+ raise ValueError("must be one of enum values ('Shape')")
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 Shape 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
+ # override the default output from pydantic by calling `to_dict()` of each item in edges (list)
81
+ _items = []
82
+ if self.edges:
83
+ for _item_edges in self.edges:
84
+ if _item_edges:
85
+ _items.append(_item_edges.to_dict())
86
+ _dict['edges'] = _items
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of Shape from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'Shape',
100
+ "edges": [Coordinate.from_dict(_item) for _item in obj["edges"]] if obj.get("edges") is not None else None
101
+ })
102
+ return _obj
103
+
104
+
@@ -0,0 +1,96 @@
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 SkipResult(BaseModel):
26
+ """
27
+ SkipResult
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for SkipResult", alias="_t")
30
+ rapid_id: StrictStr = Field(alias="rapidId")
31
+ __properties: ClassVar[List[str]] = ["_t", "rapidId"]
32
+
33
+ @field_validator('t')
34
+ def t_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set(['SkipResult']):
37
+ raise ValueError("must be one of enum values ('SkipResult')")
38
+ return value
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of SkipResult from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of SkipResult from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'SkipResult',
92
+ "rapidId": obj.get("rapidId")
93
+ })
94
+ return _obj
95
+
96
+
@@ -39,13 +39,6 @@ class TextMetadata(BaseModel):
39
39
  raise ValueError("must be one of enum values ('TextMetadata')")
40
40
  return value
41
41
 
42
- @field_validator('visibilities')
43
- def visibilities_validate_enum(cls, value):
44
- """Validates the enum"""
45
- if value not in set(['None', 'Users', 'Customers', 'Admins', 'All']):
46
- raise ValueError("must be one of enum values ('None', 'Users', 'Customers', 'Admins', 'All')")
47
- return value
48
-
49
42
  model_config = ConfigDict(
50
43
  populate_by_name=True,
51
44
  validate_assignment=True,
@@ -39,13 +39,6 @@ class TranscriptionMetadata(BaseModel):
39
39
  raise ValueError("must be one of enum values ('TranscriptionMetadata')")
40
40
  return value
41
41
 
42
- @field_validator('visibilities')
43
- def visibilities_validate_enum(cls, value):
44
- """Validates the enum"""
45
- if value not in set(['None', 'Users', 'Customers', 'Admins', 'All']):
46
- raise ValueError("must be one of enum values ('None', 'Users', 'Customers', 'Admins', 'All')")
47
- return value
48
-
49
42
  model_config = ConfigDict(
50
43
  populate_by_name=True,
51
44
  validate_assignment=True,