rapidata 2.21.5__py3-none-any.whl → 2.22.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/__init__.py +5 -0
- rapidata/api_client/__init__.py +8 -4
- rapidata/api_client/api/__init__.py +1 -0
- rapidata/api_client/api/evaluation_workflow_api.py +372 -0
- rapidata/api_client/api/identity_api.py +268 -0
- rapidata/api_client/api/rapid_api.py +353 -1987
- rapidata/api_client/api/simple_workflow_api.py +6 -6
- rapidata/api_client/models/__init__.py +7 -4
- rapidata/api_client/models/add_campaign_model.py +25 -1
- rapidata/api_client/models/add_validation_rapid_model_truth.py +24 -10
- rapidata/api_client/models/compare_result.py +2 -0
- rapidata/api_client/models/create_order_model.py +43 -2
- rapidata/api_client/models/evaluation_workflow_model1.py +115 -0
- rapidata/api_client/models/filter.py +2 -2
- rapidata/api_client/models/get_validation_rapids_result.py +11 -4
- rapidata/api_client/models/get_validation_rapids_result_truth.py +24 -10
- rapidata/api_client/models/get_workflow_by_id_result_workflow.py +23 -9
- rapidata/api_client/models/get_workflow_results_result.py +118 -0
- rapidata/api_client/models/get_workflow_results_result_paged_result.py +105 -0
- rapidata/api_client/models/google_one_tap_login_model.py +87 -0
- rapidata/api_client/models/labeling_selection.py +22 -3
- rapidata/api_client/models/logic_operator.py +1 -0
- rapidata/api_client/models/rapid_response.py +3 -1
- rapidata/api_client/models/retrieval_mode.py +38 -0
- rapidata/api_client/models/root_filter.py +2 -2
- rapidata/api_client/models/skip_truth.py +94 -0
- rapidata/api_client/models/sticky_state.py +38 -0
- rapidata/api_client/models/update_validation_rapid_model.py +11 -4
- rapidata/api_client/models/update_validation_rapid_model_truth.py +24 -10
- rapidata/api_client/rest.py +1 -0
- rapidata/api_client_README.md +10 -11
- rapidata/rapidata_client/__init__.py +7 -0
- rapidata/rapidata_client/api/rapidata_exception.py +5 -3
- rapidata/rapidata_client/assets/_media_asset.py +8 -1
- rapidata/rapidata_client/assets/_multi_asset.py +6 -0
- rapidata/rapidata_client/assets/_text_asset.py +6 -0
- rapidata/rapidata_client/demographic/demographic_manager.py +2 -3
- rapidata/rapidata_client/logging/__init__.py +2 -0
- rapidata/rapidata_client/logging/logger.py +47 -0
- rapidata/rapidata_client/logging/output_manager.py +16 -0
- rapidata/rapidata_client/order/_rapidata_dataset.py +11 -13
- rapidata/rapidata_client/order/_rapidata_order_builder.py +15 -2
- rapidata/rapidata_client/order/rapidata_order.py +22 -13
- rapidata/rapidata_client/order/rapidata_order_manager.py +4 -2
- rapidata/rapidata_client/order/rapidata_results.py +2 -1
- rapidata/rapidata_client/rapidata_client.py +6 -1
- rapidata/rapidata_client/selection/__init__.py +1 -0
- rapidata/rapidata_client/selection/labeling_selection.py +8 -2
- rapidata/rapidata_client/selection/retrieval_modes.py +9 -0
- rapidata/rapidata_client/settings/alert_on_fast_response.py +2 -1
- rapidata/rapidata_client/settings/free_text_minimum_characters.py +2 -1
- rapidata/rapidata_client/validation/rapidata_validation_set.py +2 -2
- rapidata/rapidata_client/validation/rapids/rapids.py +3 -1
- rapidata/rapidata_client/validation/validation_set_manager.py +39 -36
- rapidata/service/credential_manager.py +22 -30
- rapidata/service/openapi_service.py +11 -0
- {rapidata-2.21.5.dist-info → rapidata-2.22.0.dist-info}/METADATA +2 -1
- {rapidata-2.21.5.dist-info → rapidata-2.22.0.dist-info}/RECORD +60 -48
- {rapidata-2.21.5.dist-info → rapidata-2.22.0.dist-info}/WHEEL +1 -1
- {rapidata-2.21.5.dist-info → rapidata-2.22.0.dist-info}/LICENSE +0 -0
|
@@ -18,12 +18,13 @@ import pprint
|
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
20
|
from rapidata.api_client.models.compare_workflow_model1 import CompareWorkflowModel1
|
|
21
|
+
from rapidata.api_client.models.evaluation_workflow_model1 import EvaluationWorkflowModel1
|
|
21
22
|
from rapidata.api_client.models.simple_workflow_model1 import SimpleWorkflowModel1
|
|
22
23
|
from pydantic import StrictStr, Field
|
|
23
24
|
from typing import Union, List, Set, Optional, Dict
|
|
24
25
|
from typing_extensions import Literal, Self
|
|
25
26
|
|
|
26
|
-
GETWORKFLOWBYIDRESULTWORKFLOW_ONE_OF_SCHEMAS = ["CompareWorkflowModel1", "SimpleWorkflowModel1"]
|
|
27
|
+
GETWORKFLOWBYIDRESULTWORKFLOW_ONE_OF_SCHEMAS = ["CompareWorkflowModel1", "EvaluationWorkflowModel1", "SimpleWorkflowModel1"]
|
|
27
28
|
|
|
28
29
|
class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
29
30
|
"""
|
|
@@ -31,10 +32,12 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
|
31
32
|
"""
|
|
32
33
|
# data type: CompareWorkflowModel1
|
|
33
34
|
oneof_schema_1_validator: Optional[CompareWorkflowModel1] = None
|
|
35
|
+
# data type: EvaluationWorkflowModel1
|
|
36
|
+
oneof_schema_2_validator: Optional[EvaluationWorkflowModel1] = None
|
|
34
37
|
# data type: SimpleWorkflowModel1
|
|
35
|
-
|
|
36
|
-
actual_instance: Optional[Union[CompareWorkflowModel1, SimpleWorkflowModel1]] = None
|
|
37
|
-
one_of_schemas: Set[str] = { "CompareWorkflowModel1", "SimpleWorkflowModel1" }
|
|
38
|
+
oneof_schema_3_validator: Optional[SimpleWorkflowModel1] = None
|
|
39
|
+
actual_instance: Optional[Union[CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1]] = None
|
|
40
|
+
one_of_schemas: Set[str] = { "CompareWorkflowModel1", "EvaluationWorkflowModel1", "SimpleWorkflowModel1" }
|
|
38
41
|
|
|
39
42
|
model_config = ConfigDict(
|
|
40
43
|
validate_assignment=True,
|
|
@@ -65,6 +68,11 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
|
65
68
|
error_messages.append(f"Error! Input type `{type(v)}` is not `CompareWorkflowModel1`")
|
|
66
69
|
else:
|
|
67
70
|
match += 1
|
|
71
|
+
# validate data type: EvaluationWorkflowModel1
|
|
72
|
+
if not isinstance(v, EvaluationWorkflowModel1):
|
|
73
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `EvaluationWorkflowModel1`")
|
|
74
|
+
else:
|
|
75
|
+
match += 1
|
|
68
76
|
# validate data type: SimpleWorkflowModel1
|
|
69
77
|
if not isinstance(v, SimpleWorkflowModel1):
|
|
70
78
|
error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowModel1`")
|
|
@@ -72,10 +80,10 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
|
72
80
|
match += 1
|
|
73
81
|
if match > 1:
|
|
74
82
|
# more than 1 match
|
|
75
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
83
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
76
84
|
elif match == 0:
|
|
77
85
|
# no match
|
|
78
|
-
raise ValueError("No match found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
86
|
+
raise ValueError("No match found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
79
87
|
else:
|
|
80
88
|
return v
|
|
81
89
|
|
|
@@ -96,6 +104,12 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
|
96
104
|
match += 1
|
|
97
105
|
except (ValidationError, ValueError) as e:
|
|
98
106
|
error_messages.append(str(e))
|
|
107
|
+
# deserialize data into EvaluationWorkflowModel1
|
|
108
|
+
try:
|
|
109
|
+
instance.actual_instance = EvaluationWorkflowModel1.from_json(json_str)
|
|
110
|
+
match += 1
|
|
111
|
+
except (ValidationError, ValueError) as e:
|
|
112
|
+
error_messages.append(str(e))
|
|
99
113
|
# deserialize data into SimpleWorkflowModel1
|
|
100
114
|
try:
|
|
101
115
|
instance.actual_instance = SimpleWorkflowModel1.from_json(json_str)
|
|
@@ -105,10 +119,10 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
|
105
119
|
|
|
106
120
|
if match > 1:
|
|
107
121
|
# more than 1 match
|
|
108
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
122
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
109
123
|
elif match == 0:
|
|
110
124
|
# no match
|
|
111
|
-
raise ValueError("No match found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
125
|
+
raise ValueError("No match found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
|
|
112
126
|
else:
|
|
113
127
|
return instance
|
|
114
128
|
|
|
@@ -122,7 +136,7 @@ class GetWorkflowByIdResultWorkflow(BaseModel):
|
|
|
122
136
|
else:
|
|
123
137
|
return json.dumps(self.actual_instance)
|
|
124
138
|
|
|
125
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowModel1, SimpleWorkflowModel1]]:
|
|
139
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowModel1, EvaluationWorkflowModel1, SimpleWorkflowModel1]]:
|
|
126
140
|
"""Returns the dict representation of the actual instance"""
|
|
127
141
|
if self.actual_instance is None:
|
|
128
142
|
return None
|
|
@@ -0,0 +1,118 @@
|
|
|
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 rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
|
+
from rapidata.api_client.models.get_validation_rapids_result_payload import GetValidationRapidsResultPayload
|
|
24
|
+
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class GetWorkflowResultsResult(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
GetWorkflowResultsResult
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
33
|
+
payload: GetValidationRapidsResultPayload
|
|
34
|
+
asset: DatapointAsset
|
|
35
|
+
responses: List[RapidResponse]
|
|
36
|
+
state: StrictStr
|
|
37
|
+
__properties: ClassVar[List[str]] = ["rapidId", "payload", "asset", "responses", "state"]
|
|
38
|
+
|
|
39
|
+
@field_validator('state')
|
|
40
|
+
def state_validate_enum(cls, value):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Done', 'None']):
|
|
43
|
+
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Done', 'None')")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of GetWorkflowResultsResult from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of payload
|
|
86
|
+
if self.payload:
|
|
87
|
+
_dict['payload'] = self.payload.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
89
|
+
if self.asset:
|
|
90
|
+
_dict['asset'] = self.asset.to_dict()
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in responses (list)
|
|
92
|
+
_items = []
|
|
93
|
+
if self.responses:
|
|
94
|
+
for _item_responses in self.responses:
|
|
95
|
+
if _item_responses:
|
|
96
|
+
_items.append(_item_responses.to_dict())
|
|
97
|
+
_dict['responses'] = _items
|
|
98
|
+
return _dict
|
|
99
|
+
|
|
100
|
+
@classmethod
|
|
101
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
102
|
+
"""Create an instance of GetWorkflowResultsResult from a dict"""
|
|
103
|
+
if obj is None:
|
|
104
|
+
return None
|
|
105
|
+
|
|
106
|
+
if not isinstance(obj, dict):
|
|
107
|
+
return cls.model_validate(obj)
|
|
108
|
+
|
|
109
|
+
_obj = cls.model_validate({
|
|
110
|
+
"rapidId": obj.get("rapidId"),
|
|
111
|
+
"payload": GetValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
112
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
113
|
+
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
114
|
+
"state": obj.get("state")
|
|
115
|
+
})
|
|
116
|
+
return _obj
|
|
117
|
+
|
|
118
|
+
|
|
@@ -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.get_workflow_results_result import GetWorkflowResultsResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetWorkflowResultsResultPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetWorkflowResultsResultPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[GetWorkflowResultsResult]
|
|
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 GetWorkflowResultsResultPagedResult 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 GetWorkflowResultsResultPagedResult 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": [GetWorkflowResultsResult.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,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 GoogleOneTapLoginModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model for the Google One Tap login.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id_token: StrictStr = Field(description="The id token received from the Google One Tap login.", alias="idToken")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["idToken"]
|
|
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 GoogleOneTapLoginModel 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 GoogleOneTapLoginModel 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
|
+
"idToken": obj.get("idToken")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
@@ -28,7 +28,9 @@ class LabelingSelection(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for LabelingSelection", alias="_t")
|
|
30
30
|
amount: StrictInt
|
|
31
|
-
|
|
31
|
+
retrieval_mode: Optional[StrictStr] = Field(default=None, alias="retrievalMode")
|
|
32
|
+
max_iterations: Optional[StrictInt] = Field(default=None, alias="maxIterations")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "amount", "retrievalMode", "maxIterations"]
|
|
32
34
|
|
|
33
35
|
@field_validator('t')
|
|
34
36
|
def t_validate_enum(cls, value):
|
|
@@ -37,6 +39,16 @@ class LabelingSelection(BaseModel):
|
|
|
37
39
|
raise ValueError("must be one of enum values ('LabelingSelection')")
|
|
38
40
|
return value
|
|
39
41
|
|
|
42
|
+
@field_validator('retrieval_mode')
|
|
43
|
+
def retrieval_mode_validate_enum(cls, value):
|
|
44
|
+
"""Validates the enum"""
|
|
45
|
+
if value is None:
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
if value not in set(['Random', 'Shuffled', 'Sequential']):
|
|
49
|
+
raise ValueError("must be one of enum values ('Random', 'Shuffled', 'Sequential')")
|
|
50
|
+
return value
|
|
51
|
+
|
|
40
52
|
model_config = ConfigDict(
|
|
41
53
|
populate_by_name=True,
|
|
42
54
|
validate_assignment=True,
|
|
@@ -76,6 +88,11 @@ class LabelingSelection(BaseModel):
|
|
|
76
88
|
exclude=excluded_fields,
|
|
77
89
|
exclude_none=True,
|
|
78
90
|
)
|
|
91
|
+
# set to None if max_iterations (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.max_iterations is None and "max_iterations" in self.model_fields_set:
|
|
94
|
+
_dict['maxIterations'] = None
|
|
95
|
+
|
|
79
96
|
return _dict
|
|
80
97
|
|
|
81
98
|
@classmethod
|
|
@@ -89,7 +106,9 @@ class LabelingSelection(BaseModel):
|
|
|
89
106
|
|
|
90
107
|
_obj = cls.model_validate({
|
|
91
108
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'LabelingSelection',
|
|
92
|
-
"amount": obj.get("amount")
|
|
109
|
+
"amount": obj.get("amount"),
|
|
110
|
+
"retrievalMode": obj.get("retrievalMode"),
|
|
111
|
+
"maxIterations": obj.get("maxIterations")
|
|
93
112
|
})
|
|
94
113
|
return _obj
|
|
95
114
|
|
|
@@ -32,8 +32,9 @@ class RapidResponse(BaseModel):
|
|
|
32
32
|
country: StrictStr
|
|
33
33
|
result: RapidResponseResult
|
|
34
34
|
user_score: Union[StrictFloat, StrictInt] = Field(alias="userScore")
|
|
35
|
+
user_scores: Dict[str, Union[StrictFloat, StrictInt]] = Field(alias="userScores")
|
|
35
36
|
demographic_information: Dict[str, StrictStr] = Field(alias="demographicInformation")
|
|
36
|
-
__properties: ClassVar[List[str]] = ["id", "userId", "country", "result", "userScore", "demographicInformation"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["id", "userId", "country", "result", "userScore", "userScores", "demographicInformation"]
|
|
37
38
|
|
|
38
39
|
model_config = ConfigDict(
|
|
39
40
|
populate_by_name=True,
|
|
@@ -94,6 +95,7 @@ class RapidResponse(BaseModel):
|
|
|
94
95
|
"country": obj.get("country"),
|
|
95
96
|
"result": RapidResponseResult.from_dict(obj["result"]) if obj.get("result") is not None else None,
|
|
96
97
|
"userScore": obj.get("userScore"),
|
|
98
|
+
"userScores": obj.get("userScores"),
|
|
97
99
|
"demographicInformation": obj.get("demographicInformation")
|
|
98
100
|
})
|
|
99
101
|
return _obj
|
|
@@ -0,0 +1,38 @@
|
|
|
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 RetrievalMode(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
RetrievalMode
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
RANDOM = 'Random'
|
|
30
|
+
SHUFFLED = 'Shuffled'
|
|
31
|
+
SEQUENTIAL = 'Sequential'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of RetrievalMode from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|
|
@@ -37,8 +37,8 @@ class RootFilter(BaseModel):
|
|
|
37
37
|
if value is None:
|
|
38
38
|
return value
|
|
39
39
|
|
|
40
|
-
if value not in set(['And', 'Or']):
|
|
41
|
-
raise ValueError("must be one of enum values ('And', 'Or')")
|
|
40
|
+
if value not in set(['And', 'Or', 'Not']):
|
|
41
|
+
raise ValueError("must be one of enum values ('And', 'Or', 'Not')")
|
|
42
42
|
return value
|
|
43
43
|
|
|
44
44
|
model_config = ConfigDict(
|
|
@@ -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 SkipTruth(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SkipTruth
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for SkipTruth", 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(['SkipTruth']):
|
|
36
|
+
raise ValueError("must be one of enum values ('SkipTruth')")
|
|
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 SkipTruth 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 SkipTruth 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 'SkipTruth'
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
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 StickyState(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
StickyState
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
NONE = 'None'
|
|
30
|
+
TEMPORARY = 'Temporary'
|
|
31
|
+
PERMANENT = 'Permanent'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of StickyState from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|