rapidata 2.27.5__py3-none-any.whl → 2.28.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 (44) hide show
  1. rapidata/__init__.py +3 -1
  2. rapidata/api_client/__init__.py +19 -1
  3. rapidata/api_client/api/__init__.py +1 -0
  4. rapidata/api_client/api/client_api.py +319 -46
  5. rapidata/api_client/api/leaderboard_api.py +2506 -0
  6. rapidata/api_client/models/__init__.py +18 -1
  7. rapidata/api_client/models/client_model.py +191 -0
  8. rapidata/api_client/models/create_customer_client_result.py +89 -0
  9. rapidata/api_client/models/create_leaderboard_model.py +91 -0
  10. rapidata/api_client/models/create_leaderboard_participant_model.py +87 -0
  11. rapidata/api_client/models/create_leaderboard_participant_result.py +89 -0
  12. rapidata/api_client/models/create_leaderboard_result.py +87 -0
  13. rapidata/api_client/models/dynamic_client_registration_request.py +175 -0
  14. rapidata/api_client/models/get_leaderboard_by_id_result.py +91 -0
  15. rapidata/api_client/models/get_participant_by_id_result.py +102 -0
  16. rapidata/api_client/models/json_web_key.py +258 -0
  17. rapidata/api_client/models/json_web_key_set.py +115 -0
  18. rapidata/api_client/models/leaderboard_query_result.py +93 -0
  19. rapidata/api_client/models/leaderboard_query_result_paged_result.py +105 -0
  20. rapidata/api_client/models/participant_by_leaderboard.py +102 -0
  21. rapidata/api_client/models/participant_by_leaderboard_paged_result.py +105 -0
  22. rapidata/api_client/models/participant_status.py +39 -0
  23. rapidata/api_client/models/prompt_by_leaderboard_result.py +90 -0
  24. rapidata/api_client/models/prompt_by_leaderboard_result_paged_result.py +105 -0
  25. rapidata/api_client_README.md +29 -2
  26. rapidata/rapidata_client/__init__.py +2 -0
  27. rapidata/rapidata_client/leaderboard/__init__.py +0 -0
  28. rapidata/rapidata_client/leaderboard/rapidata_leaderboard.py +127 -0
  29. rapidata/rapidata_client/leaderboard/rapidata_leaderboard_manager.py +80 -0
  30. rapidata/rapidata_client/order/rapidata_order.py +0 -1
  31. rapidata/rapidata_client/order/rapidata_order_manager.py +5 -5
  32. rapidata/rapidata_client/order/rapidata_results.py +17 -9
  33. rapidata/rapidata_client/rapidata_client.py +4 -0
  34. rapidata/rapidata_client/selection/__init__.py +1 -0
  35. rapidata/rapidata_client/selection/effort_selection.py +19 -0
  36. rapidata/rapidata_client/settings/__init__.py +1 -0
  37. rapidata/rapidata_client/settings/allow_neither_both.py +15 -0
  38. rapidata/rapidata_client/settings/rapidata_settings.py +3 -1
  39. rapidata/rapidata_client/validation/validation_set_manager.py +14 -0
  40. rapidata/service/openapi_service.py +5 -0
  41. {rapidata-2.27.5.dist-info → rapidata-2.28.0.dist-info}/METADATA +1 -1
  42. {rapidata-2.27.5.dist-info → rapidata-2.28.0.dist-info}/RECORD +44 -20
  43. {rapidata-2.27.5.dist-info → rapidata-2.28.0.dist-info}/LICENSE +0 -0
  44. {rapidata-2.27.5.dist-info → rapidata-2.28.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,258 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import 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, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class JsonWebKey(BaseModel):
26
+ """
27
+ JsonWebKey
28
+ """ # noqa: E501
29
+ alg: Optional[StrictStr] = None
30
+ crv: Optional[StrictStr] = None
31
+ d: Optional[StrictStr] = None
32
+ dp: Optional[StrictStr] = None
33
+ dq: Optional[StrictStr] = None
34
+ e: Optional[StrictStr] = None
35
+ k: Optional[StrictStr] = None
36
+ key_ops: Optional[List[StrictStr]] = None
37
+ kid: Optional[StrictStr] = None
38
+ kty: Optional[StrictStr] = None
39
+ n: Optional[StrictStr] = None
40
+ oth: Optional[List[StrictStr]] = None
41
+ p: Optional[StrictStr] = None
42
+ q: Optional[StrictStr] = None
43
+ qi: Optional[StrictStr] = None
44
+ use: Optional[StrictStr] = None
45
+ x: Optional[StrictStr] = None
46
+ x5c: Optional[List[StrictStr]] = None
47
+ x5t: Optional[StrictStr] = None
48
+ x5t_s256: Optional[StrictStr] = Field(default=None, alias="x5t#S256")
49
+ x5u: Optional[StrictStr] = None
50
+ y: Optional[StrictStr] = None
51
+ additional_properties: Dict[str, Any] = {}
52
+ __properties: ClassVar[List[str]] = ["alg", "crv", "d", "dp", "dq", "e", "k", "key_ops", "kid", "kty", "n", "oth", "p", "q", "qi", "use", "x", "x5c", "x5t", "x5t#S256", "x5u", "y"]
53
+
54
+ model_config = ConfigDict(
55
+ populate_by_name=True,
56
+ validate_assignment=True,
57
+ protected_namespaces=(),
58
+ )
59
+
60
+
61
+ def to_str(self) -> str:
62
+ """Returns the string representation of the model using alias"""
63
+ return pprint.pformat(self.model_dump(by_alias=True))
64
+
65
+ def to_json(self) -> str:
66
+ """Returns the JSON representation of the model using alias"""
67
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
68
+ return json.dumps(self.to_dict())
69
+
70
+ @classmethod
71
+ def from_json(cls, json_str: str) -> Optional[Self]:
72
+ """Create an instance of JsonWebKey from a JSON string"""
73
+ return cls.from_dict(json.loads(json_str))
74
+
75
+ def to_dict(self) -> Dict[str, Any]:
76
+ """Return the dictionary representation of the model using alias.
77
+
78
+ This has the following differences from calling pydantic's
79
+ `self.model_dump(by_alias=True)`:
80
+
81
+ * `None` is only added to the output dict for nullable fields that
82
+ were set at model initialization. Other fields with value `None`
83
+ are ignored.
84
+ * OpenAPI `readOnly` fields are excluded.
85
+ * OpenAPI `readOnly` fields are excluded.
86
+ * OpenAPI `readOnly` fields are excluded.
87
+ * Fields in `self.additional_properties` are added to the output dict.
88
+ """
89
+ excluded_fields: Set[str] = set([
90
+ "key_ops",
91
+ "oth",
92
+ "x5c",
93
+ "additional_properties",
94
+ ])
95
+
96
+ _dict = self.model_dump(
97
+ by_alias=True,
98
+ exclude=excluded_fields,
99
+ exclude_none=True,
100
+ )
101
+ # puts key-value pairs in additional_properties in the top level
102
+ if self.additional_properties is not None:
103
+ for _key, _value in self.additional_properties.items():
104
+ _dict[_key] = _value
105
+
106
+ # set to None if alg (nullable) is None
107
+ # and model_fields_set contains the field
108
+ if self.alg is None and "alg" in self.model_fields_set:
109
+ _dict['alg'] = None
110
+
111
+ # set to None if crv (nullable) is None
112
+ # and model_fields_set contains the field
113
+ if self.crv is None and "crv" in self.model_fields_set:
114
+ _dict['crv'] = None
115
+
116
+ # set to None if d (nullable) is None
117
+ # and model_fields_set contains the field
118
+ if self.d is None and "d" in self.model_fields_set:
119
+ _dict['d'] = None
120
+
121
+ # set to None if dp (nullable) is None
122
+ # and model_fields_set contains the field
123
+ if self.dp is None and "dp" in self.model_fields_set:
124
+ _dict['dp'] = None
125
+
126
+ # set to None if dq (nullable) is None
127
+ # and model_fields_set contains the field
128
+ if self.dq is None and "dq" in self.model_fields_set:
129
+ _dict['dq'] = None
130
+
131
+ # set to None if e (nullable) is None
132
+ # and model_fields_set contains the field
133
+ if self.e is None and "e" in self.model_fields_set:
134
+ _dict['e'] = None
135
+
136
+ # set to None if k (nullable) is None
137
+ # and model_fields_set contains the field
138
+ if self.k is None and "k" in self.model_fields_set:
139
+ _dict['k'] = None
140
+
141
+ # set to None if key_ops (nullable) is None
142
+ # and model_fields_set contains the field
143
+ if self.key_ops is None and "key_ops" in self.model_fields_set:
144
+ _dict['key_ops'] = None
145
+
146
+ # set to None if kid (nullable) is None
147
+ # and model_fields_set contains the field
148
+ if self.kid is None and "kid" in self.model_fields_set:
149
+ _dict['kid'] = None
150
+
151
+ # set to None if kty (nullable) is None
152
+ # and model_fields_set contains the field
153
+ if self.kty is None and "kty" in self.model_fields_set:
154
+ _dict['kty'] = None
155
+
156
+ # set to None if n (nullable) is None
157
+ # and model_fields_set contains the field
158
+ if self.n is None and "n" in self.model_fields_set:
159
+ _dict['n'] = None
160
+
161
+ # set to None if oth (nullable) is None
162
+ # and model_fields_set contains the field
163
+ if self.oth is None and "oth" in self.model_fields_set:
164
+ _dict['oth'] = None
165
+
166
+ # set to None if p (nullable) is None
167
+ # and model_fields_set contains the field
168
+ if self.p is None and "p" in self.model_fields_set:
169
+ _dict['p'] = None
170
+
171
+ # set to None if q (nullable) is None
172
+ # and model_fields_set contains the field
173
+ if self.q is None and "q" in self.model_fields_set:
174
+ _dict['q'] = None
175
+
176
+ # set to None if qi (nullable) is None
177
+ # and model_fields_set contains the field
178
+ if self.qi is None and "qi" in self.model_fields_set:
179
+ _dict['qi'] = None
180
+
181
+ # set to None if use (nullable) is None
182
+ # and model_fields_set contains the field
183
+ if self.use is None and "use" in self.model_fields_set:
184
+ _dict['use'] = None
185
+
186
+ # set to None if x (nullable) is None
187
+ # and model_fields_set contains the field
188
+ if self.x is None and "x" in self.model_fields_set:
189
+ _dict['x'] = None
190
+
191
+ # set to None if x5c (nullable) is None
192
+ # and model_fields_set contains the field
193
+ if self.x5c is None and "x5c" in self.model_fields_set:
194
+ _dict['x5c'] = None
195
+
196
+ # set to None if x5t (nullable) is None
197
+ # and model_fields_set contains the field
198
+ if self.x5t is None and "x5t" in self.model_fields_set:
199
+ _dict['x5t'] = None
200
+
201
+ # set to None if x5t_s256 (nullable) is None
202
+ # and model_fields_set contains the field
203
+ if self.x5t_s256 is None and "x5t_s256" in self.model_fields_set:
204
+ _dict['x5t#S256'] = None
205
+
206
+ # set to None if x5u (nullable) is None
207
+ # and model_fields_set contains the field
208
+ if self.x5u is None and "x5u" in self.model_fields_set:
209
+ _dict['x5u'] = None
210
+
211
+ # set to None if y (nullable) is None
212
+ # and model_fields_set contains the field
213
+ if self.y is None and "y" in self.model_fields_set:
214
+ _dict['y'] = None
215
+
216
+ return _dict
217
+
218
+ @classmethod
219
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
220
+ """Create an instance of JsonWebKey from a dict"""
221
+ if obj is None:
222
+ return None
223
+
224
+ if not isinstance(obj, dict):
225
+ return cls.model_validate(obj)
226
+
227
+ _obj = cls.model_validate({
228
+ "alg": obj.get("alg"),
229
+ "crv": obj.get("crv"),
230
+ "d": obj.get("d"),
231
+ "dp": obj.get("dp"),
232
+ "dq": obj.get("dq"),
233
+ "e": obj.get("e"),
234
+ "k": obj.get("k"),
235
+ "key_ops": obj.get("key_ops"),
236
+ "kid": obj.get("kid"),
237
+ "kty": obj.get("kty"),
238
+ "n": obj.get("n"),
239
+ "oth": obj.get("oth"),
240
+ "p": obj.get("p"),
241
+ "q": obj.get("q"),
242
+ "qi": obj.get("qi"),
243
+ "use": obj.get("use"),
244
+ "x": obj.get("x"),
245
+ "x5c": obj.get("x5c"),
246
+ "x5t": obj.get("x5t"),
247
+ "x5t#S256": obj.get("x5t#S256"),
248
+ "x5u": obj.get("x5u"),
249
+ "y": obj.get("y")
250
+ })
251
+ # store additional fields in additional_properties
252
+ for _key in obj.keys():
253
+ if _key not in cls.__properties:
254
+ _obj.additional_properties[_key] = obj.get(_key)
255
+
256
+ return _obj
257
+
258
+
@@ -0,0 +1,115 @@
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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.json_web_key import JsonWebKey
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class JsonWebKeySet(BaseModel):
27
+ """
28
+ JsonWebKeySet
29
+ """ # noqa: E501
30
+ keys: Optional[List[JsonWebKey]] = None
31
+ additional_properties: Dict[str, Any] = {}
32
+ __properties: ClassVar[List[str]] = ["keys"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of JsonWebKeySet from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ * OpenAPI `readOnly` fields are excluded.
65
+ * Fields in `self.additional_properties` are added to the output dict.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ "keys",
69
+ "additional_properties",
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # override the default output from pydantic by calling `to_dict()` of each item in keys (list)
78
+ _items = []
79
+ if self.keys:
80
+ for _item_keys in self.keys:
81
+ if _item_keys:
82
+ _items.append(_item_keys.to_dict())
83
+ _dict['keys'] = _items
84
+ # puts key-value pairs in additional_properties in the top level
85
+ if self.additional_properties is not None:
86
+ for _key, _value in self.additional_properties.items():
87
+ _dict[_key] = _value
88
+
89
+ # set to None if keys (nullable) is None
90
+ # and model_fields_set contains the field
91
+ if self.keys is None and "keys" in self.model_fields_set:
92
+ _dict['keys'] = None
93
+
94
+ return _dict
95
+
96
+ @classmethod
97
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
98
+ """Create an instance of JsonWebKeySet from a dict"""
99
+ if obj is None:
100
+ return None
101
+
102
+ if not isinstance(obj, dict):
103
+ return cls.model_validate(obj)
104
+
105
+ _obj = cls.model_validate({
106
+ "keys": [JsonWebKey.from_dict(_item) for _item in obj["keys"]] if obj.get("keys") is not None else None
107
+ })
108
+ # store additional fields in additional_properties
109
+ for _key in obj.keys():
110
+ if _key not in cls.__properties:
111
+ _obj.additional_properties[_key] = obj.get(_key)
112
+
113
+ return _obj
114
+
115
+
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class LeaderboardQueryResult(BaseModel):
26
+ """
27
+ LeaderboardQueryResult
28
+ """ # noqa: E501
29
+ id: StrictStr
30
+ name: StrictStr
31
+ instruction: StrictStr
32
+ show_prompt: StrictBool = Field(alias="showPrompt")
33
+ __properties: ClassVar[List[str]] = ["id", "name", "instruction", "showPrompt"]
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 LeaderboardQueryResult 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 LeaderboardQueryResult 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
+ "id": obj.get("id"),
87
+ "name": obj.get("name"),
88
+ "instruction": obj.get("instruction"),
89
+ "showPrompt": obj.get("showPrompt")
90
+ })
91
+ return _obj
92
+
93
+
@@ -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.leaderboard_query_result import LeaderboardQueryResult
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class LeaderboardQueryResultPagedResult(BaseModel):
27
+ """
28
+ LeaderboardQueryResultPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[LeaderboardQueryResult]
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 LeaderboardQueryResultPagedResult 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 LeaderboardQueryResultPagedResult 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": [LeaderboardQueryResult.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,102 @@
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, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ParticipantByLeaderboard(BaseModel):
26
+ """
27
+ ParticipantByLeaderboard
28
+ """ # noqa: E501
29
+ id: StrictStr
30
+ name: StrictStr
31
+ score: Union[StrictFloat, StrictInt]
32
+ status: StrictStr
33
+ dataset_id: StrictStr = Field(alias="datasetId")
34
+ __properties: ClassVar[List[str]] = ["id", "name", "score", "status", "datasetId"]
35
+
36
+ @field_validator('status')
37
+ def status_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['Created', 'Queued', 'Running', 'Completed']):
40
+ raise ValueError("must be one of enum values ('Created', 'Queued', 'Running', 'Completed')")
41
+ return value
42
+
43
+ model_config = ConfigDict(
44
+ populate_by_name=True,
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ def to_str(self) -> str:
51
+ """Returns the string representation of the model using alias"""
52
+ return pprint.pformat(self.model_dump(by_alias=True))
53
+
54
+ def to_json(self) -> str:
55
+ """Returns the JSON representation of the model using alias"""
56
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
57
+ return json.dumps(self.to_dict())
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of ParticipantByLeaderboard from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of ParticipantByLeaderboard from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "id": obj.get("id"),
95
+ "name": obj.get("name"),
96
+ "score": obj.get("score"),
97
+ "status": obj.get("status"),
98
+ "datasetId": obj.get("datasetId")
99
+ })
100
+ return _obj
101
+
102
+