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,224 @@
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_model1 import NewUserFilterModel1
27
+ from rapidata.api_client.models.user_score_user_filter_model import UserScoreUserFilterModel
28
+ from pydantic import StrictStr, Field
29
+ from typing import Union, List, Set, Optional, Dict
30
+ from typing_extensions import Literal, Self
31
+
32
+ ADDCAMPAIGNMODELUSERFILTERSINNER_ONE_OF_SCHEMAS = ["AgeUserFilterModel", "CampaignUserFilterModel", "CountryUserFilterModel", "CustomUserFilterModel", "GenderUserFilterModel", "LanguageUserFilterModel", "NewUserFilterModel1", "UserScoreUserFilterModel"]
33
+
34
+ class AddCampaignModelUserFiltersInner(BaseModel):
35
+ """
36
+ AddCampaignModelUserFiltersInner
37
+ """
38
+ # data type: AgeUserFilterModel
39
+ oneof_schema_1_validator: Optional[AgeUserFilterModel] = None
40
+ # data type: CampaignUserFilterModel
41
+ oneof_schema_2_validator: Optional[CampaignUserFilterModel] = None
42
+ # data type: CountryUserFilterModel
43
+ oneof_schema_3_validator: Optional[CountryUserFilterModel] = None
44
+ # data type: CustomUserFilterModel
45
+ oneof_schema_4_validator: Optional[CustomUserFilterModel] = None
46
+ # data type: GenderUserFilterModel
47
+ oneof_schema_5_validator: Optional[GenderUserFilterModel] = None
48
+ # data type: LanguageUserFilterModel
49
+ oneof_schema_6_validator: Optional[LanguageUserFilterModel] = None
50
+ # data type: NewUserFilterModel1
51
+ oneof_schema_7_validator: Optional[NewUserFilterModel1] = None
52
+ # data type: UserScoreUserFilterModel
53
+ oneof_schema_8_validator: Optional[UserScoreUserFilterModel] = None
54
+ actual_instance: Optional[Union[AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel1, UserScoreUserFilterModel]] = None
55
+ one_of_schemas: Set[str] = { "AgeUserFilterModel", "CampaignUserFilterModel", "CountryUserFilterModel", "CustomUserFilterModel", "GenderUserFilterModel", "LanguageUserFilterModel", "NewUserFilterModel1", "UserScoreUserFilterModel" }
56
+
57
+ model_config = ConfigDict(
58
+ validate_assignment=True,
59
+ protected_namespaces=(),
60
+ )
61
+
62
+
63
+ discriminator_value_class_map: Dict[str, str] = {
64
+ }
65
+
66
+ def __init__(self, *args, **kwargs) -> None:
67
+ if args:
68
+ if len(args) > 1:
69
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
70
+ if kwargs:
71
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
72
+ super().__init__(actual_instance=args[0])
73
+ else:
74
+ super().__init__(**kwargs)
75
+
76
+ @field_validator('actual_instance')
77
+ def actual_instance_must_validate_oneof(cls, v):
78
+ instance = AddCampaignModelUserFiltersInner.model_construct()
79
+ error_messages = []
80
+ match = 0
81
+ # validate data type: AgeUserFilterModel
82
+ if not isinstance(v, AgeUserFilterModel):
83
+ error_messages.append(f"Error! Input type `{type(v)}` is not `AgeUserFilterModel`")
84
+ else:
85
+ match += 1
86
+ # validate data type: CampaignUserFilterModel
87
+ if not isinstance(v, CampaignUserFilterModel):
88
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CampaignUserFilterModel`")
89
+ else:
90
+ match += 1
91
+ # validate data type: CountryUserFilterModel
92
+ if not isinstance(v, CountryUserFilterModel):
93
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CountryUserFilterModel`")
94
+ else:
95
+ match += 1
96
+ # validate data type: CustomUserFilterModel
97
+ if not isinstance(v, CustomUserFilterModel):
98
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CustomUserFilterModel`")
99
+ else:
100
+ match += 1
101
+ # validate data type: GenderUserFilterModel
102
+ if not isinstance(v, GenderUserFilterModel):
103
+ error_messages.append(f"Error! Input type `{type(v)}` is not `GenderUserFilterModel`")
104
+ else:
105
+ match += 1
106
+ # validate data type: LanguageUserFilterModel
107
+ if not isinstance(v, LanguageUserFilterModel):
108
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LanguageUserFilterModel`")
109
+ else:
110
+ match += 1
111
+ # validate data type: NewUserFilterModel1
112
+ if not isinstance(v, NewUserFilterModel1):
113
+ error_messages.append(f"Error! Input type `{type(v)}` is not `NewUserFilterModel1`")
114
+ else:
115
+ match += 1
116
+ # validate data type: UserScoreUserFilterModel
117
+ if not isinstance(v, UserScoreUserFilterModel):
118
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UserScoreUserFilterModel`")
119
+ else:
120
+ match += 1
121
+ if match > 1:
122
+ # more than 1 match
123
+ raise ValueError("Multiple matches found when setting `actual_instance` in AddCampaignModelUserFiltersInner with oneOf schemas: AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel1, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
124
+ elif match == 0:
125
+ # no match
126
+ raise ValueError("No match found when setting `actual_instance` in AddCampaignModelUserFiltersInner with oneOf schemas: AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel1, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
127
+ else:
128
+ return v
129
+
130
+ @classmethod
131
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
132
+ return cls.from_json(json.dumps(obj))
133
+
134
+ @classmethod
135
+ def from_json(cls, json_str: str) -> Self:
136
+ """Returns the object represented by the json string"""
137
+ instance = cls.model_construct()
138
+ error_messages = []
139
+ match = 0
140
+
141
+ # deserialize data into AgeUserFilterModel
142
+ try:
143
+ instance.actual_instance = AgeUserFilterModel.from_json(json_str)
144
+ match += 1
145
+ except (ValidationError, ValueError) as e:
146
+ error_messages.append(str(e))
147
+ # deserialize data into CampaignUserFilterModel
148
+ try:
149
+ instance.actual_instance = CampaignUserFilterModel.from_json(json_str)
150
+ match += 1
151
+ except (ValidationError, ValueError) as e:
152
+ error_messages.append(str(e))
153
+ # deserialize data into CountryUserFilterModel
154
+ try:
155
+ instance.actual_instance = CountryUserFilterModel.from_json(json_str)
156
+ match += 1
157
+ except (ValidationError, ValueError) as e:
158
+ error_messages.append(str(e))
159
+ # deserialize data into CustomUserFilterModel
160
+ try:
161
+ instance.actual_instance = CustomUserFilterModel.from_json(json_str)
162
+ match += 1
163
+ except (ValidationError, ValueError) as e:
164
+ error_messages.append(str(e))
165
+ # deserialize data into GenderUserFilterModel
166
+ try:
167
+ instance.actual_instance = GenderUserFilterModel.from_json(json_str)
168
+ match += 1
169
+ except (ValidationError, ValueError) as e:
170
+ error_messages.append(str(e))
171
+ # deserialize data into LanguageUserFilterModel
172
+ try:
173
+ instance.actual_instance = LanguageUserFilterModel.from_json(json_str)
174
+ match += 1
175
+ except (ValidationError, ValueError) as e:
176
+ error_messages.append(str(e))
177
+ # deserialize data into NewUserFilterModel1
178
+ try:
179
+ instance.actual_instance = NewUserFilterModel1.from_json(json_str)
180
+ match += 1
181
+ except (ValidationError, ValueError) as e:
182
+ error_messages.append(str(e))
183
+ # deserialize data into UserScoreUserFilterModel
184
+ try:
185
+ instance.actual_instance = UserScoreUserFilterModel.from_json(json_str)
186
+ match += 1
187
+ except (ValidationError, ValueError) as e:
188
+ error_messages.append(str(e))
189
+
190
+ if match > 1:
191
+ # more than 1 match
192
+ raise ValueError("Multiple matches found when deserializing the JSON string into AddCampaignModelUserFiltersInner with oneOf schemas: AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel1, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
193
+ elif match == 0:
194
+ # no match
195
+ raise ValueError("No match found when deserializing the JSON string into AddCampaignModelUserFiltersInner with oneOf schemas: AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel1, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
196
+ else:
197
+ return instance
198
+
199
+ def to_json(self) -> str:
200
+ """Returns the JSON representation of the actual instance"""
201
+ if self.actual_instance is None:
202
+ return "null"
203
+
204
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
205
+ return self.actual_instance.to_json()
206
+ else:
207
+ return json.dumps(self.actual_instance)
208
+
209
+ def to_dict(self) -> Optional[Union[Dict[str, Any], AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, CustomUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, NewUserFilterModel1, UserScoreUserFilterModel]]:
210
+ """Returns the dict representation of the actual instance"""
211
+ if self.actual_instance is None:
212
+ return None
213
+
214
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
215
+ return self.actual_instance.to_dict()
216
+ else:
217
+ # primitive type
218
+ return self.actual_instance
219
+
220
+ def to_str(self) -> str:
221
+ """Returns the string representation of the actual instance"""
222
+ return pprint.pformat(self.model_dump())
223
+
224
+
@@ -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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CampaignQueryResult(BaseModel):
27
+ """
28
+ CampaignQueryResult
29
+ """ # noqa: E501
30
+ id: StrictStr
31
+ owner_mail: StrictStr = Field(alias="ownerMail")
32
+ name: StrictStr
33
+ status: StrictStr
34
+ priority: StrictInt
35
+ created_at: datetime = Field(alias="createdAt")
36
+ __properties: ClassVar[List[str]] = ["id", "ownerMail", "name", "status", "priority", "createdAt"]
37
+
38
+ @field_validator('status')
39
+ def status_validate_enum(cls, value):
40
+ """Validates the enum"""
41
+ if value not in set(['Created', 'Active', 'Paused', 'Completed']):
42
+ raise ValueError("must be one of enum values ('Created', 'Active', 'Paused', 'Completed')")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of CampaignQueryResult from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of CampaignQueryResult from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "id": obj.get("id"),
97
+ "ownerMail": obj.get("ownerMail"),
98
+ "name": obj.get("name"),
99
+ "status": obj.get("status"),
100
+ "priority": obj.get("priority"),
101
+ "createdAt": obj.get("createdAt")
102
+ })
103
+ return _obj
104
+
105
+
@@ -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.campaign_query_result import CampaignQueryResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class CampaignQueryResultPagedResult(BaseModel):
27
+ """
28
+ CampaignQueryResultPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[CampaignQueryResult]
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 CampaignQueryResultPagedResult 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 CampaignQueryResultPagedResult 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": [CampaignQueryResult.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
+
@@ -28,8 +28,7 @@ class ClassificationMetadataModel(BaseModel):
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for ClassificationMetadata", alias="_t")
30
30
  classification: StrictStr
31
- identifier: StrictStr
32
- __properties: ClassVar[List[str]] = ["_t", "classification", "identifier"]
31
+ __properties: ClassVar[List[str]] = ["_t", "classification"]
33
32
 
34
33
  @field_validator('t')
35
34
  def t_validate_enum(cls, value):
@@ -90,8 +89,7 @@ class ClassificationMetadataModel(BaseModel):
90
89
 
91
90
  _obj = cls.model_validate({
92
91
  "_t": obj.get("_t") if obj.get("_t") is not None else 'ClassificationMetadata',
93
- "classification": obj.get("classification"),
94
- "identifier": obj.get("identifier")
92
+ "classification": obj.get("classification")
95
93
  })
96
94
  return _obj
97
95
 
@@ -17,10 +17,11 @@ 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, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from rapidata.api_client.models.compare_workflow_config_pair_maker_config import CompareWorkflowConfigPairMakerConfig
23
23
  from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
24
+ from rapidata.api_client.models.elo_config import EloConfig
24
25
  from typing import Optional, Set
25
26
  from typing_extensions import Self
26
27
 
@@ -30,14 +31,11 @@ class CompareWorkflowConfig(BaseModel):
30
31
  """ # noqa: E501
31
32
  t: StrictStr = Field(description="Discriminator value for CompareWorkflowConfig", alias="_t")
32
33
  criteria: StrictStr
33
- starting_elo: Optional[StrictInt] = Field(default=None, alias="startingElo")
34
- k_factor: Optional[StrictInt] = Field(default=None, alias="kFactor")
35
- scaling_factor: Optional[StrictInt] = Field(default=None, alias="scalingFactor")
34
+ elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
36
35
  pair_maker_config: Optional[CompareWorkflowConfigPairMakerConfig] = Field(default=None, alias="pairMakerConfig")
37
- matches_until_completed: Optional[StrictInt] = Field(default=None, alias="matchesUntilCompleted")
38
36
  referee: CompareWorkflowModel1Referee
39
37
  target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
40
- __properties: ClassVar[List[str]] = ["_t", "criteria", "startingElo", "kFactor", "scalingFactor", "pairMakerConfig", "matchesUntilCompleted", "referee", "targetCountryCodes"]
38
+ __properties: ClassVar[List[str]] = ["_t", "criteria", "eloConfig", "pairMakerConfig", "referee", "targetCountryCodes"]
41
39
 
42
40
  @field_validator('t')
43
41
  def t_validate_enum(cls, value):
@@ -85,6 +83,9 @@ class CompareWorkflowConfig(BaseModel):
85
83
  exclude=excluded_fields,
86
84
  exclude_none=True,
87
85
  )
86
+ # override the default output from pydantic by calling `to_dict()` of elo_config
87
+ if self.elo_config:
88
+ _dict['eloConfig'] = self.elo_config.to_dict()
88
89
  # override the default output from pydantic by calling `to_dict()` of pair_maker_config
89
90
  if self.pair_maker_config:
90
91
  _dict['pairMakerConfig'] = self.pair_maker_config.to_dict()
@@ -105,11 +106,8 @@ class CompareWorkflowConfig(BaseModel):
105
106
  _obj = cls.model_validate({
106
107
  "_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowConfig',
107
108
  "criteria": obj.get("criteria"),
108
- "startingElo": obj.get("startingElo"),
109
- "kFactor": obj.get("kFactor"),
110
- "scalingFactor": obj.get("scalingFactor"),
109
+ "eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None,
111
110
  "pairMakerConfig": CompareWorkflowConfigPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
112
- "matchesUntilCompleted": obj.get("matchesUntilCompleted"),
113
111
  "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
114
112
  "targetCountryCodes": obj.get("targetCountryCodes")
115
113
  })
@@ -17,10 +17,11 @@ 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, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from rapidata.api_client.models.compare_workflow_config_model_pair_maker_config import CompareWorkflowConfigModelPairMakerConfig
23
23
  from rapidata.api_client.models.compare_workflow_model1_referee import CompareWorkflowModel1Referee
24
+ from rapidata.api_client.models.elo_config import EloConfig
24
25
  from typing import Optional, Set
25
26
  from typing_extensions import Self
26
27
 
@@ -30,14 +31,11 @@ class CompareWorkflowConfigModel(BaseModel):
30
31
  """ # noqa: E501
31
32
  t: StrictStr = Field(description="Discriminator value for CompareWorkflowConfig", alias="_t")
32
33
  criteria: StrictStr = Field(description="The criteria to add to each compare rapid.")
33
- starting_elo: Optional[StrictInt] = Field(default=None, description="The starting ELO score for each datapoint.", alias="startingElo")
34
- k_factor: Optional[StrictInt] = Field(default=None, description="The K-factor to use in the ELO calculation. Determines the maximum possible change in a player's Elo rating after a single match. Higher K-Factor values result in larger rating changes.", alias="kFactor")
35
- scaling_factor: Optional[StrictInt] = Field(default=None, description="Scaling factor to use in the ELO calculation. Adjusts the sensitivity of the Elo rating system to differences in player ratings. It affects how much the rating changes based on the expected outcome versus the actual outcome.", alias="scalingFactor")
36
34
  pair_maker_config: CompareWorkflowConfigModelPairMakerConfig = Field(alias="pairMakerConfig")
37
- matches_until_completed: Optional[StrictInt] = Field(default=None, description="The number of matches to run before each datapoint is considered \"completed\".", alias="matchesUntilCompleted")
38
35
  referee: CompareWorkflowModel1Referee
39
36
  target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
40
- __properties: ClassVar[List[str]] = ["_t", "criteria", "startingElo", "kFactor", "scalingFactor", "pairMakerConfig", "matchesUntilCompleted", "referee", "targetCountryCodes"]
37
+ elo_config: Optional[EloConfig] = Field(default=None, alias="eloConfig")
38
+ __properties: ClassVar[List[str]] = ["_t", "criteria", "pairMakerConfig", "referee", "targetCountryCodes", "eloConfig"]
41
39
 
42
40
  @field_validator('t')
43
41
  def t_validate_enum(cls, value):
@@ -91,6 +89,9 @@ class CompareWorkflowConfigModel(BaseModel):
91
89
  # override the default output from pydantic by calling `to_dict()` of referee
92
90
  if self.referee:
93
91
  _dict['referee'] = self.referee.to_dict()
92
+ # override the default output from pydantic by calling `to_dict()` of elo_config
93
+ if self.elo_config:
94
+ _dict['eloConfig'] = self.elo_config.to_dict()
94
95
  return _dict
95
96
 
96
97
  @classmethod
@@ -105,13 +106,10 @@ class CompareWorkflowConfigModel(BaseModel):
105
106
  _obj = cls.model_validate({
106
107
  "_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowConfig',
107
108
  "criteria": obj.get("criteria"),
108
- "startingElo": obj.get("startingElo"),
109
- "kFactor": obj.get("kFactor"),
110
- "scalingFactor": obj.get("scalingFactor"),
111
109
  "pairMakerConfig": CompareWorkflowConfigModelPairMakerConfig.from_dict(obj["pairMakerConfig"]) if obj.get("pairMakerConfig") is not None else None,
112
- "matchesUntilCompleted": obj.get("matchesUntilCompleted"),
113
110
  "referee": CompareWorkflowModel1Referee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
114
- "targetCountryCodes": obj.get("targetCountryCodes")
111
+ "targetCountryCodes": obj.get("targetCountryCodes"),
112
+ "eloConfig": EloConfig.from_dict(obj["eloConfig"]) if obj.get("eloConfig") is not None else None
115
113
  })
116
114
  return _obj
117
115
 
@@ -18,12 +18,11 @@ import pprint
18
18
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
19
  from typing import Any, List, Optional
20
20
  from rapidata.api_client.models.online_pair_maker_config import OnlinePairMakerConfig
21
- from rapidata.api_client.models.pre_arranged_pair_maker_config import PreArrangedPairMakerConfig
22
21
  from pydantic import StrictStr, Field
23
22
  from typing import Union, List, Set, Optional, Dict
24
23
  from typing_extensions import Literal, Self
25
24
 
26
- COMPAREWORKFLOWCONFIGMODELPAIRMAKERCONFIG_ONE_OF_SCHEMAS = ["OnlinePairMakerConfig", "PreArrangedPairMakerConfig"]
25
+ COMPAREWORKFLOWCONFIGMODELPAIRMAKERCONFIG_ONE_OF_SCHEMAS = ["OnlinePairMakerConfig"]
27
26
 
28
27
  class CompareWorkflowConfigModelPairMakerConfig(BaseModel):
29
28
  """
@@ -31,10 +30,8 @@ class CompareWorkflowConfigModelPairMakerConfig(BaseModel):
31
30
  """
32
31
  # data type: OnlinePairMakerConfig
33
32
  oneof_schema_1_validator: Optional[OnlinePairMakerConfig] = None
34
- # data type: PreArrangedPairMakerConfig
35
- oneof_schema_2_validator: Optional[PreArrangedPairMakerConfig] = None
36
- actual_instance: Optional[Union[OnlinePairMakerConfig, PreArrangedPairMakerConfig]] = None
37
- one_of_schemas: Set[str] = { "OnlinePairMakerConfig", "PreArrangedPairMakerConfig" }
33
+ actual_instance: Optional[Union[OnlinePairMakerConfig]] = None
34
+ one_of_schemas: Set[str] = { "OnlinePairMakerConfig" }
38
35
 
39
36
  model_config = ConfigDict(
40
37
  validate_assignment=True,
@@ -65,17 +62,12 @@ class CompareWorkflowConfigModelPairMakerConfig(BaseModel):
65
62
  error_messages.append(f"Error! Input type `{type(v)}` is not `OnlinePairMakerConfig`")
66
63
  else:
67
64
  match += 1
68
- # validate data type: PreArrangedPairMakerConfig
69
- if not isinstance(v, PreArrangedPairMakerConfig):
70
- error_messages.append(f"Error! Input type `{type(v)}` is not `PreArrangedPairMakerConfig`")
71
- else:
72
- match += 1
73
65
  if match > 1:
74
66
  # more than 1 match
75
- raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig, PreArrangedPairMakerConfig. Details: " + ", ".join(error_messages))
67
+ raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig. Details: " + ", ".join(error_messages))
76
68
  elif match == 0:
77
69
  # no match
78
- raise ValueError("No match found when setting `actual_instance` in CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig, PreArrangedPairMakerConfig. Details: " + ", ".join(error_messages))
70
+ raise ValueError("No match found when setting `actual_instance` in CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig. Details: " + ", ".join(error_messages))
79
71
  else:
80
72
  return v
81
73
 
@@ -96,19 +88,13 @@ class CompareWorkflowConfigModelPairMakerConfig(BaseModel):
96
88
  match += 1
97
89
  except (ValidationError, ValueError) as e:
98
90
  error_messages.append(str(e))
99
- # deserialize data into PreArrangedPairMakerConfig
100
- try:
101
- instance.actual_instance = PreArrangedPairMakerConfig.from_json(json_str)
102
- match += 1
103
- except (ValidationError, ValueError) as e:
104
- error_messages.append(str(e))
105
91
 
106
92
  if match > 1:
107
93
  # more than 1 match
108
- raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig, PreArrangedPairMakerConfig. Details: " + ", ".join(error_messages))
94
+ raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig. Details: " + ", ".join(error_messages))
109
95
  elif match == 0:
110
96
  # no match
111
- raise ValueError("No match found when deserializing the JSON string into CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig, PreArrangedPairMakerConfig. Details: " + ", ".join(error_messages))
97
+ raise ValueError("No match found when deserializing the JSON string into CompareWorkflowConfigModelPairMakerConfig with oneOf schemas: OnlinePairMakerConfig. Details: " + ", ".join(error_messages))
112
98
  else:
113
99
  return instance
114
100
 
@@ -122,7 +108,7 @@ class CompareWorkflowConfigModelPairMakerConfig(BaseModel):
122
108
  else:
123
109
  return json.dumps(self.actual_instance)
124
110
 
125
- def to_dict(self) -> Optional[Union[Dict[str, Any], OnlinePairMakerConfig, PreArrangedPairMakerConfig]]:
111
+ def to_dict(self) -> Optional[Union[Dict[str, Any], OnlinePairMakerConfig]]:
126
112
  """Returns the dict representation of the actual instance"""
127
113
  if self.actual_instance is None:
128
114
  return None