rapidata 2.4.1__py3-none-any.whl → 2.6.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/api_client/__init__.py +17 -15
- rapidata/api_client/api/compare_workflow_api.py +49 -48
- rapidata/api_client/api/pipeline_api.py +559 -2
- rapidata/api_client/api/rapid_api.py +283 -0
- rapidata/api_client/api/simple_workflow_api.py +49 -82
- rapidata/api_client/api/workflow_api.py +0 -264
- rapidata/api_client/models/__init__.py +17 -15
- rapidata/api_client/models/ab_test_selection.py +122 -0
- rapidata/api_client/models/ab_test_selection_a_inner.py +212 -0
- rapidata/api_client/models/add_campaign_model.py +3 -3
- rapidata/api_client/models/capped_selection.py +3 -3
- rapidata/api_client/models/compare_match_status.py +39 -0
- rapidata/api_client/models/create_order_model.py +3 -3
- rapidata/api_client/models/get_compare_workflow_results_model.py +114 -0
- rapidata/api_client/models/get_compare_workflow_results_result.py +104 -0
- rapidata/api_client/models/get_compare_workflow_results_result_asset.py +170 -0
- rapidata/api_client/models/get_compare_workflow_results_result_paged_result.py +105 -0
- rapidata/api_client/models/get_simple_workflow_results_model.py +114 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +112 -0
- rapidata/api_client/models/get_simple_workflow_results_result_paged_result.py +105 -0
- rapidata/api_client/models/multi_asset_model2.py +3 -3
- rapidata/api_client/models/order_model.py +3 -1
- rapidata/api_client/models/preliminary_download_model.py +87 -0
- rapidata/api_client/models/preliminary_download_result.py +87 -0
- rapidata/api_client/models/query_validation_rapids_result.py +11 -2
- rapidata/api_client/models/rapid_response.py +101 -0
- rapidata/api_client/models/rapid_response_result.py +266 -0
- rapidata/api_client/models/rapid_state.py +40 -0
- rapidata/api_client/models/update_validation_rapid_model.py +105 -0
- rapidata/api_client/models/update_validation_rapid_model_truth.py +252 -0
- rapidata/api_client_README.md +22 -18
- rapidata/rapidata_client/order/_rapidata_order_builder.py +3 -3
- rapidata/rapidata_client/selection/ab_test_selection.py +38 -0
- rapidata/rapidata_client/selection/capped_selection.py +3 -3
- rapidata/rapidata_client/validation/rapidata_validation_set.py +13 -1
- rapidata/rapidata_client/validation/rapids/rapids.py +18 -2
- rapidata/rapidata_client/validation/rapids/rapids_manager.py +1 -1
- rapidata/rapidata_client/validation/validation_set_manager.py +16 -22
- {rapidata-2.4.1.dist-info → rapidata-2.6.0.dist-info}/METADATA +1 -1
- {rapidata-2.4.1.dist-info → rapidata-2.6.0.dist-info}/RECORD +42 -24
- {rapidata-2.4.1.dist-info → rapidata-2.6.0.dist-info}/LICENSE +0 -0
- {rapidata-2.4.1.dist-info → rapidata-2.6.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class PreliminaryDownloadModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
PreliminaryDownloadModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
send_email: Optional[StrictBool] = Field(default=True, alias="sendEmail")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["sendEmail"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of PreliminaryDownloadModel from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of PreliminaryDownloadModel from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"sendEmail": obj.get("sendEmail") if obj.get("sendEmail") is not None else True
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class PreliminaryDownloadResult(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
PreliminaryDownloadResult
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
download_id: StrictStr = Field(alias="downloadId")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["downloadId"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of PreliminaryDownloadResult from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of PreliminaryDownloadResult from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"downloadId": obj.get("downloadId")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -30,6 +30,7 @@ class QueryValidationRapidsResult(BaseModel):
|
|
|
30
30
|
"""
|
|
31
31
|
QueryValidationRapidsResult
|
|
32
32
|
""" # noqa: E501
|
|
33
|
+
id: StrictStr
|
|
33
34
|
type: StrictStr
|
|
34
35
|
asset: Optional[QueryValidationRapidsResultAsset]
|
|
35
36
|
truth: Optional[QueryValidationRapidsResultTruth] = None
|
|
@@ -37,7 +38,8 @@ class QueryValidationRapidsResult(BaseModel):
|
|
|
37
38
|
metadata: List[FileAssetModel1MetadataInner]
|
|
38
39
|
correct_validation_count: StrictInt = Field(alias="correctValidationCount")
|
|
39
40
|
invalid_validation_count: StrictInt = Field(alias="invalidValidationCount")
|
|
40
|
-
|
|
41
|
+
explanation: Optional[StrictStr] = None
|
|
42
|
+
__properties: ClassVar[List[str]] = ["id", "type", "asset", "truth", "payload", "metadata", "correctValidationCount", "invalidValidationCount", "explanation"]
|
|
41
43
|
|
|
42
44
|
model_config = ConfigDict(
|
|
43
45
|
populate_by_name=True,
|
|
@@ -104,6 +106,11 @@ class QueryValidationRapidsResult(BaseModel):
|
|
|
104
106
|
if self.truth is None and "truth" in self.model_fields_set:
|
|
105
107
|
_dict['truth'] = None
|
|
106
108
|
|
|
109
|
+
# set to None if explanation (nullable) is None
|
|
110
|
+
# and model_fields_set contains the field
|
|
111
|
+
if self.explanation is None and "explanation" in self.model_fields_set:
|
|
112
|
+
_dict['explanation'] = None
|
|
113
|
+
|
|
107
114
|
return _dict
|
|
108
115
|
|
|
109
116
|
@classmethod
|
|
@@ -116,13 +123,15 @@ class QueryValidationRapidsResult(BaseModel):
|
|
|
116
123
|
return cls.model_validate(obj)
|
|
117
124
|
|
|
118
125
|
_obj = cls.model_validate({
|
|
126
|
+
"id": obj.get("id"),
|
|
119
127
|
"type": obj.get("type"),
|
|
120
128
|
"asset": QueryValidationRapidsResultAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
121
129
|
"truth": QueryValidationRapidsResultTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
|
|
122
130
|
"payload": QueryValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
123
131
|
"metadata": [FileAssetModel1MetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
124
132
|
"correctValidationCount": obj.get("correctValidationCount"),
|
|
125
|
-
"invalidValidationCount": obj.get("invalidValidationCount")
|
|
133
|
+
"invalidValidationCount": obj.get("invalidValidationCount"),
|
|
134
|
+
"explanation": obj.get("explanation")
|
|
126
135
|
})
|
|
127
136
|
return _obj
|
|
128
137
|
|
|
@@ -0,0 +1,101 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Union
|
|
22
|
+
from rapidata.api_client.models.rapid_response_result import RapidResponseResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class RapidResponse(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
RapidResponse
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: StrictStr
|
|
31
|
+
user_id: StrictStr = Field(alias="userId")
|
|
32
|
+
country: StrictStr
|
|
33
|
+
result: RapidResponseResult
|
|
34
|
+
user_score: Union[StrictFloat, StrictInt] = Field(alias="userScore")
|
|
35
|
+
demographic_information: Dict[str, StrictStr] = Field(alias="demographicInformation")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["id", "userId", "country", "result", "userScore", "demographicInformation"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of RapidResponse from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
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 result
|
|
78
|
+
if self.result:
|
|
79
|
+
_dict['result'] = self.result.to_dict()
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of RapidResponse 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
|
+
"id": obj.get("id"),
|
|
93
|
+
"userId": obj.get("userId"),
|
|
94
|
+
"country": obj.get("country"),
|
|
95
|
+
"result": RapidResponseResult.from_dict(obj["result"]) if obj.get("result") is not None else None,
|
|
96
|
+
"userScore": obj.get("userScore"),
|
|
97
|
+
"demographicInformation": obj.get("demographicInformation")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|
|
@@ -0,0 +1,266 @@
|
|
|
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.attach_category_result import AttachCategoryResult
|
|
21
|
+
from rapidata.api_client.models.bounding_box_result import BoundingBoxResult
|
|
22
|
+
from rapidata.api_client.models.compare_result import CompareResult
|
|
23
|
+
from rapidata.api_client.models.free_text_result import FreeTextResult
|
|
24
|
+
from rapidata.api_client.models.line_result import LineResult
|
|
25
|
+
from rapidata.api_client.models.locate_result import LocateResult
|
|
26
|
+
from rapidata.api_client.models.named_entity_result import NamedEntityResult
|
|
27
|
+
from rapidata.api_client.models.polygon_result import PolygonResult
|
|
28
|
+
from rapidata.api_client.models.scrub_result import ScrubResult
|
|
29
|
+
from rapidata.api_client.models.skip_result import SkipResult
|
|
30
|
+
from rapidata.api_client.models.transcription_result import TranscriptionResult
|
|
31
|
+
from pydantic import StrictStr, Field
|
|
32
|
+
from typing import Union, List, Set, Optional, Dict
|
|
33
|
+
from typing_extensions import Literal, Self
|
|
34
|
+
|
|
35
|
+
RAPIDRESPONSERESULT_ONE_OF_SCHEMAS = ["AttachCategoryResult", "BoundingBoxResult", "CompareResult", "FreeTextResult", "LineResult", "LocateResult", "NamedEntityResult", "PolygonResult", "ScrubResult", "SkipResult", "TranscriptionResult"]
|
|
36
|
+
|
|
37
|
+
class RapidResponseResult(BaseModel):
|
|
38
|
+
"""
|
|
39
|
+
RapidResponseResult
|
|
40
|
+
"""
|
|
41
|
+
# data type: TranscriptionResult
|
|
42
|
+
oneof_schema_1_validator: Optional[TranscriptionResult] = None
|
|
43
|
+
# data type: ScrubResult
|
|
44
|
+
oneof_schema_2_validator: Optional[ScrubResult] = None
|
|
45
|
+
# data type: PolygonResult
|
|
46
|
+
oneof_schema_3_validator: Optional[PolygonResult] = None
|
|
47
|
+
# data type: NamedEntityResult
|
|
48
|
+
oneof_schema_4_validator: Optional[NamedEntityResult] = None
|
|
49
|
+
# data type: LocateResult
|
|
50
|
+
oneof_schema_5_validator: Optional[LocateResult] = None
|
|
51
|
+
# data type: LineResult
|
|
52
|
+
oneof_schema_6_validator: Optional[LineResult] = None
|
|
53
|
+
# data type: FreeTextResult
|
|
54
|
+
oneof_schema_7_validator: Optional[FreeTextResult] = None
|
|
55
|
+
# data type: CompareResult
|
|
56
|
+
oneof_schema_8_validator: Optional[CompareResult] = None
|
|
57
|
+
# data type: SkipResult
|
|
58
|
+
oneof_schema_9_validator: Optional[SkipResult] = None
|
|
59
|
+
# data type: AttachCategoryResult
|
|
60
|
+
oneof_schema_10_validator: Optional[AttachCategoryResult] = None
|
|
61
|
+
# data type: BoundingBoxResult
|
|
62
|
+
oneof_schema_11_validator: Optional[BoundingBoxResult] = None
|
|
63
|
+
actual_instance: Optional[Union[AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, ScrubResult, SkipResult, TranscriptionResult]] = None
|
|
64
|
+
one_of_schemas: Set[str] = { "AttachCategoryResult", "BoundingBoxResult", "CompareResult", "FreeTextResult", "LineResult", "LocateResult", "NamedEntityResult", "PolygonResult", "ScrubResult", "SkipResult", "TranscriptionResult" }
|
|
65
|
+
|
|
66
|
+
model_config = ConfigDict(
|
|
67
|
+
validate_assignment=True,
|
|
68
|
+
protected_namespaces=(),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
76
|
+
if args:
|
|
77
|
+
if len(args) > 1:
|
|
78
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
79
|
+
if kwargs:
|
|
80
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
81
|
+
super().__init__(actual_instance=args[0])
|
|
82
|
+
else:
|
|
83
|
+
super().__init__(**kwargs)
|
|
84
|
+
|
|
85
|
+
@field_validator('actual_instance')
|
|
86
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
87
|
+
instance = RapidResponseResult.model_construct()
|
|
88
|
+
error_messages = []
|
|
89
|
+
match = 0
|
|
90
|
+
# validate data type: TranscriptionResult
|
|
91
|
+
if not isinstance(v, TranscriptionResult):
|
|
92
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionResult`")
|
|
93
|
+
else:
|
|
94
|
+
match += 1
|
|
95
|
+
# validate data type: ScrubResult
|
|
96
|
+
if not isinstance(v, ScrubResult):
|
|
97
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ScrubResult`")
|
|
98
|
+
else:
|
|
99
|
+
match += 1
|
|
100
|
+
# validate data type: PolygonResult
|
|
101
|
+
if not isinstance(v, PolygonResult):
|
|
102
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `PolygonResult`")
|
|
103
|
+
else:
|
|
104
|
+
match += 1
|
|
105
|
+
# validate data type: NamedEntityResult
|
|
106
|
+
if not isinstance(v, NamedEntityResult):
|
|
107
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NamedEntityResult`")
|
|
108
|
+
else:
|
|
109
|
+
match += 1
|
|
110
|
+
# validate data type: LocateResult
|
|
111
|
+
if not isinstance(v, LocateResult):
|
|
112
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LocateResult`")
|
|
113
|
+
else:
|
|
114
|
+
match += 1
|
|
115
|
+
# validate data type: LineResult
|
|
116
|
+
if not isinstance(v, LineResult):
|
|
117
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LineResult`")
|
|
118
|
+
else:
|
|
119
|
+
match += 1
|
|
120
|
+
# validate data type: FreeTextResult
|
|
121
|
+
if not isinstance(v, FreeTextResult):
|
|
122
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FreeTextResult`")
|
|
123
|
+
else:
|
|
124
|
+
match += 1
|
|
125
|
+
# validate data type: CompareResult
|
|
126
|
+
if not isinstance(v, CompareResult):
|
|
127
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareResult`")
|
|
128
|
+
else:
|
|
129
|
+
match += 1
|
|
130
|
+
# validate data type: SkipResult
|
|
131
|
+
if not isinstance(v, SkipResult):
|
|
132
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `SkipResult`")
|
|
133
|
+
else:
|
|
134
|
+
match += 1
|
|
135
|
+
# validate data type: AttachCategoryResult
|
|
136
|
+
if not isinstance(v, AttachCategoryResult):
|
|
137
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AttachCategoryResult`")
|
|
138
|
+
else:
|
|
139
|
+
match += 1
|
|
140
|
+
# validate data type: BoundingBoxResult
|
|
141
|
+
if not isinstance(v, BoundingBoxResult):
|
|
142
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `BoundingBoxResult`")
|
|
143
|
+
else:
|
|
144
|
+
match += 1
|
|
145
|
+
if match > 1:
|
|
146
|
+
# more than 1 match
|
|
147
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in RapidResponseResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, ScrubResult, SkipResult, TranscriptionResult. Details: " + ", ".join(error_messages))
|
|
148
|
+
elif match == 0:
|
|
149
|
+
# no match
|
|
150
|
+
raise ValueError("No match found when setting `actual_instance` in RapidResponseResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, ScrubResult, SkipResult, TranscriptionResult. Details: " + ", ".join(error_messages))
|
|
151
|
+
else:
|
|
152
|
+
return v
|
|
153
|
+
|
|
154
|
+
@classmethod
|
|
155
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
156
|
+
return cls.from_json(json.dumps(obj))
|
|
157
|
+
|
|
158
|
+
@classmethod
|
|
159
|
+
def from_json(cls, json_str: str) -> Self:
|
|
160
|
+
"""Returns the object represented by the json string"""
|
|
161
|
+
instance = cls.model_construct()
|
|
162
|
+
error_messages = []
|
|
163
|
+
match = 0
|
|
164
|
+
|
|
165
|
+
# deserialize data into TranscriptionResult
|
|
166
|
+
try:
|
|
167
|
+
instance.actual_instance = TranscriptionResult.from_json(json_str)
|
|
168
|
+
match += 1
|
|
169
|
+
except (ValidationError, ValueError) as e:
|
|
170
|
+
error_messages.append(str(e))
|
|
171
|
+
# deserialize data into ScrubResult
|
|
172
|
+
try:
|
|
173
|
+
instance.actual_instance = ScrubResult.from_json(json_str)
|
|
174
|
+
match += 1
|
|
175
|
+
except (ValidationError, ValueError) as e:
|
|
176
|
+
error_messages.append(str(e))
|
|
177
|
+
# deserialize data into PolygonResult
|
|
178
|
+
try:
|
|
179
|
+
instance.actual_instance = PolygonResult.from_json(json_str)
|
|
180
|
+
match += 1
|
|
181
|
+
except (ValidationError, ValueError) as e:
|
|
182
|
+
error_messages.append(str(e))
|
|
183
|
+
# deserialize data into NamedEntityResult
|
|
184
|
+
try:
|
|
185
|
+
instance.actual_instance = NamedEntityResult.from_json(json_str)
|
|
186
|
+
match += 1
|
|
187
|
+
except (ValidationError, ValueError) as e:
|
|
188
|
+
error_messages.append(str(e))
|
|
189
|
+
# deserialize data into LocateResult
|
|
190
|
+
try:
|
|
191
|
+
instance.actual_instance = LocateResult.from_json(json_str)
|
|
192
|
+
match += 1
|
|
193
|
+
except (ValidationError, ValueError) as e:
|
|
194
|
+
error_messages.append(str(e))
|
|
195
|
+
# deserialize data into LineResult
|
|
196
|
+
try:
|
|
197
|
+
instance.actual_instance = LineResult.from_json(json_str)
|
|
198
|
+
match += 1
|
|
199
|
+
except (ValidationError, ValueError) as e:
|
|
200
|
+
error_messages.append(str(e))
|
|
201
|
+
# deserialize data into FreeTextResult
|
|
202
|
+
try:
|
|
203
|
+
instance.actual_instance = FreeTextResult.from_json(json_str)
|
|
204
|
+
match += 1
|
|
205
|
+
except (ValidationError, ValueError) as e:
|
|
206
|
+
error_messages.append(str(e))
|
|
207
|
+
# deserialize data into CompareResult
|
|
208
|
+
try:
|
|
209
|
+
instance.actual_instance = CompareResult.from_json(json_str)
|
|
210
|
+
match += 1
|
|
211
|
+
except (ValidationError, ValueError) as e:
|
|
212
|
+
error_messages.append(str(e))
|
|
213
|
+
# deserialize data into SkipResult
|
|
214
|
+
try:
|
|
215
|
+
instance.actual_instance = SkipResult.from_json(json_str)
|
|
216
|
+
match += 1
|
|
217
|
+
except (ValidationError, ValueError) as e:
|
|
218
|
+
error_messages.append(str(e))
|
|
219
|
+
# deserialize data into AttachCategoryResult
|
|
220
|
+
try:
|
|
221
|
+
instance.actual_instance = AttachCategoryResult.from_json(json_str)
|
|
222
|
+
match += 1
|
|
223
|
+
except (ValidationError, ValueError) as e:
|
|
224
|
+
error_messages.append(str(e))
|
|
225
|
+
# deserialize data into BoundingBoxResult
|
|
226
|
+
try:
|
|
227
|
+
instance.actual_instance = BoundingBoxResult.from_json(json_str)
|
|
228
|
+
match += 1
|
|
229
|
+
except (ValidationError, ValueError) as e:
|
|
230
|
+
error_messages.append(str(e))
|
|
231
|
+
|
|
232
|
+
if match > 1:
|
|
233
|
+
# more than 1 match
|
|
234
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into RapidResponseResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, ScrubResult, SkipResult, TranscriptionResult. Details: " + ", ".join(error_messages))
|
|
235
|
+
elif match == 0:
|
|
236
|
+
# no match
|
|
237
|
+
raise ValueError("No match found when deserializing the JSON string into RapidResponseResult with oneOf schemas: AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, ScrubResult, SkipResult, TranscriptionResult. Details: " + ", ".join(error_messages))
|
|
238
|
+
else:
|
|
239
|
+
return instance
|
|
240
|
+
|
|
241
|
+
def to_json(self) -> str:
|
|
242
|
+
"""Returns the JSON representation of the actual instance"""
|
|
243
|
+
if self.actual_instance is None:
|
|
244
|
+
return "null"
|
|
245
|
+
|
|
246
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
247
|
+
return self.actual_instance.to_json()
|
|
248
|
+
else:
|
|
249
|
+
return json.dumps(self.actual_instance)
|
|
250
|
+
|
|
251
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AttachCategoryResult, BoundingBoxResult, CompareResult, FreeTextResult, LineResult, LocateResult, NamedEntityResult, PolygonResult, ScrubResult, SkipResult, TranscriptionResult]]:
|
|
252
|
+
"""Returns the dict representation of the actual instance"""
|
|
253
|
+
if self.actual_instance is None:
|
|
254
|
+
return None
|
|
255
|
+
|
|
256
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
257
|
+
return self.actual_instance.to_dict()
|
|
258
|
+
else:
|
|
259
|
+
# primitive type
|
|
260
|
+
return self.actual_instance
|
|
261
|
+
|
|
262
|
+
def to_str(self) -> str:
|
|
263
|
+
"""Returns the string representation of the actual instance"""
|
|
264
|
+
return pprint.pformat(self.model_dump())
|
|
265
|
+
|
|
266
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class RapidState(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
RapidState
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
LABELING = 'Labeling'
|
|
30
|
+
PAUSED = 'Paused'
|
|
31
|
+
INCOMPLETE = 'Incomplete'
|
|
32
|
+
DONE = 'Done'
|
|
33
|
+
NONE = 'None'
|
|
34
|
+
|
|
35
|
+
@classmethod
|
|
36
|
+
def from_json(cls, json_str: str) -> Self:
|
|
37
|
+
"""Create an instance of RapidState from a JSON string"""
|
|
38
|
+
return cls(json.loads(json_str))
|
|
39
|
+
|
|
40
|
+
|