rapidata 2.26.0__py3-none-any.whl → 2.27.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 (64) hide show
  1. rapidata/__init__.py +2 -2
  2. rapidata/api_client/__init__.py +11 -3
  3. rapidata/api_client/api/__init__.py +2 -1
  4. rapidata/api_client/api/client_api.py +0 -257
  5. rapidata/api_client/api/customer_rapid_api.py +1644 -0
  6. rapidata/api_client/api/dataset_api.py +358 -1
  7. rapidata/api_client/api/newsletter_api.py +11 -299
  8. rapidata/api_client/api/user_rapid_api.py +1385 -0
  9. rapidata/api_client/api/validation_set_api.py +6 -6
  10. rapidata/api_client/models/__init__.py +9 -2
  11. rapidata/api_client/models/add_campaign_model.py +5 -0
  12. rapidata/api_client/models/add_validation_rapid_model.py +3 -3
  13. rapidata/api_client/models/add_validation_rapid_model_truth.py +25 -11
  14. rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
  15. rapidata/api_client/models/asset_metadata_model.py +2 -8
  16. rapidata/api_client/models/compare_result.py +1 -10
  17. rapidata/api_client/models/compare_workflow_model.py +3 -3
  18. rapidata/api_client/models/create_datapoint_from_files_model.py +3 -3
  19. rapidata/api_client/models/create_datapoint_from_text_sources_model.py +3 -3
  20. rapidata/api_client/models/create_datapoint_from_urls_model.py +3 -3
  21. rapidata/api_client/models/create_order_model.py +2 -4
  22. rapidata/api_client/models/datapoint.py +3 -3
  23. rapidata/api_client/models/datapoint_metadata_model.py +3 -3
  24. rapidata/api_client/models/datapoint_model.py +3 -3
  25. rapidata/api_client/models/dataset_dataset_id_datapoints_post_request_metadata_inner.py +182 -0
  26. rapidata/api_client/models/file_asset_model.py +1 -3
  27. rapidata/api_client/models/file_asset_model_metadata_value.py +1 -3
  28. rapidata/api_client/models/get_compare_workflow_results_result.py +3 -3
  29. rapidata/api_client/models/get_datapoint_by_id_result.py +3 -3
  30. rapidata/api_client/models/get_rapid_responses_result.py +5 -5
  31. rapidata/api_client/models/get_validation_rapids_result.py +12 -3
  32. rapidata/api_client/models/get_validation_rapids_result_truth.py +25 -11
  33. rapidata/api_client/models/get_workflow_results_result.py +5 -5
  34. rapidata/api_client/models/multi_asset_model.py +4 -4
  35. rapidata/api_client/models/multi_compare_truth.py +96 -0
  36. rapidata/api_client/models/naive_referee_info.py +96 -0
  37. rapidata/api_client/models/never_ending_referee_info.py +94 -0
  38. rapidata/api_client/models/null_asset_model.py +1 -3
  39. rapidata/api_client/models/probabilistic_attach_category_referee_info.py +98 -0
  40. rapidata/api_client/models/rapid_model.py +173 -0
  41. rapidata/api_client/models/rapid_model_paged_result.py +105 -0
  42. rapidata/api_client/models/rapid_model_referee.py +154 -0
  43. rapidata/api_client/models/rapid_state.py +1 -0
  44. rapidata/api_client/models/text_asset_model.py +1 -3
  45. rapidata/api_client/models/update_access_model.py +1 -1
  46. rapidata/api_client/models/update_validation_rapid_model.py +3 -8
  47. rapidata/api_client/models/update_validation_rapid_model_truth.py +26 -12
  48. rapidata/api_client/models/upload_files_from_s3_bucket_model.py +12 -2
  49. rapidata/api_client/models/upload_text_sources_to_dataset_model.py +3 -3
  50. rapidata/api_client_README.md +21 -13
  51. rapidata/rapidata_client/__init__.py +1 -1
  52. rapidata/rapidata_client/assets/_multi_asset.py +0 -5
  53. rapidata/rapidata_client/logging/__init__.py +1 -1
  54. rapidata/rapidata_client/logging/output_manager.py +2 -2
  55. rapidata/rapidata_client/order/_rapidata_dataset.py +16 -39
  56. rapidata/rapidata_client/order/rapidata_order.py +21 -16
  57. rapidata/rapidata_client/order/rapidata_order_manager.py +2 -3
  58. rapidata/rapidata_client/validation/rapids/rapids.py +3 -4
  59. rapidata/rapidata_client/validation/validation_set_manager.py +2 -3
  60. rapidata/rapidata_client/workflow/_ranking_workflow.py +2 -6
  61. {rapidata-2.26.0.dist-info → rapidata-2.27.0.dist-info}/METADATA +1 -1
  62. {rapidata-2.26.0.dist-info → rapidata-2.27.0.dist-info}/RECORD +64 -54
  63. {rapidata-2.26.0.dist-info → rapidata-2.27.0.dist-info}/LICENSE +0 -0
  64. {rapidata-2.26.0.dist-info → rapidata-2.27.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class NaiveRefereeInfo(BaseModel):
26
+ """
27
+ NaiveRefereeInfo
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for NaiveRefereeInfo", alias="_t")
30
+ guess_amount_threshold: Optional[StrictInt] = Field(default=None, alias="guessAmountThreshold")
31
+ __properties: ClassVar[List[str]] = ["_t", "guessAmountThreshold"]
32
+
33
+ @field_validator('t')
34
+ def t_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set(['NaiveRefereeInfo']):
37
+ raise ValueError("must be one of enum values ('NaiveRefereeInfo')")
38
+ return value
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of NaiveRefereeInfo from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of NaiveRefereeInfo from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'NaiveRefereeInfo',
92
+ "guessAmountThreshold": obj.get("guessAmountThreshold")
93
+ })
94
+ return _obj
95
+
96
+
@@ -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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class NeverEndingRefereeInfo(BaseModel):
26
+ """
27
+ NeverEndingRefereeInfo
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for NeverEndingRefereeInfo", alias="_t")
30
+ __properties: ClassVar[List[str]] = ["_t"]
31
+
32
+ @field_validator('t')
33
+ def t_validate_enum(cls, value):
34
+ """Validates the enum"""
35
+ if value not in set(['NeverEndingRefereeInfo']):
36
+ raise ValueError("must be one of enum values ('NeverEndingRefereeInfo')")
37
+ return value
38
+
39
+ model_config = ConfigDict(
40
+ populate_by_name=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
+ return json.dumps(self.to_dict())
54
+
55
+ @classmethod
56
+ def from_json(cls, json_str: str) -> Optional[Self]:
57
+ """Create an instance of NeverEndingRefereeInfo from a JSON string"""
58
+ return cls.from_dict(json.loads(json_str))
59
+
60
+ def to_dict(self) -> Dict[str, Any]:
61
+ """Return the dictionary representation of the model using alias.
62
+
63
+ This has the following differences from calling pydantic's
64
+ `self.model_dump(by_alias=True)`:
65
+
66
+ * `None` is only added to the output dict for nullable fields that
67
+ were set at model initialization. Other fields with value `None`
68
+ are ignored.
69
+ """
70
+ excluded_fields: Set[str] = set([
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of NeverEndingRefereeInfo from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'NeverEndingRefereeInfo'
91
+ })
92
+ return _obj
93
+
94
+
@@ -19,6 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List
22
+ from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
22
23
  from typing import Optional, Set
23
24
  from typing_extensions import Self
24
25
 
@@ -107,7 +108,4 @@ class NullAssetModel(BaseModel):
107
108
  })
108
109
  return _obj
109
110
 
110
- from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
111
- # TODO: Rewrite to not use raise_errors
112
- NullAssetModel.model_rebuild(raise_errors=False)
113
111
 
@@ -0,0 +1,98 @@
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 ProbabilisticAttachCategoryRefereeInfo(BaseModel):
26
+ """
27
+ ProbabilisticAttachCategoryRefereeInfo
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for ProbabilisticAttachCategoryRefereeInfo", alias="_t")
30
+ threshold: Union[StrictFloat, StrictInt]
31
+ max_votes: StrictInt = Field(alias="maxVotes")
32
+ __properties: ClassVar[List[str]] = ["_t", "threshold", "maxVotes"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['ProbabilisticAttachCategoryRefereeInfo']):
38
+ raise ValueError("must be one of enum values ('ProbabilisticAttachCategoryRefereeInfo')")
39
+ return value
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of ProbabilisticAttachCategoryRefereeInfo from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of ProbabilisticAttachCategoryRefereeInfo from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'ProbabilisticAttachCategoryRefereeInfo',
93
+ "threshold": obj.get("threshold"),
94
+ "maxVotes": obj.get("maxVotes")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,173 @@
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, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from rapidata.api_client.models.datapoint_asset import DatapointAsset
24
+ from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
25
+ from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
26
+ from rapidata.api_client.models.get_validation_rapids_result_truth import GetValidationRapidsResultTruth
27
+ from rapidata.api_client.models.rapid_model_referee import RapidModelReferee
28
+ from typing import Optional, Set
29
+ from typing_extensions import Self
30
+
31
+ class RapidModel(BaseModel):
32
+ """
33
+ RapidModel
34
+ """ # noqa: E501
35
+ id: StrictStr
36
+ payload: GetValidationRapidsResultPayload
37
+ referee: RapidModelReferee
38
+ asset: DatapointAsset
39
+ metadata: Dict[str, FileAssetModelMetadataValue]
40
+ state: StrictStr
41
+ has_responses: StrictBool = Field(alias="hasResponses")
42
+ should_accept_incorrect: StrictBool = Field(alias="shouldAcceptIncorrect")
43
+ truth: Optional[GetValidationRapidsResultTruth] = None
44
+ explanation: Optional[StrictStr] = None
45
+ random_correct_probability: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, alias="randomCorrectProbability")
46
+ key: Optional[StrictStr] = None
47
+ completed_at: Optional[datetime] = Field(default=None, alias="completedAt")
48
+ __properties: ClassVar[List[str]] = ["id", "payload", "referee", "asset", "metadata", "state", "hasResponses", "shouldAcceptIncorrect", "truth", "explanation", "randomCorrectProbability", "key", "completedAt"]
49
+
50
+ @field_validator('state')
51
+ def state_validate_enum(cls, value):
52
+ """Validates the enum"""
53
+ if value not in set(['Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None']):
54
+ raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Flagged', 'Done', 'None')")
55
+ return value
56
+
57
+ model_config = ConfigDict(
58
+ populate_by_name=True,
59
+ validate_assignment=True,
60
+ protected_namespaces=(),
61
+ )
62
+
63
+
64
+ def to_str(self) -> str:
65
+ """Returns the string representation of the model using alias"""
66
+ return pprint.pformat(self.model_dump(by_alias=True))
67
+
68
+ def to_json(self) -> str:
69
+ """Returns the JSON representation of the model using alias"""
70
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
71
+ return json.dumps(self.to_dict())
72
+
73
+ @classmethod
74
+ def from_json(cls, json_str: str) -> Optional[Self]:
75
+ """Create an instance of RapidModel from a JSON string"""
76
+ return cls.from_dict(json.loads(json_str))
77
+
78
+ def to_dict(self) -> Dict[str, Any]:
79
+ """Return the dictionary representation of the model using alias.
80
+
81
+ This has the following differences from calling pydantic's
82
+ `self.model_dump(by_alias=True)`:
83
+
84
+ * `None` is only added to the output dict for nullable fields that
85
+ were set at model initialization. Other fields with value `None`
86
+ are ignored.
87
+ """
88
+ excluded_fields: Set[str] = set([
89
+ ])
90
+
91
+ _dict = self.model_dump(
92
+ by_alias=True,
93
+ exclude=excluded_fields,
94
+ exclude_none=True,
95
+ )
96
+ # override the default output from pydantic by calling `to_dict()` of payload
97
+ if self.payload:
98
+ _dict['payload'] = self.payload.to_dict()
99
+ # override the default output from pydantic by calling `to_dict()` of referee
100
+ if self.referee:
101
+ _dict['referee'] = self.referee.to_dict()
102
+ # override the default output from pydantic by calling `to_dict()` of asset
103
+ if self.asset:
104
+ _dict['asset'] = self.asset.to_dict()
105
+ # override the default output from pydantic by calling `to_dict()` of each value in metadata (dict)
106
+ _field_dict = {}
107
+ if self.metadata:
108
+ for _key_metadata in self.metadata:
109
+ if self.metadata[_key_metadata]:
110
+ _field_dict[_key_metadata] = self.metadata[_key_metadata].to_dict()
111
+ _dict['metadata'] = _field_dict
112
+ # override the default output from pydantic by calling `to_dict()` of truth
113
+ if self.truth:
114
+ _dict['truth'] = self.truth.to_dict()
115
+ # set to None if truth (nullable) is None
116
+ # and model_fields_set contains the field
117
+ if self.truth is None and "truth" in self.model_fields_set:
118
+ _dict['truth'] = None
119
+
120
+ # set to None if explanation (nullable) is None
121
+ # and model_fields_set contains the field
122
+ if self.explanation is None and "explanation" in self.model_fields_set:
123
+ _dict['explanation'] = None
124
+
125
+ # set to None if random_correct_probability (nullable) is None
126
+ # and model_fields_set contains the field
127
+ if self.random_correct_probability is None and "random_correct_probability" in self.model_fields_set:
128
+ _dict['randomCorrectProbability'] = None
129
+
130
+ # set to None if key (nullable) is None
131
+ # and model_fields_set contains the field
132
+ if self.key is None and "key" in self.model_fields_set:
133
+ _dict['key'] = None
134
+
135
+ # set to None if completed_at (nullable) is None
136
+ # and model_fields_set contains the field
137
+ if self.completed_at is None and "completed_at" in self.model_fields_set:
138
+ _dict['completedAt'] = None
139
+
140
+ return _dict
141
+
142
+ @classmethod
143
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
144
+ """Create an instance of RapidModel from a dict"""
145
+ if obj is None:
146
+ return None
147
+
148
+ if not isinstance(obj, dict):
149
+ return cls.model_validate(obj)
150
+
151
+ _obj = cls.model_validate({
152
+ "id": obj.get("id"),
153
+ "payload": GetValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
154
+ "referee": RapidModelReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
155
+ "asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
156
+ "metadata": dict(
157
+ (_k, FileAssetModelMetadataValue.from_dict(_v))
158
+ for _k, _v in obj["metadata"].items()
159
+ )
160
+ if obj.get("metadata") is not None
161
+ else None,
162
+ "state": obj.get("state"),
163
+ "hasResponses": obj.get("hasResponses"),
164
+ "shouldAcceptIncorrect": obj.get("shouldAcceptIncorrect"),
165
+ "truth": GetValidationRapidsResultTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
166
+ "explanation": obj.get("explanation"),
167
+ "randomCorrectProbability": obj.get("randomCorrectProbability"),
168
+ "key": obj.get("key"),
169
+ "completedAt": obj.get("completedAt")
170
+ })
171
+ return _obj
172
+
173
+
@@ -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.rapid_model import RapidModel
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class RapidModelPagedResult(BaseModel):
27
+ """
28
+ RapidModelPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[RapidModel]
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 RapidModelPagedResult 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 RapidModelPagedResult 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": [RapidModel.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
+