rapidata 0.4.1__py3-none-any.whl → 0.5.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 +4 -3
- rapidata/api_client/__init__.py +22 -12
- rapidata/api_client/api/__init__.py +2 -0
- rapidata/api_client/api/campaign_api.py +1044 -0
- rapidata/api_client/api/order_api.py +0 -556
- rapidata/api_client/api/pipeline_api.py +843 -0
- rapidata/api_client/models/__init__.py +20 -12
- rapidata/api_client/models/add_campaign_artifact_result.py +87 -0
- rapidata/api_client/models/add_campaign_model.py +149 -0
- rapidata/api_client/models/campaign_artifact_model.py +98 -0
- rapidata/api_client/models/campaign_query_model.py +105 -0
- rapidata/api_client/models/campaign_query_model_paged_result.py +105 -0
- rapidata/api_client/models/campaign_status.py +39 -0
- rapidata/api_client/models/compare_workflow_config.py +2 -12
- rapidata/api_client/models/compare_workflow_config_model.py +138 -0
- rapidata/api_client/models/conditional_validation_selection.py +106 -0
- rapidata/api_client/models/create_order_model_selections_inner.py +26 -12
- rapidata/api_client/models/dataset_artifact_model.py +98 -0
- rapidata/api_client/models/demographic_rapid_selection_config.py +7 -5
- rapidata/api_client/models/demographic_selection.py +7 -5
- rapidata/api_client/models/file_artifact_model.py +98 -0
- rapidata/api_client/models/get_pipeline_by_id_result.py +100 -0
- rapidata/api_client/models/get_pipeline_by_id_result_artifacts_value.py +182 -0
- rapidata/api_client/models/query_campaigns_model.py +112 -0
- rapidata/api_client/models/simple_workflow_config.py +2 -12
- rapidata/api_client/models/simple_workflow_config_model.py +132 -0
- rapidata/api_client/models/simple_workflow_config_model_blueprint.py +238 -0
- rapidata/api_client/models/update_workflow_config_request.py +107 -0
- rapidata/api_client/models/update_workflow_config_request_config.py +140 -0
- rapidata/api_client/models/workflow_artifact_model.py +98 -0
- rapidata/api_client/models/workflow_config_artifact_model.py +102 -0
- rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +140 -0
- rapidata/api_client_README.md +31 -21
- rapidata/rapidata_client/__init__.py +6 -1
- rapidata/rapidata_client/selection/__init__.py +1 -0
- rapidata/rapidata_client/selection/conditional_validation_rapid_selection.py +41 -0
- rapidata/rapidata_client/selection/demographic_selection.py +3 -5
- {rapidata-0.4.1.dist-info → rapidata-0.5.0.dist-info}/METADATA +1 -1
- {rapidata-0.4.1.dist-info → rapidata-0.5.0.dist-info}/RECORD +41 -18
- {rapidata-0.4.1.dist-info → rapidata-0.5.0.dist-info}/LICENSE +0 -0
- {rapidata-0.4.1.dist-info → rapidata-0.5.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
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 CampaignStatus(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
CampaignStatus
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
CREATED = 'Created'
|
|
30
|
+
ACTIVE = 'Active'
|
|
31
|
+
PAUSED = 'Paused'
|
|
32
|
+
COMPLETED = 'Completed'
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
|
36
|
+
"""Create an instance of CampaignStatus from a JSON string"""
|
|
37
|
+
return cls(json.loads(json_str))
|
|
38
|
+
|
|
39
|
+
|
|
@@ -19,7 +19,6 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from rapidata.api_client.models.compare_workflow_config_rapid_selection_configs_inner import CompareWorkflowConfigRapidSelectionConfigsInner
|
|
23
22
|
from rapidata.api_client.models.compare_workflow_config_referee import CompareWorkflowConfigReferee
|
|
24
23
|
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
25
24
|
from typing import Optional, Set
|
|
@@ -41,8 +40,7 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
41
40
|
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
42
41
|
priority: Optional[StrictStr] = None
|
|
43
42
|
is_fallback: Optional[StrictBool] = Field(default=None, alias="isFallback")
|
|
44
|
-
|
|
45
|
-
__properties: ClassVar[List[str]] = ["_t", "criteria", "startingElo", "kFactor", "matchSize", "scalingFactor", "matchesUntilCompleted", "referee", "targetCountryCodes", "featureFlags", "priority", "isFallback", "rapidSelectionConfigs"]
|
|
43
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "startingElo", "kFactor", "matchSize", "scalingFactor", "matchesUntilCompleted", "referee", "targetCountryCodes", "featureFlags", "priority", "isFallback"]
|
|
46
44
|
|
|
47
45
|
@field_validator('t')
|
|
48
46
|
def t_validate_enum(cls, value):
|
|
@@ -100,13 +98,6 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
100
98
|
if _item_feature_flags:
|
|
101
99
|
_items.append(_item_feature_flags.to_dict())
|
|
102
100
|
_dict['featureFlags'] = _items
|
|
103
|
-
# override the default output from pydantic by calling `to_dict()` of each item in rapid_selection_configs (list)
|
|
104
|
-
_items = []
|
|
105
|
-
if self.rapid_selection_configs:
|
|
106
|
-
for _item_rapid_selection_configs in self.rapid_selection_configs:
|
|
107
|
-
if _item_rapid_selection_configs:
|
|
108
|
-
_items.append(_item_rapid_selection_configs.to_dict())
|
|
109
|
-
_dict['rapidSelectionConfigs'] = _items
|
|
110
101
|
# set to None if priority (nullable) is None
|
|
111
102
|
# and model_fields_set contains the field
|
|
112
103
|
if self.priority is None and "priority" in self.model_fields_set:
|
|
@@ -135,8 +126,7 @@ class CompareWorkflowConfig(BaseModel):
|
|
|
135
126
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
136
127
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
137
128
|
"priority": obj.get("priority"),
|
|
138
|
-
"isFallback": obj.get("isFallback")
|
|
139
|
-
"rapidSelectionConfigs": [CompareWorkflowConfigRapidSelectionConfigsInner.from_dict(_item) for _item in obj["rapidSelectionConfigs"]] if obj.get("rapidSelectionConfigs") is not None else None
|
|
129
|
+
"isFallback": obj.get("isFallback")
|
|
140
130
|
})
|
|
141
131
|
return _obj
|
|
142
132
|
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.compare_workflow_config_referee import CompareWorkflowConfigReferee
|
|
23
|
+
from rapidata.api_client.models.feature_flag import FeatureFlag
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CompareWorkflowConfigModel(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
The configuration for creating a compare workflow. A compare workflow is a workflow that continuously matches datapoints against each other and updates their respective ELO scores. The ELO scores are used to determine the relative strength of the datapoints, and datapoints are matched against other datapoints with similar ELO scores. The end goal is a ranking of the datapoints based on their relative strength.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
t: StrictStr = Field(description="Discriminator value for CompareWorkflowConfig", alias="_t")
|
|
32
|
+
criteria: StrictStr = Field(description="The criteria to add to each compare rapid.")
|
|
33
|
+
starting_elo: Optional[StrictInt] = Field(default=None, description="The starting ELO score for each datapoint.", alias="startingElo")
|
|
34
|
+
k_factor: Optional[StrictInt] = Field(default=None, description="The K-factor to use in the ELO calculation. Determines the maximum possible change in a player's Elo rating after a single match. Higher K-Factor values result in larger rating changes.", alias="kFactor")
|
|
35
|
+
match_size: Optional[StrictInt] = Field(default=None, description="The number of datapoints to match against each other in each match.", alias="matchSize")
|
|
36
|
+
scaling_factor: Optional[StrictInt] = Field(default=None, description="Scaling factor to use in the ELO calculation. Adjusts the sensitivity of the Elo rating system to differences in player ratings. It affects how much the rating changes based on the expected outcome versus the actual outcome.", alias="scalingFactor")
|
|
37
|
+
matches_until_completed: Optional[StrictInt] = Field(default=None, description="The number of matches to run before each datapoint is considered \"completed\".", alias="matchesUntilCompleted")
|
|
38
|
+
referee: CompareWorkflowConfigReferee
|
|
39
|
+
target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
|
|
40
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
41
|
+
priority: Optional[StrictStr] = None
|
|
42
|
+
is_fallback: Optional[StrictBool] = Field(default=None, alias="isFallback")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["_t", "criteria", "startingElo", "kFactor", "matchSize", "scalingFactor", "matchesUntilCompleted", "referee", "targetCountryCodes", "featureFlags", "priority", "isFallback"]
|
|
44
|
+
|
|
45
|
+
@field_validator('t')
|
|
46
|
+
def t_validate_enum(cls, value):
|
|
47
|
+
"""Validates the enum"""
|
|
48
|
+
if value not in set(['CompareWorkflowConfig']):
|
|
49
|
+
raise ValueError("must be one of enum values ('CompareWorkflowConfig')")
|
|
50
|
+
return value
|
|
51
|
+
|
|
52
|
+
model_config = ConfigDict(
|
|
53
|
+
populate_by_name=True,
|
|
54
|
+
validate_assignment=True,
|
|
55
|
+
protected_namespaces=(),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def to_str(self) -> str:
|
|
60
|
+
"""Returns the string representation of the model using alias"""
|
|
61
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
62
|
+
|
|
63
|
+
def to_json(self) -> str:
|
|
64
|
+
"""Returns the JSON representation of the model using alias"""
|
|
65
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
66
|
+
return json.dumps(self.to_dict())
|
|
67
|
+
|
|
68
|
+
@classmethod
|
|
69
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
70
|
+
"""Create an instance of CompareWorkflowConfigModel from a JSON string"""
|
|
71
|
+
return cls.from_dict(json.loads(json_str))
|
|
72
|
+
|
|
73
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
74
|
+
"""Return the dictionary representation of the model using alias.
|
|
75
|
+
|
|
76
|
+
This has the following differences from calling pydantic's
|
|
77
|
+
`self.model_dump(by_alias=True)`:
|
|
78
|
+
|
|
79
|
+
* `None` is only added to the output dict for nullable fields that
|
|
80
|
+
were set at model initialization. Other fields with value `None`
|
|
81
|
+
are ignored.
|
|
82
|
+
"""
|
|
83
|
+
excluded_fields: Set[str] = set([
|
|
84
|
+
])
|
|
85
|
+
|
|
86
|
+
_dict = self.model_dump(
|
|
87
|
+
by_alias=True,
|
|
88
|
+
exclude=excluded_fields,
|
|
89
|
+
exclude_none=True,
|
|
90
|
+
)
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of referee
|
|
92
|
+
if self.referee:
|
|
93
|
+
_dict['referee'] = self.referee.to_dict()
|
|
94
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
95
|
+
_items = []
|
|
96
|
+
if self.feature_flags:
|
|
97
|
+
for _item_feature_flags in self.feature_flags:
|
|
98
|
+
if _item_feature_flags:
|
|
99
|
+
_items.append(_item_feature_flags.to_dict())
|
|
100
|
+
_dict['featureFlags'] = _items
|
|
101
|
+
# set to None if priority (nullable) is None
|
|
102
|
+
# and model_fields_set contains the field
|
|
103
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
104
|
+
_dict['priority'] = None
|
|
105
|
+
|
|
106
|
+
# set to None if is_fallback (nullable) is None
|
|
107
|
+
# and model_fields_set contains the field
|
|
108
|
+
if self.is_fallback is None and "is_fallback" in self.model_fields_set:
|
|
109
|
+
_dict['isFallback'] = None
|
|
110
|
+
|
|
111
|
+
return _dict
|
|
112
|
+
|
|
113
|
+
@classmethod
|
|
114
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
115
|
+
"""Create an instance of CompareWorkflowConfigModel from a dict"""
|
|
116
|
+
if obj is None:
|
|
117
|
+
return None
|
|
118
|
+
|
|
119
|
+
if not isinstance(obj, dict):
|
|
120
|
+
return cls.model_validate(obj)
|
|
121
|
+
|
|
122
|
+
_obj = cls.model_validate({
|
|
123
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowConfig',
|
|
124
|
+
"criteria": obj.get("criteria"),
|
|
125
|
+
"startingElo": obj.get("startingElo"),
|
|
126
|
+
"kFactor": obj.get("kFactor"),
|
|
127
|
+
"matchSize": obj.get("matchSize"),
|
|
128
|
+
"scalingFactor": obj.get("scalingFactor"),
|
|
129
|
+
"matchesUntilCompleted": obj.get("matchesUntilCompleted"),
|
|
130
|
+
"referee": CompareWorkflowConfigReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
131
|
+
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
132
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
133
|
+
"priority": obj.get("priority"),
|
|
134
|
+
"isFallback": obj.get("isFallback")
|
|
135
|
+
})
|
|
136
|
+
return _obj
|
|
137
|
+
|
|
138
|
+
|
|
@@ -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.validation_chance import ValidationChance
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ConditionalValidationSelection(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ConditionalValidationSelection
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
t: StrictStr = Field(description="Discriminator value for ConditionalValidationSelection", alias="_t")
|
|
31
|
+
validation_set_id: StrictStr = Field(alias="validationSetId")
|
|
32
|
+
validation_chances: List[ValidationChance] = Field(alias="validationChances")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["_t", "validationSetId", "validationChances"]
|
|
34
|
+
|
|
35
|
+
@field_validator('t')
|
|
36
|
+
def t_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['ConditionalValidationSelection']):
|
|
39
|
+
raise ValueError("must be one of enum values ('ConditionalValidationSelection')")
|
|
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 ConditionalValidationSelection 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 validation_chances (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.validation_chances:
|
|
84
|
+
for _item_validation_chances in self.validation_chances:
|
|
85
|
+
if _item_validation_chances:
|
|
86
|
+
_items.append(_item_validation_chances.to_dict())
|
|
87
|
+
_dict['validationChances'] = _items
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of ConditionalValidationSelection 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 'ConditionalValidationSelection',
|
|
101
|
+
"validationSetId": obj.get("validationSetId"),
|
|
102
|
+
"validationChances": [ValidationChance.from_dict(_item) for _item in obj["validationChances"]] if obj.get("validationChances") is not None else None
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -17,6 +17,7 @@ import json
|
|
|
17
17
|
import pprint
|
|
18
18
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
19
|
from typing import Any, List, Optional
|
|
20
|
+
from rapidata.api_client.models.conditional_validation_selection import ConditionalValidationSelection
|
|
20
21
|
from rapidata.api_client.models.demographic_selection import DemographicSelection
|
|
21
22
|
from rapidata.api_client.models.labeling_selection import LabelingSelection
|
|
22
23
|
from rapidata.api_client.models.static_selection import StaticSelection
|
|
@@ -25,22 +26,24 @@ from pydantic import StrictStr, Field
|
|
|
25
26
|
from typing import Union, List, Set, Optional, Dict
|
|
26
27
|
from typing_extensions import Literal, Self
|
|
27
28
|
|
|
28
|
-
CREATEORDERMODELSELECTIONSINNER_ONE_OF_SCHEMAS = ["DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection"]
|
|
29
|
+
CREATEORDERMODELSELECTIONSINNER_ONE_OF_SCHEMAS = ["ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection"]
|
|
29
30
|
|
|
30
31
|
class CreateOrderModelSelectionsInner(BaseModel):
|
|
31
32
|
"""
|
|
32
33
|
CreateOrderModelSelectionsInner
|
|
33
34
|
"""
|
|
35
|
+
# data type: ConditionalValidationSelection
|
|
36
|
+
oneof_schema_1_validator: Optional[ConditionalValidationSelection] = None
|
|
34
37
|
# data type: DemographicSelection
|
|
35
|
-
|
|
38
|
+
oneof_schema_2_validator: Optional[DemographicSelection] = None
|
|
36
39
|
# data type: LabelingSelection
|
|
37
|
-
|
|
40
|
+
oneof_schema_3_validator: Optional[LabelingSelection] = None
|
|
38
41
|
# data type: StaticSelection
|
|
39
|
-
|
|
42
|
+
oneof_schema_4_validator: Optional[StaticSelection] = None
|
|
40
43
|
# data type: ValidationSelection
|
|
41
|
-
|
|
42
|
-
actual_instance: Optional[Union[DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]] = None
|
|
43
|
-
one_of_schemas: Set[str] = { "DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection" }
|
|
44
|
+
oneof_schema_5_validator: Optional[ValidationSelection] = None
|
|
45
|
+
actual_instance: Optional[Union[ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]] = None
|
|
46
|
+
one_of_schemas: Set[str] = { "ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection" }
|
|
44
47
|
|
|
45
48
|
model_config = ConfigDict(
|
|
46
49
|
validate_assignment=True,
|
|
@@ -66,6 +69,11 @@ class CreateOrderModelSelectionsInner(BaseModel):
|
|
|
66
69
|
instance = CreateOrderModelSelectionsInner.model_construct()
|
|
67
70
|
error_messages = []
|
|
68
71
|
match = 0
|
|
72
|
+
# validate data type: ConditionalValidationSelection
|
|
73
|
+
if not isinstance(v, ConditionalValidationSelection):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ConditionalValidationSelection`")
|
|
75
|
+
else:
|
|
76
|
+
match += 1
|
|
69
77
|
# validate data type: DemographicSelection
|
|
70
78
|
if not isinstance(v, DemographicSelection):
|
|
71
79
|
error_messages.append(f"Error! Input type `{type(v)}` is not `DemographicSelection`")
|
|
@@ -88,10 +96,10 @@ class CreateOrderModelSelectionsInner(BaseModel):
|
|
|
88
96
|
match += 1
|
|
89
97
|
if match > 1:
|
|
90
98
|
# more than 1 match
|
|
91
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
99
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CreateOrderModelSelectionsInner with oneOf schemas: ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
92
100
|
elif match == 0:
|
|
93
101
|
# no match
|
|
94
|
-
raise ValueError("No match found when setting `actual_instance` in CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
102
|
+
raise ValueError("No match found when setting `actual_instance` in CreateOrderModelSelectionsInner with oneOf schemas: ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
95
103
|
else:
|
|
96
104
|
return v
|
|
97
105
|
|
|
@@ -106,6 +114,12 @@ class CreateOrderModelSelectionsInner(BaseModel):
|
|
|
106
114
|
error_messages = []
|
|
107
115
|
match = 0
|
|
108
116
|
|
|
117
|
+
# deserialize data into ConditionalValidationSelection
|
|
118
|
+
try:
|
|
119
|
+
instance.actual_instance = ConditionalValidationSelection.from_json(json_str)
|
|
120
|
+
match += 1
|
|
121
|
+
except (ValidationError, ValueError) as e:
|
|
122
|
+
error_messages.append(str(e))
|
|
109
123
|
# deserialize data into DemographicSelection
|
|
110
124
|
try:
|
|
111
125
|
instance.actual_instance = DemographicSelection.from_json(json_str)
|
|
@@ -133,10 +147,10 @@ class CreateOrderModelSelectionsInner(BaseModel):
|
|
|
133
147
|
|
|
134
148
|
if match > 1:
|
|
135
149
|
# more than 1 match
|
|
136
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
150
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CreateOrderModelSelectionsInner with oneOf schemas: ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
137
151
|
elif match == 0:
|
|
138
152
|
# no match
|
|
139
|
-
raise ValueError("No match found when deserializing the JSON string into CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
153
|
+
raise ValueError("No match found when deserializing the JSON string into CreateOrderModelSelectionsInner with oneOf schemas: ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection. Details: " + ", ".join(error_messages))
|
|
140
154
|
else:
|
|
141
155
|
return instance
|
|
142
156
|
|
|
@@ -150,7 +164,7 @@ class CreateOrderModelSelectionsInner(BaseModel):
|
|
|
150
164
|
else:
|
|
151
165
|
return json.dumps(self.actual_instance)
|
|
152
166
|
|
|
153
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]]:
|
|
167
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]]:
|
|
154
168
|
"""Returns the dict representation of the actual instance"""
|
|
155
169
|
if self.actual_instance is None:
|
|
156
170
|
return None
|
|
@@ -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 DatasetArtifactModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DatasetArtifactModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for DatasetArtifactModel", alias="_t")
|
|
30
|
+
dataset_id: StrictStr = Field(alias="datasetId")
|
|
31
|
+
identifier: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "datasetId", "identifier"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['DatasetArtifactModel']):
|
|
38
|
+
raise ValueError("must be one of enum values ('DatasetArtifactModel')")
|
|
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 DatasetArtifactModel 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 DatasetArtifactModel 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 'DatasetArtifactModel',
|
|
93
|
+
"datasetId": obj.get("datasetId"),
|
|
94
|
+
"identifier": obj.get("identifier")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -17,8 +17,8 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
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
|
|
|
@@ -27,8 +27,9 @@ class DemographicRapidSelectionConfig(BaseModel):
|
|
|
27
27
|
DemographicRapidSelectionConfig
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for DemographicRapidSelectionConfig", alias="_t")
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
keys: List[StrictStr]
|
|
31
|
+
max_rapids: Optional[StrictInt] = Field(default=None, alias="maxRapids")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "keys", "maxRapids"]
|
|
32
33
|
|
|
33
34
|
@field_validator('t')
|
|
34
35
|
def t_validate_enum(cls, value):
|
|
@@ -89,7 +90,8 @@ class DemographicRapidSelectionConfig(BaseModel):
|
|
|
89
90
|
|
|
90
91
|
_obj = cls.model_validate({
|
|
91
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'DemographicRapidSelectionConfig',
|
|
92
|
-
"
|
|
93
|
+
"keys": obj.get("keys"),
|
|
94
|
+
"maxRapids": obj.get("maxRapids")
|
|
93
95
|
})
|
|
94
96
|
return _obj
|
|
95
97
|
|
|
@@ -17,8 +17,8 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
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
|
|
|
@@ -27,8 +27,9 @@ class DemographicSelection(BaseModel):
|
|
|
27
27
|
DemographicSelection
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for DemographicSelection", alias="_t")
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
keys: List[StrictStr]
|
|
31
|
+
max_rapids: Optional[StrictInt] = Field(default=None, alias="maxRapids")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "keys", "maxRapids"]
|
|
32
33
|
|
|
33
34
|
@field_validator('t')
|
|
34
35
|
def t_validate_enum(cls, value):
|
|
@@ -89,7 +90,8 @@ class DemographicSelection(BaseModel):
|
|
|
89
90
|
|
|
90
91
|
_obj = cls.model_validate({
|
|
91
92
|
"_t": obj.get("_t") if obj.get("_t") is not None else 'DemographicSelection',
|
|
92
|
-
"
|
|
93
|
+
"keys": obj.get("keys"),
|
|
94
|
+
"maxRapids": obj.get("maxRapids")
|
|
93
95
|
})
|
|
94
96
|
return _obj
|
|
95
97
|
|