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,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_model2 import FileAssetModel2
|
|
21
|
+
from rapidata.api_client.models.null_asset_model2 import NullAssetModel2
|
|
22
|
+
from rapidata.api_client.models.text_asset_model2 import TextAssetModel2
|
|
23
|
+
from pydantic import StrictStr, Field
|
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
|
|
27
|
+
GETCOMPAREWORKFLOWRESULTSRESULTASSET_ONE_OF_SCHEMAS = ["FileAssetModel2", "MultiAssetModel2", "NullAssetModel2", "TextAssetModel2"]
|
|
28
|
+
|
|
29
|
+
class GetCompareWorkflowResultsResultAsset(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
GetCompareWorkflowResultsResultAsset
|
|
32
|
+
"""
|
|
33
|
+
# data type: FileAssetModel2
|
|
34
|
+
oneof_schema_1_validator: Optional[FileAssetModel2] = None
|
|
35
|
+
# data type: MultiAssetModel2
|
|
36
|
+
oneof_schema_2_validator: Optional[MultiAssetModel2] = None
|
|
37
|
+
# data type: NullAssetModel2
|
|
38
|
+
oneof_schema_3_validator: Optional[NullAssetModel2] = None
|
|
39
|
+
# data type: TextAssetModel2
|
|
40
|
+
oneof_schema_4_validator: Optional[TextAssetModel2] = None
|
|
41
|
+
actual_instance: Optional[Union[FileAssetModel2, MultiAssetModel2, NullAssetModel2, TextAssetModel2]] = None
|
|
42
|
+
one_of_schemas: Set[str] = { "FileAssetModel2", "MultiAssetModel2", "NullAssetModel2", "TextAssetModel2" }
|
|
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 = GetCompareWorkflowResultsResultAsset.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
match = 0
|
|
68
|
+
# validate data type: FileAssetModel2
|
|
69
|
+
if not isinstance(v, FileAssetModel2):
|
|
70
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FileAssetModel2`")
|
|
71
|
+
else:
|
|
72
|
+
match += 1
|
|
73
|
+
# validate data type: MultiAssetModel2
|
|
74
|
+
if not isinstance(v, MultiAssetModel2):
|
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAssetModel2`")
|
|
76
|
+
else:
|
|
77
|
+
match += 1
|
|
78
|
+
# validate data type: NullAssetModel2
|
|
79
|
+
if not isinstance(v, NullAssetModel2):
|
|
80
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NullAssetModel2`")
|
|
81
|
+
else:
|
|
82
|
+
match += 1
|
|
83
|
+
# validate data type: TextAssetModel2
|
|
84
|
+
if not isinstance(v, TextAssetModel2):
|
|
85
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextAssetModel2`")
|
|
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 GetCompareWorkflowResultsResultAsset with oneOf schemas: FileAssetModel2, MultiAssetModel2, NullAssetModel2, TextAssetModel2. Details: " + ", ".join(error_messages))
|
|
91
|
+
elif match == 0:
|
|
92
|
+
# no match
|
|
93
|
+
raise ValueError("No match found when setting `actual_instance` in GetCompareWorkflowResultsResultAsset with oneOf schemas: FileAssetModel2, MultiAssetModel2, NullAssetModel2, TextAssetModel2. 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 FileAssetModel2
|
|
109
|
+
try:
|
|
110
|
+
instance.actual_instance = FileAssetModel2.from_json(json_str)
|
|
111
|
+
match += 1
|
|
112
|
+
except (ValidationError, ValueError) as e:
|
|
113
|
+
error_messages.append(str(e))
|
|
114
|
+
# deserialize data into MultiAssetModel2
|
|
115
|
+
try:
|
|
116
|
+
instance.actual_instance = MultiAssetModel2.from_json(json_str)
|
|
117
|
+
match += 1
|
|
118
|
+
except (ValidationError, ValueError) as e:
|
|
119
|
+
error_messages.append(str(e))
|
|
120
|
+
# deserialize data into NullAssetModel2
|
|
121
|
+
try:
|
|
122
|
+
instance.actual_instance = NullAssetModel2.from_json(json_str)
|
|
123
|
+
match += 1
|
|
124
|
+
except (ValidationError, ValueError) as e:
|
|
125
|
+
error_messages.append(str(e))
|
|
126
|
+
# deserialize data into TextAssetModel2
|
|
127
|
+
try:
|
|
128
|
+
instance.actual_instance = TextAssetModel2.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 GetCompareWorkflowResultsResultAsset with oneOf schemas: FileAssetModel2, MultiAssetModel2, NullAssetModel2, TextAssetModel2. Details: " + ", ".join(error_messages))
|
|
136
|
+
elif match == 0:
|
|
137
|
+
# no match
|
|
138
|
+
raise ValueError("No match found when deserializing the JSON string into GetCompareWorkflowResultsResultAsset with oneOf schemas: FileAssetModel2, MultiAssetModel2, NullAssetModel2, TextAssetModel2. 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], FileAssetModel2, MultiAssetModel2, NullAssetModel2, TextAssetModel2]]:
|
|
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_model2 import MultiAssetModel2
|
|
168
|
+
# TODO: Rewrite to not use raise_errors
|
|
169
|
+
GetCompareWorkflowResultsResultAsset.model_rebuild(raise_errors=False)
|
|
170
|
+
|
|
@@ -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_compare_workflow_results_result import GetCompareWorkflowResultsResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetCompareWorkflowResultsResultPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetCompareWorkflowResultsResultPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[GetCompareWorkflowResultsResult]
|
|
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 GetCompareWorkflowResultsResultPagedResult 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 GetCompareWorkflowResultsResultPagedResult 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": [GetCompareWorkflowResultsResult.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,114 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.page_info import PageInfo
|
|
23
|
+
from rapidata.api_client.models.rapid_state import RapidState
|
|
24
|
+
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class GetSimpleWorkflowResultsModel(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
Model for getting the overview of a simple workflow result.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
page: Optional[PageInfo] = None
|
|
33
|
+
states: Optional[List[RapidState]] = Field(default=None, description="An optional list of states to filter the rapids by.")
|
|
34
|
+
sort_criteria: Optional[List[SortCriterion]] = Field(default=None, description="A list of criteria to sort the results by.", alias="sortCriteria")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["page", "states", "sortCriteria"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of GetSimpleWorkflowResultsModel from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of page
|
|
77
|
+
if self.page:
|
|
78
|
+
_dict['page'] = self.page.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in sort_criteria (list)
|
|
80
|
+
_items = []
|
|
81
|
+
if self.sort_criteria:
|
|
82
|
+
for _item_sort_criteria in self.sort_criteria:
|
|
83
|
+
if _item_sort_criteria:
|
|
84
|
+
_items.append(_item_sort_criteria.to_dict())
|
|
85
|
+
_dict['sortCriteria'] = _items
|
|
86
|
+
# set to None if states (nullable) is None
|
|
87
|
+
# and model_fields_set contains the field
|
|
88
|
+
if self.states is None and "states" in self.model_fields_set:
|
|
89
|
+
_dict['states'] = None
|
|
90
|
+
|
|
91
|
+
# set to None if sort_criteria (nullable) is None
|
|
92
|
+
# and model_fields_set contains the field
|
|
93
|
+
if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
|
|
94
|
+
_dict['sortCriteria'] = None
|
|
95
|
+
|
|
96
|
+
return _dict
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
100
|
+
"""Create an instance of GetSimpleWorkflowResultsModel 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
|
+
"page": PageInfo.from_dict(obj["page"]) if obj.get("page") is not None else None,
|
|
109
|
+
"states": obj.get("states"),
|
|
110
|
+
"sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None
|
|
111
|
+
})
|
|
112
|
+
return _obj
|
|
113
|
+
|
|
114
|
+
|
|
@@ -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.get_compare_workflow_results_result_asset import GetCompareWorkflowResultsResultAsset
|
|
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 GetSimpleWorkflowResultsResult(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
GetSimpleWorkflowResultsResult
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
asset: GetCompareWorkflowResultsResultAsset
|
|
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 GetSimpleWorkflowResultsResult 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 GetSimpleWorkflowResultsResult 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": GetCompareWorkflowResultsResultAsset.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
|
+
|
|
@@ -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_simple_workflow_results_result import GetSimpleWorkflowResultsResult
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetSimpleWorkflowResultsResultPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetSimpleWorkflowResultsResultPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[GetSimpleWorkflowResultsResult]
|
|
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 GetSimpleWorkflowResultsResultPagedResult 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 GetSimpleWorkflowResultsResultPagedResult 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": [GetSimpleWorkflowResultsResult.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
|
+
|
|
@@ -28,7 +28,7 @@ class MultiAssetModel2(BaseModel):
|
|
|
28
28
|
MultiAssetModel2
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
t: StrictStr = Field(description="Discriminator value for MultiAssetModel", alias="_t")
|
|
31
|
-
assets: List[
|
|
31
|
+
assets: List[GetCompareWorkflowResultsResultAsset]
|
|
32
32
|
metadata: List[FileAssetModel1MetadataInner]
|
|
33
33
|
identifier: StrictStr
|
|
34
34
|
__properties: ClassVar[List[str]] = ["_t", "assets", "metadata", "identifier"]
|
|
@@ -106,13 +106,13 @@ class MultiAssetModel2(BaseModel):
|
|
|
106
106
|
|
|
107
107
|
_obj = cls.model_validate({
|
|
108
108
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'MultiAssetModel',
|
|
109
|
-
"assets": [
|
|
109
|
+
"assets": [GetCompareWorkflowResultsResultAsset.from_dict(_item) for _item in obj["assets"]] if obj.get("assets") is not None else None,
|
|
110
110
|
"metadata": [FileAssetModel1MetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
|
|
111
111
|
"identifier": obj.get("identifier")
|
|
112
112
|
})
|
|
113
113
|
return _obj
|
|
114
114
|
|
|
115
|
-
from rapidata.api_client.models.
|
|
115
|
+
from rapidata.api_client.models.get_compare_workflow_results_result_asset import GetCompareWorkflowResultsResultAsset
|
|
116
116
|
# TODO: Rewrite to not use raise_errors
|
|
117
117
|
MultiAssetModel2.model_rebuild(raise_errors=False)
|
|
118
118
|
|
|
@@ -28,12 +28,13 @@ class OrderModel(BaseModel):
|
|
|
28
28
|
OrderModel
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
id: StrictStr
|
|
31
|
+
pipeline_id: StrictStr = Field(alias="pipelineId")
|
|
31
32
|
order_date: Optional[datetime] = Field(alias="orderDate")
|
|
32
33
|
customer_mail: StrictStr = Field(alias="customerMail")
|
|
33
34
|
state: StrictStr
|
|
34
35
|
order_name: StrictStr = Field(alias="orderName")
|
|
35
36
|
is_public: StrictBool = Field(alias="isPublic")
|
|
36
|
-
__properties: ClassVar[List[str]] = ["id", "orderDate", "customerMail", "state", "orderName", "isPublic"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["id", "pipelineId", "orderDate", "customerMail", "state", "orderName", "isPublic"]
|
|
37
38
|
|
|
38
39
|
@field_validator('state')
|
|
39
40
|
def state_validate_enum(cls, value):
|
|
@@ -99,6 +100,7 @@ class OrderModel(BaseModel):
|
|
|
99
100
|
|
|
100
101
|
_obj = cls.model_validate({
|
|
101
102
|
"id": obj.get("id"),
|
|
103
|
+
"pipelineId": obj.get("pipelineId"),
|
|
102
104
|
"orderDate": obj.get("orderDate"),
|
|
103
105
|
"customerMail": obj.get("customerMail"),
|
|
104
106
|
"state": obj.get("state"),
|