rapidata 0.4.0__py3-none-any.whl → 0.4.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. rapidata/api_client/__init__.py +29 -3
  2. rapidata/api_client/api/__init__.py +3 -0
  3. rapidata/api_client/api/compare_workflow_api.py +316 -0
  4. rapidata/api_client/api/dataset_api.py +24 -24
  5. rapidata/api_client/api/order_api.py +515 -289
  6. rapidata/api_client/api/rapid_api.py +6 -6
  7. rapidata/api_client/api/simple_workflow_api.py +350 -0
  8. rapidata/api_client/api/validation_api.py +6 -6
  9. rapidata/api_client/api/workflow_api.py +2386 -0
  10. rapidata/api_client/api_client.py +2 -2
  11. rapidata/api_client/models/__init__.py +26 -3
  12. rapidata/api_client/models/admin_order_model.py +8 -1
  13. rapidata/api_client/models/age_group.py +1 -1
  14. rapidata/api_client/models/age_user_filter_model.py +2 -2
  15. rapidata/api_client/models/campaign_user_filter_model.py +2 -2
  16. rapidata/api_client/models/compare_workflow_get_result_overview_get200_response.py +137 -0
  17. rapidata/api_client/models/compare_workflow_model1.py +146 -0
  18. rapidata/api_client/models/completed_rapid_model.py +103 -0
  19. rapidata/api_client/models/country_user_filter_model.py +2 -2
  20. rapidata/api_client/models/create_demographic_rapid_model.py +3 -3
  21. rapidata/api_client/models/create_independent_workflow_model.py +93 -0
  22. rapidata/api_client/models/create_independent_workflow_model_workflow_config.py +140 -0
  23. rapidata/api_client/models/create_independent_workflow_result.py +89 -0
  24. rapidata/api_client/models/create_order_model.py +40 -31
  25. rapidata/api_client/models/create_order_model_selections_inner.py +24 -10
  26. rapidata/api_client/models/create_order_model_user_filters_inner.py +35 -35
  27. rapidata/api_client/models/customer_order_model.py +8 -1
  28. rapidata/api_client/models/demographic_rapid_selection_config.py +3 -3
  29. rapidata/api_client/models/demographic_selection.py +4 -4
  30. rapidata/api_client/models/feedback_model.py +1 -1
  31. rapidata/api_client/models/gender.py +1 -1
  32. rapidata/api_client/models/gender_user_filter_model.py +2 -2
  33. rapidata/api_client/models/get_attach_category_workflow_result_overview_result.py +144 -0
  34. rapidata/api_client/models/get_compare_workflow_result_overview_result.py +125 -0
  35. rapidata/api_client/models/get_compare_workflow_result_overview_small_result.py +114 -0
  36. rapidata/api_client/models/get_simple_workflow_result_overview_result.py +142 -0
  37. rapidata/api_client/models/get_workflow_by_id_result.py +91 -0
  38. rapidata/api_client/models/get_workflow_by_id_result_workflow.py +140 -0
  39. rapidata/api_client/models/get_workflow_progress_result.py +100 -0
  40. rapidata/api_client/models/get_workflow_result_overview_result.py +104 -0
  41. rapidata/api_client/models/i_workflow_model_paged_result.py +105 -0
  42. rapidata/api_client/models/in_progress_rapid_model.py +103 -0
  43. rapidata/api_client/models/labeling_selection.py +2 -2
  44. rapidata/api_client/models/language_user_filter_model.py +2 -2
  45. rapidata/api_client/models/not_started_rapid_model.py +93 -0
  46. rapidata/api_client/models/order_state.py +43 -0
  47. rapidata/api_client/models/query_workflows_model.py +112 -0
  48. rapidata/api_client/models/ranked_datapoint_model.py +95 -0
  49. rapidata/api_client/models/rapid_answer.py +97 -0
  50. rapidata/api_client/models/rapid_answer_result.py +252 -0
  51. rapidata/api_client/models/simple_workflow_get_result_overview_get200_response.py +137 -0
  52. rapidata/api_client/models/simple_workflow_model1.py +140 -0
  53. rapidata/api_client/models/static_selection.py +96 -0
  54. rapidata/api_client/models/user_score_user_filter_model.py +3 -3
  55. rapidata/api_client/models/validation_selection.py +3 -3
  56. rapidata/api_client/models/workflow_state.py +41 -0
  57. rapidata/api_client/rest.py +1 -1
  58. rapidata/api_client_README.md +44 -8
  59. rapidata/rapidata_client/order/rapidata_order_builder.py +2 -1
  60. {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/METADATA +1 -1
  61. {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/RECORD +63 -34
  62. {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/LICENSE +0 -0
  63. {rapidata-0.4.0.dist-info → rapidata-0.4.1.dist-info}/WHEEL +0 -0
@@ -0,0 +1,91 @@
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_workflow_by_id_result_workflow import GetWorkflowByIdResultWorkflow
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetWorkflowByIdResult(BaseModel):
27
+ """
28
+ GetWorkflowByIdResult
29
+ """ # noqa: E501
30
+ workflow: GetWorkflowByIdResultWorkflow
31
+ __properties: ClassVar[List[str]] = ["workflow"]
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 GetWorkflowByIdResult 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 workflow
73
+ if self.workflow:
74
+ _dict['workflow'] = self.workflow.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of GetWorkflowByIdResult from a dict"""
80
+ if obj is None:
81
+ return None
82
+
83
+ if not isinstance(obj, dict):
84
+ return cls.model_validate(obj)
85
+
86
+ _obj = cls.model_validate({
87
+ "workflow": GetWorkflowByIdResultWorkflow.from_dict(obj["workflow"]) if obj.get("workflow") is not None else None
88
+ })
89
+ return _obj
90
+
91
+
@@ -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_model1 import CompareWorkflowModel1
21
+ from rapidata.api_client.models.simple_workflow_model1 import SimpleWorkflowModel1
22
+ from pydantic import StrictStr, Field
23
+ from typing import Union, List, Set, Optional, Dict
24
+ from typing_extensions import Literal, Self
25
+
26
+ GETWORKFLOWBYIDRESULTWORKFLOW_ONE_OF_SCHEMAS = ["CompareWorkflowModel1", "SimpleWorkflowModel1"]
27
+
28
+ class GetWorkflowByIdResultWorkflow(BaseModel):
29
+ """
30
+ GetWorkflowByIdResultWorkflow
31
+ """
32
+ # data type: CompareWorkflowModel1
33
+ oneof_schema_1_validator: Optional[CompareWorkflowModel1] = None
34
+ # data type: SimpleWorkflowModel1
35
+ oneof_schema_2_validator: Optional[SimpleWorkflowModel1] = None
36
+ actual_instance: Optional[Union[CompareWorkflowModel1, SimpleWorkflowModel1]] = None
37
+ one_of_schemas: Set[str] = { "CompareWorkflowModel1", "SimpleWorkflowModel1" }
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 = GetWorkflowByIdResultWorkflow.model_construct()
61
+ error_messages = []
62
+ match = 0
63
+ # validate data type: CompareWorkflowModel1
64
+ if not isinstance(v, CompareWorkflowModel1):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CompareWorkflowModel1`")
66
+ else:
67
+ match += 1
68
+ # validate data type: SimpleWorkflowModel1
69
+ if not isinstance(v, SimpleWorkflowModel1):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SimpleWorkflowModel1`")
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 GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
76
+ elif match == 0:
77
+ # no match
78
+ raise ValueError("No match found when setting `actual_instance` in GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. 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 CompareWorkflowModel1
94
+ try:
95
+ instance.actual_instance = CompareWorkflowModel1.from_json(json_str)
96
+ match += 1
97
+ except (ValidationError, ValueError) as e:
98
+ error_messages.append(str(e))
99
+ # deserialize data into SimpleWorkflowModel1
100
+ try:
101
+ instance.actual_instance = SimpleWorkflowModel1.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 GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. Details: " + ", ".join(error_messages))
109
+ elif match == 0:
110
+ # no match
111
+ raise ValueError("No match found when deserializing the JSON string into GetWorkflowByIdResultWorkflow with oneOf schemas: CompareWorkflowModel1, SimpleWorkflowModel1. 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], CompareWorkflowModel1, SimpleWorkflowModel1]]:
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
+
@@ -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, Field, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetWorkflowProgressResult(BaseModel):
26
+ """
27
+ GetWorkflowProgressResult
28
+ """ # noqa: E501
29
+ completion_percentage: Union[StrictFloat, StrictInt] = Field(alias="completionPercentage")
30
+ total: StrictInt
31
+ completed: StrictInt
32
+ state: StrictStr
33
+ __properties: ClassVar[List[str]] = ["completionPercentage", "total", "completed", "state"]
34
+
35
+ @field_validator('state')
36
+ def state_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed']):
39
+ raise ValueError("must be one of enum values ('Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of GetWorkflowProgressResult from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ """
73
+ excluded_fields: Set[str] = set([
74
+ ])
75
+
76
+ _dict = self.model_dump(
77
+ by_alias=True,
78
+ exclude=excluded_fields,
79
+ exclude_none=True,
80
+ )
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of GetWorkflowProgressResult from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "completionPercentage": obj.get("completionPercentage"),
94
+ "total": obj.get("total"),
95
+ "completed": obj.get("completed"),
96
+ "state": obj.get("state")
97
+ })
98
+ return _obj
99
+
100
+
@@ -0,0 +1,104 @@
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 typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GetWorkflowResultOverviewResult(BaseModel):
27
+ """
28
+ GetWorkflowResultOverviewResult
29
+ """ # noqa: E501
30
+ result_type: Optional[StrictStr] = Field(default=None, alias="resultType")
31
+ state: StrictStr
32
+ progress: GetWorkflowProgressResult
33
+ __properties: ClassVar[List[str]] = ["resultType", "state", "progress"]
34
+
35
+ @field_validator('state')
36
+ def state_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed']):
39
+ raise ValueError("must be one of enum values ('Created', 'Started', 'Labeling', 'Paused', 'Done', 'Failed')")
40
+ return value
41
+
42
+ model_config = ConfigDict(
43
+ populate_by_name=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
56
+ return json.dumps(self.to_dict())
57
+
58
+ @classmethod
59
+ def from_json(cls, json_str: str) -> Optional[Self]:
60
+ """Create an instance of GetWorkflowResultOverviewResult from a JSON string"""
61
+ return cls.from_dict(json.loads(json_str))
62
+
63
+ def to_dict(self) -> Dict[str, Any]:
64
+ """Return the dictionary representation of the model using alias.
65
+
66
+ This has the following differences from calling pydantic's
67
+ `self.model_dump(by_alias=True)`:
68
+
69
+ * `None` is only added to the output dict for nullable fields that
70
+ were set at model initialization. Other fields with value `None`
71
+ are ignored.
72
+ * OpenAPI `readOnly` fields are excluded.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ "result_type",
76
+ ])
77
+
78
+ _dict = self.model_dump(
79
+ by_alias=True,
80
+ exclude=excluded_fields,
81
+ exclude_none=True,
82
+ )
83
+ # override the default output from pydantic by calling `to_dict()` of progress
84
+ if self.progress:
85
+ _dict['progress'] = self.progress.to_dict()
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of GetWorkflowResultOverviewResult from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate({
98
+ "resultType": obj.get("resultType"),
99
+ "state": obj.get("state"),
100
+ "progress": GetWorkflowProgressResult.from_dict(obj["progress"]) if obj.get("progress") is not None else None
101
+ })
102
+ return _obj
103
+
104
+
@@ -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_workflow_by_id_result_workflow import GetWorkflowByIdResultWorkflow
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class IWorkflowModelPagedResult(BaseModel):
27
+ """
28
+ IWorkflowModelPagedResult
29
+ """ # noqa: E501
30
+ total: StrictInt
31
+ page: StrictInt
32
+ page_size: StrictInt = Field(alias="pageSize")
33
+ items: List[GetWorkflowByIdResultWorkflow]
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 IWorkflowModelPagedResult 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 IWorkflowModelPagedResult 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": [GetWorkflowByIdResultWorkflow.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
+
@@ -0,0 +1,103 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Rapidata.Dataset
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from rapidata.api_client.models.datapoint_model_asset import DatapointModelAsset
23
+ from rapidata.api_client.models.rapid_answer import RapidAnswer
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class InProgressRapidModel(BaseModel):
28
+ """
29
+ InProgressRapidModel
30
+ """ # noqa: E501
31
+ rapid_id: StrictStr = Field(alias="rapidId")
32
+ asset: DatapointModelAsset
33
+ answers: List[RapidAnswer]
34
+ __properties: ClassVar[List[str]] = ["rapidId", "asset", "answers"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of InProgressRapidModel from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of asset
76
+ if self.asset:
77
+ _dict['asset'] = self.asset.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of each item in answers (list)
79
+ _items = []
80
+ if self.answers:
81
+ for _item_answers in self.answers:
82
+ if _item_answers:
83
+ _items.append(_item_answers.to_dict())
84
+ _dict['answers'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of InProgressRapidModel from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "rapidId": obj.get("rapidId"),
98
+ "asset": DatapointModelAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
99
+ "answers": [RapidAnswer.from_dict(_item) for _item in obj["answers"]] if obj.get("answers") is not None else None
100
+ })
101
+ return _obj
102
+
103
+
@@ -24,10 +24,10 @@ from typing_extensions import Self
24
24
 
25
25
  class LabelingSelection(BaseModel):
26
26
  """
27
- The labeling selection has to be supplied so that the users will be shown the actual labeling tasks
27
+ LabelingSelection
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for LabelingSelection", alias="_t")
30
- amount: StrictInt = Field(description="The amount of labeling tasks that should be shown to the user.")
30
+ amount: StrictInt
31
31
  __properties: ClassVar[List[str]] = ["_t", "amount"]
32
32
 
33
33
  @field_validator('t')
@@ -24,10 +24,10 @@ from typing_extensions import Self
24
24
 
25
25
  class LanguageUserFilterModel(BaseModel):
26
26
  """
27
- The LanguageFilter is used to restrict users to specific languages.
27
+ LanguageUserFilterModel
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for LanguageFilter", alias="_t")
30
- languages: List[StrictStr] = Field(description="A whitelist for languages of the users. The languages are in the ISO 639-1 format.")
30
+ languages: List[StrictStr]
31
31
  __properties: ClassVar[List[str]] = ["_t", "languages"]
32
32
 
33
33
  @field_validator('t')