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.

Potentially problematic release.


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

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
@@ -28,7 +28,7 @@ class FeedbackModel(BaseModel):
28
28
  """ # noqa: E501
29
29
  feedback: StrictStr = Field(description="The feedback")
30
30
  email: Optional[StrictStr] = Field(default=None, description="The email of the user submitting the feedback")
31
- token: Optional[StrictStr] = None
31
+ token: Optional[StrictStr] = Field(default=None, description="The recaptcha token of the user submitting the feedback")
32
32
  __properties: ClassVar[List[str]] = ["feedback", "email", "token"]
33
33
 
34
34
  model_config = ConfigDict(
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class FileArtifactModel(BaseModel):
26
+ """
27
+ FileArtifactModel
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for FileArtifactModel", alias="_t")
30
+ file_name: StrictStr = Field(alias="fileName")
31
+ identifier: StrictStr
32
+ __properties: ClassVar[List[str]] = ["_t", "fileName", "identifier"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['FileArtifactModel']):
38
+ raise ValueError("must be one of enum values ('FileArtifactModel')")
39
+ return value
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of FileArtifactModel from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of FileArtifactModel from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'FileArtifactModel',
93
+ "fileName": obj.get("fileName"),
94
+ "identifier": obj.get("identifier")
95
+ })
96
+ return _obj
97
+
98
+
@@ -20,7 +20,7 @@ from typing_extensions import Self
20
20
 
21
21
  class Gender(str, Enum):
22
22
  """
23
- All available Gender options.
23
+ Gender
24
24
  """
25
25
 
26
26
  """
@@ -25,10 +25,10 @@ from typing_extensions import Self
25
25
 
26
26
  class GenderUserFilterModel(BaseModel):
27
27
  """
28
- The GenderFilter is used to restrict users to specific genders.
28
+ GenderUserFilterModel
29
29
  """ # noqa: E501
30
30
  t: StrictStr = Field(description="Discriminator value for GenderFilter", alias="_t")
31
- genders: List[Gender] = Field(description="A whitelist of all genders allowed.")
31
+ genders: List[Gender]
32
32
  __properties: ClassVar[List[str]] = ["_t", "genders"]
33
33
 
34
34
  @field_validator('t')
@@ -0,0 +1,144 @@
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.completed_rapid_model import CompletedRapidModel
23
+ from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
24
+ from rapidata.api_client.models.in_progress_rapid_model import InProgressRapidModel
25
+ from rapidata.api_client.models.not_started_rapid_model import NotStartedRapidModel
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+
29
+ class GetAttachCategoryWorkflowResultOverviewResult(BaseModel):
30
+ """
31
+ GetAttachCategoryWorkflowResultOverviewResult
32
+ """ # noqa: E501
33
+ state: StrictStr
34
+ progress: GetWorkflowProgressResult
35
+ rapid_type: StrictStr = Field(alias="rapidType")
36
+ not_started_rapids: List[NotStartedRapidModel] = Field(alias="notStartedRapids")
37
+ hidden_not_started_count: StrictInt = Field(alias="hiddenNotStartedCount")
38
+ in_progress_rapids: List[InProgressRapidModel] = Field(alias="inProgressRapids")
39
+ hidden_in_progress_rapids_count: StrictInt = Field(alias="hiddenInProgressRapidsCount")
40
+ completed_rapids: List[CompletedRapidModel] = Field(alias="completedRapids")
41
+ hidden_completed_rapids_count: StrictInt = Field(alias="hiddenCompletedRapidsCount")
42
+ result_type: Optional[StrictStr] = Field(default=None, alias="resultType")
43
+ occurrences_by_category: Dict[str, StrictInt] = Field(alias="occurrencesByCategory")
44
+ __properties: ClassVar[List[str]] = ["state", "progress", "rapidType", "notStartedRapids", "hiddenNotStartedCount", "inProgressRapids", "hiddenInProgressRapidsCount", "completedRapids", "hiddenCompletedRapidsCount", "resultType", "occurrencesByCategory"]
45
+
46
+ @field_validator('state')
47
+ def state_validate_enum(cls, value):
48
+ """Validates the enum"""
49
+ if value not in set(['Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed']):
50
+ raise ValueError("must be one of enum values ('Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed')")
51
+ return value
52
+
53
+ model_config = ConfigDict(
54
+ populate_by_name=True,
55
+ validate_assignment=True,
56
+ protected_namespaces=(),
57
+ )
58
+
59
+
60
+ def to_str(self) -> str:
61
+ """Returns the string representation of the model using alias"""
62
+ return pprint.pformat(self.model_dump(by_alias=True))
63
+
64
+ def to_json(self) -> str:
65
+ """Returns the JSON representation of the model using alias"""
66
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
67
+ return json.dumps(self.to_dict())
68
+
69
+ @classmethod
70
+ def from_json(cls, json_str: str) -> Optional[Self]:
71
+ """Create an instance of GetAttachCategoryWorkflowResultOverviewResult from a JSON string"""
72
+ return cls.from_dict(json.loads(json_str))
73
+
74
+ def to_dict(self) -> Dict[str, Any]:
75
+ """Return the dictionary representation of the model using alias.
76
+
77
+ This has the following differences from calling pydantic's
78
+ `self.model_dump(by_alias=True)`:
79
+
80
+ * `None` is only added to the output dict for nullable fields that
81
+ were set at model initialization. Other fields with value `None`
82
+ are ignored.
83
+ * OpenAPI `readOnly` fields are excluded.
84
+ """
85
+ excluded_fields: Set[str] = set([
86
+ "result_type",
87
+ ])
88
+
89
+ _dict = self.model_dump(
90
+ by_alias=True,
91
+ exclude=excluded_fields,
92
+ exclude_none=True,
93
+ )
94
+ # override the default output from pydantic by calling `to_dict()` of progress
95
+ if self.progress:
96
+ _dict['progress'] = self.progress.to_dict()
97
+ # override the default output from pydantic by calling `to_dict()` of each item in not_started_rapids (list)
98
+ _items = []
99
+ if self.not_started_rapids:
100
+ for _item_not_started_rapids in self.not_started_rapids:
101
+ if _item_not_started_rapids:
102
+ _items.append(_item_not_started_rapids.to_dict())
103
+ _dict['notStartedRapids'] = _items
104
+ # override the default output from pydantic by calling `to_dict()` of each item in in_progress_rapids (list)
105
+ _items = []
106
+ if self.in_progress_rapids:
107
+ for _item_in_progress_rapids in self.in_progress_rapids:
108
+ if _item_in_progress_rapids:
109
+ _items.append(_item_in_progress_rapids.to_dict())
110
+ _dict['inProgressRapids'] = _items
111
+ # override the default output from pydantic by calling `to_dict()` of each item in completed_rapids (list)
112
+ _items = []
113
+ if self.completed_rapids:
114
+ for _item_completed_rapids in self.completed_rapids:
115
+ if _item_completed_rapids:
116
+ _items.append(_item_completed_rapids.to_dict())
117
+ _dict['completedRapids'] = _items
118
+ return _dict
119
+
120
+ @classmethod
121
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
122
+ """Create an instance of GetAttachCategoryWorkflowResultOverviewResult from a dict"""
123
+ if obj is None:
124
+ return None
125
+
126
+ if not isinstance(obj, dict):
127
+ return cls.model_validate(obj)
128
+
129
+ _obj = cls.model_validate({
130
+ "state": obj.get("state"),
131
+ "progress": GetWorkflowProgressResult.from_dict(obj["progress"]) if obj.get("progress") is not None else None,
132
+ "rapidType": obj.get("rapidType"),
133
+ "notStartedRapids": [NotStartedRapidModel.from_dict(_item) for _item in obj["notStartedRapids"]] if obj.get("notStartedRapids") is not None else None,
134
+ "hiddenNotStartedCount": obj.get("hiddenNotStartedCount"),
135
+ "inProgressRapids": [InProgressRapidModel.from_dict(_item) for _item in obj["inProgressRapids"]] if obj.get("inProgressRapids") is not None else None,
136
+ "hiddenInProgressRapidsCount": obj.get("hiddenInProgressRapidsCount"),
137
+ "completedRapids": [CompletedRapidModel.from_dict(_item) for _item in obj["completedRapids"]] if obj.get("completedRapids") is not None else None,
138
+ "hiddenCompletedRapidsCount": obj.get("hiddenCompletedRapidsCount"),
139
+ "resultType": obj.get("resultType"),
140
+ "occurrencesByCategory": obj.get("occurrencesByCategory")
141
+ })
142
+ return _obj
143
+
144
+
@@ -0,0 +1,125 @@
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.get_workflow_progress_result import GetWorkflowProgressResult
23
+ from rapidata.api_client.models.ranked_datapoint_model import RankedDatapointModel
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class GetCompareWorkflowResultOverviewResult(BaseModel):
28
+ """
29
+ GetCompareWorkflowResultOverviewResult
30
+ """ # noqa: E501
31
+ state: StrictStr
32
+ progress: GetWorkflowProgressResult
33
+ top: List[RankedDatapointModel]
34
+ bottom: List[RankedDatapointModel]
35
+ hidden_count: StrictInt = Field(alias="hiddenCount")
36
+ result_type: Optional[StrictStr] = Field(default=None, alias="resultType")
37
+ __properties: ClassVar[List[str]] = ["state", "progress", "top", "bottom", "hiddenCount", "resultType"]
38
+
39
+ @field_validator('state')
40
+ def state_validate_enum(cls, value):
41
+ """Validates the enum"""
42
+ if value not in set(['Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed']):
43
+ raise ValueError("must be one of enum values ('Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed')")
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 GetCompareWorkflowResultOverviewResult 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
+ * OpenAPI `readOnly` fields are excluded.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ "result_type",
80
+ ])
81
+
82
+ _dict = self.model_dump(
83
+ by_alias=True,
84
+ exclude=excluded_fields,
85
+ exclude_none=True,
86
+ )
87
+ # override the default output from pydantic by calling `to_dict()` of progress
88
+ if self.progress:
89
+ _dict['progress'] = self.progress.to_dict()
90
+ # override the default output from pydantic by calling `to_dict()` of each item in top (list)
91
+ _items = []
92
+ if self.top:
93
+ for _item_top in self.top:
94
+ if _item_top:
95
+ _items.append(_item_top.to_dict())
96
+ _dict['top'] = _items
97
+ # override the default output from pydantic by calling `to_dict()` of each item in bottom (list)
98
+ _items = []
99
+ if self.bottom:
100
+ for _item_bottom in self.bottom:
101
+ if _item_bottom:
102
+ _items.append(_item_bottom.to_dict())
103
+ _dict['bottom'] = _items
104
+ return _dict
105
+
106
+ @classmethod
107
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
108
+ """Create an instance of GetCompareWorkflowResultOverviewResult from a dict"""
109
+ if obj is None:
110
+ return None
111
+
112
+ if not isinstance(obj, dict):
113
+ return cls.model_validate(obj)
114
+
115
+ _obj = cls.model_validate({
116
+ "state": obj.get("state"),
117
+ "progress": GetWorkflowProgressResult.from_dict(obj["progress"]) if obj.get("progress") is not None else None,
118
+ "top": [RankedDatapointModel.from_dict(_item) for _item in obj["top"]] if obj.get("top") is not None else None,
119
+ "bottom": [RankedDatapointModel.from_dict(_item) for _item in obj["bottom"]] if obj.get("bottom") is not None else None,
120
+ "hiddenCount": obj.get("hiddenCount"),
121
+ "resultType": obj.get("resultType")
122
+ })
123
+ return _obj
124
+
125
+
@@ -0,0 +1,114 @@
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.get_workflow_progress_result import GetWorkflowProgressResult
23
+ from rapidata.api_client.models.ranked_datapoint_model import RankedDatapointModel
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class GetCompareWorkflowResultOverviewSmallResult(BaseModel):
28
+ """
29
+ GetCompareWorkflowResultOverviewSmallResult
30
+ """ # noqa: E501
31
+ state: StrictStr
32
+ progress: GetWorkflowProgressResult
33
+ datapoints: List[RankedDatapointModel]
34
+ result_type: Optional[StrictStr] = Field(default=None, alias="resultType")
35
+ __properties: ClassVar[List[str]] = ["state", "progress", "datapoints", "resultType"]
36
+
37
+ @field_validator('state')
38
+ def state_validate_enum(cls, value):
39
+ """Validates the enum"""
40
+ if value not in set(['Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed']):
41
+ raise ValueError("must be one of enum values ('Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed')")
42
+ return value
43
+
44
+ model_config = ConfigDict(
45
+ populate_by_name=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58
+ return json.dumps(self.to_dict())
59
+
60
+ @classmethod
61
+ def from_json(cls, json_str: str) -> Optional[Self]:
62
+ """Create an instance of GetCompareWorkflowResultOverviewSmallResult from a JSON string"""
63
+ return cls.from_dict(json.loads(json_str))
64
+
65
+ def to_dict(self) -> Dict[str, Any]:
66
+ """Return the dictionary representation of the model using alias.
67
+
68
+ This has the following differences from calling pydantic's
69
+ `self.model_dump(by_alias=True)`:
70
+
71
+ * `None` is only added to the output dict for nullable fields that
72
+ were set at model initialization. Other fields with value `None`
73
+ are ignored.
74
+ * OpenAPI `readOnly` fields are excluded.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ "result_type",
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 progress
86
+ if self.progress:
87
+ _dict['progress'] = self.progress.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of each item in datapoints (list)
89
+ _items = []
90
+ if self.datapoints:
91
+ for _item_datapoints in self.datapoints:
92
+ if _item_datapoints:
93
+ _items.append(_item_datapoints.to_dict())
94
+ _dict['datapoints'] = _items
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of GetCompareWorkflowResultOverviewSmallResult from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "state": obj.get("state"),
108
+ "progress": GetWorkflowProgressResult.from_dict(obj["progress"]) if obj.get("progress") is not None else None,
109
+ "datapoints": [RankedDatapointModel.from_dict(_item) for _item in obj["datapoints"]] if obj.get("datapoints") is not None else None,
110
+ "resultType": obj.get("resultType")
111
+ })
112
+ return _obj
113
+
114
+
@@ -0,0 +1,100 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import GetPipelineByIdResultArtifactsValue
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetPipelineByIdResult(BaseModel):
27
+ """
28
+ GetPipelineByIdResult
29
+ """ # noqa: E501
30
+ artifacts: Dict[str, GetPipelineByIdResultArtifactsValue]
31
+ __properties: ClassVar[List[str]] = ["artifacts"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of GetPipelineByIdResult from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each value in artifacts (dict)
73
+ _field_dict = {}
74
+ if self.artifacts:
75
+ for _key_artifacts in self.artifacts:
76
+ if self.artifacts[_key_artifacts]:
77
+ _field_dict[_key_artifacts] = self.artifacts[_key_artifacts].to_dict()
78
+ _dict['artifacts'] = _field_dict
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of GetPipelineByIdResult from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "artifacts": dict(
92
+ (_k, GetPipelineByIdResultArtifactsValue.from_dict(_v))
93
+ for _k, _v in obj["artifacts"].items()
94
+ )
95
+ if obj.get("artifacts") is not None
96
+ else None
97
+ })
98
+ return _obj
99
+
100
+