rapidata 1.1.0__py3-none-any.whl → 1.2.1__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/__init__.py +1 -0
- rapidata/api_client/__init__.py +30 -8
- rapidata/api_client/api/__init__.py +2 -0
- rapidata/api_client/api/campaign_api.py +8 -4
- rapidata/api_client/api/coco_api.py +4 -2
- rapidata/api_client/api/compare_workflow_api.py +2 -1
- rapidata/api_client/api/datapoint_api.py +6 -3
- rapidata/api_client/api/dataset_api.py +404 -396
- rapidata/api_client/api/identity_api.py +329 -50
- rapidata/api_client/api/newsletter_api.py +4 -2
- rapidata/api_client/api/order_api.py +40 -20
- rapidata/api_client/api/pipeline_api.py +6 -3
- rapidata/api_client/api/rapid_api.py +10 -5
- rapidata/api_client/api/rapidata_identity_api_api.py +272 -0
- rapidata/api_client/api/simple_workflow_api.py +2 -1
- rapidata/api_client/api/user_info_api.py +272 -0
- rapidata/api_client/api/validation_api.py +14 -7
- rapidata/api_client/api/workflow_api.py +30 -1067
- rapidata/api_client/models/__init__.py +28 -8
- rapidata/api_client/models/classification_metadata_model.py +98 -0
- rapidata/api_client/models/compare_workflow_config.py +3 -3
- rapidata/api_client/models/compare_workflow_config_model.py +3 -3
- rapidata/api_client/models/compare_workflow_model1.py +4 -18
- rapidata/api_client/models/compare_workflow_model1_referee.py +154 -0
- rapidata/api_client/models/completed_rapid_model.py +3 -3
- rapidata/api_client/models/completed_rapid_model_asset.py +170 -0
- rapidata/api_client/models/count_metadata_model.py +98 -0
- rapidata/api_client/models/demographic_metadata_model.py +100 -0
- rapidata/api_client/models/file_asset_model.py +3 -3
- rapidata/api_client/models/file_asset_model1.py +108 -0
- rapidata/api_client/models/file_asset_model1_metadata_inner.py +252 -0
- rapidata/api_client/models/file_asset_model2.py +108 -0
- rapidata/api_client/models/file_asset_model_metadata_inner.py +252 -0
- rapidata/api_client/models/image_dimension_metadata_model.py +100 -0
- rapidata/api_client/models/in_progress_rapid_model.py +3 -3
- rapidata/api_client/models/issue_auth_token_result.py +1 -1
- rapidata/api_client/models/legacy_issue_client_auth_token_result.py +87 -0
- rapidata/api_client/models/legacy_request_password_reset_command.py +98 -0
- rapidata/api_client/models/legacy_submit_password_reset_command.py +102 -0
- rapidata/api_client/models/location_metadata_model.py +100 -0
- rapidata/api_client/models/multi_asset_model.py +3 -3
- rapidata/api_client/models/multi_asset_model1.py +118 -0
- rapidata/api_client/models/multi_asset_model1_assets_inner.py +170 -0
- rapidata/api_client/models/multi_asset_model2.py +118 -0
- rapidata/api_client/models/not_started_rapid_model.py +3 -3
- rapidata/api_client/models/null_asset_model.py +3 -3
- rapidata/api_client/models/null_asset_model1.py +106 -0
- rapidata/api_client/models/null_asset_model2.py +106 -0
- rapidata/api_client/models/original_filename_metadata_model.py +98 -0
- rapidata/api_client/models/prompt_metadata_model.py +98 -0
- rapidata/api_client/models/query_validation_rapids_result_asset.py +40 -40
- rapidata/api_client/models/ranked_datapoint_model.py +3 -3
- rapidata/api_client/models/simple_workflow_config.py +6 -6
- rapidata/api_client/models/simple_workflow_config_model.py +3 -3
- rapidata/api_client/models/simple_workflow_model1.py +7 -21
- rapidata/api_client/models/simple_workflow_model1_blueprint.py +238 -0
- rapidata/api_client/models/text_asset_model.py +3 -3
- rapidata/api_client/models/text_asset_model1.py +108 -0
- rapidata/api_client/models/text_asset_model2.py +108 -0
- rapidata/api_client/models/text_metadata_model.py +98 -0
- rapidata/api_client/models/transcription_metadata_model.py +98 -0
- rapidata/api_client/models/translated_prompt_metadata_model.py +102 -0
- rapidata/api_client/models/translated_string.py +93 -0
- rapidata/api_client_README.md +36 -13
- rapidata/rapidata_client/__init__.py +13 -2
- rapidata/rapidata_client/assets/media_asset.py +1 -1
- rapidata/rapidata_client/assets/multi_asset.py +14 -3
- rapidata/rapidata_client/dataset/rapidata_dataset.py +59 -21
- rapidata/rapidata_client/dataset/validation_set_builder.py +1 -1
- rapidata/rapidata_client/order/rapidata_order.py +49 -18
- rapidata/rapidata_client/order/rapidata_order_builder.py +99 -41
- rapidata/rapidata_client/selection/__init__.py +1 -0
- rapidata/rapidata_client/selection/capped_selection.py +25 -0
- rapidata/rapidata_client/selection/demographic_selection.py +3 -2
- rapidata/rapidata_client/simple_builders/__init__.py +0 -0
- rapidata/rapidata_client/simple_builders/simple_classification_builders.py +14 -9
- rapidata/rapidata_client/simple_builders/simple_compare_builders.py +6 -3
- rapidata/service/openapi_service.py +15 -0
- {rapidata-1.1.0.dist-info → rapidata-1.2.1.dist-info}/METADATA +1 -1
- {rapidata-1.1.0.dist-info → rapidata-1.2.1.dist-info}/RECORD +82 -50
- {rapidata-1.1.0.dist-info → rapidata-1.2.1.dist-info}/LICENSE +0 -0
- {rapidata-1.1.0.dist-info → rapidata-1.2.1.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,170 @@
|
|
|
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_model1 import FileAssetModel1
|
|
21
|
+
from rapidata.api_client.models.null_asset_model1 import NullAssetModel1
|
|
22
|
+
from rapidata.api_client.models.text_asset_model1 import TextAssetModel1
|
|
23
|
+
from pydantic import StrictStr, Field
|
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
|
|
27
|
+
MULTIASSETMODEL1ASSETSINNER_ONE_OF_SCHEMAS = ["FileAssetModel1", "MultiAssetModel1", "NullAssetModel1", "TextAssetModel1"]
|
|
28
|
+
|
|
29
|
+
class MultiAssetModel1AssetsInner(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
MultiAssetModel1AssetsInner
|
|
32
|
+
"""
|
|
33
|
+
# data type: FileAssetModel1
|
|
34
|
+
oneof_schema_1_validator: Optional[FileAssetModel1] = None
|
|
35
|
+
# data type: MultiAssetModel1
|
|
36
|
+
oneof_schema_2_validator: Optional[MultiAssetModel1] = None
|
|
37
|
+
# data type: NullAssetModel1
|
|
38
|
+
oneof_schema_3_validator: Optional[NullAssetModel1] = None
|
|
39
|
+
# data type: TextAssetModel1
|
|
40
|
+
oneof_schema_4_validator: Optional[TextAssetModel1] = None
|
|
41
|
+
actual_instance: Optional[Union[FileAssetModel1, MultiAssetModel1, NullAssetModel1, TextAssetModel1]] = None
|
|
42
|
+
one_of_schemas: Set[str] = { "FileAssetModel1", "MultiAssetModel1", "NullAssetModel1", "TextAssetModel1" }
|
|
43
|
+
|
|
44
|
+
model_config = ConfigDict(
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
54
|
+
if args:
|
|
55
|
+
if len(args) > 1:
|
|
56
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
59
|
+
super().__init__(actual_instance=args[0])
|
|
60
|
+
else:
|
|
61
|
+
super().__init__(**kwargs)
|
|
62
|
+
|
|
63
|
+
@field_validator('actual_instance')
|
|
64
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
65
|
+
instance = MultiAssetModel1AssetsInner.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
match = 0
|
|
68
|
+
# validate data type: FileAssetModel1
|
|
69
|
+
if not isinstance(v, FileAssetModel1):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetModel1`")
|
|
71
|
+
else:
|
|
72
|
+
match += 1
|
|
73
|
+
# validate data type: MultiAssetModel1
|
|
74
|
+
if not isinstance(v, MultiAssetModel1):
|
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetModel1`")
|
|
76
|
+
else:
|
|
77
|
+
match += 1
|
|
78
|
+
# validate data type: NullAssetModel1
|
|
79
|
+
if not isinstance(v, NullAssetModel1):
|
|
80
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NullAssetModel1`")
|
|
81
|
+
else:
|
|
82
|
+
match += 1
|
|
83
|
+
# validate data type: TextAssetModel1
|
|
84
|
+
if not isinstance(v, TextAssetModel1):
|
|
85
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetModel1`")
|
|
86
|
+
else:
|
|
87
|
+
match += 1
|
|
88
|
+
if match > 1:
|
|
89
|
+
# more than 1 match
|
|
90
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in MultiAssetModel1AssetsInner with oneOf schemas: FileAssetModel1, MultiAssetModel1, NullAssetModel1, TextAssetModel1. Details: " + ", ".join(error_messages))
|
|
91
|
+
elif match == 0:
|
|
92
|
+
# no match
|
|
93
|
+
raise ValueError("No match found when setting `actual_instance` in MultiAssetModel1AssetsInner with oneOf schemas: FileAssetModel1, MultiAssetModel1, NullAssetModel1, TextAssetModel1. Details: " + ", ".join(error_messages))
|
|
94
|
+
else:
|
|
95
|
+
return v
|
|
96
|
+
|
|
97
|
+
@classmethod
|
|
98
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
99
|
+
return cls.from_json(json.dumps(obj))
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_json(cls, json_str: str) -> Self:
|
|
103
|
+
"""Returns the object represented by the json string"""
|
|
104
|
+
instance = cls.model_construct()
|
|
105
|
+
error_messages = []
|
|
106
|
+
match = 0
|
|
107
|
+
|
|
108
|
+
# deserialize data into FileAssetModel1
|
|
109
|
+
try:
|
|
110
|
+
instance.actual_instance = FileAssetModel1.from_json(json_str)
|
|
111
|
+
match += 1
|
|
112
|
+
except (ValidationError, ValueError) as e:
|
|
113
|
+
error_messages.append(str(e))
|
|
114
|
+
# deserialize data into MultiAssetModel1
|
|
115
|
+
try:
|
|
116
|
+
instance.actual_instance = MultiAssetModel1.from_json(json_str)
|
|
117
|
+
match += 1
|
|
118
|
+
except (ValidationError, ValueError) as e:
|
|
119
|
+
error_messages.append(str(e))
|
|
120
|
+
# deserialize data into NullAssetModel1
|
|
121
|
+
try:
|
|
122
|
+
instance.actual_instance = NullAssetModel1.from_json(json_str)
|
|
123
|
+
match += 1
|
|
124
|
+
except (ValidationError, ValueError) as e:
|
|
125
|
+
error_messages.append(str(e))
|
|
126
|
+
# deserialize data into TextAssetModel1
|
|
127
|
+
try:
|
|
128
|
+
instance.actual_instance = TextAssetModel1.from_json(json_str)
|
|
129
|
+
match += 1
|
|
130
|
+
except (ValidationError, ValueError) as e:
|
|
131
|
+
error_messages.append(str(e))
|
|
132
|
+
|
|
133
|
+
if match > 1:
|
|
134
|
+
# more than 1 match
|
|
135
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into MultiAssetModel1AssetsInner with oneOf schemas: FileAssetModel1, MultiAssetModel1, NullAssetModel1, TextAssetModel1. Details: " + ", ".join(error_messages))
|
|
136
|
+
elif match == 0:
|
|
137
|
+
# no match
|
|
138
|
+
raise ValueError("No match found when deserializing the JSON string into MultiAssetModel1AssetsInner with oneOf schemas: FileAssetModel1, MultiAssetModel1, NullAssetModel1, TextAssetModel1. Details: " + ", ".join(error_messages))
|
|
139
|
+
else:
|
|
140
|
+
return instance
|
|
141
|
+
|
|
142
|
+
def to_json(self) -> str:
|
|
143
|
+
"""Returns the JSON representation of the actual instance"""
|
|
144
|
+
if self.actual_instance is None:
|
|
145
|
+
return "null"
|
|
146
|
+
|
|
147
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
148
|
+
return self.actual_instance.to_json()
|
|
149
|
+
else:
|
|
150
|
+
return json.dumps(self.actual_instance)
|
|
151
|
+
|
|
152
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], FileAssetModel1, MultiAssetModel1, NullAssetModel1, TextAssetModel1]]:
|
|
153
|
+
"""Returns the dict representation of the actual instance"""
|
|
154
|
+
if self.actual_instance is None:
|
|
155
|
+
return None
|
|
156
|
+
|
|
157
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
158
|
+
return self.actual_instance.to_dict()
|
|
159
|
+
else:
|
|
160
|
+
# primitive type
|
|
161
|
+
return self.actual_instance
|
|
162
|
+
|
|
163
|
+
def to_str(self) -> str:
|
|
164
|
+
"""Returns the string representation of the actual instance"""
|
|
165
|
+
return pprint.pformat(self.model_dump())
|
|
166
|
+
|
|
167
|
+
from rapidata.api_client.models.multi_asset_model1 import MultiAssetModel1
|
|
168
|
+
# TODO: Rewrite to not use raise_errors
|
|
169
|
+
MultiAssetModel1AssetsInner.model_rebuild(raise_errors=False)
|
|
170
|
+
|
|
@@ -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.file_asset_model1_metadata_inner import FileAssetModel1MetadataInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class MultiAssetModel2(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
MultiAssetModel2
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for MultiAssetModel", alias="_t")
|
|
31
|
+
assets: List[CompletedRapidModelAsset]
|
|
32
|
+
metadata: List[FileAssetModel1MetadataInner]
|
|
33
|
+
identifier: StrictStr
|
|
34
|
+
__properties: ClassVar[List[str]] = ["_t", "assets", "metadata", "identifier"]
|
|
35
|
+
|
|
36
|
+
@field_validator('t')
|
|
37
|
+
def t_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value not in set(['MultiAssetModel']):
|
|
40
|
+
raise ValueError("must be one of enum values ('MultiAssetModel')")
|
|
41
|
+
return value
|
|
42
|
+
|
|
43
|
+
model_config = ConfigDict(
|
|
44
|
+
populate_by_name=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
57
|
+
return json.dumps(self.to_dict())
|
|
58
|
+
|
|
59
|
+
@classmethod
|
|
60
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
61
|
+
"""Create an instance of MultiAssetModel2 from a JSON string"""
|
|
62
|
+
return cls.from_dict(json.loads(json_str))
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
65
|
+
"""Return the dictionary representation of the model using alias.
|
|
66
|
+
|
|
67
|
+
This has the following differences from calling pydantic's
|
|
68
|
+
`self.model_dump(by_alias=True)`:
|
|
69
|
+
|
|
70
|
+
* `None` is only added to the output dict for nullable fields that
|
|
71
|
+
were set at model initialization. Other fields with value `None`
|
|
72
|
+
are ignored.
|
|
73
|
+
"""
|
|
74
|
+
excluded_fields: Set[str] = set([
|
|
75
|
+
])
|
|
76
|
+
|
|
77
|
+
_dict = self.model_dump(
|
|
78
|
+
by_alias=True,
|
|
79
|
+
exclude=excluded_fields,
|
|
80
|
+
exclude_none=True,
|
|
81
|
+
)
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of each item in assets (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.assets:
|
|
85
|
+
for _item_assets in self.assets:
|
|
86
|
+
if _item_assets:
|
|
87
|
+
_items.append(_item_assets.to_dict())
|
|
88
|
+
_dict['assets'] = _items
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
90
|
+
_items = []
|
|
91
|
+
if self.metadata:
|
|
92
|
+
for _item_metadata in self.metadata:
|
|
93
|
+
if _item_metadata:
|
|
94
|
+
_items.append(_item_metadata.to_dict())
|
|
95
|
+
_dict['metadata'] = _items
|
|
96
|
+
return _dict
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
100
|
+
"""Create an instance of MultiAssetModel2 from a dict"""
|
|
101
|
+
if obj is None:
|
|
102
|
+
return None
|
|
103
|
+
|
|
104
|
+
if not isinstance(obj, dict):
|
|
105
|
+
return cls.model_validate(obj)
|
|
106
|
+
|
|
107
|
+
_obj = cls.model_validate({
|
|
108
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'MultiAssetModel',
|
|
109
|
+
"assets": [CompletedRapidModelAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None,
|
|
110
|
+
"metadata": [FileAssetModel1MetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
111
|
+
"identifier": obj.get("identifier")
|
|
112
|
+
})
|
|
113
|
+
return _obj
|
|
114
|
+
|
|
115
|
+
from rapidata.api_client.models.completed_rapid_model_asset import CompletedRapidModelAsset
|
|
116
|
+
# TODO: Rewrite to not use raise_errors
|
|
117
|
+
MultiAssetModel2.model_rebuild(raise_errors=False)
|
|
118
|
+
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.completed_rapid_model_asset import CompletedRapidModelAsset
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ class NotStartedRapidModel(BaseModel):
|
|
|
28
28
|
NotStartedRapidModel
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
rapid_id: StrictStr = Field(alias="rapidId")
|
|
31
|
-
asset:
|
|
31
|
+
asset: CompletedRapidModelAsset
|
|
32
32
|
__properties: ClassVar[List[str]] = ["rapidId", "asset"]
|
|
33
33
|
|
|
34
34
|
model_config = ConfigDict(
|
|
@@ -86,7 +86,7 @@ class NotStartedRapidModel(BaseModel):
|
|
|
86
86
|
|
|
87
87
|
_obj = cls.model_validate({
|
|
88
88
|
"rapidId": obj.get("rapidId"),
|
|
89
|
-
"asset":
|
|
89
|
+
"asset": CompletedRapidModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None
|
|
90
90
|
})
|
|
91
91
|
return _obj
|
|
92
92
|
|
|
@@ -19,7 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from rapidata.api_client.models.
|
|
22
|
+
from rapidata.api_client.models.file_asset_model_metadata_inner import FileAssetModelMetadataInner
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -28,7 +28,7 @@ class NullAssetModel(BaseModel):
|
|
|
28
28
|
NullAssetModel
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
t: StrictStr = Field(description="Discriminator value for NullAssetModel", alias="_t")
|
|
31
|
-
metadata: List[
|
|
31
|
+
metadata: List[FileAssetModelMetadataInner]
|
|
32
32
|
identifier: StrictStr
|
|
33
33
|
__properties: ClassVar[List[str]] = ["_t", "metadata", "identifier"]
|
|
34
34
|
|
|
@@ -98,7 +98,7 @@ class NullAssetModel(BaseModel):
|
|
|
98
98
|
|
|
99
99
|
_obj = cls.model_validate({
|
|
100
100
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'NullAssetModel',
|
|
101
|
-
"metadata": [
|
|
101
|
+
"metadata": [FileAssetModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
102
102
|
"identifier": obj.get("identifier")
|
|
103
103
|
})
|
|
104
104
|
return _obj
|
|
@@ -0,0 +1,106 @@
|
|
|
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.file_asset_model1_metadata_inner import FileAssetModel1MetadataInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class NullAssetModel1(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
NullAssetModel1
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for NullAssetModel", alias="_t")
|
|
31
|
+
metadata: List[FileAssetModel1MetadataInner]
|
|
32
|
+
identifier: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "metadata", "identifier"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['NullAssetModel']):
|
|
39
|
+
raise ValueError("must be one of enum values ('NullAssetModel')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of NullAssetModel1 from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.metadata:
|
|
84
|
+
for _item_metadata in self.metadata:
|
|
85
|
+
if _item_metadata:
|
|
86
|
+
_items.append(_item_metadata.to_dict())
|
|
87
|
+
_dict['metadata'] = _items
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of NullAssetModel1 from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'NullAssetModel',
|
|
101
|
+
"metadata": [FileAssetModel1MetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
102
|
+
"identifier": obj.get("identifier")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -0,0 +1,106 @@
|
|
|
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.file_asset_model1_metadata_inner import FileAssetModel1MetadataInner
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class NullAssetModel2(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
NullAssetModel2
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for NullAssetModel", alias="_t")
|
|
31
|
+
metadata: List[FileAssetModel1MetadataInner]
|
|
32
|
+
identifier: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "metadata", "identifier"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['NullAssetModel']):
|
|
39
|
+
raise ValueError("must be one of enum values ('NullAssetModel')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of NullAssetModel2 from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.metadata:
|
|
84
|
+
for _item_metadata in self.metadata:
|
|
85
|
+
if _item_metadata:
|
|
86
|
+
_items.append(_item_metadata.to_dict())
|
|
87
|
+
_dict['metadata'] = _items
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of NullAssetModel2 from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'NullAssetModel',
|
|
101
|
+
"metadata": [FileAssetModel1MetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
102
|
+
"identifier": obj.get("identifier")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -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
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class OriginalFilenameMetadataModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
OriginalFilenameMetadataModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for OriginalFilenameMetadata", alias="_t")
|
|
30
|
+
original_filename: StrictStr = Field(alias="originalFilename")
|
|
31
|
+
identifier: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "originalFilename", "identifier"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['OriginalFilenameMetadata']):
|
|
38
|
+
raise ValueError("must be one of enum values ('OriginalFilenameMetadata')")
|
|
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 OriginalFilenameMetadataModel 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 OriginalFilenameMetadataModel 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 'OriginalFilenameMetadata',
|
|
93
|
+
"originalFilename": obj.get("originalFilename"),
|
|
94
|
+
"identifier": obj.get("identifier")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|