rapidata 2.14.0__py3-none-any.whl → 2.15.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 +13 -0
- rapidata/api_client/api/campaign_api.py +252 -0
- rapidata/api_client/api/order_api.py +252 -0
- rapidata/api_client/api/rapid_api.py +262 -0
- rapidata/api_client/api/validation_api.py +283 -0
- rapidata/api_client/api/workflow_api.py +3 -3
- rapidata/api_client/models/__init__.py +13 -0
- rapidata/api_client/models/add_campaign_model.py +9 -2
- rapidata/api_client/models/campaign_query_result.py +2 -2
- rapidata/api_client/models/campaign_status.py +1 -0
- rapidata/api_client/models/classification_metadata.py +2 -4
- rapidata/api_client/models/compare_workflow_config.py +17 -2
- rapidata/api_client/models/compare_workflow_config_metadata_value.py +238 -0
- rapidata/api_client/models/compare_workflow_config_model.py +17 -2
- rapidata/api_client/models/compare_workflow_model.py +17 -2
- rapidata/api_client/models/count_metadata.py +1 -3
- rapidata/api_client/models/create_order_model.py +15 -1
- rapidata/api_client/models/early_stopping_referee_model.py +1 -1
- rapidata/api_client/models/evaluation_workflow_model.py +1 -1
- rapidata/api_client/models/get_rapid_responses_result.py +112 -0
- rapidata/api_client/models/get_simple_workflow_results_result.py +7 -1
- rapidata/api_client/models/image_dimension_metadata.py +1 -3
- rapidata/api_client/models/location_metadata.py +2 -4
- rapidata/api_client/models/metadata_visibilities.py +1 -0
- rapidata/api_client/models/order_model.py +2 -2
- rapidata/api_client/models/order_state.py +1 -0
- rapidata/api_client/models/original_filename_metadata.py +2 -4
- rapidata/api_client/models/prompt_metadata.py +1 -3
- rapidata/api_client/models/scrub_result.py +4 -4
- rapidata/api_client/models/source_url_metadata.py +98 -0
- rapidata/api_client/models/text_metadata.py +3 -5
- rapidata/api_client/models/transcription_metadata.py +1 -3
- rapidata/api_client/models/update_dimensions_model.py +87 -0
- rapidata/api_client_README.md +22 -4
- rapidata/rapidata_client/demographic/demographic_manager.py +35 -0
- rapidata/rapidata_client/filter/rapidata_filters.py +10 -2
- rapidata/rapidata_client/order/_rapidata_order_builder.py +7 -5
- rapidata/rapidata_client/order/rapidata_order.py +3 -5
- rapidata/rapidata_client/order/rapidata_order_manager.py +20 -20
- rapidata/rapidata_client/order/rapidata_results.py +2 -1
- rapidata/rapidata_client/rapidata_client.py +4 -0
- rapidata/rapidata_client/selection/rapidata_selections.py +10 -9
- rapidata/rapidata_client/settings/no_shuffle.py +2 -2
- rapidata/rapidata_client/settings/rapidata_settings.py +8 -0
- rapidata/rapidata_client/workflow/_ranking_workflow.py +15 -4
- rapidata/service/credential_manager.py +7 -0
- rapidata/service/openapi_service.py +6 -6
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/METADATA +1 -1
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/RECORD +51 -47
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.dist-info}/LICENSE +0 -0
- {rapidata-2.14.0.dist-info → rapidata-2.15.0.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, 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.rapid_response import RapidResponse
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class GetRapidResponsesResult(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
GetRapidResponsesResult
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
asset: DatapointAsset
|
|
33
|
+
responses: List[RapidResponse]
|
|
34
|
+
state: StrictStr
|
|
35
|
+
__properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
|
|
36
|
+
|
|
37
|
+
@field_validator('state')
|
|
38
|
+
def state_validate_enum(cls, value):
|
|
39
|
+
"""Validates the enum"""
|
|
40
|
+
if value not in set(['Labeling', 'Paused', 'Incomplete', 'Done', 'None']):
|
|
41
|
+
raise ValueError("must be one of enum values ('Labeling', 'Paused', 'Incomplete', 'Done', 'None')")
|
|
42
|
+
return value
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
populate_by_name=True,
|
|
46
|
+
validate_assignment=True,
|
|
47
|
+
protected_namespaces=(),
|
|
48
|
+
)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def to_str(self) -> str:
|
|
52
|
+
"""Returns the string representation of the model using alias"""
|
|
53
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
+
|
|
55
|
+
def to_json(self) -> str:
|
|
56
|
+
"""Returns the JSON representation of the model using alias"""
|
|
57
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
58
|
+
return json.dumps(self.to_dict())
|
|
59
|
+
|
|
60
|
+
@classmethod
|
|
61
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
+
"""Create an instance of GetRapidResponsesResult from a JSON string"""
|
|
63
|
+
return cls.from_dict(json.loads(json_str))
|
|
64
|
+
|
|
65
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
+
"""Return the dictionary representation of the model using alias.
|
|
67
|
+
|
|
68
|
+
This has the following differences from calling pydantic's
|
|
69
|
+
`self.model_dump(by_alias=True)`:
|
|
70
|
+
|
|
71
|
+
* `None` is only added to the output dict for nullable fields that
|
|
72
|
+
were set at model initialization. Other fields with value `None`
|
|
73
|
+
are ignored.
|
|
74
|
+
"""
|
|
75
|
+
excluded_fields: Set[str] = set([
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
_dict = self.model_dump(
|
|
79
|
+
by_alias=True,
|
|
80
|
+
exclude=excluded_fields,
|
|
81
|
+
exclude_none=True,
|
|
82
|
+
)
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
84
|
+
if self.asset:
|
|
85
|
+
_dict['asset'] = self.asset.to_dict()
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of each item in responses (list)
|
|
87
|
+
_items = []
|
|
88
|
+
if self.responses:
|
|
89
|
+
for _item_responses in self.responses:
|
|
90
|
+
if _item_responses:
|
|
91
|
+
_items.append(_item_responses.to_dict())
|
|
92
|
+
_dict['responses'] = _items
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of GetRapidResponsesResult from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"rapidId": obj.get("rapidId"),
|
|
106
|
+
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
107
|
+
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
108
|
+
"state": obj.get("state")
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from rapidata.api_client.models.datapoint_asset import DatapointAsset
|
|
23
|
+
from rapidata.api_client.models.query_validation_rapids_result_payload import QueryValidationRapidsResultPayload
|
|
23
24
|
from rapidata.api_client.models.rapid_response import RapidResponse
|
|
24
25
|
from typing import Optional, Set
|
|
25
26
|
from typing_extensions import Self
|
|
@@ -29,10 +30,11 @@ class GetSimpleWorkflowResultsResult(BaseModel):
|
|
|
29
30
|
GetSimpleWorkflowResultsResult
|
|
30
31
|
""" # noqa: E501
|
|
31
32
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
33
|
+
payload: QueryValidationRapidsResultPayload
|
|
32
34
|
asset: DatapointAsset
|
|
33
35
|
responses: List[RapidResponse]
|
|
34
36
|
state: StrictStr
|
|
35
|
-
__properties: ClassVar[List[str]] = ["rapidId", "asset", "responses", "state"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["rapidId", "payload", "asset", "responses", "state"]
|
|
36
38
|
|
|
37
39
|
@field_validator('state')
|
|
38
40
|
def state_validate_enum(cls, value):
|
|
@@ -80,6 +82,9 @@ class GetSimpleWorkflowResultsResult(BaseModel):
|
|
|
80
82
|
exclude=excluded_fields,
|
|
81
83
|
exclude_none=True,
|
|
82
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()
|
|
83
88
|
# override the default output from pydantic by calling `to_dict()` of asset
|
|
84
89
|
if self.asset:
|
|
85
90
|
_dict['asset'] = self.asset.to_dict()
|
|
@@ -103,6 +108,7 @@ class GetSimpleWorkflowResultsResult(BaseModel):
|
|
|
103
108
|
|
|
104
109
|
_obj = cls.model_validate({
|
|
105
110
|
"rapidId": obj.get("rapidId"),
|
|
111
|
+
"payload": QueryValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
|
|
106
112
|
"asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
107
113
|
"responses": [RapidResponse.from_dict(_item) for _item in obj["responses"]] if obj.get("responses") is not None else None,
|
|
108
114
|
"state": obj.get("state")
|
|
@@ -29,9 +29,8 @@ class ImageDimensionMetadata(BaseModel):
|
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ImageDimensionMetadata", alias="_t")
|
|
30
30
|
height: Optional[StrictInt] = None
|
|
31
31
|
width: Optional[StrictInt] = None
|
|
32
|
-
identifier: Optional[StrictStr] = None
|
|
33
32
|
visibilities: Optional[StrictStr] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["_t", "height", "width", "
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "height", "width", "visibilities"]
|
|
35
34
|
|
|
36
35
|
@field_validator('t')
|
|
37
36
|
def t_validate_enum(cls, value):
|
|
@@ -94,7 +93,6 @@ class ImageDimensionMetadata(BaseModel):
|
|
|
94
93
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'ImageDimensionMetadata',
|
|
95
94
|
"height": obj.get("height"),
|
|
96
95
|
"width": obj.get("width"),
|
|
97
|
-
"identifier": obj.get("identifier"),
|
|
98
96
|
"visibilities": obj.get("visibilities")
|
|
99
97
|
})
|
|
100
98
|
return _obj
|
|
@@ -30,8 +30,7 @@ class LocationMetadata(BaseModel):
|
|
|
30
30
|
x: Union[StrictFloat, StrictInt]
|
|
31
31
|
y: Union[StrictFloat, StrictInt]
|
|
32
32
|
visibilities: Optional[StrictStr] = None
|
|
33
|
-
|
|
34
|
-
__properties: ClassVar[List[str]] = ["_t", "x", "y", "visibilities", "identifier"]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "x", "y", "visibilities"]
|
|
35
34
|
|
|
36
35
|
@field_validator('t')
|
|
37
36
|
def t_validate_enum(cls, value):
|
|
@@ -94,8 +93,7 @@ class LocationMetadata(BaseModel):
|
|
|
94
93
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'LocationMetadata',
|
|
95
94
|
"x": obj.get("x"),
|
|
96
95
|
"y": obj.get("y"),
|
|
97
|
-
"visibilities": obj.get("visibilities")
|
|
98
|
-
"identifier": obj.get("identifier")
|
|
96
|
+
"visibilities": obj.get("visibilities")
|
|
99
97
|
})
|
|
100
98
|
return _obj
|
|
101
99
|
|
|
@@ -39,8 +39,8 @@ class OrderModel(BaseModel):
|
|
|
39
39
|
@field_validator('state')
|
|
40
40
|
def state_validate_enum(cls, value):
|
|
41
41
|
"""Validates the enum"""
|
|
42
|
-
if value not in set(['Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed']):
|
|
43
|
-
raise ValueError("must be one of enum values ('Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed')")
|
|
42
|
+
if value not in set(['Created', 'Preview', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed']):
|
|
43
|
+
raise ValueError("must be one of enum values ('Created', 'Preview', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed')")
|
|
44
44
|
return value
|
|
45
45
|
|
|
46
46
|
model_config = ConfigDict(
|
|
@@ -29,8 +29,7 @@ class OriginalFilenameMetadata(BaseModel):
|
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for OriginalFilenameMetadata", alias="_t")
|
|
30
30
|
original_filename: StrictStr = Field(alias="originalFilename")
|
|
31
31
|
visibilities: Optional[StrictStr] = None
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "originalFilename", "visibilities", "identifier"]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "originalFilename", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,8 +91,7 @@ class OriginalFilenameMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'OriginalFilenameMetadata',
|
|
94
93
|
"originalFilename": obj.get("originalFilename"),
|
|
95
|
-
"visibilities": obj.get("visibilities")
|
|
96
|
-
"identifier": obj.get("identifier")
|
|
94
|
+
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
99
97
|
|
|
@@ -28,9 +28,8 @@ class PromptMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for PromptMetadata", alias="_t")
|
|
30
30
|
prompt: StrictStr
|
|
31
|
-
identifier: Optional[StrictStr] = None
|
|
32
31
|
visibilities: Optional[StrictStr] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "prompt", "
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "prompt", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class PromptMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'PromptMetadata',
|
|
94
93
|
"prompt": obj.get("prompt"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
@@ -27,9 +27,9 @@ class ScrubResult(BaseModel):
|
|
|
27
27
|
ScrubResult
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for ScrubResult", alias="_t")
|
|
30
|
-
rapid_id: StrictStr = Field(alias="rapidId")
|
|
31
30
|
timestamps: List[StrictInt]
|
|
32
|
-
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "timestamps", "rapidId"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
35
35
|
def t_validate_enum(cls, value):
|
|
@@ -90,8 +90,8 @@ class ScrubResult(BaseModel):
|
|
|
90
90
|
|
|
91
91
|
_obj = cls.model_validate({
|
|
92
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'ScrubResult',
|
|
93
|
-
"
|
|
94
|
-
"
|
|
93
|
+
"timestamps": obj.get("timestamps"),
|
|
94
|
+
"rapidId": obj.get("rapidId")
|
|
95
95
|
})
|
|
96
96
|
return _obj
|
|
97
97
|
|
|
@@ -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, 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 SourceUrlMetadata(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SourceUrlMetadata
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for SourceUrlMetadata", alias="_t")
|
|
30
|
+
url: StrictStr
|
|
31
|
+
visibilities: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "url", "visibilities"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['SourceUrlMetadata']):
|
|
38
|
+
raise ValueError("must be one of enum values ('SourceUrlMetadata')")
|
|
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 SourceUrlMetadata 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 SourceUrlMetadata 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 'SourceUrlMetadata',
|
|
93
|
+
"url": obj.get("url"),
|
|
94
|
+
"visibilities": obj.get("visibilities")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, 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,9 +28,8 @@ class TextMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TextMetadata", alias="_t")
|
|
30
30
|
text: StrictStr
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "text", "identifier", "visibilities"]
|
|
31
|
+
visibilities: Optional[StrictStr] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "text", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class TextMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TextMetadata',
|
|
94
93
|
"text": obj.get("text"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
@@ -28,9 +28,8 @@ class TranscriptionMetadata(BaseModel):
|
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for TranscriptionMetadata", alias="_t")
|
|
30
30
|
transcription: StrictStr
|
|
31
|
-
identifier: StrictStr
|
|
32
31
|
visibilities: StrictStr
|
|
33
|
-
__properties: ClassVar[List[str]] = ["_t", "transcription", "
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "transcription", "visibilities"]
|
|
34
33
|
|
|
35
34
|
@field_validator('t')
|
|
36
35
|
def t_validate_enum(cls, value):
|
|
@@ -92,7 +91,6 @@ class TranscriptionMetadata(BaseModel):
|
|
|
92
91
|
_obj = cls.model_validate({
|
|
93
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'TranscriptionMetadata',
|
|
94
93
|
"transcription": obj.get("transcription"),
|
|
95
|
-
"identifier": obj.get("identifier"),
|
|
96
94
|
"visibilities": obj.get("visibilities")
|
|
97
95
|
})
|
|
98
96
|
return _obj
|
|
@@ -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, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class UpdateDimensionsModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
The model for updating the dimensions of all rapids within a validation set.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
dimensions: List[StrictStr]
|
|
30
|
+
__properties: ClassVar[List[str]] = ["dimensions"]
|
|
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 UpdateDimensionsModel 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 UpdateDimensionsModel 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
|
+
"dimensions": obj.get("dimensions")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|