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
@@ -0,0 +1,96 @@
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 StaticSelection(BaseModel):
26
+ """
27
+ StaticSelection
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for StaticSelection", alias="_t")
30
+ rapid_ids: List[StrictStr] = Field(alias="rapidIds")
31
+ __properties: ClassVar[List[str]] = ["_t", "rapidIds"]
32
+
33
+ @field_validator('t')
34
+ def t_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set(['StaticSelection']):
37
+ raise ValueError("must be one of enum values ('StaticSelection')")
38
+ return value
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of StaticSelection from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of StaticSelection 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
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'StaticSelection',
92
+ "rapidIds": obj.get("rapidIds")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,107 @@
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, Optional
22
+ from rapidata.api_client.models.update_workflow_config_request_config import UpdateWorkflowConfigRequestConfig
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class UpdateWorkflowConfigRequest(BaseModel):
27
+ """
28
+ A request to update the workflow configuration.
29
+ """ # noqa: E501
30
+ pipeline_id: StrictStr = Field(description="The id of the pipeline to update.", alias="pipelineId")
31
+ artifact_id: Optional[StrictStr] = Field(description="The id of the workflow config artifact to update.", alias="artifactId")
32
+ config: UpdateWorkflowConfigRequestConfig
33
+ campaign_artifact_id: Optional[StrictStr] = Field(default=None, description="The id of the campaign artifact to update.", alias="campaignArtifactId")
34
+ __properties: ClassVar[List[str]] = ["pipelineId", "artifactId", "config", "campaignArtifactId"]
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 UpdateWorkflowConfigRequest 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 config
76
+ if self.config:
77
+ _dict['config'] = self.config.to_dict()
78
+ # set to None if artifact_id (nullable) is None
79
+ # and model_fields_set contains the field
80
+ if self.artifact_id is None and "artifact_id" in self.model_fields_set:
81
+ _dict['artifactId'] = None
82
+
83
+ # set to None if campaign_artifact_id (nullable) is None
84
+ # and model_fields_set contains the field
85
+ if self.campaign_artifact_id is None and "campaign_artifact_id" in self.model_fields_set:
86
+ _dict['campaignArtifactId'] = None
87
+
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of UpdateWorkflowConfigRequest from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "pipelineId": obj.get("pipelineId"),
101
+ "artifactId": obj.get("artifactId"),
102
+ "config": UpdateWorkflowConfigRequestConfig.from_dict(obj["config"]) if obj.get("config") is not None else None,
103
+ "campaignArtifactId": obj.get("campaignArtifactId")
104
+ })
105
+ return _obj
106
+
107
+
@@ -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
+ UPDATEWORKFLOWCONFIGREQUESTCONFIG_ONE_OF_SCHEMAS = ["CompareWorkflowConfigModel", "SimpleWorkflowConfigModel"]
27
+
28
+ class UpdateWorkflowConfigRequestConfig(BaseModel):
29
+ """
30
+ The new workflow configuration.
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 = UpdateWorkflowConfigRequestConfig.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 UpdateWorkflowConfigRequestConfig 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 UpdateWorkflowConfigRequestConfig 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 UpdateWorkflowConfigRequestConfig 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 UpdateWorkflowConfigRequestConfig 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
+
@@ -24,11 +24,11 @@ from typing_extensions import Self
24
24
 
25
25
  class UserScoreUserFilterModel(BaseModel):
26
26
  """
27
- The UserScoreFilter is used to restrict users to a specific user score.
27
+ UserScoreUserFilterModel
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for UserScoreFilter", alias="_t")
30
- lowerbound: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The lowerbound of the user score.")
31
- upperbound: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The upperbound of the user score.")
30
+ lowerbound: Optional[Union[StrictFloat, StrictInt]] = None
31
+ upperbound: Optional[Union[StrictFloat, StrictInt]] = None
32
32
  __properties: ClassVar[List[str]] = ["_t", "lowerbound", "upperbound"]
33
33
 
34
34
  @field_validator('t')
@@ -24,11 +24,11 @@ from typing_extensions import Self
24
24
 
25
25
  class ValidationSelection(BaseModel):
26
26
  """
27
- A validation selection is used to show the validation tasks to the user. note that it is not supported to supply both a validation set id and selection configs.
27
+ ValidationSelection
28
28
  """ # noqa: E501
29
29
  t: StrictStr = Field(description="Discriminator value for ValidationSelection", alias="_t")
30
- amount: StrictInt = Field(description="The amount of validation tasks that should be shown to the user.")
31
- validation_set_id: StrictStr = Field(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")
30
+ amount: StrictInt
31
+ validation_set_id: StrictStr = Field(alias="validationSetId")
32
32
  __properties: ClassVar[List[str]] = ["_t", "amount", "validationSetId"]
33
33
 
34
34
  @field_validator('t')
@@ -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 WorkflowArtifactModel(BaseModel):
26
+ """
27
+ WorkflowArtifactModel
28
+ """ # noqa: E501
29
+ t: StrictStr = Field(description="Discriminator value for WorkflowArtifactModel", alias="_t")
30
+ workflow_id: StrictStr = Field(alias="workflowId")
31
+ identifier: StrictStr
32
+ __properties: ClassVar[List[str]] = ["_t", "workflowId", "identifier"]
33
+
34
+ @field_validator('t')
35
+ def t_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['WorkflowArtifactModel']):
38
+ raise ValueError("must be one of enum values ('WorkflowArtifactModel')")
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 WorkflowArtifactModel 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 WorkflowArtifactModel 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 'WorkflowArtifactModel',
93
+ "workflowId": obj.get("workflowId"),
94
+ "identifier": obj.get("identifier")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,102 @@
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 rapidata.api_client.models.workflow_config_artifact_model_workflow_config import WorkflowConfigArtifactModelWorkflowConfig
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class WorkflowConfigArtifactModel(BaseModel):
27
+ """
28
+ WorkflowConfigArtifactModel
29
+ """ # noqa: E501
30
+ t: StrictStr = Field(description="Discriminator value for WorkflowConfigArtifactModel", alias="_t")
31
+ workflow_config: WorkflowConfigArtifactModelWorkflowConfig = Field(alias="workflowConfig")
32
+ identifier: StrictStr
33
+ __properties: ClassVar[List[str]] = ["_t", "workflowConfig", "identifier"]
34
+
35
+ @field_validator('t')
36
+ def t_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['WorkflowConfigArtifactModel']):
39
+ raise ValueError("must be one of enum values ('WorkflowConfigArtifactModel')")
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 WorkflowConfigArtifactModel 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
+ # override the default output from pydantic by calling `to_dict()` of workflow_config
82
+ if self.workflow_config:
83
+ _dict['workflowConfig'] = self.workflow_config.to_dict()
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of WorkflowConfigArtifactModel from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'WorkflowConfigArtifactModel',
97
+ "workflowConfig": WorkflowConfigArtifactModelWorkflowConfig.from_dict(obj["workflowConfig"]) if obj.get("workflowConfig") is not None else None,
98
+ "identifier": obj.get("identifier")
99
+ })
100
+ return _obj
101
+
102
+