rapidata 0.1.18__py3-none-any.whl → 0.1.19__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.
- rapidata/api_client/__init__.py +2 -0
- rapidata/api_client/api/rapid_api.py +1370 -0
- rapidata/api_client/api/validation_api.py +15 -5
- rapidata/api_client/models/__init__.py +2 -0
- rapidata/api_client/models/add_validation_rapid_result.py +87 -0
- rapidata/api_client/models/attach_category_result.py +98 -0
- rapidata/api_client/models/bounding_box_result.py +106 -0
- rapidata/api_client/models/classification_metadata.py +0 -10
- rapidata/api_client/models/compare_result.py +98 -0
- rapidata/api_client/models/coordinate.py +108 -0
- rapidata/api_client/models/count_metadata.py +0 -10
- rapidata/api_client/models/create_demographic_rapid_model.py +93 -0
- rapidata/api_client/models/create_order_model_referee.py +22 -8
- rapidata/api_client/models/early_stopping_referee_model.py +98 -0
- rapidata/api_client/models/free_text_result.py +98 -0
- rapidata/api_client/models/image_dimension_metadata.py +0 -10
- rapidata/api_client/models/line.py +106 -0
- rapidata/api_client/models/line_point.py +98 -0
- rapidata/api_client/models/line_result.py +106 -0
- rapidata/api_client/models/locate_coordinate.py +98 -0
- rapidata/api_client/models/locate_result.py +106 -0
- rapidata/api_client/models/location_metadata.py +0 -10
- rapidata/api_client/models/named_entity_result.py +106 -0
- rapidata/api_client/models/order_query_get200_response.py +12 -12
- rapidata/api_client/models/original_filename_metadata.py +0 -10
- rapidata/api_client/models/polygon_result.py +106 -0
- rapidata/api_client/models/prompt_metadata.py +0 -10
- rapidata/api_client/models/query_model.py +112 -0
- rapidata/api_client/models/query_validation_rapids_result.py +98 -0
- rapidata/api_client/models/query_validation_rapids_result_asset.py +174 -0
- rapidata/api_client/models/query_validation_rapids_result_paged_result.py +105 -0
- rapidata/api_client/models/rapid_result_model.py +93 -0
- rapidata/api_client/models/rapid_result_model_result.py +252 -0
- rapidata/api_client/models/rapid_skipped_model.py +89 -0
- rapidata/api_client/models/shape.py +104 -0
- rapidata/api_client/models/skip_result.py +96 -0
- rapidata/api_client/models/text_metadata.py +0 -7
- rapidata/api_client/models/transcription_metadata.py +0 -7
- rapidata/api_client/models/transcription_result.py +106 -0
- rapidata/rapidata_client/dataset/rapidata_dataset.py +1 -2
- rapidata/rapidata_client/dataset/rapidata_validation_set.py +1 -2
- rapidata/rapidata_client/dataset/validation_rapid_parts.py +1 -2
- rapidata/rapidata_client/order/rapidata_order_builder.py +2 -3
- rapidata/rapidata_client/utils/utils.py +22 -0
- rapidata/service/openapi_service.py +6 -2
- {rapidata-0.1.18.dist-info → rapidata-0.1.19.dist-info}/METADATA +2 -1
- {rapidata-0.1.18.dist-info → rapidata-0.1.19.dist-info}/RECORD +49 -23
- rapidata/rapidata_client/types/__init__.py +0 -1
- {rapidata-0.1.18.dist-info → rapidata-0.1.19.dist-info}/LICENSE +0 -0
- {rapidata-0.1.18.dist-info → rapidata-0.1.19.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.page_info import PageInfo
|
|
23
|
+
from rapidata.api_client.models.root_filter import RootFilter
|
|
24
|
+
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class QueryModel(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The model for a query.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
page_info: Optional[PageInfo] = Field(default=None, alias="pageInfo")
|
|
33
|
+
filter: Optional[RootFilter] = None
|
|
34
|
+
sort_criteria: Optional[List[SortCriterion]] = Field(default=None, description="The sort criteria to apply to the query.", alias="sortCriteria")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["pageInfo", "filter", "sortCriteria"]
|
|
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 QueryModel 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
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of page_info
|
|
77
|
+
if self.page_info:
|
|
78
|
+
_dict['pageInfo'] = self.page_info.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of filter
|
|
80
|
+
if self.filter:
|
|
81
|
+
_dict['filter'] = self.filter.to_dict()
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of each item in sort_criteria (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.sort_criteria:
|
|
85
|
+
for _item_sort_criteria in self.sort_criteria:
|
|
86
|
+
if _item_sort_criteria:
|
|
87
|
+
_items.append(_item_sort_criteria.to_dict())
|
|
88
|
+
_dict['sortCriteria'] = _items
|
|
89
|
+
# set to None if sort_criteria (nullable) is None
|
|
90
|
+
# and model_fields_set contains the field
|
|
91
|
+
if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
|
|
92
|
+
_dict['sortCriteria'] = 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 QueryModel 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
|
+
"pageInfo": PageInfo.from_dict(obj["pageInfo"]) if obj.get("pageInfo") is not None else None,
|
|
107
|
+
"filter": RootFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
|
|
108
|
+
"sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.query_validation_rapids_result_asset import QueryValidationRapidsResultAsset
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class QueryValidationRapidsResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
QueryValidationRapidsResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
type: StrictStr
|
|
31
|
+
asset: Optional[QueryValidationRapidsResultAsset]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["type", "asset"]
|
|
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 QueryValidationRapidsResult 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
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
74
|
+
if self.asset:
|
|
75
|
+
_dict['asset'] = self.asset.to_dict()
|
|
76
|
+
# set to None if asset (nullable) is None
|
|
77
|
+
# and model_fields_set contains the field
|
|
78
|
+
if self.asset is None and "asset" in self.model_fields_set:
|
|
79
|
+
_dict['asset'] = None
|
|
80
|
+
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of QueryValidationRapidsResult from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"type": obj.get("type"),
|
|
94
|
+
"asset": QueryValidationRapidsResultAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -0,0 +1,174 @@
|
|
|
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.file_asset_model import FileAssetModel
|
|
21
|
+
from rapidata.api_client.models.multi_asset_model import MultiAssetModel
|
|
22
|
+
from rapidata.api_client.models.null_asset_model import NullAssetModel
|
|
23
|
+
from rapidata.api_client.models.text_asset_model import TextAssetModel
|
|
24
|
+
from pydantic import StrictStr, Field
|
|
25
|
+
from typing import Union, List, Set, Optional, Dict
|
|
26
|
+
from typing_extensions import Literal, Self
|
|
27
|
+
|
|
28
|
+
QUERYVALIDATIONRAPIDSRESULTASSET_ONE_OF_SCHEMAS = ["FileAssetModel", "MultiAssetModel", "NullAssetModel", "TextAssetModel"]
|
|
29
|
+
|
|
30
|
+
class QueryValidationRapidsResultAsset(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
QueryValidationRapidsResultAsset
|
|
33
|
+
"""
|
|
34
|
+
# data type: FileAssetModel
|
|
35
|
+
oneof_schema_1_validator: Optional[FileAssetModel] = None
|
|
36
|
+
# data type: MultiAssetModel
|
|
37
|
+
oneof_schema_2_validator: Optional[MultiAssetModel] = None
|
|
38
|
+
# data type: NullAssetModel
|
|
39
|
+
oneof_schema_3_validator: Optional[NullAssetModel] = None
|
|
40
|
+
# data type: TextAssetModel
|
|
41
|
+
oneof_schema_4_validator: Optional[TextAssetModel] = None
|
|
42
|
+
actual_instance: Optional[Union[FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel]] = None
|
|
43
|
+
one_of_schemas: Set[str] = { "FileAssetModel", "MultiAssetModel", "NullAssetModel", "TextAssetModel" }
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
55
|
+
if args:
|
|
56
|
+
if len(args) > 1:
|
|
57
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
58
|
+
if kwargs:
|
|
59
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
60
|
+
super().__init__(actual_instance=args[0])
|
|
61
|
+
else:
|
|
62
|
+
super().__init__(**kwargs)
|
|
63
|
+
|
|
64
|
+
@field_validator('actual_instance')
|
|
65
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
66
|
+
if v is None:
|
|
67
|
+
return v
|
|
68
|
+
|
|
69
|
+
instance = QueryValidationRapidsResultAsset.model_construct()
|
|
70
|
+
error_messages = []
|
|
71
|
+
match = 0
|
|
72
|
+
# validate data type: FileAssetModel
|
|
73
|
+
if not isinstance(v, FileAssetModel):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetModel`")
|
|
75
|
+
else:
|
|
76
|
+
match += 1
|
|
77
|
+
# validate data type: MultiAssetModel
|
|
78
|
+
if not isinstance(v, MultiAssetModel):
|
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetModel`")
|
|
80
|
+
else:
|
|
81
|
+
match += 1
|
|
82
|
+
# validate data type: NullAssetModel
|
|
83
|
+
if not isinstance(v, NullAssetModel):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NullAssetModel`")
|
|
85
|
+
else:
|
|
86
|
+
match += 1
|
|
87
|
+
# validate data type: TextAssetModel
|
|
88
|
+
if not isinstance(v, TextAssetModel):
|
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetModel`")
|
|
90
|
+
else:
|
|
91
|
+
match += 1
|
|
92
|
+
if match > 1:
|
|
93
|
+
# more than 1 match
|
|
94
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
95
|
+
elif match == 0:
|
|
96
|
+
# no match
|
|
97
|
+
raise ValueError("No match found when setting `actual_instance` in QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
98
|
+
else:
|
|
99
|
+
return v
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
103
|
+
return cls.from_json(json.dumps(obj))
|
|
104
|
+
|
|
105
|
+
@classmethod
|
|
106
|
+
def from_json(cls, json_str: Optional[str]) -> Self:
|
|
107
|
+
"""Returns the object represented by the json string"""
|
|
108
|
+
instance = cls.model_construct()
|
|
109
|
+
if json_str is None:
|
|
110
|
+
return instance
|
|
111
|
+
|
|
112
|
+
error_messages = []
|
|
113
|
+
match = 0
|
|
114
|
+
|
|
115
|
+
# deserialize data into FileAssetModel
|
|
116
|
+
try:
|
|
117
|
+
instance.actual_instance = FileAssetModel.from_json(json_str)
|
|
118
|
+
match += 1
|
|
119
|
+
except (ValidationError, ValueError) as e:
|
|
120
|
+
error_messages.append(str(e))
|
|
121
|
+
# deserialize data into MultiAssetModel
|
|
122
|
+
try:
|
|
123
|
+
instance.actual_instance = MultiAssetModel.from_json(json_str)
|
|
124
|
+
match += 1
|
|
125
|
+
except (ValidationError, ValueError) as e:
|
|
126
|
+
error_messages.append(str(e))
|
|
127
|
+
# deserialize data into NullAssetModel
|
|
128
|
+
try:
|
|
129
|
+
instance.actual_instance = NullAssetModel.from_json(json_str)
|
|
130
|
+
match += 1
|
|
131
|
+
except (ValidationError, ValueError) as e:
|
|
132
|
+
error_messages.append(str(e))
|
|
133
|
+
# deserialize data into TextAssetModel
|
|
134
|
+
try:
|
|
135
|
+
instance.actual_instance = TextAssetModel.from_json(json_str)
|
|
136
|
+
match += 1
|
|
137
|
+
except (ValidationError, ValueError) as e:
|
|
138
|
+
error_messages.append(str(e))
|
|
139
|
+
|
|
140
|
+
if match > 1:
|
|
141
|
+
# more than 1 match
|
|
142
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
143
|
+
elif match == 0:
|
|
144
|
+
# no match
|
|
145
|
+
raise ValueError("No match found when deserializing the JSON string into QueryValidationRapidsResultAsset with oneOf schemas: FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel. Details: " + ", ".join(error_messages))
|
|
146
|
+
else:
|
|
147
|
+
return instance
|
|
148
|
+
|
|
149
|
+
def to_json(self) -> str:
|
|
150
|
+
"""Returns the JSON representation of the actual instance"""
|
|
151
|
+
if self.actual_instance is None:
|
|
152
|
+
return "null"
|
|
153
|
+
|
|
154
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
155
|
+
return self.actual_instance.to_json()
|
|
156
|
+
else:
|
|
157
|
+
return json.dumps(self.actual_instance)
|
|
158
|
+
|
|
159
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetModel, MultiAssetModel, NullAssetModel, TextAssetModel]]:
|
|
160
|
+
"""Returns the dict representation of the actual instance"""
|
|
161
|
+
if self.actual_instance is None:
|
|
162
|
+
return None
|
|
163
|
+
|
|
164
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
165
|
+
return self.actual_instance.to_dict()
|
|
166
|
+
else:
|
|
167
|
+
# primitive type
|
|
168
|
+
return self.actual_instance
|
|
169
|
+
|
|
170
|
+
def to_str(self) -> str:
|
|
171
|
+
"""Returns the string representation of the actual instance"""
|
|
172
|
+
return pprint.pformat(self.model_dump())
|
|
173
|
+
|
|
174
|
+
|
|
@@ -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.query_validation_rapids_result import QueryValidationRapidsResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class QueryValidationRapidsResultPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
QueryValidationRapidsResultPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[QueryValidationRapidsResult]
|
|
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 QueryValidationRapidsResultPagedResult 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 QueryValidationRapidsResultPagedResult 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": [QueryValidationRapidsResult.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,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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.rapid_result_model_result import RapidResultModelResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class RapidResultModel(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
The model for a Rapid result.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
session_index: StrictInt = Field(description="The index of the session when the result was submitted.", alias="sessionIndex")
|
|
31
|
+
result: RapidResultModelResult
|
|
32
|
+
__properties: ClassVar[List[str]] = ["sessionIndex", "result"]
|
|
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 RapidResultModel 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
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of result
|
|
74
|
+
if self.result:
|
|
75
|
+
_dict['result'] = self.result.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of RapidResultModel from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"sessionIndex": obj.get("sessionIndex"),
|
|
89
|
+
"result": RapidResultModelResult.from_dict(obj["result"]) if obj.get("result") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|