rapidata 0.4.0__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.
Files changed (92) hide show
  1. rapidata/__init__.py +4 -3
  2. rapidata/api_client/__init__.py +51 -15
  3. rapidata/api_client/api/__init__.py +5 -0
  4. rapidata/api_client/api/campaign_api.py +1044 -0
  5. rapidata/api_client/api/compare_workflow_api.py +316 -0
  6. rapidata/api_client/api/dataset_api.py +24 -24
  7. rapidata/api_client/api/order_api.py +206 -536
  8. rapidata/api_client/api/pipeline_api.py +843 -0
  9. rapidata/api_client/api/rapid_api.py +6 -6
  10. rapidata/api_client/api/simple_workflow_api.py +350 -0
  11. rapidata/api_client/api/validation_api.py +6 -6
  12. rapidata/api_client/api/workflow_api.py +2386 -0
  13. rapidata/api_client/api_client.py +2 -2
  14. rapidata/api_client/models/__init__.py +46 -15
  15. rapidata/api_client/models/add_campaign_artifact_result.py +87 -0
  16. rapidata/api_client/models/add_campaign_model.py +149 -0
  17. rapidata/api_client/models/admin_order_model.py +8 -1
  18. rapidata/api_client/models/age_group.py +1 -1
  19. rapidata/api_client/models/age_user_filter_model.py +2 -2
  20. rapidata/api_client/models/campaign_artifact_model.py +98 -0
  21. rapidata/api_client/models/campaign_query_model.py +105 -0
  22. rapidata/api_client/models/campaign_query_model_paged_result.py +105 -0
  23. rapidata/api_client/models/campaign_status.py +39 -0
  24. rapidata/api_client/models/campaign_user_filter_model.py +2 -2
  25. rapidata/api_client/models/compare_workflow_config.py +2 -12
  26. rapidata/api_client/models/compare_workflow_config_model.py +138 -0
  27. rapidata/api_client/models/compare_workflow_get_result_overview_get200_response.py +137 -0
  28. rapidata/api_client/models/compare_workflow_model1.py +146 -0
  29. rapidata/api_client/models/completed_rapid_model.py +103 -0
  30. rapidata/api_client/models/conditional_validation_selection.py +106 -0
  31. rapidata/api_client/models/country_user_filter_model.py +2 -2
  32. rapidata/api_client/models/create_demographic_rapid_model.py +3 -3
  33. rapidata/api_client/models/create_independent_workflow_model.py +93 -0
  34. rapidata/api_client/models/create_independent_workflow_model_workflow_config.py +140 -0
  35. rapidata/api_client/models/create_independent_workflow_result.py +89 -0
  36. rapidata/api_client/models/create_order_model.py +40 -31
  37. rapidata/api_client/models/create_order_model_selections_inner.py +40 -12
  38. rapidata/api_client/models/create_order_model_user_filters_inner.py +35 -35
  39. rapidata/api_client/models/customer_order_model.py +8 -1
  40. rapidata/api_client/models/dataset_artifact_model.py +98 -0
  41. rapidata/api_client/models/demographic_rapid_selection_config.py +7 -5
  42. rapidata/api_client/models/demographic_selection.py +8 -6
  43. rapidata/api_client/models/feedback_model.py +1 -1
  44. rapidata/api_client/models/file_artifact_model.py +98 -0
  45. rapidata/api_client/models/gender.py +1 -1
  46. rapidata/api_client/models/gender_user_filter_model.py +2 -2
  47. rapidata/api_client/models/get_attach_category_workflow_result_overview_result.py +144 -0
  48. rapidata/api_client/models/get_compare_workflow_result_overview_result.py +125 -0
  49. rapidata/api_client/models/get_compare_workflow_result_overview_small_result.py +114 -0
  50. rapidata/api_client/models/get_pipeline_by_id_result.py +100 -0
  51. rapidata/api_client/models/get_pipeline_by_id_result_artifacts_value.py +182 -0
  52. rapidata/api_client/models/get_simple_workflow_result_overview_result.py +142 -0
  53. rapidata/api_client/models/get_workflow_by_id_result.py +91 -0
  54. rapidata/api_client/models/get_workflow_by_id_result_workflow.py +140 -0
  55. rapidata/api_client/models/get_workflow_progress_result.py +100 -0
  56. rapidata/api_client/models/get_workflow_result_overview_result.py +104 -0
  57. rapidata/api_client/models/i_workflow_model_paged_result.py +105 -0
  58. rapidata/api_client/models/in_progress_rapid_model.py +103 -0
  59. rapidata/api_client/models/labeling_selection.py +2 -2
  60. rapidata/api_client/models/language_user_filter_model.py +2 -2
  61. rapidata/api_client/models/not_started_rapid_model.py +93 -0
  62. rapidata/api_client/models/order_state.py +43 -0
  63. rapidata/api_client/models/query_campaigns_model.py +112 -0
  64. rapidata/api_client/models/query_workflows_model.py +112 -0
  65. rapidata/api_client/models/ranked_datapoint_model.py +95 -0
  66. rapidata/api_client/models/rapid_answer.py +97 -0
  67. rapidata/api_client/models/rapid_answer_result.py +252 -0
  68. rapidata/api_client/models/simple_workflow_config.py +2 -12
  69. rapidata/api_client/models/simple_workflow_config_model.py +132 -0
  70. rapidata/api_client/models/simple_workflow_config_model_blueprint.py +238 -0
  71. rapidata/api_client/models/simple_workflow_get_result_overview_get200_response.py +137 -0
  72. rapidata/api_client/models/simple_workflow_model1.py +140 -0
  73. rapidata/api_client/models/static_selection.py +96 -0
  74. rapidata/api_client/models/update_workflow_config_request.py +107 -0
  75. rapidata/api_client/models/update_workflow_config_request_config.py +140 -0
  76. rapidata/api_client/models/user_score_user_filter_model.py +3 -3
  77. rapidata/api_client/models/validation_selection.py +3 -3
  78. rapidata/api_client/models/workflow_artifact_model.py +98 -0
  79. rapidata/api_client/models/workflow_config_artifact_model.py +102 -0
  80. rapidata/api_client/models/workflow_config_artifact_model_workflow_config.py +140 -0
  81. rapidata/api_client/models/workflow_state.py +41 -0
  82. rapidata/api_client/rest.py +1 -1
  83. rapidata/api_client_README.md +75 -29
  84. rapidata/rapidata_client/__init__.py +6 -1
  85. rapidata/rapidata_client/order/rapidata_order_builder.py +2 -1
  86. rapidata/rapidata_client/selection/__init__.py +1 -0
  87. rapidata/rapidata_client/selection/conditional_validation_rapid_selection.py +41 -0
  88. rapidata/rapidata_client/selection/demographic_selection.py +3 -5
  89. {rapidata-0.4.0.dist-info → rapidata-0.5.0.dist-info}/METADATA +1 -1
  90. {rapidata-0.4.0.dist-info → rapidata-0.5.0.dist-info}/RECORD +92 -40
  91. {rapidata-0.4.0.dist-info → rapidata-0.5.0.dist-info}/LICENSE +0 -0
  92. {rapidata-0.4.0.dist-info → rapidata-0.5.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,89 @@
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 typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CreateIndependentWorkflowResult(BaseModel):
26
+ """
27
+ CreateIndependentWorkflowResult
28
+ """ # noqa: E501
29
+ workflow_id: StrictStr = Field(alias="workflowId")
30
+ dataset_id: StrictStr = Field(alias="datasetId")
31
+ __properties: ClassVar[List[str]] = ["workflowId", "datasetId"]
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 CreateIndependentWorkflowResult 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
+ return _dict
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
76
+ """Create an instance of CreateIndependentWorkflowResult from a dict"""
77
+ if obj is None:
78
+ return None
79
+
80
+ if not isinstance(obj, dict):
81
+ return cls.model_validate(obj)
82
+
83
+ _obj = cls.model_validate({
84
+ "workflowId": obj.get("workflowId"),
85
+ "datasetId": obj.get("datasetId")
86
+ })
87
+ return _obj
88
+
89
+
@@ -31,16 +31,24 @@ class CreateOrderModel(BaseModel):
31
31
  """
32
32
  This model is used to create a simple order
33
33
  """ # noqa: E501
34
+ t: StrictStr = Field(description="Discriminator value for CreateOrderModel", alias="_t")
34
35
  order_name: StrictStr = Field(description="The name is used as an identifier for an order and can be freely chosen.", alias="orderName")
35
- user_filters: List[CreateOrderModelUserFiltersInner] = Field(description="The user filters are used to restrict the order to only collect votes from a specific demographic.", alias="userFilters")
36
36
  workflow: CreateOrderModelWorkflow
37
37
  referee: CreateOrderModelReferee
38
38
  aggregator: Optional[StrictStr] = Field(default=None, description="The aggregator is used to determine how the data will be aggregated. The default behavior is enough for most cases")
39
- validation_set_id: Optional[StrictStr] = Field(default=None, description="The validation set id can be changed to point to a specific validation set. if not provided a sane default will be used.", alias="validationSetId")
40
- selections: Optional[List[CreateOrderModelSelectionsInner]] = Field(default=None, description="The selections are used to determine which tasks are shown to a user.")
41
39
  feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="The feature flags are used to enable or disable certain features.", alias="featureFlags")
42
40
  priority: Optional[StrictInt] = Field(default=None, description="The priority is used to prioritize over other orders.")
43
- __properties: ClassVar[List[str]] = ["orderName", "userFilters", "workflow", "referee", "aggregator", "validationSetId", "selections", "featureFlags", "priority"]
41
+ user_filters: List[CreateOrderModelUserFiltersInner] = Field(description="The user filters are used to restrict the order to only collect votes from a specific demographic.", alias="userFilters")
42
+ validation_set_id: Optional[StrictStr] = Field(default=None, description="The validation set id can be changed to point to a specific validation set. if not provided a sane default will be used.", alias="validationSetId")
43
+ selections: Optional[List[CreateOrderModelSelectionsInner]] = Field(default=None, description="The selections are used to determine which tasks are shown to a user.")
44
+ __properties: ClassVar[List[str]] = ["_t", "orderName", "workflow", "referee", "aggregator", "featureFlags", "priority", "userFilters", "validationSetId", "selections"]
45
+
46
+ @field_validator('t')
47
+ def t_validate_enum(cls, value):
48
+ """Validates the enum"""
49
+ if value not in set(['CreateOrderModel']):
50
+ raise ValueError("must be one of enum values ('CreateOrderModel')")
51
+ return value
44
52
 
45
53
  @field_validator('aggregator')
46
54
  def aggregator_validate_enum(cls, value):
@@ -91,6 +99,19 @@ class CreateOrderModel(BaseModel):
91
99
  exclude=excluded_fields,
92
100
  exclude_none=True,
93
101
  )
102
+ # override the default output from pydantic by calling `to_dict()` of workflow
103
+ if self.workflow:
104
+ _dict['workflow'] = self.workflow.to_dict()
105
+ # override the default output from pydantic by calling `to_dict()` of referee
106
+ if self.referee:
107
+ _dict['referee'] = self.referee.to_dict()
108
+ # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
109
+ _items = []
110
+ if self.feature_flags:
111
+ for _item_feature_flags in self.feature_flags:
112
+ if _item_feature_flags:
113
+ _items.append(_item_feature_flags.to_dict())
114
+ _dict['featureFlags'] = _items
94
115
  # override the default output from pydantic by calling `to_dict()` of each item in user_filters (list)
95
116
  _items = []
96
117
  if self.user_filters:
@@ -98,12 +119,6 @@ class CreateOrderModel(BaseModel):
98
119
  if _item_user_filters:
99
120
  _items.append(_item_user_filters.to_dict())
100
121
  _dict['userFilters'] = _items
101
- # override the default output from pydantic by calling `to_dict()` of workflow
102
- if self.workflow:
103
- _dict['workflow'] = self.workflow.to_dict()
104
- # override the default output from pydantic by calling `to_dict()` of referee
105
- if self.referee:
106
- _dict['referee'] = self.referee.to_dict()
107
122
  # override the default output from pydantic by calling `to_dict()` of each item in selections (list)
108
123
  _items = []
109
124
  if self.selections:
@@ -111,28 +126,11 @@ class CreateOrderModel(BaseModel):
111
126
  if _item_selections:
112
127
  _items.append(_item_selections.to_dict())
113
128
  _dict['selections'] = _items
114
- # override the default output from pydantic by calling `to_dict()` of each item in feature_flags (list)
115
- _items = []
116
- if self.feature_flags:
117
- for _item_feature_flags in self.feature_flags:
118
- if _item_feature_flags:
119
- _items.append(_item_feature_flags.to_dict())
120
- _dict['featureFlags'] = _items
121
129
  # set to None if aggregator (nullable) is None
122
130
  # and model_fields_set contains the field
123
131
  if self.aggregator is None and "aggregator" in self.model_fields_set:
124
132
  _dict['aggregator'] = None
125
133
 
126
- # set to None if validation_set_id (nullable) is None
127
- # and model_fields_set contains the field
128
- if self.validation_set_id is None and "validation_set_id" in self.model_fields_set:
129
- _dict['validationSetId'] = None
130
-
131
- # set to None if selections (nullable) is None
132
- # and model_fields_set contains the field
133
- if self.selections is None and "selections" in self.model_fields_set:
134
- _dict['selections'] = None
135
-
136
134
  # set to None if feature_flags (nullable) is None
137
135
  # and model_fields_set contains the field
138
136
  if self.feature_flags is None and "feature_flags" in self.model_fields_set:
@@ -143,6 +141,16 @@ class CreateOrderModel(BaseModel):
143
141
  if self.priority is None and "priority" in self.model_fields_set:
144
142
  _dict['priority'] = None
145
143
 
144
+ # set to None if validation_set_id (nullable) is None
145
+ # and model_fields_set contains the field
146
+ if self.validation_set_id is None and "validation_set_id" in self.model_fields_set:
147
+ _dict['validationSetId'] = None
148
+
149
+ # set to None if selections (nullable) is None
150
+ # and model_fields_set contains the field
151
+ if self.selections is None and "selections" in self.model_fields_set:
152
+ _dict['selections'] = None
153
+
146
154
  return _dict
147
155
 
148
156
  @classmethod
@@ -155,15 +163,16 @@ class CreateOrderModel(BaseModel):
155
163
  return cls.model_validate(obj)
156
164
 
157
165
  _obj = cls.model_validate({
166
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'CreateOrderModel',
158
167
  "orderName": obj.get("orderName"),
159
- "userFilters": [CreateOrderModelUserFiltersInner.from_dict(_item) for _item in obj["userFilters"]] if obj.get("userFilters") is not None else None,
160
168
  "workflow": CreateOrderModelWorkflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None,
161
169
  "referee": CreateOrderModelReferee.from_dict(obj["referee"]) if obj.get("referee") is not None else None,
162
170
  "aggregator": obj.get("aggregator"),
163
- "validationSetId": obj.get("validationSetId"),
164
- "selections": [CreateOrderModelSelectionsInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None,
165
171
  "featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
166
- "priority": obj.get("priority")
172
+ "priority": obj.get("priority"),
173
+ "userFilters": [CreateOrderModelUserFiltersInner.from_dict(_item) for _item in obj["userFilters"]] if obj.get("userFilters") is not None else None,
174
+ "validationSetId": obj.get("validationSetId"),
175
+ "selections": [CreateOrderModelSelectionsInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None
167
176
  })
168
177
  return _obj
169
178
 
@@ -17,27 +17,33 @@ 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
23
+ from rapidata.api_client.models.static_selection import StaticSelection
22
24
  from rapidata.api_client.models.validation_selection import ValidationSelection
23
25
  from pydantic import StrictStr, Field
24
26
  from typing import Union, List, Set, Optional, Dict
25
27
  from typing_extensions import Literal, Self
26
28
 
27
- CREATEORDERMODELSELECTIONSINNER_ONE_OF_SCHEMAS = ["DemographicSelection", "LabelingSelection", "ValidationSelection"]
29
+ CREATEORDERMODELSELECTIONSINNER_ONE_OF_SCHEMAS = ["ConditionalValidationSelection", "DemographicSelection", "LabelingSelection", "StaticSelection", "ValidationSelection"]
28
30
 
29
31
  class CreateOrderModelSelectionsInner(BaseModel):
30
32
  """
31
- A selection is used to determine which tasks are shown to a user.
33
+ CreateOrderModelSelectionsInner
32
34
  """
35
+ # data type: ConditionalValidationSelection
36
+ oneof_schema_1_validator: Optional[ConditionalValidationSelection] = None
33
37
  # data type: DemographicSelection
34
- oneof_schema_1_validator: Optional[DemographicSelection] = None
38
+ oneof_schema_2_validator: Optional[DemographicSelection] = None
35
39
  # data type: LabelingSelection
36
- oneof_schema_2_validator: Optional[LabelingSelection] = None
40
+ oneof_schema_3_validator: Optional[LabelingSelection] = None
41
+ # data type: StaticSelection
42
+ oneof_schema_4_validator: Optional[StaticSelection] = None
37
43
  # data type: ValidationSelection
38
- oneof_schema_3_validator: Optional[ValidationSelection] = None
39
- actual_instance: Optional[Union[DemographicSelection, LabelingSelection, ValidationSelection]] = None
40
- one_of_schemas: Set[str] = { "DemographicSelection", "LabelingSelection", "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" }
41
47
 
42
48
  model_config = ConfigDict(
43
49
  validate_assignment=True,
@@ -63,6 +69,11 @@ class CreateOrderModelSelectionsInner(BaseModel):
63
69
  instance = CreateOrderModelSelectionsInner.model_construct()
64
70
  error_messages = []
65
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
66
77
  # validate data type: DemographicSelection
67
78
  if not isinstance(v, DemographicSelection):
68
79
  error_messages.append(f"Error! Input type `{type(v)}` is not `DemographicSelection`")
@@ -73,6 +84,11 @@ class CreateOrderModelSelectionsInner(BaseModel):
73
84
  error_messages.append(f"Error! Input type `{type(v)}` is not `LabelingSelection`")
74
85
  else:
75
86
  match += 1
87
+ # validate data type: StaticSelection
88
+ if not isinstance(v, StaticSelection):
89
+ error_messages.append(f"Error! Input type `{type(v)}` is not `StaticSelection`")
90
+ else:
91
+ match += 1
76
92
  # validate data type: ValidationSelection
77
93
  if not isinstance(v, ValidationSelection):
78
94
  error_messages.append(f"Error! Input type `{type(v)}` is not `ValidationSelection`")
@@ -80,10 +96,10 @@ class CreateOrderModelSelectionsInner(BaseModel):
80
96
  match += 1
81
97
  if match > 1:
82
98
  # more than 1 match
83
- raise ValueError("Multiple matches found when setting `actual_instance` in CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, 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))
84
100
  elif match == 0:
85
101
  # no match
86
- raise ValueError("No match found when setting `actual_instance` in CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, 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))
87
103
  else:
88
104
  return v
89
105
 
@@ -98,6 +114,12 @@ class CreateOrderModelSelectionsInner(BaseModel):
98
114
  error_messages = []
99
115
  match = 0
100
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))
101
123
  # deserialize data into DemographicSelection
102
124
  try:
103
125
  instance.actual_instance = DemographicSelection.from_json(json_str)
@@ -110,6 +132,12 @@ class CreateOrderModelSelectionsInner(BaseModel):
110
132
  match += 1
111
133
  except (ValidationError, ValueError) as e:
112
134
  error_messages.append(str(e))
135
+ # deserialize data into StaticSelection
136
+ try:
137
+ instance.actual_instance = StaticSelection.from_json(json_str)
138
+ match += 1
139
+ except (ValidationError, ValueError) as e:
140
+ error_messages.append(str(e))
113
141
  # deserialize data into ValidationSelection
114
142
  try:
115
143
  instance.actual_instance = ValidationSelection.from_json(json_str)
@@ -119,10 +147,10 @@ class CreateOrderModelSelectionsInner(BaseModel):
119
147
 
120
148
  if match > 1:
121
149
  # more than 1 match
122
- raise ValueError("Multiple matches found when deserializing the JSON string into CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, 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))
123
151
  elif match == 0:
124
152
  # no match
125
- raise ValueError("No match found when deserializing the JSON string into CreateOrderModelSelectionsInner with oneOf schemas: DemographicSelection, LabelingSelection, 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))
126
154
  else:
127
155
  return instance
128
156
 
@@ -136,7 +164,7 @@ class CreateOrderModelSelectionsInner(BaseModel):
136
164
  else:
137
165
  return json.dumps(self.actual_instance)
138
166
 
139
- def to_dict(self) -> Optional[Union[Dict[str, Any], DemographicSelection, LabelingSelection, ValidationSelection]]:
167
+ def to_dict(self) -> Optional[Union[Dict[str, Any], ConditionalValidationSelection, DemographicSelection, LabelingSelection, StaticSelection, ValidationSelection]]:
140
168
  """Returns the dict representation of the actual instance"""
141
169
  if self.actual_instance is None:
142
170
  return None
@@ -31,20 +31,20 @@ CREATEORDERMODELUSERFILTERSINNER_ONE_OF_SCHEMAS = ["AgeUserFilterModel", "Campai
31
31
 
32
32
  class CreateOrderModelUserFiltersInner(BaseModel):
33
33
  """
34
- The filter model can be used to restrict users to specific demographics.
34
+ CreateOrderModelUserFiltersInner
35
35
  """
36
- # data type: UserScoreUserFilterModel
37
- oneof_schema_1_validator: Optional[UserScoreUserFilterModel] = None
38
- # data type: LanguageUserFilterModel
39
- oneof_schema_2_validator: Optional[LanguageUserFilterModel] = None
36
+ # data type: AgeUserFilterModel
37
+ oneof_schema_1_validator: Optional[AgeUserFilterModel] = None
40
38
  # data type: CampaignUserFilterModel
41
- oneof_schema_3_validator: Optional[CampaignUserFilterModel] = None
39
+ oneof_schema_2_validator: Optional[CampaignUserFilterModel] = None
42
40
  # data type: CountryUserFilterModel
43
- oneof_schema_4_validator: Optional[CountryUserFilterModel] = None
44
- # data type: AgeUserFilterModel
45
- oneof_schema_5_validator: Optional[AgeUserFilterModel] = None
41
+ oneof_schema_3_validator: Optional[CountryUserFilterModel] = None
46
42
  # data type: GenderUserFilterModel
47
- oneof_schema_6_validator: Optional[GenderUserFilterModel] = None
43
+ oneof_schema_4_validator: Optional[GenderUserFilterModel] = None
44
+ # data type: LanguageUserFilterModel
45
+ oneof_schema_5_validator: Optional[LanguageUserFilterModel] = None
46
+ # data type: UserScoreUserFilterModel
47
+ oneof_schema_6_validator: Optional[UserScoreUserFilterModel] = None
48
48
  actual_instance: Optional[Union[AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, UserScoreUserFilterModel]] = None
49
49
  one_of_schemas: Set[str] = { "AgeUserFilterModel", "CampaignUserFilterModel", "CountryUserFilterModel", "GenderUserFilterModel", "LanguageUserFilterModel", "UserScoreUserFilterModel" }
50
50
 
@@ -72,14 +72,9 @@ class CreateOrderModelUserFiltersInner(BaseModel):
72
72
  instance = CreateOrderModelUserFiltersInner.model_construct()
73
73
  error_messages = []
74
74
  match = 0
75
- # validate data type: UserScoreUserFilterModel
76
- if not isinstance(v, UserScoreUserFilterModel):
77
- error_messages.append(f"Error! Input type `{type(v)}` is not `UserScoreUserFilterModel`")
78
- else:
79
- match += 1
80
- # validate data type: LanguageUserFilterModel
81
- if not isinstance(v, LanguageUserFilterModel):
82
- error_messages.append(f"Error! Input type `{type(v)}` is not `LanguageUserFilterModel`")
75
+ # validate data type: AgeUserFilterModel
76
+ if not isinstance(v, AgeUserFilterModel):
77
+ error_messages.append(f"Error! Input type `{type(v)}` is not `AgeUserFilterModel`")
83
78
  else:
84
79
  match += 1
85
80
  # validate data type: CampaignUserFilterModel
@@ -92,16 +87,21 @@ class CreateOrderModelUserFiltersInner(BaseModel):
92
87
  error_messages.append(f"Error! Input type `{type(v)}` is not `CountryUserFilterModel`")
93
88
  else:
94
89
  match += 1
95
- # validate data type: AgeUserFilterModel
96
- if not isinstance(v, AgeUserFilterModel):
97
- error_messages.append(f"Error! Input type `{type(v)}` is not `AgeUserFilterModel`")
98
- else:
99
- match += 1
100
90
  # validate data type: GenderUserFilterModel
101
91
  if not isinstance(v, GenderUserFilterModel):
102
92
  error_messages.append(f"Error! Input type `{type(v)}` is not `GenderUserFilterModel`")
103
93
  else:
104
94
  match += 1
95
+ # validate data type: LanguageUserFilterModel
96
+ if not isinstance(v, LanguageUserFilterModel):
97
+ error_messages.append(f"Error! Input type `{type(v)}` is not `LanguageUserFilterModel`")
98
+ else:
99
+ match += 1
100
+ # validate data type: UserScoreUserFilterModel
101
+ if not isinstance(v, UserScoreUserFilterModel):
102
+ error_messages.append(f"Error! Input type `{type(v)}` is not `UserScoreUserFilterModel`")
103
+ else:
104
+ match += 1
105
105
  if match > 1:
106
106
  # more than 1 match
107
107
  raise ValueError("Multiple matches found when setting `actual_instance` in CreateOrderModelUserFiltersInner with oneOf schemas: AgeUserFilterModel, CampaignUserFilterModel, CountryUserFilterModel, GenderUserFilterModel, LanguageUserFilterModel, UserScoreUserFilterModel. Details: " + ", ".join(error_messages))
@@ -122,15 +122,9 @@ class CreateOrderModelUserFiltersInner(BaseModel):
122
122
  error_messages = []
123
123
  match = 0
124
124
 
125
- # deserialize data into UserScoreUserFilterModel
126
- try:
127
- instance.actual_instance = UserScoreUserFilterModel.from_json(json_str)
128
- match += 1
129
- except (ValidationError, ValueError) as e:
130
- error_messages.append(str(e))
131
- # deserialize data into LanguageUserFilterModel
125
+ # deserialize data into AgeUserFilterModel
132
126
  try:
133
- instance.actual_instance = LanguageUserFilterModel.from_json(json_str)
127
+ instance.actual_instance = AgeUserFilterModel.from_json(json_str)
134
128
  match += 1
135
129
  except (ValidationError, ValueError) as e:
136
130
  error_messages.append(str(e))
@@ -146,15 +140,21 @@ class CreateOrderModelUserFiltersInner(BaseModel):
146
140
  match += 1
147
141
  except (ValidationError, ValueError) as e:
148
142
  error_messages.append(str(e))
149
- # deserialize data into AgeUserFilterModel
143
+ # deserialize data into GenderUserFilterModel
150
144
  try:
151
- instance.actual_instance = AgeUserFilterModel.from_json(json_str)
145
+ instance.actual_instance = GenderUserFilterModel.from_json(json_str)
152
146
  match += 1
153
147
  except (ValidationError, ValueError) as e:
154
148
  error_messages.append(str(e))
155
- # deserialize data into GenderUserFilterModel
149
+ # deserialize data into LanguageUserFilterModel
156
150
  try:
157
- instance.actual_instance = GenderUserFilterModel.from_json(json_str)
151
+ instance.actual_instance = LanguageUserFilterModel.from_json(json_str)
152
+ match += 1
153
+ except (ValidationError, ValueError) as e:
154
+ error_messages.append(str(e))
155
+ # deserialize data into UserScoreUserFilterModel
156
+ try:
157
+ instance.actual_instance = UserScoreUserFilterModel.from_json(json_str)
158
158
  match += 1
159
159
  except (ValidationError, ValueError) as e:
160
160
  error_messages.append(str(e))
@@ -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
@@ -34,6 +34,13 @@ class CustomerOrderModel(BaseModel):
34
34
  is_public: StrictBool = Field(alias="isPublic")
35
35
  __properties: ClassVar[List[str]] = ["id", "orderDate", "state", "orderName", "isPublic"]
36
36
 
37
+ @field_validator('state')
38
+ def state_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in set(['Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed']):
41
+ raise ValueError("must be one of enum values ('Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed')")
42
+ return value
43
+
37
44
  model_config = ConfigDict(
38
45
  populate_by_name=True,
39
46
  validate_assignment=True,
@@ -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
- rapid_id: StrictStr = Field(alias="rapidId")
31
- __properties: ClassVar[List[str]] = ["_t", "rapidId"]
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
- "rapidId": obj.get("rapidId")
93
+ "keys": obj.get("keys"),
94
+ "maxRapids": obj.get("maxRapids")
93
95
  })
94
96
  return _obj
95
97
 
@@ -17,18 +17,19 @@ 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
 
25
25
  class DemographicSelection(BaseModel):
26
26
  """
27
- The demographic selection can be used to show a specific demographic rapid to the users.
27
+ DemographicSelection
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for DemographicSelection", alias="_t")
30
- rapid_id: StrictStr = Field(description="The rapid id is used to determine which rapid is shown to the user.", alias="rapidId")
31
- __properties: ClassVar[List[str]] = ["_t", "rapidId"]
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
- "rapidId": obj.get("rapidId")
93
+ "keys": obj.get("keys"),
94
+ "maxRapids": obj.get("maxRapids")
93
95
  })
94
96
  return _obj
95
97