rapidata 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rapidata/api_client/__init__.py +29 -3
- rapidata/api_client/api/__init__.py +3 -0
- rapidata/api_client/api/compare_workflow_api.py +316 -0
- rapidata/api_client/api/dataset_api.py +24 -24
- rapidata/api_client/api/order_api.py +515 -289
- rapidata/api_client/api/rapid_api.py +6 -6
- rapidata/api_client/api/simple_workflow_api.py +350 -0
- rapidata/api_client/api/validation_api.py +6 -6
- rapidata/api_client/api/workflow_api.py +2386 -0
- rapidata/api_client/api_client.py +2 -2
- rapidata/api_client/models/__init__.py +26 -3
- rapidata/api_client/models/admin_order_model.py +8 -1
- rapidata/api_client/models/age_group.py +1 -1
- rapidata/api_client/models/age_user_filter_model.py +2 -2
- rapidata/api_client/models/campaign_user_filter_model.py +2 -2
- rapidata/api_client/models/compare_workflow_get_result_overview_get200_response.py +137 -0
- rapidata/api_client/models/compare_workflow_model1.py +146 -0
- rapidata/api_client/models/completed_rapid_model.py +103 -0
- rapidata/api_client/models/country_user_filter_model.py +2 -2
- rapidata/api_client/models/create_demographic_rapid_model.py +3 -3
- rapidata/api_client/models/create_independent_workflow_model.py +93 -0
- rapidata/api_client/models/create_independent_workflow_model_workflow_config.py +140 -0
- rapidata/api_client/models/create_independent_workflow_result.py +89 -0
- rapidata/api_client/models/create_order_model.py +40 -31
- rapidata/api_client/models/create_order_model_selections_inner.py +24 -10
- rapidata/api_client/models/create_order_model_user_filters_inner.py +35 -35
- rapidata/api_client/models/customer_order_model.py +8 -1
- rapidata/api_client/models/demographic_rapid_selection_config.py +3 -3
- rapidata/api_client/models/demographic_selection.py +4 -4
- rapidata/api_client/models/feedback_model.py +1 -1
- rapidata/api_client/models/gender.py +1 -1
- rapidata/api_client/models/gender_user_filter_model.py +2 -2
- rapidata/api_client/models/get_attach_category_workflow_result_overview_result.py +144 -0
- rapidata/api_client/models/get_compare_workflow_result_overview_result.py +125 -0
- rapidata/api_client/models/get_compare_workflow_result_overview_small_result.py +114 -0
- rapidata/api_client/models/get_simple_workflow_result_overview_result.py +142 -0
- rapidata/api_client/models/get_workflow_by_id_result.py +91 -0
- rapidata/api_client/models/get_workflow_by_id_result_workflow.py +140 -0
- rapidata/api_client/models/get_workflow_progress_result.py +100 -0
- rapidata/api_client/models/get_workflow_result_overview_result.py +104 -0
- rapidata/api_client/models/i_workflow_model_paged_result.py +105 -0
- rapidata/api_client/models/in_progress_rapid_model.py +103 -0
- rapidata/api_client/models/labeling_selection.py +2 -2
- rapidata/api_client/models/language_user_filter_model.py +2 -2
- rapidata/api_client/models/not_started_rapid_model.py +93 -0
- rapidata/api_client/models/order_state.py +43 -0
- rapidata/api_client/models/query_workflows_model.py +112 -0
- rapidata/api_client/models/ranked_datapoint_model.py +95 -0
- rapidata/api_client/models/rapid_answer.py +97 -0
- rapidata/api_client/models/rapid_answer_result.py +252 -0
- rapidata/api_client/models/simple_workflow_get_result_overview_get200_response.py +137 -0
- rapidata/api_client/models/simple_workflow_model1.py +140 -0
- rapidata/api_client/models/static_selection.py +96 -0
- rapidata/api_client/models/user_score_user_filter_model.py +3 -3
- rapidata/api_client/models/validation_selection.py +3 -3
- rapidata/api_client/models/workflow_state.py +41 -0
- rapidata/api_client/rest.py +1 -1
- rapidata/api_client_README.md +44 -8
- rapidata/rapidata_client/order/rapidata_order_builder.py +2 -1
- {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/METADATA +1 -1
- {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/RECORD +63 -34
- {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/LICENSE +0 -0
- {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/WHEEL +0 -0
|
@@ -404,12 +404,12 @@ class ApiClient:
|
|
|
404
404
|
data = json.loads(response_text)
|
|
405
405
|
except ValueError:
|
|
406
406
|
data = response_text
|
|
407
|
-
elif
|
|
407
|
+
elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE):
|
|
408
408
|
if response_text == "":
|
|
409
409
|
data = ""
|
|
410
410
|
else:
|
|
411
411
|
data = json.loads(response_text)
|
|
412
|
-
elif
|
|
412
|
+
elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE):
|
|
413
413
|
data = response_text
|
|
414
414
|
else:
|
|
415
415
|
raise ApiException(
|
|
@@ -46,7 +46,10 @@ from rapidata.api_client.models.compare_truth import CompareTruth
|
|
|
46
46
|
from rapidata.api_client.models.compare_workflow_config import CompareWorkflowConfig
|
|
47
47
|
from rapidata.api_client.models.compare_workflow_config_rapid_selection_configs_inner import CompareWorkflowConfigRapidSelectionConfigsInner
|
|
48
48
|
from rapidata.api_client.models.compare_workflow_config_referee import CompareWorkflowConfigReferee
|
|
49
|
+
from rapidata.api_client.models.compare_workflow_get_result_overview_get200_response import CompareWorkflowGetResultOverviewGet200Response
|
|
49
50
|
from rapidata.api_client.models.compare_workflow_model import CompareWorkflowModel
|
|
51
|
+
from rapidata.api_client.models.compare_workflow_model1 import CompareWorkflowModel1
|
|
52
|
+
from rapidata.api_client.models.completed_rapid_model import CompletedRapidModel
|
|
50
53
|
from rapidata.api_client.models.conditional_validation_rapid_selection_config import ConditionalValidationRapidSelectionConfig
|
|
51
54
|
from rapidata.api_client.models.coordinate import Coordinate
|
|
52
55
|
from rapidata.api_client.models.correlated_rapid_selection_config import CorrelatedRapidSelectionConfig
|
|
@@ -59,11 +62,11 @@ from rapidata.api_client.models.create_complex_order_model_pipeline import Creat
|
|
|
59
62
|
from rapidata.api_client.models.create_complex_order_result import CreateComplexOrderResult
|
|
60
63
|
from rapidata.api_client.models.create_dataset_artifact_model import CreateDatasetArtifactModel
|
|
61
64
|
from rapidata.api_client.models.create_dataset_artifact_model_dataset import CreateDatasetArtifactModelDataset
|
|
62
|
-
from rapidata.api_client.models.create_default_order_model import CreateDefaultOrderModel
|
|
63
|
-
from rapidata.api_client.models.create_default_order_model_workflow_config import CreateDefaultOrderModelWorkflowConfig
|
|
64
65
|
from rapidata.api_client.models.create_demographic_rapid_model import CreateDemographicRapidModel
|
|
65
66
|
from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
|
|
66
|
-
from rapidata.api_client.models.
|
|
67
|
+
from rapidata.api_client.models.create_independent_workflow_model import CreateIndependentWorkflowModel
|
|
68
|
+
from rapidata.api_client.models.create_independent_workflow_model_workflow_config import CreateIndependentWorkflowModelWorkflowConfig
|
|
69
|
+
from rapidata.api_client.models.create_independent_workflow_result import CreateIndependentWorkflowResult
|
|
67
70
|
from rapidata.api_client.models.create_order_model import CreateOrderModel
|
|
68
71
|
from rapidata.api_client.models.create_order_model_referee import CreateOrderModelReferee
|
|
69
72
|
from rapidata.api_client.models.create_order_model_selections_inner import CreateOrderModelSelectionsInner
|
|
@@ -102,17 +105,27 @@ from rapidata.api_client.models.free_text_rapid_blueprint import FreeTextRapidBl
|
|
|
102
105
|
from rapidata.api_client.models.free_text_result import FreeTextResult
|
|
103
106
|
from rapidata.api_client.models.gender import Gender
|
|
104
107
|
from rapidata.api_client.models.gender_user_filter_model import GenderUserFilterModel
|
|
108
|
+
from rapidata.api_client.models.get_attach_category_workflow_result_overview_result import GetAttachCategoryWorkflowResultOverviewResult
|
|
105
109
|
from rapidata.api_client.models.get_available_validation_sets_result import GetAvailableValidationSetsResult
|
|
110
|
+
from rapidata.api_client.models.get_compare_workflow_result_overview_result import GetCompareWorkflowResultOverviewResult
|
|
111
|
+
from rapidata.api_client.models.get_compare_workflow_result_overview_small_result import GetCompareWorkflowResultOverviewSmallResult
|
|
106
112
|
from rapidata.api_client.models.get_datapoints_by_dataset_id_result import GetDatapointsByDatasetIdResult
|
|
107
113
|
from rapidata.api_client.models.get_dataset_by_id_result import GetDatasetByIdResult
|
|
108
114
|
from rapidata.api_client.models.get_order_by_id_result import GetOrderByIdResult
|
|
109
115
|
from rapidata.api_client.models.get_order_results_result import GetOrderResultsResult
|
|
110
116
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
117
|
+
from rapidata.api_client.models.get_simple_workflow_result_overview_result import GetSimpleWorkflowResultOverviewResult
|
|
118
|
+
from rapidata.api_client.models.get_workflow_by_id_result import GetWorkflowByIdResult
|
|
119
|
+
from rapidata.api_client.models.get_workflow_by_id_result_workflow import GetWorkflowByIdResultWorkflow
|
|
111
120
|
from rapidata.api_client.models.get_workflow_config_result import GetWorkflowConfigResult
|
|
112
121
|
from rapidata.api_client.models.get_workflow_config_result_workflow_config import GetWorkflowConfigResultWorkflowConfig
|
|
122
|
+
from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
|
|
123
|
+
from rapidata.api_client.models.get_workflow_result_overview_result import GetWorkflowResultOverviewResult
|
|
124
|
+
from rapidata.api_client.models.i_workflow_model_paged_result import IWorkflowModelPagedResult
|
|
113
125
|
from rapidata.api_client.models.image_dimension_metadata import ImageDimensionMetadata
|
|
114
126
|
from rapidata.api_client.models.import_from_file_result import ImportFromFileResult
|
|
115
127
|
from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
|
|
128
|
+
from rapidata.api_client.models.in_progress_rapid_model import InProgressRapidModel
|
|
116
129
|
from rapidata.api_client.models.issue_auth_token_result import IssueAuthTokenResult
|
|
117
130
|
from rapidata.api_client.models.issue_client_auth_token_result import IssueClientAuthTokenResult
|
|
118
131
|
from rapidata.api_client.models.labeling_selection import LabelingSelection
|
|
@@ -145,11 +158,13 @@ from rapidata.api_client.models.named_entity_truth import NamedEntityTruth
|
|
|
145
158
|
from rapidata.api_client.models.never_ending_referee_config import NeverEndingRefereeConfig
|
|
146
159
|
from rapidata.api_client.models.newsletter_model import NewsletterModel
|
|
147
160
|
from rapidata.api_client.models.no_validation_workflow_rapid_selection_config import NoValidationWorkflowRapidSelectionConfig
|
|
161
|
+
from rapidata.api_client.models.not_started_rapid_model import NotStartedRapidModel
|
|
148
162
|
from rapidata.api_client.models.null_asset import NullAsset
|
|
149
163
|
from rapidata.api_client.models.null_asset_model import NullAssetModel
|
|
150
164
|
from rapidata.api_client.models.only_validation_workflow_rapid_selection_config import OnlyValidationWorkflowRapidSelectionConfig
|
|
151
165
|
from rapidata.api_client.models.order_model import OrderModel
|
|
152
166
|
from rapidata.api_client.models.order_query_get200_response import OrderQueryGet200Response
|
|
167
|
+
from rapidata.api_client.models.order_state import OrderState
|
|
153
168
|
from rapidata.api_client.models.original_filename_metadata import OriginalFilenameMetadata
|
|
154
169
|
from rapidata.api_client.models.page_info import PageInfo
|
|
155
170
|
from rapidata.api_client.models.polygon_payload import PolygonPayload
|
|
@@ -167,6 +182,10 @@ from rapidata.api_client.models.query_validation_rapids_result import QueryValid
|
|
|
167
182
|
from rapidata.api_client.models.query_validation_rapids_result_asset import QueryValidationRapidsResultAsset
|
|
168
183
|
from rapidata.api_client.models.query_validation_rapids_result_paged_result import QueryValidationRapidsResultPagedResult
|
|
169
184
|
from rapidata.api_client.models.query_validation_set_model import QueryValidationSetModel
|
|
185
|
+
from rapidata.api_client.models.query_workflows_model import QueryWorkflowsModel
|
|
186
|
+
from rapidata.api_client.models.ranked_datapoint_model import RankedDatapointModel
|
|
187
|
+
from rapidata.api_client.models.rapid_answer import RapidAnswer
|
|
188
|
+
from rapidata.api_client.models.rapid_answer_result import RapidAnswerResult
|
|
170
189
|
from rapidata.api_client.models.rapid_result_model import RapidResultModel
|
|
171
190
|
from rapidata.api_client.models.rapid_result_model_result import RapidResultModelResult
|
|
172
191
|
from rapidata.api_client.models.rapid_skipped_model import RapidSkippedModel
|
|
@@ -178,12 +197,15 @@ from rapidata.api_client.models.signup_customer_model import SignupCustomerModel
|
|
|
178
197
|
from rapidata.api_client.models.signup_shadow_customer_model import SignupShadowCustomerModel
|
|
179
198
|
from rapidata.api_client.models.simple_workflow_config import SimpleWorkflowConfig
|
|
180
199
|
from rapidata.api_client.models.simple_workflow_config_blueprint import SimpleWorkflowConfigBlueprint
|
|
200
|
+
from rapidata.api_client.models.simple_workflow_get_result_overview_get200_response import SimpleWorkflowGetResultOverviewGet200Response
|
|
181
201
|
from rapidata.api_client.models.simple_workflow_model import SimpleWorkflowModel
|
|
202
|
+
from rapidata.api_client.models.simple_workflow_model1 import SimpleWorkflowModel1
|
|
182
203
|
from rapidata.api_client.models.simple_workflow_model_blueprint import SimpleWorkflowModelBlueprint
|
|
183
204
|
from rapidata.api_client.models.skip_result import SkipResult
|
|
184
205
|
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
185
206
|
from rapidata.api_client.models.sort_direction import SortDirection
|
|
186
207
|
from rapidata.api_client.models.static_rapid_selection_config import StaticRapidSelectionConfig
|
|
208
|
+
from rapidata.api_client.models.static_selection import StaticSelection
|
|
187
209
|
from rapidata.api_client.models.submit_coco_model import SubmitCocoModel
|
|
188
210
|
from rapidata.api_client.models.submit_coco_result import SubmitCocoResult
|
|
189
211
|
from rapidata.api_client.models.submit_password_reset_command import SubmitPasswordResetCommand
|
|
@@ -218,3 +240,4 @@ from rapidata.api_client.models.workflow_aggregation_step_model import WorkflowA
|
|
|
218
240
|
from rapidata.api_client.models.workflow_labeling_step_model import WorkflowLabelingStepModel
|
|
219
241
|
from rapidata.api_client.models.workflow_split_model import WorkflowSplitModel
|
|
220
242
|
from rapidata.api_client.models.workflow_split_model_filter_configs_inner import WorkflowSplitModelFilterConfigsInner
|
|
243
|
+
from rapidata.api_client.models.workflow_state import WorkflowState
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
@@ -35,6 +35,13 @@ class AdminOrderModel(BaseModel):
|
|
|
35
35
|
is_public: StrictBool = Field(alias="isPublic")
|
|
36
36
|
__properties: ClassVar[List[str]] = ["id", "orderDate", "customerMail", "state", "orderName", "isPublic"]
|
|
37
37
|
|
|
38
|
+
@field_validator('state')
|
|
39
|
+
def state_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value not in set(['Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed']):
|
|
42
|
+
raise ValueError("must be one of enum values ('Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed')")
|
|
43
|
+
return value
|
|
44
|
+
|
|
38
45
|
model_config = ConfigDict(
|
|
39
46
|
populate_by_name=True,
|
|
40
47
|
validate_assignment=True,
|
|
@@ -25,10 +25,10 @@ from typing_extensions import Self
|
|
|
25
25
|
|
|
26
26
|
class AgeUserFilterModel(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
AgeUserFilterModel
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
t: StrictStr = Field(description="Discriminator value for AgeFilter", alias="_t")
|
|
31
|
-
age_groups: List[AgeGroup] = Field(
|
|
31
|
+
age_groups: List[AgeGroup] = Field(alias="ageGroups")
|
|
32
32
|
__properties: ClassVar[List[str]] = ["_t", "ageGroups"]
|
|
33
33
|
|
|
34
34
|
@field_validator('t')
|
|
@@ -24,10 +24,10 @@ from typing_extensions import Self
|
|
|
24
24
|
|
|
25
25
|
class CampaignUserFilterModel(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
CampaignUserFilterModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for CampaignFilter", alias="_t")
|
|
30
|
-
campaign_ids: List[StrictStr] = Field(
|
|
30
|
+
campaign_ids: List[StrictStr] = Field(alias="campaignIds")
|
|
31
31
|
__properties: ClassVar[List[str]] = ["_t", "campaignIds"]
|
|
32
32
|
|
|
33
33
|
@field_validator('t')
|
|
@@ -0,0 +1,137 @@
|
|
|
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.get_compare_workflow_result_overview_result import GetCompareWorkflowResultOverviewResult
|
|
21
|
+
from rapidata.api_client.models.get_compare_workflow_result_overview_small_result import GetCompareWorkflowResultOverviewSmallResult
|
|
22
|
+
from pydantic import StrictStr, Field
|
|
23
|
+
from typing import Union, List, Set, Optional, Dict
|
|
24
|
+
from typing_extensions import Literal, Self
|
|
25
|
+
|
|
26
|
+
COMPAREWORKFLOWGETRESULTOVERVIEWGET200RESPONSE_ONE_OF_SCHEMAS = ["GetCompareWorkflowResultOverviewResult", "GetCompareWorkflowResultOverviewSmallResult"]
|
|
27
|
+
|
|
28
|
+
class CompareWorkflowGetResultOverviewGet200Response(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CompareWorkflowGetResultOverviewGet200Response
|
|
31
|
+
"""
|
|
32
|
+
# data type: GetCompareWorkflowResultOverviewResult
|
|
33
|
+
oneof_schema_1_validator: Optional[GetCompareWorkflowResultOverviewResult] = None
|
|
34
|
+
# data type: GetCompareWorkflowResultOverviewSmallResult
|
|
35
|
+
oneof_schema_2_validator: Optional[GetCompareWorkflowResultOverviewSmallResult] = None
|
|
36
|
+
actual_instance: Optional[Union[GetCompareWorkflowResultOverviewResult, GetCompareWorkflowResultOverviewSmallResult]] = None
|
|
37
|
+
one_of_schemas: Set[str] = { "GetCompareWorkflowResultOverviewResult", "GetCompareWorkflowResultOverviewSmallResult" }
|
|
38
|
+
|
|
39
|
+
model_config = ConfigDict(
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
46
|
+
if args:
|
|
47
|
+
if len(args) > 1:
|
|
48
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
49
|
+
if kwargs:
|
|
50
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
51
|
+
super().__init__(actual_instance=args[0])
|
|
52
|
+
else:
|
|
53
|
+
super().__init__(**kwargs)
|
|
54
|
+
|
|
55
|
+
@field_validator('actual_instance')
|
|
56
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
57
|
+
instance = CompareWorkflowGetResultOverviewGet200Response.model_construct()
|
|
58
|
+
error_messages = []
|
|
59
|
+
match = 0
|
|
60
|
+
# validate data type: GetCompareWorkflowResultOverviewResult
|
|
61
|
+
if not isinstance(v, GetCompareWorkflowResultOverviewResult):
|
|
62
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `GetCompareWorkflowResultOverviewResult`")
|
|
63
|
+
else:
|
|
64
|
+
match += 1
|
|
65
|
+
# validate data type: GetCompareWorkflowResultOverviewSmallResult
|
|
66
|
+
if not isinstance(v, GetCompareWorkflowResultOverviewSmallResult):
|
|
67
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `GetCompareWorkflowResultOverviewSmallResult`")
|
|
68
|
+
else:
|
|
69
|
+
match += 1
|
|
70
|
+
if match > 1:
|
|
71
|
+
# more than 1 match
|
|
72
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in CompareWorkflowGetResultOverviewGet200Response with oneOf schemas: GetCompareWorkflowResultOverviewResult, GetCompareWorkflowResultOverviewSmallResult. Details: " + ", ".join(error_messages))
|
|
73
|
+
elif match == 0:
|
|
74
|
+
# no match
|
|
75
|
+
raise ValueError("No match found when setting `actual_instance` in CompareWorkflowGetResultOverviewGet200Response with oneOf schemas: GetCompareWorkflowResultOverviewResult, GetCompareWorkflowResultOverviewSmallResult. Details: " + ", ".join(error_messages))
|
|
76
|
+
else:
|
|
77
|
+
return v
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
81
|
+
return cls.from_json(json.dumps(obj))
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_json(cls, json_str: str) -> Self:
|
|
85
|
+
"""Returns the object represented by the json string"""
|
|
86
|
+
instance = cls.model_construct()
|
|
87
|
+
error_messages = []
|
|
88
|
+
match = 0
|
|
89
|
+
|
|
90
|
+
# deserialize data into GetCompareWorkflowResultOverviewResult
|
|
91
|
+
try:
|
|
92
|
+
instance.actual_instance = GetCompareWorkflowResultOverviewResult.from_json(json_str)
|
|
93
|
+
match += 1
|
|
94
|
+
except (ValidationError, ValueError) as e:
|
|
95
|
+
error_messages.append(str(e))
|
|
96
|
+
# deserialize data into GetCompareWorkflowResultOverviewSmallResult
|
|
97
|
+
try:
|
|
98
|
+
instance.actual_instance = GetCompareWorkflowResultOverviewSmallResult.from_json(json_str)
|
|
99
|
+
match += 1
|
|
100
|
+
except (ValidationError, ValueError) as e:
|
|
101
|
+
error_messages.append(str(e))
|
|
102
|
+
|
|
103
|
+
if match > 1:
|
|
104
|
+
# more than 1 match
|
|
105
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into CompareWorkflowGetResultOverviewGet200Response with oneOf schemas: GetCompareWorkflowResultOverviewResult, GetCompareWorkflowResultOverviewSmallResult. Details: " + ", ".join(error_messages))
|
|
106
|
+
elif match == 0:
|
|
107
|
+
# no match
|
|
108
|
+
raise ValueError("No match found when deserializing the JSON string into CompareWorkflowGetResultOverviewGet200Response with oneOf schemas: GetCompareWorkflowResultOverviewResult, GetCompareWorkflowResultOverviewSmallResult. Details: " + ", ".join(error_messages))
|
|
109
|
+
else:
|
|
110
|
+
return instance
|
|
111
|
+
|
|
112
|
+
def to_json(self) -> str:
|
|
113
|
+
"""Returns the JSON representation of the actual instance"""
|
|
114
|
+
if self.actual_instance is None:
|
|
115
|
+
return "null"
|
|
116
|
+
|
|
117
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
118
|
+
return self.actual_instance.to_json()
|
|
119
|
+
else:
|
|
120
|
+
return json.dumps(self.actual_instance)
|
|
121
|
+
|
|
122
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], GetCompareWorkflowResultOverviewResult, GetCompareWorkflowResultOverviewSmallResult]]:
|
|
123
|
+
"""Returns the dict representation of the actual instance"""
|
|
124
|
+
if self.actual_instance is None:
|
|
125
|
+
return None
|
|
126
|
+
|
|
127
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
128
|
+
return self.actual_instance.to_dict()
|
|
129
|
+
else:
|
|
130
|
+
# primitive type
|
|
131
|
+
return self.actual_instance
|
|
132
|
+
|
|
133
|
+
def to_str(self) -> str:
|
|
134
|
+
"""Returns the string representation of the actual instance"""
|
|
135
|
+
return pprint.pformat(self.model_dump())
|
|
136
|
+
|
|
137
|
+
|
|
@@ -0,0 +1,146 @@
|
|
|
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, 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 CompareWorkflowModel1(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CompareWorkflowModel1
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
t: StrictStr = Field(description="Discriminator value for CompareWorkflowModel", alias="_t")
|
|
32
|
+
id: StrictStr
|
|
33
|
+
dataset_id: Optional[StrictStr] = Field(alias="datasetId")
|
|
34
|
+
target_country_codes: List[StrictStr] = Field(alias="targetCountryCodes")
|
|
35
|
+
feature_flags: List[FeatureFlag] = Field(alias="featureFlags")
|
|
36
|
+
referee: CompareWorkflowConfigReferee
|
|
37
|
+
state: StrictStr
|
|
38
|
+
priority: StrictStr
|
|
39
|
+
criteria: StrictStr
|
|
40
|
+
name: StrictStr
|
|
41
|
+
owner_mail: Optional[StrictStr] = Field(alias="ownerMail")
|
|
42
|
+
starting_elo: StrictInt = Field(alias="startingElo")
|
|
43
|
+
k_factor: StrictInt = Field(alias="kFactor")
|
|
44
|
+
match_size: StrictInt = Field(alias="matchSize")
|
|
45
|
+
scaling_factor: StrictInt = Field(alias="scalingFactor")
|
|
46
|
+
matches_until_completed: StrictInt = Field(alias="matchesUntilCompleted")
|
|
47
|
+
__properties: ClassVar[List[str]] = ["_t", "id", "datasetId", "targetCountryCodes", "featureFlags", "referee", "state", "priority", "criteria", "name", "ownerMail", "startingElo", "kFactor", "matchSize", "scalingFactor", "matchesUntilCompleted"]
|
|
48
|
+
|
|
49
|
+
@field_validator('t')
|
|
50
|
+
def t_validate_enum(cls, value):
|
|
51
|
+
"""Validates the enum"""
|
|
52
|
+
if value not in set(['CompareWorkflowModel']):
|
|
53
|
+
raise ValueError("must be one of enum values ('CompareWorkflowModel')")
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(
|
|
57
|
+
populate_by_name=True,
|
|
58
|
+
validate_assignment=True,
|
|
59
|
+
protected_namespaces=(),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def to_str(self) -> str:
|
|
64
|
+
"""Returns the string representation of the model using alias"""
|
|
65
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
66
|
+
|
|
67
|
+
def to_json(self) -> str:
|
|
68
|
+
"""Returns the JSON representation of the model using alias"""
|
|
69
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
70
|
+
return json.dumps(self.to_dict())
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of CompareWorkflowModel1 from a JSON string"""
|
|
75
|
+
return cls.from_dict(json.loads(json_str))
|
|
76
|
+
|
|
77
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
78
|
+
"""Return the dictionary representation of the model using alias.
|
|
79
|
+
|
|
80
|
+
This has the following differences from calling pydantic's
|
|
81
|
+
`self.model_dump(by_alias=True)`:
|
|
82
|
+
|
|
83
|
+
* `None` is only added to the output dict for nullable fields that
|
|
84
|
+
were set at model initialization. Other fields with value `None`
|
|
85
|
+
are ignored.
|
|
86
|
+
"""
|
|
87
|
+
excluded_fields: Set[str] = set([
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
_dict = self.model_dump(
|
|
91
|
+
by_alias=True,
|
|
92
|
+
exclude=excluded_fields,
|
|
93
|
+
exclude_none=True,
|
|
94
|
+
)
|
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
|
|
96
|
+
_items = []
|
|
97
|
+
if self.feature_flags:
|
|
98
|
+
for _item_feature_flags in self.feature_flags:
|
|
99
|
+
if _item_feature_flags:
|
|
100
|
+
_items.append(_item_feature_flags.to_dict())
|
|
101
|
+
_dict['featureFlags'] = _items
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of referee
|
|
103
|
+
if self.referee:
|
|
104
|
+
_dict['referee'] = self.referee.to_dict()
|
|
105
|
+
# set to None if dataset_id (nullable) is None
|
|
106
|
+
# and model_fields_set contains the field
|
|
107
|
+
if self.dataset_id is None and "dataset_id" in self.model_fields_set:
|
|
108
|
+
_dict['datasetId'] = None
|
|
109
|
+
|
|
110
|
+
# set to None if owner_mail (nullable) is None
|
|
111
|
+
# and model_fields_set contains the field
|
|
112
|
+
if self.owner_mail is None and "owner_mail" in self.model_fields_set:
|
|
113
|
+
_dict['ownerMail'] = None
|
|
114
|
+
|
|
115
|
+
return _dict
|
|
116
|
+
|
|
117
|
+
@classmethod
|
|
118
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
119
|
+
"""Create an instance of CompareWorkflowModel1 from a dict"""
|
|
120
|
+
if obj is None:
|
|
121
|
+
return None
|
|
122
|
+
|
|
123
|
+
if not isinstance(obj, dict):
|
|
124
|
+
return cls.model_validate(obj)
|
|
125
|
+
|
|
126
|
+
_obj = cls.model_validate({
|
|
127
|
+
"_t": obj.get("_t") if obj.get("_t") is not None else 'CompareWorkflowModel',
|
|
128
|
+
"id": obj.get("id"),
|
|
129
|
+
"datasetId": obj.get("datasetId"),
|
|
130
|
+
"targetCountryCodes": obj.get("targetCountryCodes"),
|
|
131
|
+
"featureFlags": [FeatureFlag.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
|
|
132
|
+
"referee": CompareWorkflowConfigReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
|
|
133
|
+
"state": obj.get("state"),
|
|
134
|
+
"priority": obj.get("priority"),
|
|
135
|
+
"criteria": obj.get("criteria"),
|
|
136
|
+
"name": obj.get("name"),
|
|
137
|
+
"ownerMail": obj.get("ownerMail"),
|
|
138
|
+
"startingElo": obj.get("startingElo"),
|
|
139
|
+
"kFactor": obj.get("kFactor"),
|
|
140
|
+
"matchSize": obj.get("matchSize"),
|
|
141
|
+
"scalingFactor": obj.get("scalingFactor"),
|
|
142
|
+
"matchesUntilCompleted": obj.get("matchesUntilCompleted")
|
|
143
|
+
})
|
|
144
|
+
return _obj
|
|
145
|
+
|
|
146
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
|
|
23
|
+
from rapidata.api_client.models.rapid_answer import RapidAnswer
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class CompletedRapidModel(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
CompletedRapidModel
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
rapid_id: StrictStr = Field(alias="rapidId")
|
|
32
|
+
asset: DatapointModelAsset
|
|
33
|
+
answers: List[RapidAnswer]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["rapidId", "asset", "answers"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of CompletedRapidModel from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of asset
|
|
76
|
+
if self.asset:
|
|
77
|
+
_dict['asset'] = self.asset.to_dict()
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in answers (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.answers:
|
|
81
|
+
for _item_answers in self.answers:
|
|
82
|
+
if _item_answers:
|
|
83
|
+
_items.append(_item_answers.to_dict())
|
|
84
|
+
_dict['answers'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of CompletedRapidModel 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
|
+
"rapidId": obj.get("rapidId"),
|
|
98
|
+
"asset": DatapointModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
|
|
99
|
+
"answers": [RapidAnswer.from_dict(_item) for _item in obj["answers"]] if obj.get("answers") is not None else None
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -24,10 +24,10 @@ from typing_extensions import Self
|
|
|
24
24
|
|
|
25
25
|
class CountryUserFilterModel(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
CountryUserFilterModel
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
t: StrictStr = Field(description="Discriminator value for CountryFilter", alias="_t")
|
|
30
|
-
countries: List[StrictStr]
|
|
30
|
+
countries: List[StrictStr]
|
|
31
31
|
__properties: ClassVar[List[str]] = ["_t", "countries"]
|
|
32
32
|
|
|
33
33
|
@field_validator('t')
|
|
@@ -27,9 +27,9 @@ class CreateDemographicRapidModel(BaseModel):
|
|
|
27
27
|
"""
|
|
28
28
|
The model for creating a demographic rapid.
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
|
|
30
|
+
key: StrictStr = Field(description="The identifier of the demographic classification.")
|
|
31
31
|
payload: ClassifyPayload
|
|
32
|
-
__properties: ClassVar[List[str]] = ["
|
|
32
|
+
__properties: ClassVar[List[str]] = ["key", "payload"]
|
|
33
33
|
|
|
34
34
|
model_config = ConfigDict(
|
|
35
35
|
populate_by_name=True,
|
|
@@ -85,7 +85,7 @@ class CreateDemographicRapidModel(BaseModel):
|
|
|
85
85
|
return cls.model_validate(obj)
|
|
86
86
|
|
|
87
87
|
_obj = cls.model_validate({
|
|
88
|
-
"
|
|
88
|
+
"key": obj.get("key"),
|
|
89
89
|
"payload": ClassifyPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None
|
|
90
90
|
})
|
|
91
91
|
return _obj
|