rapidata 2.12.0__py3-none-any.whl → 2.13.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.

Files changed (70) hide show
  1. rapidata/__init__.py +0 -33
  2. rapidata/api_client/__init__.py +17 -39
  3. rapidata/api_client/api/__init__.py +0 -1
  4. rapidata/api_client/api/campaign_api.py +13 -13
  5. rapidata/api_client/api/datapoint_api.py +6 -6
  6. rapidata/api_client/api/dataset_api.py +574 -16
  7. rapidata/api_client/api/rapid_api.py +262 -0
  8. rapidata/api_client/api/validation_api.py +7 -7
  9. rapidata/api_client/models/__init__.py +17 -38
  10. rapidata/api_client/models/add_campaign_model.py +3 -3
  11. rapidata/api_client/models/add_campaign_model_user_filters_inner.py +224 -0
  12. rapidata/api_client/models/campaign_query_result.py +105 -0
  13. rapidata/api_client/models/campaign_query_result_paged_result.py +105 -0
  14. rapidata/api_client/models/classification_metadata_model.py +2 -4
  15. rapidata/api_client/models/compare_workflow_config.py +8 -10
  16. rapidata/api_client/models/compare_workflow_config_model.py +9 -11
  17. rapidata/api_client/models/compare_workflow_config_model_pair_maker_config.py +8 -22
  18. rapidata/api_client/models/compare_workflow_config_pair_maker_config.py +8 -22
  19. rapidata/api_client/models/compare_workflow_model.py +8 -10
  20. rapidata/api_client/models/compare_workflow_model1.py +8 -10
  21. rapidata/api_client/models/compare_workflow_model1_pair_maker_information.py +8 -22
  22. rapidata/api_client/models/compare_workflow_model_pair_maker_config.py +10 -24
  23. rapidata/api_client/models/count_metadata_model.py +2 -4
  24. rapidata/api_client/models/create_datapoint_from_urls_model.py +87 -0
  25. rapidata/api_client/models/create_datapoint_result.py +97 -0
  26. rapidata/api_client/models/create_order_model_user_filters_inner.py +23 -9
  27. rapidata/api_client/models/datapoint_state.py +38 -0
  28. rapidata/api_client/models/demographic.py +89 -0
  29. rapidata/api_client/models/demographic_metadata_model.py +18 -9
  30. rapidata/api_client/models/elo_config.py +91 -0
  31. rapidata/api_client/models/elo_config_model.py +91 -0
  32. rapidata/api_client/models/file_asset_model.py +18 -13
  33. rapidata/api_client/models/file_asset_model_metadata_value.py +266 -0
  34. rapidata/api_client/models/get_compare_workflow_results_model.py +1 -9
  35. rapidata/api_client/models/get_compare_workflow_results_result.py +6 -15
  36. rapidata/api_client/models/get_datapoint_by_id_result.py +114 -0
  37. rapidata/api_client/models/get_dataset_progress_result.py +93 -0
  38. rapidata/api_client/models/get_simple_workflow_results_result.py +3 -3
  39. rapidata/api_client/models/image_dimension_metadata_model.py +2 -4
  40. rapidata/api_client/models/inspect_report_result.py +92 -0
  41. rapidata/api_client/models/location_metadata_model.py +2 -4
  42. rapidata/api_client/models/multi_asset_model.py +18 -13
  43. rapidata/api_client/models/new_user_filter_model.py +94 -0
  44. rapidata/api_client/models/new_user_filter_model1.py +94 -0
  45. rapidata/api_client/models/null_asset_model.py +18 -13
  46. rapidata/api_client/models/online_pair_maker_config_model.py +1 -1
  47. rapidata/api_client/models/original_filename_metadata_model.py +2 -4
  48. rapidata/api_client/models/prompt_metadata_input.py +2 -4
  49. rapidata/api_client/models/prompt_metadata_model.py +2 -4
  50. rapidata/api_client/models/query_validation_rapids_result.py +14 -9
  51. rapidata/api_client/models/query_validation_rapids_result_asset.py +40 -40
  52. rapidata/api_client/models/report_model.py +11 -4
  53. rapidata/api_client/models/source_url_metadata_model.py +96 -0
  54. rapidata/api_client/models/text_asset_model.py +18 -13
  55. rapidata/api_client/models/text_metadata_model.py +2 -4
  56. rapidata/api_client/models/transcription_metadata_input.py +2 -4
  57. rapidata/api_client/models/transcription_metadata_model.py +1 -3
  58. rapidata/api_client/models/translated_prompt_metadata_model.py +2 -4
  59. rapidata/api_client/models/upload_from_s3_result.py +87 -0
  60. rapidata/api_client_README.md +20 -39
  61. rapidata/rapidata_client/metadata/_base_metadata.py +0 -3
  62. rapidata/rapidata_client/metadata/_private_text_metadata.py +2 -1
  63. rapidata/rapidata_client/metadata/_prompt_metadata.py +3 -3
  64. rapidata/rapidata_client/metadata/_public_text_metadata.py +2 -1
  65. rapidata/rapidata_client/metadata/_select_words_metadata.py +2 -4
  66. rapidata/rapidata_client/validation/validation_set_manager.py +3 -2
  67. {rapidata-2.12.0.dist-info → rapidata-2.13.0.dist-info}/METADATA +1 -1
  68. {rapidata-2.12.0.dist-info → rapidata-2.13.0.dist-info}/RECORD +70 -53
  69. {rapidata-2.12.0.dist-info → rapidata-2.13.0.dist-info}/LICENSE +0 -0
  70. {rapidata-2.12.0.dist-info → rapidata-2.13.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,266 @@
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.classification_metadata_model import ClassificationMetadataModel
21
+ from rapidata.api_client.models.count_metadata_model import CountMetadataModel
22
+ from rapidata.api_client.models.demographic_metadata_model import DemographicMetadataModel
23
+ from rapidata.api_client.models.image_dimension_metadata_model import ImageDimensionMetadataModel
24
+ from rapidata.api_client.models.location_metadata_model import LocationMetadataModel
25
+ from rapidata.api_client.models.original_filename_metadata_model import OriginalFilenameMetadataModel
26
+ from rapidata.api_client.models.prompt_metadata_model import PromptMetadataModel
27
+ from rapidata.api_client.models.source_url_metadata_model import SourceUrlMetadataModel
28
+ from rapidata.api_client.models.text_metadata_model import TextMetadataModel
29
+ from rapidata.api_client.models.transcription_metadata_model import TranscriptionMetadataModel
30
+ from rapidata.api_client.models.translated_prompt_metadata_model import TranslatedPromptMetadataModel
31
+ from pydantic import StrictStr, Field
32
+ from typing import Union, List, Set, Optional, Dict
33
+ from typing_extensions import Literal, Self
34
+
35
+ FILEASSETMODELMETADATAVALUE_ONE_OF_SCHEMAS = ["ClassificationMetadataModel", "CountMetadataModel", "DemographicMetadataModel", "ImageDimensionMetadataModel", "LocationMetadataModel", "OriginalFilenameMetadataModel", "PromptMetadataModel", "SourceUrlMetadataModel", "TextMetadataModel", "TranscriptionMetadataModel", "TranslatedPromptMetadataModel"]
36
+
37
+ class FileAssetModelMetadataValue(BaseModel):
38
+ """
39
+ FileAssetModelMetadataValue
40
+ """
41
+ # data type: ClassificationMetadataModel
42
+ oneof_schema_1_validator: Optional[ClassificationMetadataModel] = None
43
+ # data type: CountMetadataModel
44
+ oneof_schema_2_validator: Optional[CountMetadataModel] = None
45
+ # data type: DemographicMetadataModel
46
+ oneof_schema_3_validator: Optional[DemographicMetadataModel] = None
47
+ # data type: ImageDimensionMetadataModel
48
+ oneof_schema_4_validator: Optional[ImageDimensionMetadataModel] = None
49
+ # data type: LocationMetadataModel
50
+ oneof_schema_5_validator: Optional[LocationMetadataModel] = None
51
+ # data type: OriginalFilenameMetadataModel
52
+ oneof_schema_6_validator: Optional[OriginalFilenameMetadataModel] = None
53
+ # data type: PromptMetadataModel
54
+ oneof_schema_7_validator: Optional[PromptMetadataModel] = None
55
+ # data type: SourceUrlMetadataModel
56
+ oneof_schema_8_validator: Optional[SourceUrlMetadataModel] = None
57
+ # data type: TextMetadataModel
58
+ oneof_schema_9_validator: Optional[TextMetadataModel] = None
59
+ # data type: TranscriptionMetadataModel
60
+ oneof_schema_10_validator: Optional[TranscriptionMetadataModel] = None
61
+ # data type: TranslatedPromptMetadataModel
62
+ oneof_schema_11_validator: Optional[TranslatedPromptMetadataModel] = None
63
+ actual_instance: Optional[Union[ClassificationMetadataModel, CountMetadataModel, DemographicMetadataModel, ImageDimensionMetadataModel, LocationMetadataModel, OriginalFilenameMetadataModel, PromptMetadataModel, SourceUrlMetadataModel, TextMetadataModel, TranscriptionMetadataModel, TranslatedPromptMetadataModel]] = None
64
+ one_of_schemas: Set[str] = { "ClassificationMetadataModel", "CountMetadataModel", "DemographicMetadataModel", "ImageDimensionMetadataModel", "LocationMetadataModel", "OriginalFilenameMetadataModel", "PromptMetadataModel", "SourceUrlMetadataModel", "TextMetadataModel", "TranscriptionMetadataModel", "TranslatedPromptMetadataModel" }
65
+
66
+ model_config = ConfigDict(
67
+ validate_assignment=True,
68
+ protected_namespaces=(),
69
+ )
70
+
71
+
72
+ discriminator_value_class_map: Dict[str, str] = {
73
+ }
74
+
75
+ def __init__(self, *args, **kwargs) -> None:
76
+ if args:
77
+ if len(args) > 1:
78
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
79
+ if kwargs:
80
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
81
+ super().__init__(actual_instance=args[0])
82
+ else:
83
+ super().__init__(**kwargs)
84
+
85
+ @field_validator('actual_instance')
86
+ def actual_instance_must_validate_oneof(cls, v):
87
+ instance = FileAssetModelMetadataValue.model_construct()
88
+ error_messages = []
89
+ match = 0
90
+ # validate data type: ClassificationMetadataModel
91
+ if not isinstance(v, ClassificationMetadataModel):
92
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ClassificationMetadataModel`")
93
+ else:
94
+ match += 1
95
+ # validate data type: CountMetadataModel
96
+ if not isinstance(v, CountMetadataModel):
97
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CountMetadataModel`")
98
+ else:
99
+ match += 1
100
+ # validate data type: DemographicMetadataModel
101
+ if not isinstance(v, DemographicMetadataModel):
102
+ error_messages.append(f"Error! Input type `{type(v)}` is not `DemographicMetadataModel`")
103
+ else:
104
+ match += 1
105
+ # validate data type: ImageDimensionMetadataModel
106
+ if not isinstance(v, ImageDimensionMetadataModel):
107
+ error_messages.append(f"Error! Input type `{type(v)}` is not `ImageDimensionMetadataModel`")
108
+ else:
109
+ match += 1
110
+ # validate data type: LocationMetadataModel
111
+ if not isinstance(v, LocationMetadataModel):
112
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LocationMetadataModel`")
113
+ else:
114
+ match += 1
115
+ # validate data type: OriginalFilenameMetadataModel
116
+ if not isinstance(v, OriginalFilenameMetadataModel):
117
+ error_messages.append(f"Error! Input type `{type(v)}` is not `OriginalFilenameMetadataModel`")
118
+ else:
119
+ match += 1
120
+ # validate data type: PromptMetadataModel
121
+ if not isinstance(v, PromptMetadataModel):
122
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PromptMetadataModel`")
123
+ else:
124
+ match += 1
125
+ # validate data type: SourceUrlMetadataModel
126
+ if not isinstance(v, SourceUrlMetadataModel):
127
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SourceUrlMetadataModel`")
128
+ else:
129
+ match += 1
130
+ # validate data type: TextMetadataModel
131
+ if not isinstance(v, TextMetadataModel):
132
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TextMetadataModel`")
133
+ else:
134
+ match += 1
135
+ # validate data type: TranscriptionMetadataModel
136
+ if not isinstance(v, TranscriptionMetadataModel):
137
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionMetadataModel`")
138
+ else:
139
+ match += 1
140
+ # validate data type: TranslatedPromptMetadataModel
141
+ if not isinstance(v, TranslatedPromptMetadataModel):
142
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TranslatedPromptMetadataModel`")
143
+ else:
144
+ match += 1
145
+ if match > 1:
146
+ # more than 1 match
147
+ raise ValueError("Multiple matches found when setting `actual_instance` in FileAssetModelMetadataValue with oneOf schemas: ClassificationMetadataModel, CountMetadataModel, DemographicMetadataModel, ImageDimensionMetadataModel, LocationMetadataModel, OriginalFilenameMetadataModel, PromptMetadataModel, SourceUrlMetadataModel, TextMetadataModel, TranscriptionMetadataModel, TranslatedPromptMetadataModel. Details: " + ", ".join(error_messages))
148
+ elif match == 0:
149
+ # no match
150
+ raise ValueError("No match found when setting `actual_instance` in FileAssetModelMetadataValue with oneOf schemas: ClassificationMetadataModel, CountMetadataModel, DemographicMetadataModel, ImageDimensionMetadataModel, LocationMetadataModel, OriginalFilenameMetadataModel, PromptMetadataModel, SourceUrlMetadataModel, TextMetadataModel, TranscriptionMetadataModel, TranslatedPromptMetadataModel. Details: " + ", ".join(error_messages))
151
+ else:
152
+ return v
153
+
154
+ @classmethod
155
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
156
+ return cls.from_json(json.dumps(obj))
157
+
158
+ @classmethod
159
+ def from_json(cls, json_str: str) -> Self:
160
+ """Returns the object represented by the json string"""
161
+ instance = cls.model_construct()
162
+ error_messages = []
163
+ match = 0
164
+
165
+ # deserialize data into ClassificationMetadataModel
166
+ try:
167
+ instance.actual_instance = ClassificationMetadataModel.from_json(json_str)
168
+ match += 1
169
+ except (ValidationError, ValueError) as e:
170
+ error_messages.append(str(e))
171
+ # deserialize data into CountMetadataModel
172
+ try:
173
+ instance.actual_instance = CountMetadataModel.from_json(json_str)
174
+ match += 1
175
+ except (ValidationError, ValueError) as e:
176
+ error_messages.append(str(e))
177
+ # deserialize data into DemographicMetadataModel
178
+ try:
179
+ instance.actual_instance = DemographicMetadataModel.from_json(json_str)
180
+ match += 1
181
+ except (ValidationError, ValueError) as e:
182
+ error_messages.append(str(e))
183
+ # deserialize data into ImageDimensionMetadataModel
184
+ try:
185
+ instance.actual_instance = ImageDimensionMetadataModel.from_json(json_str)
186
+ match += 1
187
+ except (ValidationError, ValueError) as e:
188
+ error_messages.append(str(e))
189
+ # deserialize data into LocationMetadataModel
190
+ try:
191
+ instance.actual_instance = LocationMetadataModel.from_json(json_str)
192
+ match += 1
193
+ except (ValidationError, ValueError) as e:
194
+ error_messages.append(str(e))
195
+ # deserialize data into OriginalFilenameMetadataModel
196
+ try:
197
+ instance.actual_instance = OriginalFilenameMetadataModel.from_json(json_str)
198
+ match += 1
199
+ except (ValidationError, ValueError) as e:
200
+ error_messages.append(str(e))
201
+ # deserialize data into PromptMetadataModel
202
+ try:
203
+ instance.actual_instance = PromptMetadataModel.from_json(json_str)
204
+ match += 1
205
+ except (ValidationError, ValueError) as e:
206
+ error_messages.append(str(e))
207
+ # deserialize data into SourceUrlMetadataModel
208
+ try:
209
+ instance.actual_instance = SourceUrlMetadataModel.from_json(json_str)
210
+ match += 1
211
+ except (ValidationError, ValueError) as e:
212
+ error_messages.append(str(e))
213
+ # deserialize data into TextMetadataModel
214
+ try:
215
+ instance.actual_instance = TextMetadataModel.from_json(json_str)
216
+ match += 1
217
+ except (ValidationError, ValueError) as e:
218
+ error_messages.append(str(e))
219
+ # deserialize data into TranscriptionMetadataModel
220
+ try:
221
+ instance.actual_instance = TranscriptionMetadataModel.from_json(json_str)
222
+ match += 1
223
+ except (ValidationError, ValueError) as e:
224
+ error_messages.append(str(e))
225
+ # deserialize data into TranslatedPromptMetadataModel
226
+ try:
227
+ instance.actual_instance = TranslatedPromptMetadataModel.from_json(json_str)
228
+ match += 1
229
+ except (ValidationError, ValueError) as e:
230
+ error_messages.append(str(e))
231
+
232
+ if match > 1:
233
+ # more than 1 match
234
+ raise ValueError("Multiple matches found when deserializing the JSON string into FileAssetModelMetadataValue with oneOf schemas: ClassificationMetadataModel, CountMetadataModel, DemographicMetadataModel, ImageDimensionMetadataModel, LocationMetadataModel, OriginalFilenameMetadataModel, PromptMetadataModel, SourceUrlMetadataModel, TextMetadataModel, TranscriptionMetadataModel, TranslatedPromptMetadataModel. Details: " + ", ".join(error_messages))
235
+ elif match == 0:
236
+ # no match
237
+ raise ValueError("No match found when deserializing the JSON string into FileAssetModelMetadataValue with oneOf schemas: ClassificationMetadataModel, CountMetadataModel, DemographicMetadataModel, ImageDimensionMetadataModel, LocationMetadataModel, OriginalFilenameMetadataModel, PromptMetadataModel, SourceUrlMetadataModel, TextMetadataModel, TranscriptionMetadataModel, TranslatedPromptMetadataModel. Details: " + ", ".join(error_messages))
238
+ else:
239
+ return instance
240
+
241
+ def to_json(self) -> str:
242
+ """Returns the JSON representation of the actual instance"""
243
+ if self.actual_instance is None:
244
+ return "null"
245
+
246
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
247
+ return self.actual_instance.to_json()
248
+ else:
249
+ return json.dumps(self.actual_instance)
250
+
251
+ def to_dict(self) -> Optional[Union[Dict[str, Any], ClassificationMetadataModel, CountMetadataModel, DemographicMetadataModel, ImageDimensionMetadataModel, LocationMetadataModel, OriginalFilenameMetadataModel, PromptMetadataModel, SourceUrlMetadataModel, TextMetadataModel, TranscriptionMetadataModel, TranslatedPromptMetadataModel]]:
252
+ """Returns the dict representation of the actual instance"""
253
+ if self.actual_instance is None:
254
+ return None
255
+
256
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
257
+ return self.actual_instance.to_dict()
258
+ else:
259
+ # primitive type
260
+ return self.actual_instance
261
+
262
+ def to_str(self) -> str:
263
+ """Returns the string representation of the actual instance"""
264
+ return pprint.pformat(self.model_dump())
265
+
266
+
@@ -19,7 +19,6 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from rapidata.api_client.models.compare_match_status import CompareMatchStatus
23
22
  from rapidata.api_client.models.page_info import PageInfo
24
23
  from rapidata.api_client.models.sort_criterion import SortCriterion
25
24
  from typing import Optional, Set
@@ -30,9 +29,8 @@ class GetCompareWorkflowResultsModel(BaseModel):
30
29
  Model for getting the overview of a compare workflow result.
31
30
  """ # noqa: E501
32
31
  page: Optional[PageInfo] = None
33
- states: Optional[List[CompareMatchStatus]] = Field(default=None, description="An optional list of states to filter the results by.")
34
32
  sort_criteria: Optional[List[SortCriterion]] = Field(default=None, description="A list of criteria to sort the results by.", alias="sortCriteria")
35
- __properties: ClassVar[List[str]] = ["page", "states", "sortCriteria"]
33
+ __properties: ClassVar[List[str]] = ["page", "sortCriteria"]
36
34
 
37
35
  model_config = ConfigDict(
38
36
  populate_by_name=True,
@@ -83,11 +81,6 @@ class GetCompareWorkflowResultsModel(BaseModel):
83
81
  if _item_sort_criteria:
84
82
  _items.append(_item_sort_criteria.to_dict())
85
83
  _dict['sortCriteria'] = _items
86
- # set to None if states (nullable) is None
87
- # and model_fields_set contains the field
88
- if self.states is None and "states" in self.model_fields_set:
89
- _dict['states'] = None
90
-
91
84
  # set to None if sort_criteria (nullable) is None
92
85
  # and model_fields_set contains the field
93
86
  if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
@@ -106,7 +99,6 @@ class GetCompareWorkflowResultsModel(BaseModel):
106
99
 
107
100
  _obj = cls.model_validate({
108
101
  "page": PageInfo.from_dict(obj["page"]) if obj.get("page") is not None else None,
109
- "states": obj.get("states"),
110
102
  "sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None
111
103
  })
112
104
  return _obj
@@ -17,9 +17,9 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List
22
- from rapidata.api_client.models.get_compare_workflow_results_result_asset import GetCompareWorkflowResultsResultAsset
22
+ from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
@@ -28,17 +28,9 @@ class GetCompareWorkflowResultsResult(BaseModel):
28
28
  GetCompareWorkflowResultsResult
29
29
  """ # noqa: E501
30
30
  workflow_datapoint_id: StrictStr = Field(alias="workflowDatapointId")
31
- asset: GetCompareWorkflowResultsResultAsset
31
+ asset: DatapointModelAsset
32
32
  elo: StrictInt
33
- state: StrictStr
34
- __properties: ClassVar[List[str]] = ["workflowDatapointId", "asset", "elo", "state"]
35
-
36
- @field_validator('state')
37
- def state_validate_enum(cls, value):
38
- """Validates the enum"""
39
- if value not in set(['Idle', 'Queued', 'Processing', 'Completed']):
40
- raise ValueError("must be one of enum values ('Idle', 'Queued', 'Processing', 'Completed')")
41
- return value
33
+ __properties: ClassVar[List[str]] = ["workflowDatapointId", "asset", "elo"]
42
34
 
43
35
  model_config = ConfigDict(
44
36
  populate_by_name=True,
@@ -95,9 +87,8 @@ class GetCompareWorkflowResultsResult(BaseModel):
95
87
 
96
88
  _obj = cls.model_validate({
97
89
  "workflowDatapointId": obj.get("workflowDatapointId"),
98
- "asset": GetCompareWorkflowResultsResultAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
99
- "elo": obj.get("elo"),
100
- "state": obj.get("state")
90
+ "asset": DatapointModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
91
+ "elo": obj.get("elo")
101
92
  })
102
93
  return _obj
103
94
 
@@ -0,0 +1,114 @@
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class GetDatapointByIdResult(BaseModel):
28
+ """
29
+ GetDatapointByIdResult
30
+ """ # noqa: E501
31
+ id: StrictStr
32
+ dataset_id: StrictStr = Field(alias="datasetId")
33
+ state: StrictStr
34
+ sort_index: Optional[StrictInt] = Field(default=None, alias="sortIndex")
35
+ asset: DatapointModelAsset
36
+ created_at: datetime = Field(alias="createdAt")
37
+ __properties: ClassVar[List[str]] = ["id", "datasetId", "state", "sortIndex", "asset", "createdAt"]
38
+
39
+ @field_validator('state')
40
+ def state_validate_enum(cls, value):
41
+ """Validates the enum"""
42
+ if value not in set(['Ready', 'Pending', 'Failed']):
43
+ raise ValueError("must be one of enum values ('Ready', 'Pending', 'Failed')")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of GetDatapointByIdResult from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # override the default output from pydantic by calling `to_dict()` of asset
86
+ if self.asset:
87
+ _dict['asset'] = self.asset.to_dict()
88
+ # set to None if sort_index (nullable) is None
89
+ # and model_fields_set contains the field
90
+ if self.sort_index is None and "sort_index" in self.model_fields_set:
91
+ _dict['sortIndex'] = None
92
+
93
+ return _dict
94
+
95
+ @classmethod
96
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
97
+ """Create an instance of GetDatapointByIdResult from a dict"""
98
+ if obj is None:
99
+ return None
100
+
101
+ if not isinstance(obj, dict):
102
+ return cls.model_validate(obj)
103
+
104
+ _obj = cls.model_validate({
105
+ "id": obj.get("id"),
106
+ "datasetId": obj.get("datasetId"),
107
+ "state": obj.get("state"),
108
+ "sortIndex": obj.get("sortIndex"),
109
+ "asset": DatapointModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
110
+ "createdAt": obj.get("createdAt")
111
+ })
112
+ return _obj
113
+
114
+
@@ -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, StrictInt
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetDatasetProgressResult(BaseModel):
26
+ """
27
+ GetDatasetProgressResult
28
+ """ # noqa: E501
29
+ total: StrictInt
30
+ ready: StrictInt
31
+ pending: StrictInt
32
+ failed: StrictInt
33
+ __properties: ClassVar[List[str]] = ["total", "ready", "pending", "failed"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of GetDatasetProgressResult from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of GetDatasetProgressResult from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "total": obj.get("total"),
87
+ "ready": obj.get("ready"),
88
+ "pending": obj.get("pending"),
89
+ "failed": obj.get("failed")
90
+ })
91
+ return _obj
92
+
93
+
@@ -19,7 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List
22
- from rapidata.api_client.models.get_compare_workflow_results_result_asset import GetCompareWorkflowResultsResultAsset
22
+ from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
23
23
  from rapidata.api_client.models.rapid_response import RapidResponse
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
@@ -29,7 +29,7 @@ class GetSimpleWorkflowResultsResult(BaseModel):
29
29
  GetSimpleWorkflowResultsResult
30
30
  """ # noqa: E501
31
31
  rapid_id: StrictStr = Field(alias="rapidId")
32
- asset: GetCompareWorkflowResultsResultAsset
32
+ asset: DatapointModelAsset
33
33
  responses: List[RapidResponse]
34
34
  state: StrictStr
35
35
  __properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
@@ -103,7 +103,7 @@ class GetSimpleWorkflowResultsResult(BaseModel):
103
103
 
104
104
  _obj = cls.model_validate({
105
105
  "rapidId": obj.get("rapidId"),
106
- "asset": GetCompareWorkflowResultsResultAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
106
+ "asset": DatapointModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
107
107
  "responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
108
108
  "state": obj.get("state")
109
109
  })
@@ -29,8 +29,7 @@ class ImageDimensionMetadataModel(BaseModel):
29
29
  t: StrictStr = Field(description="Discriminator value for ImageDimensionMetadata", alias="_t")
30
30
  height: Optional[StrictInt] = None
31
31
  width: Optional[StrictInt] = None
32
- identifier: StrictStr
33
- __properties: ClassVar[List[str]] = ["_t", "height", "width", "identifier"]
32
+ __properties: ClassVar[List[str]] = ["_t", "height", "width"]
34
33
 
35
34
  @field_validator('t')
36
35
  def t_validate_enum(cls, value):
@@ -92,8 +91,7 @@ class ImageDimensionMetadataModel(BaseModel):
92
91
  _obj = cls.model_validate({
93
92
  "_t": obj.get("_t") if obj.get("_t") is not None else 'ImageDimensionMetadata',
94
93
  "height": obj.get("height"),
95
- "width": obj.get("width"),
96
- "identifier": obj.get("identifier")
94
+ "width": obj.get("width")
97
95
  })
98
96
  return _obj
99
97