rapidata 2.14.1__py3-none-any.whl → 2.16.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of rapidata might be problematic. Click here for more details.

Files changed (69) hide show
  1. rapidata/api_client/__init__.py +18 -7
  2. rapidata/api_client/api/__init__.py +2 -1
  3. rapidata/api_client/api/campaign_api.py +868 -92
  4. rapidata/api_client/api/client_api.py +292 -20
  5. rapidata/api_client/api/coco_api.py +594 -8
  6. rapidata/api_client/api/compare_workflow_api.py +23 -23
  7. rapidata/api_client/api/datapoint_api.py +548 -26
  8. rapidata/api_client/api/dataset_api.py +2198 -186
  9. rapidata/api_client/api/feedback_api.py +306 -0
  10. rapidata/api_client/api/identity_api.py +1143 -78
  11. rapidata/api_client/api/newsletter_api.py +299 -11
  12. rapidata/api_client/api/order_api.py +5570 -516
  13. rapidata/api_client/api/pipeline_api.py +263 -524
  14. rapidata/api_client/api/rapid_api.py +1930 -254
  15. rapidata/api_client/api/simple_workflow_api.py +23 -23
  16. rapidata/api_client/api/validation_api.py +283 -0
  17. rapidata/api_client/api/validation_set_api.py +5259 -0
  18. rapidata/api_client/api/workflow_api.py +929 -134
  19. rapidata/api_client/models/__init__.py +16 -6
  20. rapidata/api_client/models/ab_test_selection_a_inner.py +24 -10
  21. rapidata/api_client/models/add_campaign_model.py +9 -2
  22. rapidata/api_client/models/add_user_response_result.py +106 -0
  23. rapidata/api_client/models/add_user_response_result_validation_truth.py +258 -0
  24. rapidata/api_client/models/add_validation_rapid_model.py +3 -3
  25. rapidata/api_client/models/add_validation_text_rapid_model.py +3 -3
  26. rapidata/api_client/models/are_rapids_active_result.py +87 -0
  27. rapidata/api_client/models/campaign_query_result.py +2 -2
  28. rapidata/api_client/models/campaign_status.py +1 -0
  29. rapidata/api_client/models/compare_workflow_model.py +3 -3
  30. rapidata/api_client/models/create_datapoint_from_files_model.py +102 -0
  31. rapidata/api_client/models/create_datapoint_from_files_model_metadata_inner.py +168 -0
  32. rapidata/api_client/models/create_datapoint_from_text_sources_model.py +109 -0
  33. rapidata/api_client/models/create_datapoint_from_urls_model.py +4 -4
  34. rapidata/api_client/models/create_datapoints_from_s3_bucket_model.py +124 -0
  35. rapidata/api_client/models/create_order_model.py +15 -1
  36. rapidata/api_client/models/create_rapid_result.py +87 -0
  37. rapidata/api_client/models/create_validation_set_model.py +87 -0
  38. rapidata/api_client/models/datapoint_metadata_model.py +3 -3
  39. rapidata/api_client/models/evaluation_workflow_model.py +1 -1
  40. rapidata/api_client/models/get_validation_rapids_query.py +123 -0
  41. rapidata/api_client/models/get_validation_rapids_query_paged_result.py +105 -0
  42. rapidata/api_client/models/order_model.py +2 -2
  43. rapidata/api_client/models/order_state.py +1 -0
  44. rapidata/api_client/models/pipeline_id_workflow_artifact_id_put_request.py +140 -0
  45. rapidata/api_client/models/query_validation_rapids_result.py +3 -3
  46. rapidata/api_client/models/rapid_issue.py +4 -0
  47. rapidata/api_client/models/report_model.py +4 -4
  48. rapidata/api_client/models/shuffling_selection.py +106 -0
  49. rapidata/api_client/models/update_dataset_name_model.py +87 -0
  50. rapidata/api_client/models/update_dimensions_model.py +87 -0
  51. rapidata/api_client/models/update_order_name_model.py +87 -0
  52. rapidata/api_client/models/upload_text_sources_to_dataset_model.py +3 -3
  53. rapidata/api_client/models/user_score_user_filter_model.py +9 -2
  54. rapidata/api_client_README.md +154 -84
  55. rapidata/rapidata_client/demographic/demographic_manager.py +36 -1
  56. rapidata/rapidata_client/filter/user_score_filter.py +4 -1
  57. rapidata/rapidata_client/order/_rapidata_dataset.py +10 -11
  58. rapidata/rapidata_client/order/_rapidata_order_builder.py +3 -1
  59. rapidata/rapidata_client/order/rapidata_order.py +8 -10
  60. rapidata/rapidata_client/order/rapidata_order_manager.py +11 -2
  61. rapidata/rapidata_client/order/rapidata_results.py +1 -1
  62. rapidata/rapidata_client/validation/rapidata_validation_set.py +11 -0
  63. rapidata/rapidata_client/validation/rapids/rapids.py +3 -5
  64. rapidata/rapidata_client/validation/validation_set_manager.py +36 -21
  65. rapidata/rapidata_client/workflow/_ranking_workflow.py +2 -2
  66. {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/METADATA +1 -1
  67. {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/RECORD +69 -51
  68. {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/LICENSE +0 -0
  69. {rapidata-2.14.1.dist-info → rapidata-2.16.0.dist-info}/WHEEL +0 -0
@@ -39,10 +39,12 @@ class CreateOrderModel(BaseModel):
39
39
  feature_flags: Optional[List[FeatureFlagModel]] = Field(default=None, description="The feature flags are used to enable or disable certain features.", alias="featureFlags")
40
40
  priority: Optional[StrictInt] = Field(default=None, description="The priority is used to prioritize over other orders.")
41
41
  is_sticky: Optional[StrictBool] = Field(default=None, description="Indicates if the underlying campaign should be sticky.", alias="isSticky")
42
+ user_score_dimensions: Optional[List[StrictStr]] = Field(default=None, description="The user score dimensions are used to determine the score of the responses from the user.", alias="userScoreDimensions")
43
+ demographic_keys: Optional[List[StrictStr]] = Field(default=None, description="The demographic keys are used to determine which demographics to store on the resposnes from the user.", alias="demographicKeys")
42
44
  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")
43
45
  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")
44
46
  selections: Optional[List[AbTestSelectionAInner]] = Field(default=None, description="The selections are used to determine which tasks are shown to a user.")
45
- __properties: ClassVar[List[str]] = ["_t", "orderName", "workflow", "referee", "aggregator", "featureFlags", "priority", "isSticky", "userFilters", "validationSetId", "selections"]
47
+ __properties: ClassVar[List[str]] = ["_t", "orderName", "workflow", "referee", "aggregator", "featureFlags", "priority", "isSticky", "userScoreDimensions", "demographicKeys", "userFilters", "validationSetId", "selections"]
46
48
 
47
49
  @field_validator('t')
48
50
  def t_validate_enum(cls, value):
@@ -142,6 +144,16 @@ class CreateOrderModel(BaseModel):
142
144
  if self.priority is None and "priority" in self.model_fields_set:
143
145
  _dict['priority'] = None
144
146
 
147
+ # set to None if user_score_dimensions (nullable) is None
148
+ # and model_fields_set contains the field
149
+ if self.user_score_dimensions is None and "user_score_dimensions" in self.model_fields_set:
150
+ _dict['userScoreDimensions'] = None
151
+
152
+ # set to None if demographic_keys (nullable) is None
153
+ # and model_fields_set contains the field
154
+ if self.demographic_keys is None and "demographic_keys" in self.model_fields_set:
155
+ _dict['demographicKeys'] = None
156
+
145
157
  # set to None if validation_set_id (nullable) is None
146
158
  # and model_fields_set contains the field
147
159
  if self.validation_set_id is None and "validation_set_id" in self.model_fields_set:
@@ -172,6 +184,8 @@ class CreateOrderModel(BaseModel):
172
184
  "featureFlags": [FeatureFlagModel.from_dict(_item) for _item in obj["featureFlags"]] if obj.get("featureFlags") is not None else None,
173
185
  "priority": obj.get("priority"),
174
186
  "isSticky": obj.get("isSticky"),
187
+ "userScoreDimensions": obj.get("userScoreDimensions"),
188
+ "demographicKeys": obj.get("demographicKeys"),
175
189
  "userFilters": [CreateOrderModelUserFiltersInner.from_dict(_item) for _item in obj["userFilters"]] if obj.get("userFilters") is not None else None,
176
190
  "validationSetId": obj.get("validationSetId"),
177
191
  "selections": [AbTestSelectionAInner.from_dict(_item) for _item in obj["selections"]] if obj.get("selections") is not None else None
@@ -0,0 +1,87 @@
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 CreateRapidResult(BaseModel):
26
+ """
27
+ CreateRapidResult
28
+ """ # noqa: E501
29
+ rapid_id: StrictStr = Field(alias="rapidId")
30
+ __properties: ClassVar[List[str]] = ["rapidId"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of CreateRapidResult from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of CreateRapidResult from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "rapidId": obj.get("rapidId")
84
+ })
85
+ return _obj
86
+
87
+
@@ -0,0 +1,87 @@
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 CreateValidationSetModel(BaseModel):
26
+ """
27
+ The body request for creating a new validation set.
28
+ """ # noqa: E501
29
+ name: StrictStr = Field(description="The name of the validation set.")
30
+ __properties: ClassVar[List[str]] = ["name"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of CreateValidationSetModel from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of CreateValidationSetModel from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "name": obj.get("name")
84
+ })
85
+ return _obj
86
+
87
+
@@ -19,7 +19,7 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from rapidata.api_client.models.create_datapoint_from_urls_model_metadata_inner import CreateDatapointFromUrlsModelMetadataInner
22
+ from rapidata.api_client.models.create_datapoint_from_files_model_metadata_inner import CreateDatapointFromFilesModelMetadataInner
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
 
@@ -28,7 +28,7 @@ class DatapointMetadataModel(BaseModel):
28
28
  The model for creating a datapoint.
29
29
  """ # noqa: E501
30
30
  dataset_id: StrictStr = Field(description="The id of the dataset to create the datapoint in.", alias="datasetId")
31
- metadata: List[CreateDatapointFromUrlsModelMetadataInner] = Field(description="The metadata of the datapoint.")
31
+ metadata: List[CreateDatapointFromFilesModelMetadataInner] = Field(description="The metadata of the datapoint.")
32
32
  sort_index: Optional[StrictInt] = Field(default=None, description="The index will be used to keep the datapoints in order. Useful if upload is parallelized", alias="sortIndex")
33
33
  __properties: ClassVar[List[str]] = ["datasetId", "metadata", "sortIndex"]
34
34
 
@@ -96,7 +96,7 @@ class DatapointMetadataModel(BaseModel):
96
96
 
97
97
  _obj = cls.model_validate({
98
98
  "datasetId": obj.get("datasetId"),
99
- "metadata": [CreateDatapointFromUrlsModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
99
+ "metadata": [CreateDatapointFromFilesModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None,
100
100
  "sortIndex": obj.get("sortIndex")
101
101
  })
102
102
  return _obj
@@ -27,7 +27,7 @@ class EvaluationWorkflowModel(BaseModel):
27
27
  If the EvaluationWorkflow is chosen a validation set will be used as a source for all tasks. It functions similarly to the SimpleWorkflow as there is a 1:1 mapping between validation rapids and tasks.
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for EvaluationWorkflow", alias="_t")
30
- validation_set_id: StrictStr = Field(description="The Validation Set Id is used to as a source for the tasks that will be sent to the user.", alias="validationSetId")
30
+ validation_set_id: StrictStr = Field(description="The Validation Set id is used to as a source for the tasks that will be sent to the user.", alias="validationSetId")
31
31
  should_accept_incorrect: StrictBool = Field(description="Indicates if the user should get feedback on their answers if they answer wrong. If set to true the user will not notice that he was tested.", alias="shouldAcceptIncorrect")
32
32
  __properties: ClassVar[List[str]] = ["_t", "validationSetId", "shouldAcceptIncorrect"]
33
33
 
@@ -0,0 +1,123 @@
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, 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 GetValidationRapidsQuery(BaseModel):
29
+ """
30
+ GetValidationRapidsQuery
31
+ """ # noqa: E501
32
+ t: StrictStr = Field(description="Discriminator value for GetValidationRapidsQuery", alias="_t")
33
+ page_info: Optional[PageInfo] = Field(default=None, alias="pageInfo")
34
+ root_filter: Optional[RootFilter] = Field(default=None, alias="rootFilter")
35
+ sort_criteria: Optional[List[SortCriterion]] = Field(default=None, alias="sortCriteria")
36
+ validation_set_id: StrictStr = Field(alias="validationSetId")
37
+ __properties: ClassVar[List[str]] = ["_t", "pageInfo", "rootFilter", "sortCriteria", "validationSetId"]
38
+
39
+ @field_validator('t')
40
+ def t_validate_enum(cls, value):
41
+ """Validates the enum"""
42
+ if value not in set(['GetValidationRapidsQuery']):
43
+ raise ValueError("must be one of enum values ('GetValidationRapidsQuery')")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
60
+ return json.dumps(self.to_dict())
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of GetValidationRapidsQuery from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # override the default output from pydantic by calling `to_dict()` of page_info
86
+ if self.page_info:
87
+ _dict['pageInfo'] = self.page_info.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of root_filter
89
+ if self.root_filter:
90
+ _dict['rootFilter'] = self.root_filter.to_dict()
91
+ # override the default output from pydantic by calling `to_dict()` of each item in sort_criteria (list)
92
+ _items = []
93
+ if self.sort_criteria:
94
+ for _item_sort_criteria in self.sort_criteria:
95
+ if _item_sort_criteria:
96
+ _items.append(_item_sort_criteria.to_dict())
97
+ _dict['sortCriteria'] = _items
98
+ # set to None if sort_criteria (nullable) is None
99
+ # and model_fields_set contains the field
100
+ if self.sort_criteria is None and "sort_criteria" in self.model_fields_set:
101
+ _dict['sortCriteria'] = None
102
+
103
+ return _dict
104
+
105
+ @classmethod
106
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
107
+ """Create an instance of GetValidationRapidsQuery from a dict"""
108
+ if obj is None:
109
+ return None
110
+
111
+ if not isinstance(obj, dict):
112
+ return cls.model_validate(obj)
113
+
114
+ _obj = cls.model_validate({
115
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'GetValidationRapidsQuery',
116
+ "pageInfo": PageInfo.from_dict(obj["pageInfo"]) if obj.get("pageInfo") is not None else None,
117
+ "rootFilter": RootFilter.from_dict(obj["rootFilter"]) if obj.get("rootFilter") is not None else None,
118
+ "sortCriteria": [SortCriterion.from_dict(_item) for _item in obj["sortCriteria"]] if obj.get("sortCriteria") is not None else None,
119
+ "validationSetId": obj.get("validationSetId")
120
+ })
121
+ return _obj
122
+
123
+
@@ -0,0 +1,105 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.get_validation_rapids_query import GetValidationRapidsQuery
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetValidationRapidsQueryPagedResult(BaseModel):
27
+ """
28
+ GetValidationRapidsQueryPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[GetValidationRapidsQuery]
34
+ total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
35
+ __properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
36
+
37
+ model_config = ConfigDict(
38
+ populate_by_name=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
51
+ return json.dumps(self.to_dict())
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of GetValidationRapidsQueryPagedResult from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ * OpenAPI `readOnly` fields are excluded.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ "total_pages",
71
+ ])
72
+
73
+ _dict = self.model_dump(
74
+ by_alias=True,
75
+ exclude=excluded_fields,
76
+ exclude_none=True,
77
+ )
78
+ # override the default output from pydantic by calling `to_dict()` of each item in items (list)
79
+ _items = []
80
+ if self.items:
81
+ for _item_items in self.items:
82
+ if _item_items:
83
+ _items.append(_item_items.to_dict())
84
+ _dict['items'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of GetValidationRapidsQueryPagedResult from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "total": obj.get("total"),
98
+ "page": obj.get("page"),
99
+ "pageSize": obj.get("pageSize"),
100
+ "items": [GetValidationRapidsQuery.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
101
+ "totalPages": obj.get("totalPages")
102
+ })
103
+ return _obj
104
+
105
+
@@ -39,8 +39,8 @@ class OrderModel(BaseModel):
39
39
  @field_validator('state')
40
40
  def state_validate_enum(cls, value):
41
41
  """Validates the enum"""
42
- if value not in set(['Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed']):
43
- raise ValueError("must be one of enum values ('Created', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed')")
42
+ if value not in set(['Created', 'Preview', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed']):
43
+ raise ValueError("must be one of enum values ('Created', 'Preview', 'Submitted', 'ManualReview', 'Processing', 'Paused', 'Completed', 'Cancelled', 'Failed')")
44
44
  return value
45
45
 
46
46
  model_config = ConfigDict(
@@ -27,6 +27,7 @@ class OrderState(str, Enum):
27
27
  allowed enum values
28
28
  """
29
29
  CREATED = 'Created'
30
+ PREVIEW = 'Preview'
30
31
  SUBMITTED = 'Submitted'
31
32
  MANUALREVIEW = 'ManualReview'
32
33
  PROCESSING = 'Processing'
@@ -0,0 +1,140 @@
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.compare_workflow_config_model import CompareWorkflowConfigModel
21
+ from rapidata.api_client.models.simple_workflow_config_model import SimpleWorkflowConfigModel
22
+ from pydantic import StrictStr, Field
23
+ from typing import Union, List, Set, Optional, Dict
24
+ from typing_extensions import Literal, Self
25
+
26
+ PIPELINEIDWORKFLOWARTIFACTIDPUTREQUEST_ONE_OF_SCHEMAS = ["CompareWorkflowConfigModel", "SimpleWorkflowConfigModel"]
27
+
28
+ class PipelineIdWorkflowArtifactIdPutRequest(BaseModel):
29
+ """
30
+ The base configuration for a workflow.
31
+ """
32
+ # data type: CompareWorkflowConfigModel
33
+ oneof_schema_1_validator: Optional[CompareWorkflowConfigModel] = None
34
+ # data type: SimpleWorkflowConfigModel
35
+ oneof_schema_2_validator: Optional[SimpleWorkflowConfigModel] = None
36
+ actual_instance: Optional[Union[CompareWorkflowConfigModel, SimpleWorkflowConfigModel]] = None
37
+ one_of_schemas: Set[str] = { "CompareWorkflowConfigModel", "SimpleWorkflowConfigModel" }
38
+
39
+ model_config = ConfigDict(
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ discriminator_value_class_map: Dict[str, str] = {
46
+ }
47
+
48
+ def __init__(self, *args, **kwargs) -> None:
49
+ if args:
50
+ if len(args) > 1:
51
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
+ if kwargs:
53
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
+ super().__init__(actual_instance=args[0])
55
+ else:
56
+ super().__init__(**kwargs)
57
+
58
+ @field_validator('actual_instance')
59
+ def actual_instance_must_validate_oneof(cls, v):
60
+ instance = PipelineIdWorkflowArtifactIdPutRequest.model_construct()
61
+ error_messages = []
62
+ match = 0
63
+ # validate data type: CompareWorkflowConfigModel
64
+ if not isinstance(v, CompareWorkflowConfigModel):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompareWorkflowConfigModel`")
66
+ else:
67
+ match += 1
68
+ # validate data type: SimpleWorkflowConfigModel
69
+ if not isinstance(v, SimpleWorkflowConfigModel):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowConfigModel`")
71
+ else:
72
+ match += 1
73
+ if match > 1:
74
+ # more than 1 match
75
+ raise ValueError("Multiple matches found when setting `actual_instance` in PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
76
+ elif match == 0:
77
+ # no match
78
+ raise ValueError("No match found when setting `actual_instance` in PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ match = 0
92
+
93
+ # deserialize data into CompareWorkflowConfigModel
94
+ try:
95
+ instance.actual_instance = CompareWorkflowConfigModel.from_json(json_str)
96
+ match += 1
97
+ except (ValidationError, ValueError) as e:
98
+ error_messages.append(str(e))
99
+ # deserialize data into SimpleWorkflowConfigModel
100
+ try:
101
+ instance.actual_instance = SimpleWorkflowConfigModel.from_json(json_str)
102
+ match += 1
103
+ except (ValidationError, ValueError) as e:
104
+ error_messages.append(str(e))
105
+
106
+ if match > 1:
107
+ # more than 1 match
108
+ raise ValueError("Multiple matches found when deserializing the JSON string into PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
109
+ elif match == 0:
110
+ # no match
111
+ raise ValueError("No match found when deserializing the JSON string into PipelineIdWorkflowArtifactIdPutRequest with oneOf schemas: CompareWorkflowConfigModel, SimpleWorkflowConfigModel. Details: " + ", ".join(error_messages))
112
+ else:
113
+ return instance
114
+
115
+ def to_json(self) -> str:
116
+ """Returns the JSON representation of the actual instance"""
117
+ if self.actual_instance is None:
118
+ return "null"
119
+
120
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
121
+ return self.actual_instance.to_json()
122
+ else:
123
+ return json.dumps(self.actual_instance)
124
+
125
+ def to_dict(self) -> Optional[Union[Dict[str, Any], CompareWorkflowConfigModel, SimpleWorkflowConfigModel]]:
126
+ """Returns the dict representation of the actual instance"""
127
+ if self.actual_instance is None:
128
+ return None
129
+
130
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
131
+ return self.actual_instance.to_dict()
132
+ else:
133
+ # primitive type
134
+ return self.actual_instance
135
+
136
+ def to_str(self) -> str:
137
+ """Returns the string representation of the actual instance"""
138
+ return pprint.pformat(self.model_dump())
139
+
140
+
@@ -19,10 +19,10 @@ import json
19
19
 
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
+ from rapidata.api_client.models.add_user_response_result_validation_truth import AddUserResponseResultValidationTruth
22
23
  from rapidata.api_client.models.file_asset_model_metadata_value import FileAssetModelMetadataValue
23
24
  from rapidata.api_client.models.query_validation_rapids_result_asset import QueryValidationRapidsResultAsset
24
25
  from rapidata.api_client.models.query_validation_rapids_result_payload import QueryValidationRapidsResultPayload
25
- from rapidata.api_client.models.query_validation_rapids_result_truth import QueryValidationRapidsResultTruth
26
26
  from typing import Optional, Set
27
27
  from typing_extensions import Self
28
28
 
@@ -33,7 +33,7 @@ class QueryValidationRapidsResult(BaseModel):
33
33
  id: StrictStr
34
34
  type: StrictStr
35
35
  asset: Optional[QueryValidationRapidsResultAsset] = None
36
- truth: Optional[QueryValidationRapidsResultTruth] = None
36
+ truth: Optional[AddUserResponseResultValidationTruth] = None
37
37
  payload: QueryValidationRapidsResultPayload
38
38
  metadata: Dict[str, FileAssetModelMetadataValue]
39
39
  correct_validation_count: StrictInt = Field(alias="correctValidationCount")
@@ -126,7 +126,7 @@ class QueryValidationRapidsResult(BaseModel):
126
126
  "id": obj.get("id"),
127
127
  "type": obj.get("type"),
128
128
  "asset": QueryValidationRapidsResultAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
129
- "truth": QueryValidationRapidsResultTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
129
+ "truth": AddUserResponseResultValidationTruth.from_dict(obj["truth"]) if obj.get("truth") is not None else None,
130
130
  "payload": QueryValidationRapidsResultPayload.from_dict(obj["payload"]) if obj.get("payload") is not None else None,
131
131
  "metadata": dict(
132
132
  (_k, FileAssetModelMetadataValue.from_dict(_v))