rapidata 2.28.4__py3-none-any.whl → 2.29.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 +1 -1
- rapidata/api_client/__init__.py +44 -17
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/benchmark_api.py +2766 -0
- rapidata/api_client/api/campaign_api.py +0 -780
- rapidata/api_client/api/coco_api.py +0 -571
- rapidata/api_client/api/customer_rapid_api.py +332 -1
- rapidata/api_client/api/datapoint_api.py +0 -524
- rapidata/api_client/api/dataset_api.py +595 -2276
- rapidata/api_client/api/feedback_api.py +0 -270
- rapidata/api_client/api/identity_api.py +74 -888
- rapidata/api_client/api/leaderboard_api.py +1642 -259
- rapidata/api_client/api/order_api.py +617 -5692
- rapidata/api_client/api/pipeline_api.py +31 -334
- rapidata/api_client/api/validation_set_api.py +469 -3356
- rapidata/api_client/api/workflow_api.py +0 -799
- rapidata/api_client/models/__init__.py +43 -17
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/add_validation_rapid_model.py +1 -3
- rapidata/api_client/models/add_validation_text_rapid_model.py +1 -3
- rapidata/api_client/models/and_user_filter_model.py +106 -0
- rapidata/api_client/models/and_user_filter_model_filters_inner.py +282 -0
- rapidata/api_client/models/benchmark_query_result.py +94 -0
- rapidata/api_client/models/benchmark_query_result_paged_result.py +105 -0
- rapidata/api_client/models/boost_leaderboard_model.py +89 -0
- rapidata/api_client/models/clone_order_model.py +2 -4
- rapidata/api_client/models/create_benchmark_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_model.py +87 -0
- rapidata/api_client/models/create_benchmark_participant_result.py +89 -0
- rapidata/api_client/models/create_benchmark_result.py +87 -0
- rapidata/api_client/models/create_datapoint_result.py +4 -16
- rapidata/api_client/models/create_leaderboard_model.py +18 -2
- rapidata/api_client/models/create_leaderboard_result.py +5 -3
- rapidata/api_client/models/create_order_model.py +3 -3
- rapidata/api_client/models/file_asset_input.py +104 -0
- rapidata/api_client/models/file_asset_input1.py +104 -0
- rapidata/api_client/models/file_asset_input1_file.py +168 -0
- rapidata/api_client/models/file_asset_input2.py +104 -0
- rapidata/api_client/models/file_asset_input_file.py +182 -0
- rapidata/api_client/models/form_file_wrapper.py +120 -0
- rapidata/api_client/models/get_benchmark_by_id_query.py +96 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result.py +94 -0
- rapidata/api_client/models/get_benchmark_by_id_query_result_paged_result.py +105 -0
- rapidata/api_client/models/get_benchmark_by_id_result.py +94 -0
- rapidata/api_client/models/get_participant_by_id_result.py +6 -22
- rapidata/api_client/models/get_standing_by_id_result.py +113 -0
- rapidata/api_client/models/get_validation_rapids_result.py +3 -3
- rapidata/api_client/models/get_workflow_results_result.py +3 -3
- rapidata/api_client/models/local_file_wrapper.py +120 -0
- rapidata/api_client/models/multi_asset_input.py +110 -0
- rapidata/api_client/models/multi_asset_input1.py +110 -0
- rapidata/api_client/models/multi_asset_input1_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_input2.py +110 -0
- rapidata/api_client/models/multi_asset_input_assets_inner.py +170 -0
- rapidata/api_client/models/not_user_filter_model.py +3 -3
- rapidata/api_client/models/or_user_filter_model.py +3 -3
- rapidata/api_client/models/participant_by_benchmark.py +102 -0
- rapidata/api_client/models/participant_by_benchmark_paged_result.py +105 -0
- rapidata/api_client/models/participant_by_leaderboard.py +6 -2
- rapidata/api_client/models/participant_status.py +1 -4
- rapidata/api_client/models/pipeline_id_workflow_config_put_request.py +140 -0
- rapidata/api_client/models/potential_validation_rapid.py +103 -0
- rapidata/api_client/models/potential_validation_rapid_paged_result.py +105 -0
- rapidata/api_client/models/potential_validation_rapid_truth.py +280 -0
- rapidata/api_client/models/prompt_asset_metadata_input.py +3 -3
- rapidata/api_client/models/prompt_asset_metadata_input_asset.py +170 -0
- rapidata/api_client/models/prompt_by_benchmark_result.py +92 -0
- rapidata/api_client/models/prompt_by_benchmark_result_paged_result.py +105 -0
- rapidata/api_client/models/prompt_metadata_input.py +5 -3
- rapidata/api_client/models/proxy_file_wrapper.py +114 -0
- rapidata/api_client/models/query_validation_model.py +97 -0
- rapidata/api_client/models/rapid_model.py +3 -3
- rapidata/api_client/models/simple_workflow_config.py +3 -3
- rapidata/api_client/models/simple_workflow_model1.py +3 -3
- rapidata/api_client/models/standing_by_leaderboard.py +113 -0
- rapidata/api_client/models/standing_by_leaderboard_paged_result.py +105 -0
- rapidata/api_client/models/standing_status.py +38 -0
- rapidata/api_client/models/stream_file_wrapper.py +116 -0
- rapidata/api_client/models/submit_coco_model.py +1 -3
- rapidata/api_client/models/submit_prompt_model.py +89 -0
- rapidata/api_client/models/text_asset_input.py +100 -0
- rapidata/api_client/models/transcription_metadata_input.py +5 -3
- rapidata/api_client/models/validation_set_zip_post_request_blueprint.py +252 -0
- rapidata/api_client/models/zip_entry_file_wrapper.py +120 -0
- rapidata/api_client_README.md +67 -76
- rapidata/rapidata_client/benchmark/leaderboard/__init__.py +0 -0
- rapidata/rapidata_client/benchmark/leaderboard/rapidata_leaderboard.py +62 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark.py +227 -0
- rapidata/rapidata_client/benchmark/rapidata_benchmark_manager.py +83 -0
- rapidata/rapidata_client/filter/not_filter.py +2 -2
- rapidata/rapidata_client/filter/or_filter.py +2 -2
- rapidata/rapidata_client/metadata/__init__.py +1 -0
- rapidata/rapidata_client/metadata/_media_asset_metadata.py +8 -1
- rapidata/rapidata_client/metadata/_prompt_identifier_metadata.py +15 -0
- rapidata/rapidata_client/order/_rapidata_dataset.py +6 -6
- rapidata/rapidata_client/order/_rapidata_order_builder.py +4 -4
- rapidata/rapidata_client/order/rapidata_order.py +1 -1
- rapidata/rapidata_client/rapidata_client.py +3 -3
- rapidata/rapidata_client/validation/rapidata_validation_set.py +1 -1
- rapidata/rapidata_client/validation/rapids/rapids.py +4 -6
- rapidata/service/openapi_service.py +5 -0
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/METADATA +1 -1
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/RECORD +106 -57
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +0 -127
- rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +0 -92
- /rapidata/rapidata_client/{leaderboard → benchmark}/__init__.py +0 -0
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/LICENSE +0 -0
- {rapidata-2.28.4.dist-info → rapidata-2.29.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,282 @@
|
|
|
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.age_user_filter_model import AgeUserFilterModel
|
|
21
|
+
from rapidata.api_client.models.campaign_user_filter_model import CampaignUserFilterModel
|
|
22
|
+
from rapidata.api_client.models.country_user_filter_model import CountryUserFilterModel
|
|
23
|
+
from rapidata.api_client.models.custom_user_filter_model import CustomUserFilterModel
|
|
24
|
+
from rapidata.api_client.models.gender_user_filter_model import GenderUserFilterModel
|
|
25
|
+
from rapidata.api_client.models.language_user_filter_model import LanguageUserFilterModel
|
|
26
|
+
from rapidata.api_client.models.new_user_filter_model import NewUserFilterModel
|
|
27
|
+
from rapidata.api_client.models.response_count_user_filter_model import ResponseCountUserFilterModel
|
|
28
|
+
from rapidata.api_client.models.user_score_user_filter_model import UserScoreUserFilterModel
|
|
29
|
+
from pydantic import StrictStr, Field
|
|
30
|
+
from typing import Union, List, Set, Optional, Dict
|
|
31
|
+
from typing_extensions import Literal, Self
|
|
32
|
+
|
|
33
|
+
ANDUSERFILTERMODELFILTERSINNER_ONE_OF_SCHEMAS = ["AgeUserFilterModel", "AndUserFilterModel", "CampaignUserFilterModel", "CountryUserFilterModel", "CustomUserFilterModel", "GenderUserFilterModel", "LanguageUserFilterModel", "NewUserFilterModel", "NotUserFilterModel", "OrUserFilterModel", "ResponseCountUserFilterModel", "UserScoreUserFilterModel"]
|
|
34
|
+
|
|
35
|
+
class AndUserFilterModelFiltersInner(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
AndUserFilterModelFiltersInner
|
|
38
|
+
"""
|
|
39
|
+
# data type: AgeUserFilterModel
|
|
40
|
+
oneof_schema_1_validator: Optional[AgeUserFilterModel] = None
|
|
41
|
+
# data type: AndUserFilterModel
|
|
42
|
+
oneof_schema_2_validator: Optional[AndUserFilterModel] = None
|
|
43
|
+
# data type: CampaignUserFilterModel
|
|
44
|
+
oneof_schema_3_validator: Optional[CampaignUserFilterModel] = None
|
|
45
|
+
# data type: CountryUserFilterModel
|
|
46
|
+
oneof_schema_4_validator: Optional[CountryUserFilterModel] = None
|
|
47
|
+
# data type: CustomUserFilterModel
|
|
48
|
+
oneof_schema_5_validator: Optional[CustomUserFilterModel] = None
|
|
49
|
+
# data type: GenderUserFilterModel
|
|
50
|
+
oneof_schema_6_validator: Optional[GenderUserFilterModel] = None
|
|
51
|
+
# data type: LanguageUserFilterModel
|
|
52
|
+
oneof_schema_7_validator: Optional[LanguageUserFilterModel] = None
|
|
53
|
+
# data type: NewUserFilterModel
|
|
54
|
+
oneof_schema_8_validator: Optional[NewUserFilterModel] = None
|
|
55
|
+
# data type: NotUserFilterModel
|
|
56
|
+
oneof_schema_9_validator: Optional[NotUserFilterModel] = None
|
|
57
|
+
# data type: OrUserFilterModel
|
|
58
|
+
oneof_schema_10_validator: Optional[OrUserFilterModel] = None
|
|
59
|
+
# data type: ResponseCountUserFilterModel
|
|
60
|
+
oneof_schema_11_validator: Optional[ResponseCountUserFilterModel] = None
|
|
61
|
+
# data type: UserScoreUserFilterModel
|
|
62
|
+
oneof_schema_12_validator: Optional[UserScoreUserFilterModel] = None
|
|
63
|
+
actual_instance: Optional[Union[AgeUserFilterModel, AndUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel, NotUserFilterModel, OrUserFilterModel, ResponseCountUserFilterModel, UserScoreUserFilterModel]] = None
|
|
64
|
+
one_of_schemas: Set[str] = { "AgeUserFilterModel", "AndUserFilterModel", "CampaignUserFilterModel", "CountryUserFilterModel", "CustomUserFilterModel", "GenderUserFilterModel", "LanguageUserFilterModel", "NewUserFilterModel", "NotUserFilterModel", "OrUserFilterModel", "ResponseCountUserFilterModel", "UserScoreUserFilterModel" }
|
|
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 = AndUserFilterModelFiltersInner.model_construct()
|
|
88
|
+
error_messages = []
|
|
89
|
+
match = 0
|
|
90
|
+
# validate data type: AgeUserFilterModel
|
|
91
|
+
if not isinstance(v, AgeUserFilterModel):
|
|
92
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgeUserFilterModel`")
|
|
93
|
+
else:
|
|
94
|
+
match += 1
|
|
95
|
+
# validate data type: AndUserFilterModel
|
|
96
|
+
if not isinstance(v, AndUserFilterModel):
|
|
97
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AndUserFilterModel`")
|
|
98
|
+
else:
|
|
99
|
+
match += 1
|
|
100
|
+
# validate data type: CampaignUserFilterModel
|
|
101
|
+
if not isinstance(v, CampaignUserFilterModel):
|
|
102
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CampaignUserFilterModel`")
|
|
103
|
+
else:
|
|
104
|
+
match += 1
|
|
105
|
+
# validate data type: CountryUserFilterModel
|
|
106
|
+
if not isinstance(v, CountryUserFilterModel):
|
|
107
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CountryUserFilterModel`")
|
|
108
|
+
else:
|
|
109
|
+
match += 1
|
|
110
|
+
# validate data type: CustomUserFilterModel
|
|
111
|
+
if not isinstance(v, CustomUserFilterModel):
|
|
112
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CustomUserFilterModel`")
|
|
113
|
+
else:
|
|
114
|
+
match += 1
|
|
115
|
+
# validate data type: GenderUserFilterModel
|
|
116
|
+
if not isinstance(v, GenderUserFilterModel):
|
|
117
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `GenderUserFilterModel`")
|
|
118
|
+
else:
|
|
119
|
+
match += 1
|
|
120
|
+
# validate data type: LanguageUserFilterModel
|
|
121
|
+
if not isinstance(v, LanguageUserFilterModel):
|
|
122
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LanguageUserFilterModel`")
|
|
123
|
+
else:
|
|
124
|
+
match += 1
|
|
125
|
+
# validate data type: NewUserFilterModel
|
|
126
|
+
if not isinstance(v, NewUserFilterModel):
|
|
127
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NewUserFilterModel`")
|
|
128
|
+
else:
|
|
129
|
+
match += 1
|
|
130
|
+
# validate data type: NotUserFilterModel
|
|
131
|
+
if not isinstance(v, NotUserFilterModel):
|
|
132
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NotUserFilterModel`")
|
|
133
|
+
else:
|
|
134
|
+
match += 1
|
|
135
|
+
# validate data type: OrUserFilterModel
|
|
136
|
+
if not isinstance(v, OrUserFilterModel):
|
|
137
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `OrUserFilterModel`")
|
|
138
|
+
else:
|
|
139
|
+
match += 1
|
|
140
|
+
# validate data type: ResponseCountUserFilterModel
|
|
141
|
+
if not isinstance(v, ResponseCountUserFilterModel):
|
|
142
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ResponseCountUserFilterModel`")
|
|
143
|
+
else:
|
|
144
|
+
match += 1
|
|
145
|
+
# validate data type: UserScoreUserFilterModel
|
|
146
|
+
if not isinstance(v, UserScoreUserFilterModel):
|
|
147
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `UserScoreUserFilterModel`")
|
|
148
|
+
else:
|
|
149
|
+
match += 1
|
|
150
|
+
if match > 1:
|
|
151
|
+
# more than 1 match
|
|
152
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in AndUserFilterModelFiltersInner with oneOf schemas: AgeUserFilterModel, AndUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel, NotUserFilterModel, OrUserFilterModel, ResponseCountUserFilterModel, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
|
|
153
|
+
elif match == 0:
|
|
154
|
+
# no match
|
|
155
|
+
raise ValueError("No match found when setting `actual_instance` in AndUserFilterModelFiltersInner with oneOf schemas: AgeUserFilterModel, AndUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel, NotUserFilterModel, OrUserFilterModel, ResponseCountUserFilterModel, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
|
|
156
|
+
else:
|
|
157
|
+
return v
|
|
158
|
+
|
|
159
|
+
@classmethod
|
|
160
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
161
|
+
return cls.from_json(json.dumps(obj))
|
|
162
|
+
|
|
163
|
+
@classmethod
|
|
164
|
+
def from_json(cls, json_str: str) -> Self:
|
|
165
|
+
"""Returns the object represented by the json string"""
|
|
166
|
+
instance = cls.model_construct()
|
|
167
|
+
error_messages = []
|
|
168
|
+
match = 0
|
|
169
|
+
|
|
170
|
+
# deserialize data into AgeUserFilterModel
|
|
171
|
+
try:
|
|
172
|
+
instance.actual_instance = AgeUserFilterModel.from_json(json_str)
|
|
173
|
+
match += 1
|
|
174
|
+
except (ValidationError, ValueError) as e:
|
|
175
|
+
error_messages.append(str(e))
|
|
176
|
+
# deserialize data into AndUserFilterModel
|
|
177
|
+
try:
|
|
178
|
+
instance.actual_instance = AndUserFilterModel.from_json(json_str)
|
|
179
|
+
match += 1
|
|
180
|
+
except (ValidationError, ValueError) as e:
|
|
181
|
+
error_messages.append(str(e))
|
|
182
|
+
# deserialize data into CampaignUserFilterModel
|
|
183
|
+
try:
|
|
184
|
+
instance.actual_instance = CampaignUserFilterModel.from_json(json_str)
|
|
185
|
+
match += 1
|
|
186
|
+
except (ValidationError, ValueError) as e:
|
|
187
|
+
error_messages.append(str(e))
|
|
188
|
+
# deserialize data into CountryUserFilterModel
|
|
189
|
+
try:
|
|
190
|
+
instance.actual_instance = CountryUserFilterModel.from_json(json_str)
|
|
191
|
+
match += 1
|
|
192
|
+
except (ValidationError, ValueError) as e:
|
|
193
|
+
error_messages.append(str(e))
|
|
194
|
+
# deserialize data into CustomUserFilterModel
|
|
195
|
+
try:
|
|
196
|
+
instance.actual_instance = CustomUserFilterModel.from_json(json_str)
|
|
197
|
+
match += 1
|
|
198
|
+
except (ValidationError, ValueError) as e:
|
|
199
|
+
error_messages.append(str(e))
|
|
200
|
+
# deserialize data into GenderUserFilterModel
|
|
201
|
+
try:
|
|
202
|
+
instance.actual_instance = GenderUserFilterModel.from_json(json_str)
|
|
203
|
+
match += 1
|
|
204
|
+
except (ValidationError, ValueError) as e:
|
|
205
|
+
error_messages.append(str(e))
|
|
206
|
+
# deserialize data into LanguageUserFilterModel
|
|
207
|
+
try:
|
|
208
|
+
instance.actual_instance = LanguageUserFilterModel.from_json(json_str)
|
|
209
|
+
match += 1
|
|
210
|
+
except (ValidationError, ValueError) as e:
|
|
211
|
+
error_messages.append(str(e))
|
|
212
|
+
# deserialize data into NewUserFilterModel
|
|
213
|
+
try:
|
|
214
|
+
instance.actual_instance = NewUserFilterModel.from_json(json_str)
|
|
215
|
+
match += 1
|
|
216
|
+
except (ValidationError, ValueError) as e:
|
|
217
|
+
error_messages.append(str(e))
|
|
218
|
+
# deserialize data into NotUserFilterModel
|
|
219
|
+
try:
|
|
220
|
+
instance.actual_instance = NotUserFilterModel.from_json(json_str)
|
|
221
|
+
match += 1
|
|
222
|
+
except (ValidationError, ValueError) as e:
|
|
223
|
+
error_messages.append(str(e))
|
|
224
|
+
# deserialize data into OrUserFilterModel
|
|
225
|
+
try:
|
|
226
|
+
instance.actual_instance = OrUserFilterModel.from_json(json_str)
|
|
227
|
+
match += 1
|
|
228
|
+
except (ValidationError, ValueError) as e:
|
|
229
|
+
error_messages.append(str(e))
|
|
230
|
+
# deserialize data into ResponseCountUserFilterModel
|
|
231
|
+
try:
|
|
232
|
+
instance.actual_instance = ResponseCountUserFilterModel.from_json(json_str)
|
|
233
|
+
match += 1
|
|
234
|
+
except (ValidationError, ValueError) as e:
|
|
235
|
+
error_messages.append(str(e))
|
|
236
|
+
# deserialize data into UserScoreUserFilterModel
|
|
237
|
+
try:
|
|
238
|
+
instance.actual_instance = UserScoreUserFilterModel.from_json(json_str)
|
|
239
|
+
match += 1
|
|
240
|
+
except (ValidationError, ValueError) as e:
|
|
241
|
+
error_messages.append(str(e))
|
|
242
|
+
|
|
243
|
+
if match > 1:
|
|
244
|
+
# more than 1 match
|
|
245
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into AndUserFilterModelFiltersInner with oneOf schemas: AgeUserFilterModel, AndUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel, NotUserFilterModel, OrUserFilterModel, ResponseCountUserFilterModel, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
|
|
246
|
+
elif match == 0:
|
|
247
|
+
# no match
|
|
248
|
+
raise ValueError("No match found when deserializing the JSON string into AndUserFilterModelFiltersInner with oneOf schemas: AgeUserFilterModel, AndUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel, NotUserFilterModel, OrUserFilterModel, ResponseCountUserFilterModel, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
|
|
249
|
+
else:
|
|
250
|
+
return instance
|
|
251
|
+
|
|
252
|
+
def to_json(self) -> str:
|
|
253
|
+
"""Returns the JSON representation of the actual instance"""
|
|
254
|
+
if self.actual_instance is None:
|
|
255
|
+
return "null"
|
|
256
|
+
|
|
257
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
258
|
+
return self.actual_instance.to_json()
|
|
259
|
+
else:
|
|
260
|
+
return json.dumps(self.actual_instance)
|
|
261
|
+
|
|
262
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AgeUserFilterModel, AndUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel, NotUserFilterModel, OrUserFilterModel, ResponseCountUserFilterModel, UserScoreUserFilterModel]]:
|
|
263
|
+
"""Returns the dict representation of the actual instance"""
|
|
264
|
+
if self.actual_instance is None:
|
|
265
|
+
return None
|
|
266
|
+
|
|
267
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
268
|
+
return self.actual_instance.to_dict()
|
|
269
|
+
else:
|
|
270
|
+
# primitive type
|
|
271
|
+
return self.actual_instance
|
|
272
|
+
|
|
273
|
+
def to_str(self) -> str:
|
|
274
|
+
"""Returns the string representation of the actual instance"""
|
|
275
|
+
return pprint.pformat(self.model_dump())
|
|
276
|
+
|
|
277
|
+
from rapidata.api_client.models.and_user_filter_model import AndUserFilterModel
|
|
278
|
+
from rapidata.api_client.models.not_user_filter_model import NotUserFilterModel
|
|
279
|
+
from rapidata.api_client.models.or_user_filter_model import OrUserFilterModel
|
|
280
|
+
# TODO: Rewrite to not use raise_errors
|
|
281
|
+
AndUserFilterModelFiltersInner.model_rebuild(raise_errors=False)
|
|
282
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class BenchmarkQueryResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
BenchmarkQueryResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: StrictStr
|
|
31
|
+
name: StrictStr
|
|
32
|
+
created_at: datetime = Field(alias="createdAt")
|
|
33
|
+
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "name", "createdAt", "ownerMail"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of BenchmarkQueryResult from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of BenchmarkQueryResult from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"id": obj.get("id"),
|
|
88
|
+
"name": obj.get("name"),
|
|
89
|
+
"createdAt": obj.get("createdAt"),
|
|
90
|
+
"ownerMail": obj.get("ownerMail")
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -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.benchmark_query_result import BenchmarkQueryResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class BenchmarkQueryResultPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
BenchmarkQueryResultPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[BenchmarkQueryResult]
|
|
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 BenchmarkQueryResultPagedResult 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 BenchmarkQueryResultPagedResult 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": [BenchmarkQueryResult.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,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 BoostLeaderboardModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model for boosting a leaderboard.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
participants: List[StrictStr] = Field(description="The participants of the given leaderboard that should be boosted.")
|
|
30
|
+
total_responses: StrictInt = Field(description="The amount of responses in total that should be added, shared across all participants.", alias="totalResponses")
|
|
31
|
+
__properties: ClassVar[List[str]] = ["participants", "totalResponses"]
|
|
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 BoostLeaderboardModel 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 BoostLeaderboardModel 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
|
+
"participants": obj.get("participants"),
|
|
85
|
+
"totalResponses": obj.get("totalResponses")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -27,8 +27,7 @@ class CloneOrderModel(BaseModel):
|
|
|
27
27
|
The model for cloning an existing order.
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
order_name: StrictStr = Field(description="The name of the new order", alias="orderName")
|
|
30
|
-
|
|
31
|
-
__properties: ClassVar[List[str]] = ["orderName", "orderToCloneId"]
|
|
30
|
+
__properties: ClassVar[List[str]] = ["orderName"]
|
|
32
31
|
|
|
33
32
|
model_config = ConfigDict(
|
|
34
33
|
populate_by_name=True,
|
|
@@ -81,8 +80,7 @@ class CloneOrderModel(BaseModel):
|
|
|
81
80
|
return cls.model_validate(obj)
|
|
82
81
|
|
|
83
82
|
_obj = cls.model_validate({
|
|
84
|
-
"orderName": obj.get("orderName")
|
|
85
|
-
"orderToCloneId": obj.get("orderToCloneId")
|
|
83
|
+
"orderName": obj.get("orderName")
|
|
86
84
|
})
|
|
87
85
|
return _obj
|
|
88
86
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class CreateBenchmarkModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model for creating a benchmark.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
name: StrictStr = Field(description="The name of the benchmark")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["name"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of CreateBenchmarkModel from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of CreateBenchmarkModel from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"name": obj.get("name")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|