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.
- 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,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 FileArtifactModel(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
FileArtifactModel
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
t: StrictStr = Field(description="Discriminator value for FileArtifactModel", alias="_t")
|
|
30
|
+
file_name: StrictStr = Field(alias="fileName")
|
|
31
|
+
identifier: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["_t", "fileName", "identifier"]
|
|
33
|
+
|
|
34
|
+
@field_validator('t')
|
|
35
|
+
def t_validate_enum(cls, value):
|
|
36
|
+
"""Validates the enum"""
|
|
37
|
+
if value not in set(['FileArtifactModel']):
|
|
38
|
+
raise ValueError("must be one of enum values ('FileArtifactModel')")
|
|
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 FileArtifactModel 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 FileArtifactModel 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 'FileArtifactModel',
|
|
93
|
+
"fileName": obj.get("fileName"),
|
|
94
|
+
"identifier": obj.get("identifier")
|
|
95
|
+
})
|
|
96
|
+
return _obj
|
|
97
|
+
|
|
98
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import GetPipelineByIdResultArtifactsValue
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetPipelineByIdResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetPipelineByIdResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
artifacts: Dict[str, GetPipelineByIdResultArtifactsValue]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["artifacts"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of GetPipelineByIdResult from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
# override the default output from pydantic by calling `to_dict()` of each value in artifacts (dict)
|
|
73
|
+
_field_dict = {}
|
|
74
|
+
if self.artifacts:
|
|
75
|
+
for _key_artifacts in self.artifacts:
|
|
76
|
+
if self.artifacts[_key_artifacts]:
|
|
77
|
+
_field_dict[_key_artifacts] = self.artifacts[_key_artifacts].to_dict()
|
|
78
|
+
_dict['artifacts'] = _field_dict
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of GetPipelineByIdResult from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"artifacts": dict(
|
|
92
|
+
(_k, GetPipelineByIdResultArtifactsValue.from_dict(_v))
|
|
93
|
+
for _k, _v in obj["artifacts"].items()
|
|
94
|
+
)
|
|
95
|
+
if obj.get("artifacts") is not None
|
|
96
|
+
else None
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|
|
@@ -0,0 +1,182 @@
|
|
|
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.campaign_artifact_model import CampaignArtifactModel
|
|
21
|
+
from rapidata.api_client.models.dataset_artifact_model import DatasetArtifactModel
|
|
22
|
+
from rapidata.api_client.models.file_artifact_model import FileArtifactModel
|
|
23
|
+
from rapidata.api_client.models.workflow_artifact_model import WorkflowArtifactModel
|
|
24
|
+
from rapidata.api_client.models.workflow_config_artifact_model import WorkflowConfigArtifactModel
|
|
25
|
+
from pydantic import StrictStr, Field
|
|
26
|
+
from typing import Union, List, Set, Optional, Dict
|
|
27
|
+
from typing_extensions import Literal, Self
|
|
28
|
+
|
|
29
|
+
GETPIPELINEBYIDRESULTARTIFACTSVALUE_ONE_OF_SCHEMAS = ["CampaignArtifactModel", "DatasetArtifactModel", "FileArtifactModel", "WorkflowArtifactModel", "WorkflowConfigArtifactModel"]
|
|
30
|
+
|
|
31
|
+
class GetPipelineByIdResultArtifactsValue(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
GetPipelineByIdResultArtifactsValue
|
|
34
|
+
"""
|
|
35
|
+
# data type: CampaignArtifactModel
|
|
36
|
+
oneof_schema_1_validator: Optional[CampaignArtifactModel] = None
|
|
37
|
+
# data type: DatasetArtifactModel
|
|
38
|
+
oneof_schema_2_validator: Optional[DatasetArtifactModel] = None
|
|
39
|
+
# data type: FileArtifactModel
|
|
40
|
+
oneof_schema_3_validator: Optional[FileArtifactModel] = None
|
|
41
|
+
# data type: WorkflowArtifactModel
|
|
42
|
+
oneof_schema_4_validator: Optional[WorkflowArtifactModel] = None
|
|
43
|
+
# data type: WorkflowConfigArtifactModel
|
|
44
|
+
oneof_schema_5_validator: Optional[WorkflowConfigArtifactModel] = None
|
|
45
|
+
actual_instance: Optional[Union[CampaignArtifactModel, DatasetArtifactModel, FileArtifactModel, WorkflowArtifactModel, WorkflowConfigArtifactModel]] = None
|
|
46
|
+
one_of_schemas: Set[str] = { "CampaignArtifactModel", "DatasetArtifactModel", "FileArtifactModel", "WorkflowArtifactModel", "WorkflowConfigArtifactModel" }
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
validate_assignment=True,
|
|
50
|
+
protected_namespaces=(),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
58
|
+
if args:
|
|
59
|
+
if len(args) > 1:
|
|
60
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
61
|
+
if kwargs:
|
|
62
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
63
|
+
super().__init__(actual_instance=args[0])
|
|
64
|
+
else:
|
|
65
|
+
super().__init__(**kwargs)
|
|
66
|
+
|
|
67
|
+
@field_validator('actual_instance')
|
|
68
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
69
|
+
instance = GetPipelineByIdResultArtifactsValue.model_construct()
|
|
70
|
+
error_messages = []
|
|
71
|
+
match = 0
|
|
72
|
+
# validate data type: CampaignArtifactModel
|
|
73
|
+
if not isinstance(v, CampaignArtifactModel):
|
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `CampaignArtifactModel`")
|
|
75
|
+
else:
|
|
76
|
+
match += 1
|
|
77
|
+
# validate data type: DatasetArtifactModel
|
|
78
|
+
if not isinstance(v, DatasetArtifactModel):
|
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `DatasetArtifactModel`")
|
|
80
|
+
else:
|
|
81
|
+
match += 1
|
|
82
|
+
# validate data type: FileArtifactModel
|
|
83
|
+
if not isinstance(v, FileArtifactModel):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FileArtifactModel`")
|
|
85
|
+
else:
|
|
86
|
+
match += 1
|
|
87
|
+
# validate data type: WorkflowArtifactModel
|
|
88
|
+
if not isinstance(v, WorkflowArtifactModel):
|
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `WorkflowArtifactModel`")
|
|
90
|
+
else:
|
|
91
|
+
match += 1
|
|
92
|
+
# validate data type: WorkflowConfigArtifactModel
|
|
93
|
+
if not isinstance(v, WorkflowConfigArtifactModel):
|
|
94
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `WorkflowConfigArtifactModel`")
|
|
95
|
+
else:
|
|
96
|
+
match += 1
|
|
97
|
+
if match > 1:
|
|
98
|
+
# more than 1 match
|
|
99
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in GetPipelineByIdResultArtifactsValue with oneOf schemas: CampaignArtifactModel, DatasetArtifactModel, FileArtifactModel, WorkflowArtifactModel, WorkflowConfigArtifactModel. Details: " + ", ".join(error_messages))
|
|
100
|
+
elif match == 0:
|
|
101
|
+
# no match
|
|
102
|
+
raise ValueError("No match found when setting `actual_instance` in GetPipelineByIdResultArtifactsValue with oneOf schemas: CampaignArtifactModel, DatasetArtifactModel, FileArtifactModel, WorkflowArtifactModel, WorkflowConfigArtifactModel. Details: " + ", ".join(error_messages))
|
|
103
|
+
else:
|
|
104
|
+
return v
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
108
|
+
return cls.from_json(json.dumps(obj))
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_json(cls, json_str: str) -> Self:
|
|
112
|
+
"""Returns the object represented by the json string"""
|
|
113
|
+
instance = cls.model_construct()
|
|
114
|
+
error_messages = []
|
|
115
|
+
match = 0
|
|
116
|
+
|
|
117
|
+
# deserialize data into CampaignArtifactModel
|
|
118
|
+
try:
|
|
119
|
+
instance.actual_instance = CampaignArtifactModel.from_json(json_str)
|
|
120
|
+
match += 1
|
|
121
|
+
except (ValidationError, ValueError) as e:
|
|
122
|
+
error_messages.append(str(e))
|
|
123
|
+
# deserialize data into DatasetArtifactModel
|
|
124
|
+
try:
|
|
125
|
+
instance.actual_instance = DatasetArtifactModel.from_json(json_str)
|
|
126
|
+
match += 1
|
|
127
|
+
except (ValidationError, ValueError) as e:
|
|
128
|
+
error_messages.append(str(e))
|
|
129
|
+
# deserialize data into FileArtifactModel
|
|
130
|
+
try:
|
|
131
|
+
instance.actual_instance = FileArtifactModel.from_json(json_str)
|
|
132
|
+
match += 1
|
|
133
|
+
except (ValidationError, ValueError) as e:
|
|
134
|
+
error_messages.append(str(e))
|
|
135
|
+
# deserialize data into WorkflowArtifactModel
|
|
136
|
+
try:
|
|
137
|
+
instance.actual_instance = WorkflowArtifactModel.from_json(json_str)
|
|
138
|
+
match += 1
|
|
139
|
+
except (ValidationError, ValueError) as e:
|
|
140
|
+
error_messages.append(str(e))
|
|
141
|
+
# deserialize data into WorkflowConfigArtifactModel
|
|
142
|
+
try:
|
|
143
|
+
instance.actual_instance = WorkflowConfigArtifactModel.from_json(json_str)
|
|
144
|
+
match += 1
|
|
145
|
+
except (ValidationError, ValueError) as e:
|
|
146
|
+
error_messages.append(str(e))
|
|
147
|
+
|
|
148
|
+
if match > 1:
|
|
149
|
+
# more than 1 match
|
|
150
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into GetPipelineByIdResultArtifactsValue with oneOf schemas: CampaignArtifactModel, DatasetArtifactModel, FileArtifactModel, WorkflowArtifactModel, WorkflowConfigArtifactModel. Details: " + ", ".join(error_messages))
|
|
151
|
+
elif match == 0:
|
|
152
|
+
# no match
|
|
153
|
+
raise ValueError("No match found when deserializing the JSON string into GetPipelineByIdResultArtifactsValue with oneOf schemas: CampaignArtifactModel, DatasetArtifactModel, FileArtifactModel, WorkflowArtifactModel, WorkflowConfigArtifactModel. Details: " + ", ".join(error_messages))
|
|
154
|
+
else:
|
|
155
|
+
return instance
|
|
156
|
+
|
|
157
|
+
def to_json(self) -> str:
|
|
158
|
+
"""Returns the JSON representation of the actual instance"""
|
|
159
|
+
if self.actual_instance is None:
|
|
160
|
+
return "null"
|
|
161
|
+
|
|
162
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
163
|
+
return self.actual_instance.to_json()
|
|
164
|
+
else:
|
|
165
|
+
return json.dumps(self.actual_instance)
|
|
166
|
+
|
|
167
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], CampaignArtifactModel, DatasetArtifactModel, FileArtifactModel, WorkflowArtifactModel, WorkflowConfigArtifactModel]]:
|
|
168
|
+
"""Returns the dict representation of the actual instance"""
|
|
169
|
+
if self.actual_instance is None:
|
|
170
|
+
return None
|
|
171
|
+
|
|
172
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
173
|
+
return self.actual_instance.to_dict()
|
|
174
|
+
else:
|
|
175
|
+
# primitive type
|
|
176
|
+
return self.actual_instance
|
|
177
|
+
|
|
178
|
+
def to_str(self) -> str:
|
|
179
|
+
"""Returns the string representation of the actual instance"""
|
|
180
|
+
return pprint.pformat(self.model_dump())
|
|
181
|
+
|
|
182
|
+
|
|
@@ -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
|
|
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.root_filter import RootFilter
|
|
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 QueryCampaignsModel(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The model for querying campaigns.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
page: Optional[PageInfo] = None
|
|
33
|
+
filter: Optional[RootFilter] = None
|
|
34
|
+
sort_criteria: Optional[List[SortCriterion]] = Field(default=None, description="The sorting criteria", alias="sortCriteria")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["page", "filter", "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 QueryCampaignsModel 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 filter
|
|
80
|
+
if self.filter:
|
|
81
|
+
_dict['filter'] = self.filter.to_dict()
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of each item in sort_criteria (list)
|
|
83
|
+
_items = []
|
|
84
|
+
if self.sort_criteria:
|
|
85
|
+
for _item_sort_criteria in self.sort_criteria:
|
|
86
|
+
if _item_sort_criteria:
|
|
87
|
+
_items.append(_item_sort_criteria.to_dict())
|
|
88
|
+
_dict['sortCriteria'] = _items
|
|
89
|
+
# set to None if sort_criteria (nullable) is None
|
|
90
|
+
# and model_fields_set contains the field
|
|
91
|
+
if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
|
|
92
|
+
_dict['sortCriteria'] = None
|
|
93
|
+
|
|
94
|
+
return _dict
|
|
95
|
+
|
|
96
|
+
@classmethod
|
|
97
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
98
|
+
"""Create an instance of QueryCampaignsModel from a dict"""
|
|
99
|
+
if obj is None:
|
|
100
|
+
return None
|
|
101
|
+
|
|
102
|
+
if not isinstance(obj, dict):
|
|
103
|
+
return cls.model_validate(obj)
|
|
104
|
+
|
|
105
|
+
_obj = cls.model_validate({
|
|
106
|
+
"page": PageInfo.from_dict(obj["page"]) if obj.get("page") is not None else None,
|
|
107
|
+
"filter": RootFilter.from_dict(obj["filter"]) if obj.get("filter") is not None else None,
|
|
108
|
+
"sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None
|
|
109
|
+
})
|
|
110
|
+
return _obj
|
|
111
|
+
|
|
112
|
+
|
|
@@ -19,7 +19,6 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, 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 rapidata.api_client.models.simple_workflow_config_blueprint import SimpleWorkflowConfigBlueprint
|
|
@@ -37,8 +36,7 @@ class SimpleWorkflowConfig(BaseModel):
|
|
|
37
36
|
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
38
37
|
priority: Optional[StrictStr] = None
|
|
39
38
|
is_fallback: Optional[StrictBool] = Field(default=None, alias="isFallback")
|
|
40
|
-
|
|
41
|
-
__properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes", "featureFlags", "priority", "isFallback", "rapidSelectionConfigs"]
|
|
39
|
+
__properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes", "featureFlags", "priority", "isFallback"]
|
|
42
40
|
|
|
43
41
|
@field_validator('t')
|
|
44
42
|
def t_validate_enum(cls, value):
|
|
@@ -99,13 +97,6 @@ class SimpleWorkflowConfig(BaseModel):
|
|
|
99
97
|
if _item_feature_flags:
|
|
100
98
|
_items.append(_item_feature_flags.to_dict())
|
|
101
99
|
_dict['featureFlags'] = _items
|
|
102
|
-
# override the default output from pydantic by calling `to_dict()` of each item in rapid_selection_configs (list)
|
|
103
|
-
_items = []
|
|
104
|
-
if self.rapid_selection_configs:
|
|
105
|
-
for _item_rapid_selection_configs in self.rapid_selection_configs:
|
|
106
|
-
if _item_rapid_selection_configs:
|
|
107
|
-
_items.append(_item_rapid_selection_configs.to_dict())
|
|
108
|
-
_dict['rapidSelectionConfigs'] = _items
|
|
109
100
|
# set to None if priority (nullable) is None
|
|
110
101
|
# and model_fields_set contains the field
|
|
111
102
|
if self.priority is None and "priority" in self.model_fields_set:
|
|
@@ -129,8 +120,7 @@ class SimpleWorkflowConfig(BaseModel):
|
|
|
129
120
|
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
130
121
|
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
131
122
|
"priority": obj.get("priority"),
|
|
132
|
-
"isFallback": obj.get("isFallback")
|
|
133
|
-
"rapidSelectionConfigs": [CompareWorkflowConfigRapidSelectionConfigsInner.from_dict(_item) for _item in obj["rapidSelectionConfigs"]] if obj.get("rapidSelectionConfigs") is not None else None
|
|
123
|
+
"isFallback": obj.get("isFallback")
|
|
134
124
|
})
|
|
135
125
|
return _obj
|
|
136
126
|
|
|
@@ -0,0 +1,132 @@
|
|
|
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, 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 rapidata.api_client.models.simple_workflow_config_model_blueprint import SimpleWorkflowConfigModelBlueprint
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class SimpleWorkflowConfigModel(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
The configuration for a simple workflow. A simple workflow creates a rapid for each datapoint in its dataset. It is considered complete when all rapids have been completed.
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
t: StrictStr = Field(description="Discriminator value for SimpleWorkflowConfig", alias="_t")
|
|
33
|
+
referee: CompareWorkflowConfigReferee
|
|
34
|
+
blueprint: SimpleWorkflowConfigModelBlueprint
|
|
35
|
+
target_country_codes: List[StrictStr] = Field(description="A list of country codes that this workflow is targeting.", alias="targetCountryCodes")
|
|
36
|
+
feature_flags: Optional[List[FeatureFlag]] = Field(default=None, alias="featureFlags")
|
|
37
|
+
priority: Optional[StrictStr] = None
|
|
38
|
+
is_fallback: Optional[StrictBool] = Field(default=None, alias="isFallback")
|
|
39
|
+
__properties: ClassVar[List[str]] = ["_t", "referee", "blueprint", "targetCountryCodes", "featureFlags", "priority", "isFallback"]
|
|
40
|
+
|
|
41
|
+
@field_validator('t')
|
|
42
|
+
def t_validate_enum(cls, value):
|
|
43
|
+
"""Validates the enum"""
|
|
44
|
+
if value not in set(['SimpleWorkflowConfig']):
|
|
45
|
+
raise ValueError("must be one of enum values ('SimpleWorkflowConfig')")
|
|
46
|
+
return value
|
|
47
|
+
|
|
48
|
+
model_config = ConfigDict(
|
|
49
|
+
populate_by_name=True,
|
|
50
|
+
validate_assignment=True,
|
|
51
|
+
protected_namespaces=(),
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def to_str(self) -> str:
|
|
56
|
+
"""Returns the string representation of the model using alias"""
|
|
57
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
58
|
+
|
|
59
|
+
def to_json(self) -> str:
|
|
60
|
+
"""Returns the JSON representation of the model using alias"""
|
|
61
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
62
|
+
return json.dumps(self.to_dict())
|
|
63
|
+
|
|
64
|
+
@classmethod
|
|
65
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
66
|
+
"""Create an instance of SimpleWorkflowConfigModel from a JSON string"""
|
|
67
|
+
return cls.from_dict(json.loads(json_str))
|
|
68
|
+
|
|
69
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
70
|
+
"""Return the dictionary representation of the model using alias.
|
|
71
|
+
|
|
72
|
+
This has the following differences from calling pydantic's
|
|
73
|
+
`self.model_dump(by_alias=True)`:
|
|
74
|
+
|
|
75
|
+
* `None` is only added to the output dict for nullable fields that
|
|
76
|
+
were set at model initialization. Other fields with value `None`
|
|
77
|
+
are ignored.
|
|
78
|
+
"""
|
|
79
|
+
excluded_fields: Set[str] = set([
|
|
80
|
+
])
|
|
81
|
+
|
|
82
|
+
_dict = self.model_dump(
|
|
83
|
+
by_alias=True,
|
|
84
|
+
exclude=excluded_fields,
|
|
85
|
+
exclude_none=True,
|
|
86
|
+
)
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of referee
|
|
88
|
+
if self.referee:
|
|
89
|
+
_dict['referee'] = self.referee.to_dict()
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of blueprint
|
|
91
|
+
if self.blueprint:
|
|
92
|
+
_dict['blueprint'] = self.blueprint.to_dict()
|
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
94
|
+
_items = []
|
|
95
|
+
if self.feature_flags:
|
|
96
|
+
for _item_feature_flags in self.feature_flags:
|
|
97
|
+
if _item_feature_flags:
|
|
98
|
+
_items.append(_item_feature_flags.to_dict())
|
|
99
|
+
_dict['featureFlags'] = _items
|
|
100
|
+
# set to None if priority (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
103
|
+
_dict['priority'] = None
|
|
104
|
+
|
|
105
|
+
# set to None if is_fallback (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.is_fallback is None and "is_fallback" in self.model_fields_set:
|
|
108
|
+
_dict['isFallback'] = None
|
|
109
|
+
|
|
110
|
+
return _dict
|
|
111
|
+
|
|
112
|
+
@classmethod
|
|
113
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
114
|
+
"""Create an instance of SimpleWorkflowConfigModel from a dict"""
|
|
115
|
+
if obj is None:
|
|
116
|
+
return None
|
|
117
|
+
|
|
118
|
+
if not isinstance(obj, dict):
|
|
119
|
+
return cls.model_validate(obj)
|
|
120
|
+
|
|
121
|
+
_obj = cls.model_validate({
|
|
122
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'SimpleWorkflowConfig',
|
|
123
|
+
"referee": CompareWorkflowConfigReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
124
|
+
"blueprint": SimpleWorkflowConfigModelBlueprint.from_dict(obj["blueprint"]) if obj.get("blueprint") is not None else None,
|
|
125
|
+
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
126
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
127
|
+
"priority": obj.get("priority"),
|
|
128
|
+
"isFallback": obj.get("isFallback")
|
|
129
|
+
})
|
|
130
|
+
return _obj
|
|
131
|
+
|
|
132
|
+
|