rapidata 0.1.2__py3-none-any.whl → 0.1.5__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 (225) hide show
  1. openapi/openapi-client/openapi_client/__init__.py +215 -0
  2. openapi/openapi-client/openapi_client/api/__init__.py +11 -0
  3. openapi/openapi-client/openapi_client/api/coco_api.py +619 -0
  4. openapi/openapi-client/openapi_client/api/datapoint_api.py +817 -0
  5. openapi/openapi-client/openapi_client/api/dataset_api.py +2290 -0
  6. openapi/openapi-client/openapi_client/api/identity_api.py +3181 -0
  7. openapi/openapi-client/openapi_client/api/newsletter_api.py +571 -0
  8. openapi/openapi-client/openapi_client/api/order_api.py +5390 -0
  9. openapi/openapi-client/openapi_client/api/validation_api.py +1670 -0
  10. openapi/openapi-client/openapi_client/api_client.py +797 -0
  11. openapi/openapi-client/openapi_client/api_response.py +21 -0
  12. openapi/openapi-client/openapi_client/configuration.py +479 -0
  13. openapi/openapi-client/openapi_client/exceptions.py +199 -0
  14. openapi/openapi-client/openapi_client/models/__init__.py +192 -0
  15. openapi/openapi-client/openapi_client/models/add_validation_rapid_model.py +116 -0
  16. openapi/openapi-client/openapi_client/models/add_validation_rapid_model_payload.py +238 -0
  17. openapi/openapi-client/openapi_client/models/add_validation_rapid_model_truth.py +238 -0
  18. openapi/openapi-client/openapi_client/models/admin_order_model.py +103 -0
  19. openapi/openapi-client/openapi_client/models/admin_order_model_paged_result.py +105 -0
  20. openapi/openapi-client/openapi_client/models/age_group.py +40 -0
  21. openapi/openapi-client/openapi_client/models/age_user_filter_model.py +97 -0
  22. openapi/openapi-client/openapi_client/models/aggregator_type.py +46 -0
  23. openapi/openapi-client/openapi_client/models/attach_category_rapid_blueprint.py +98 -0
  24. openapi/openapi-client/openapi_client/models/attach_category_truth.py +96 -0
  25. openapi/openapi-client/openapi_client/models/base_error.py +90 -0
  26. openapi/openapi-client/openapi_client/models/bounding_box_payload.py +96 -0
  27. openapi/openapi-client/openapi_client/models/bounding_box_rapid_blueprint.py +96 -0
  28. openapi/openapi-client/openapi_client/models/bounding_box_truth.py +102 -0
  29. openapi/openapi-client/openapi_client/models/box_shape.py +122 -0
  30. openapi/openapi-client/openapi_client/models/classification_metadata.py +110 -0
  31. openapi/openapi-client/openapi_client/models/classification_metadata_filter_config.py +96 -0
  32. openapi/openapi-client/openapi_client/models/classify_payload.py +98 -0
  33. openapi/openapi-client/openapi_client/models/clone_dataset_model.py +98 -0
  34. openapi/openapi-client/openapi_client/models/clone_order_model.py +89 -0
  35. openapi/openapi-client/openapi_client/models/clone_order_result.py +89 -0
  36. openapi/openapi-client/openapi_client/models/compare_payload.py +96 -0
  37. openapi/openapi-client/openapi_client/models/compare_rapid_blueprint.py +96 -0
  38. openapi/openapi-client/openapi_client/models/compare_truth.py +96 -0
  39. openapi/openapi-client/openapi_client/models/compare_workflow_config.py +143 -0
  40. openapi/openapi-client/openapi_client/models/compare_workflow_config_rapid_selection_configs_inner.py +210 -0
  41. openapi/openapi-client/openapi_client/models/compare_workflow_config_referee.py +154 -0
  42. openapi/openapi-client/openapi_client/models/compare_workflow_model.py +106 -0
  43. openapi/openapi-client/openapi_client/models/conditional_validation_rapid_selection_config.py +113 -0
  44. openapi/openapi-client/openapi_client/models/correlated_rapid_selection_config.py +98 -0
  45. openapi/openapi-client/openapi_client/models/count_classification_metadata_filter_config.py +94 -0
  46. openapi/openapi-client/openapi_client/models/count_metadata.py +110 -0
  47. openapi/openapi-client/openapi_client/models/country_user_filter_model.py +96 -0
  48. openapi/openapi-client/openapi_client/models/create_client_model.py +89 -0
  49. openapi/openapi-client/openapi_client/models/create_complex_order_model.py +95 -0
  50. openapi/openapi-client/openapi_client/models/create_complex_order_model_pipeline.py +126 -0
  51. openapi/openapi-client/openapi_client/models/create_complex_order_result.py +96 -0
  52. openapi/openapi-client/openapi_client/models/create_dataset_artifact_model.py +102 -0
  53. openapi/openapi-client/openapi_client/models/create_dataset_artifact_model_dataset.py +126 -0
  54. openapi/openapi-client/openapi_client/models/create_default_order_model.py +109 -0
  55. openapi/openapi-client/openapi_client/models/create_default_order_model_workflow_config.py +140 -0
  56. openapi/openapi-client/openapi_client/models/create_empty_validation_set_result.py +87 -0
  57. openapi/openapi-client/openapi_client/models/create_legacy_order_result.py +89 -0
  58. openapi/openapi-client/openapi_client/models/create_order_model.py +163 -0
  59. openapi/openapi-client/openapi_client/models/create_order_model_referee.py +126 -0
  60. openapi/openapi-client/openapi_client/models/create_order_model_selections_inner.py +154 -0
  61. openapi/openapi-client/openapi_client/models/create_order_model_user_filters_inner.py +154 -0
  62. openapi/openapi-client/openapi_client/models/create_order_model_workflow.py +140 -0
  63. openapi/openapi-client/openapi_client/models/create_order_result.py +96 -0
  64. openapi/openapi-client/openapi_client/models/create_simple_pipeline_model.py +116 -0
  65. openapi/openapi-client/openapi_client/models/create_simple_pipeline_model_artifacts_inner.py +126 -0
  66. openapi/openapi-client/openapi_client/models/create_simple_pipeline_model_pipeline_steps_inner.py +182 -0
  67. openapi/openapi-client/openapi_client/models/create_unsupported_order_model.py +91 -0
  68. openapi/openapi-client/openapi_client/models/customer_order_model.py +101 -0
  69. openapi/openapi-client/openapi_client/models/customer_order_model_paged_result.py +105 -0
  70. openapi/openapi-client/openapi_client/models/datapoint.py +121 -0
  71. openapi/openapi-client/openapi_client/models/datapoint_asset.py +170 -0
  72. openapi/openapi-client/openapi_client/models/datapoint_get_by_id_get200_response.py +126 -0
  73. openapi/openapi-client/openapi_client/models/datapoint_metadata_model.py +97 -0
  74. openapi/openapi-client/openapi_client/models/datapoint_metadata_model_metadata_inner.py +168 -0
  75. openapi/openapi-client/openapi_client/models/datapoint_model.py +95 -0
  76. openapi/openapi-client/openapi_client/models/datapoint_model_asset.py +170 -0
  77. openapi/openapi-client/openapi_client/models/dataset_evaluation_step_model.py +102 -0
  78. openapi/openapi-client/openapi_client/models/demographic_rapid_selection_config.py +96 -0
  79. openapi/openapi-client/openapi_client/models/demographic_selection.py +96 -0
  80. openapi/openapi-client/openapi_client/models/empty_validation_truth.py +94 -0
  81. openapi/openapi-client/openapi_client/models/error_type.py +40 -0
  82. openapi/openapi-client/openapi_client/models/feature_flag.py +89 -0
  83. openapi/openapi-client/openapi_client/models/feature_flag_model.py +89 -0
  84. openapi/openapi-client/openapi_client/models/feedback_model.py +94 -0
  85. openapi/openapi-client/openapi_client/models/file_asset.py +108 -0
  86. openapi/openapi-client/openapi_client/models/file_asset_metadata_inner.py +224 -0
  87. openapi/openapi-client/openapi_client/models/file_asset_model.py +108 -0
  88. openapi/openapi-client/openapi_client/models/filter.py +134 -0
  89. openapi/openapi-client/openapi_client/models/filter_operator.py +44 -0
  90. openapi/openapi-client/openapi_client/models/free_text_payload.py +96 -0
  91. openapi/openapi-client/openapi_client/models/free_text_rapid_blueprint.py +96 -0
  92. openapi/openapi-client/openapi_client/models/gender.py +38 -0
  93. openapi/openapi-client/openapi_client/models/gender_user_filter_model.py +97 -0
  94. openapi/openapi-client/openapi_client/models/get_available_validation_sets_result.py +95 -0
  95. openapi/openapi-client/openapi_client/models/get_datapoints_by_dataset_id_result.py +95 -0
  96. openapi/openapi-client/openapi_client/models/get_dataset_by_id_result.py +87 -0
  97. openapi/openapi-client/openapi_client/models/get_order_by_id_result.py +98 -0
  98. openapi/openapi-client/openapi_client/models/get_order_results_result.py +91 -0
  99. openapi/openapi-client/openapi_client/models/get_public_orders_result.py +95 -0
  100. openapi/openapi-client/openapi_client/models/get_workflow_config_result.py +91 -0
  101. openapi/openapi-client/openapi_client/models/get_workflow_config_result_workflow_config.py +140 -0
  102. openapi/openapi-client/openapi_client/models/image_dimension_metadata.py +112 -0
  103. openapi/openapi-client/openapi_client/models/import_from_file_result.py +87 -0
  104. openapi/openapi-client/openapi_client/models/import_validation_set_from_file_result.py +87 -0
  105. openapi/openapi-client/openapi_client/models/issue_auth_token_result.py +87 -0
  106. openapi/openapi-client/openapi_client/models/issue_client_auth_token_result.py +87 -0
  107. openapi/openapi-client/openapi_client/models/labeling_selection.py +96 -0
  108. openapi/openapi-client/openapi_client/models/line_payload.py +96 -0
  109. openapi/openapi-client/openapi_client/models/line_rapid_blueprint.py +96 -0
  110. openapi/openapi-client/openapi_client/models/line_truth.py +94 -0
  111. openapi/openapi-client/openapi_client/models/locate_box_truth.py +104 -0
  112. openapi/openapi-client/openapi_client/models/locate_payload.py +96 -0
  113. openapi/openapi-client/openapi_client/models/locate_rapid_blueprint.py +96 -0
  114. openapi/openapi-client/openapi_client/models/location_metadata.py +112 -0
  115. openapi/openapi-client/openapi_client/models/location_metadata_exists_filter_config.py +94 -0
  116. openapi/openapi-client/openapi_client/models/logic_operator.py +37 -0
  117. openapi/openapi-client/openapi_client/models/login_model.py +89 -0
  118. openapi/openapi-client/openapi_client/models/metadata_visibilities.py +40 -0
  119. openapi/openapi-client/openapi_client/models/multi_asset.py +116 -0
  120. openapi/openapi-client/openapi_client/models/multi_asset_model.py +118 -0
  121. openapi/openapi-client/openapi_client/models/naive_referee_config.py +96 -0
  122. openapi/openapi-client/openapi_client/models/naive_referee_model.py +96 -0
  123. openapi/openapi-client/openapi_client/models/named_classification.py +100 -0
  124. openapi/openapi-client/openapi_client/models/named_entity_payload.py +98 -0
  125. openapi/openapi-client/openapi_client/models/named_entity_rapid_blueprint.py +98 -0
  126. openapi/openapi-client/openapi_client/models/named_entity_truth.py +104 -0
  127. openapi/openapi-client/openapi_client/models/never_ending_referee_config.py +94 -0
  128. openapi/openapi-client/openapi_client/models/newsletter_model.py +89 -0
  129. openapi/openapi-client/openapi_client/models/no_validation_workflow_rapid_selection_config.py +101 -0
  130. openapi/openapi-client/openapi_client/models/null_asset.py +104 -0
  131. openapi/openapi-client/openapi_client/models/null_asset_model.py +106 -0
  132. openapi/openapi-client/openapi_client/models/only_validation_workflow_rapid_selection_config.py +96 -0
  133. openapi/openapi-client/openapi_client/models/order_model.py +91 -0
  134. openapi/openapi-client/openapi_client/models/order_query_get200_response.py +137 -0
  135. openapi/openapi-client/openapi_client/models/original_filename_metadata.py +110 -0
  136. openapi/openapi-client/openapi_client/models/page_info.py +94 -0
  137. openapi/openapi-client/openapi_client/models/polygon_payload.py +96 -0
  138. openapi/openapi-client/openapi_client/models/polygon_rapid_blueprint.py +96 -0
  139. openapi/openapi-client/openapi_client/models/polygon_truth.py +94 -0
  140. openapi/openapi-client/openapi_client/models/private_text_metadata_input.py +98 -0
  141. openapi/openapi-client/openapi_client/models/probabilistic_attach_category_referee_config.py +98 -0
  142. openapi/openapi-client/openapi_client/models/prompt_metadata.py +110 -0
  143. openapi/openapi-client/openapi_client/models/prompt_metadata_input.py +98 -0
  144. openapi/openapi-client/openapi_client/models/public_text_metadata_input.py +98 -0
  145. openapi/openapi-client/openapi_client/models/query_orders_model.py +112 -0
  146. openapi/openapi-client/openapi_client/models/query_validation_set_model.py +112 -0
  147. openapi/openapi-client/openapi_client/models/request_password_reset_command.py +98 -0
  148. openapi/openapi-client/openapi_client/models/root_filter.py +107 -0
  149. openapi/openapi-client/openapi_client/models/send_completion_mail_step_model.py +98 -0
  150. openapi/openapi-client/openapi_client/models/signup_customer_model.py +93 -0
  151. openapi/openapi-client/openapi_client/models/signup_shadow_customer_model.py +87 -0
  152. openapi/openapi-client/openapi_client/models/simple_workflow_config.py +137 -0
  153. openapi/openapi-client/openapi_client/models/simple_workflow_config_blueprint.py +238 -0
  154. openapi/openapi-client/openapi_client/models/simple_workflow_model.py +100 -0
  155. openapi/openapi-client/openapi_client/models/simple_workflow_model_blueprint.py +238 -0
  156. openapi/openapi-client/openapi_client/models/sort_criterion.py +96 -0
  157. openapi/openapi-client/openapi_client/models/sort_direction.py +37 -0
  158. openapi/openapi-client/openapi_client/models/static_rapid_selection_config.py +96 -0
  159. openapi/openapi-client/openapi_client/models/submit_coco_model.py +91 -0
  160. openapi/openapi-client/openapi_client/models/submit_coco_result.py +87 -0
  161. openapi/openapi-client/openapi_client/models/submit_password_reset_command.py +102 -0
  162. openapi/openapi-client/openapi_client/models/text_asset.py +106 -0
  163. openapi/openapi-client/openapi_client/models/text_asset_model.py +108 -0
  164. openapi/openapi-client/openapi_client/models/text_metadata.py +107 -0
  165. openapi/openapi-client/openapi_client/models/transcription_metadata.py +107 -0
  166. openapi/openapi-client/openapi_client/models/transcription_metadata_input.py +98 -0
  167. openapi/openapi-client/openapi_client/models/transcription_payload.py +106 -0
  168. openapi/openapi-client/openapi_client/models/transcription_rapid_blueprint.py +96 -0
  169. openapi/openapi-client/openapi_client/models/transcription_truth.py +106 -0
  170. openapi/openapi-client/openapi_client/models/transcription_word.py +89 -0
  171. openapi/openapi-client/openapi_client/models/unlock_order_result.py +87 -0
  172. openapi/openapi-client/openapi_client/models/update_access_model.py +87 -0
  173. openapi/openapi-client/openapi_client/models/update_order_model.py +87 -0
  174. openapi/openapi-client/openapi_client/models/update_workflow_config_model.py +100 -0
  175. openapi/openapi-client/openapi_client/models/update_workflow_config_model_workflow_config.py +140 -0
  176. openapi/openapi-client/openapi_client/models/upload_coco_result.py +91 -0
  177. openapi/openapi-client/openapi_client/models/upload_datapoints_result.py +97 -0
  178. openapi/openapi-client/openapi_client/models/upload_files_from_s3_bucket_model.py +116 -0
  179. openapi/openapi-client/openapi_client/models/upload_text_sources_to_dataset_model.py +89 -0
  180. openapi/openapi-client/openapi_client/models/validation_chance.py +91 -0
  181. openapi/openapi-client/openapi_client/models/validation_import_post_request_blueprint.py +238 -0
  182. openapi/openapi-client/openapi_client/models/validation_rapid_selection_config.py +98 -0
  183. openapi/openapi-client/openapi_client/models/validation_selection.py +98 -0
  184. openapi/openapi-client/openapi_client/models/validation_set.py +105 -0
  185. openapi/openapi-client/openapi_client/models/validation_set_overview_model.py +91 -0
  186. openapi/openapi-client/openapi_client/models/validation_set_paged_result.py +105 -0
  187. openapi/openapi-client/openapi_client/models/workflow_aggregation_step_model.py +112 -0
  188. openapi/openapi-client/openapi_client/models/workflow_labeling_step_model.py +96 -0
  189. openapi/openapi-client/openapi_client/models/workflow_split_model.py +110 -0
  190. openapi/openapi-client/openapi_client/models/workflow_split_model_filter_configs_inner.py +154 -0
  191. openapi/openapi-client/openapi_client/rest.py +257 -0
  192. rapidata/rapidata_client/{workflow/feature_flags → feature_flags}/feature_flags.py +5 -3
  193. rapidata/rapidata_client/metadata/__init__.py +0 -0
  194. rapidata/rapidata_client/metadata/base_metadata.py +12 -0
  195. rapidata/rapidata_client/metadata/transcription_metadata.py +19 -0
  196. rapidata/rapidata_client/order/dataset/rapidata_dataset.py +42 -16
  197. rapidata/rapidata_client/order/dataset/validation_set_builder.py +187 -0
  198. rapidata/rapidata_client/order/rapidata_order.py +49 -23
  199. rapidata/rapidata_client/order/rapidata_order_builder.py +126 -8
  200. rapidata/rapidata_client/rapidata_client.py +17 -5
  201. rapidata/rapidata_client/{workflow/referee → referee}/base_referee.py +8 -2
  202. rapidata/rapidata_client/{workflow/referee → referee}/classify_early_stopping_referee.py +1 -1
  203. rapidata/rapidata_client/{workflow/referee → referee}/naive_referee.py +5 -1
  204. rapidata/rapidata_client/workflow/__init__.py +0 -2
  205. rapidata/rapidata_client/workflow/base_workflow.py +9 -5
  206. rapidata/rapidata_client/workflow/classify_workflow.py +18 -3
  207. rapidata/rapidata_client/workflow/compare_workflow.py +13 -14
  208. rapidata/rapidata_client/workflow/free_text_workflow.py +14 -0
  209. rapidata/rapidata_client/workflow/transcription_workflow.py +22 -0
  210. rapidata/service/__init__.py +0 -1
  211. rapidata/service/openapi_service.py +43 -0
  212. {rapidata-0.1.2.dist-info → rapidata-0.1.5.dist-info}/METADATA +1 -1
  213. rapidata-0.1.5.dist-info/RECORD +227 -0
  214. rapidata/service/rapidata_api_services/base_service.py +0 -76
  215. rapidata/service/rapidata_api_services/dataset_service.py +0 -82
  216. rapidata/service/rapidata_api_services/order_service.py +0 -49
  217. rapidata/service/rapidata_api_services/rapidata_service.py +0 -18
  218. rapidata-0.1.2.dist-info/RECORD +0 -34
  219. /rapidata/service/rapidata_api_services/__init__.py → /openapi/openapi-client/openapi_client/py.typed +0 -0
  220. /rapidata/rapidata_client/{workflow/country_codes → country_codes}/__init__.py +0 -0
  221. /rapidata/rapidata_client/{workflow/country_codes → country_codes}/country_codes.py +0 -0
  222. /rapidata/rapidata_client/{workflow/feature_flags → feature_flags}/__init__.py +0 -0
  223. /rapidata/rapidata_client/{workflow/referee → referee}/__init__.py +0 -0
  224. {rapidata-0.1.2.dist-info → rapidata-0.1.5.dist-info}/LICENSE +0 -0
  225. {rapidata-0.1.2.dist-info → rapidata-0.1.5.dist-info}/WHEEL +0 -0
@@ -0,0 +1,121 @@
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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from openapi_client.models.datapoint_asset import DatapointAsset
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class Datapoint(BaseModel):
28
+ """
29
+ Datapoint
30
+ """ # noqa: E501
31
+ t: StrictStr = Field(description="Discriminator value for Datapoint", alias="_t")
32
+ asset: DatapointAsset
33
+ dataset_id: StrictStr = Field(alias="datasetId")
34
+ id: Optional[StrictStr] = None
35
+ deletion_date: Optional[datetime] = Field(default=None, alias="deletionDate")
36
+ deleter_id: Optional[StrictStr] = Field(default=None, alias="deleterId")
37
+ created_at: Optional[datetime] = Field(default=None, alias="createdAt")
38
+ __properties: ClassVar[List[str]] = ["_t", "asset", "datasetId", "id", "deletionDate", "deleterId", "createdAt"]
39
+
40
+ @field_validator('t')
41
+ def t_validate_enum(cls, value):
42
+ """Validates the enum"""
43
+ if value not in set(['Datapoint']):
44
+ raise ValueError("must be one of enum values ('Datapoint')")
45
+ return value
46
+
47
+ model_config = ConfigDict(
48
+ populate_by_name=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> Optional[Self]:
65
+ """Create an instance of Datapoint from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self) -> Dict[str, Any]:
69
+ """Return the dictionary representation of the model using alias.
70
+
71
+ This has the following differences from calling pydantic's
72
+ `self.model_dump(by_alias=True)`:
73
+
74
+ * `None` is only added to the output dict for nullable fields that
75
+ were set at model initialization. Other fields with value `None`
76
+ are ignored.
77
+ """
78
+ excluded_fields: Set[str] = set([
79
+ ])
80
+
81
+ _dict = self.model_dump(
82
+ by_alias=True,
83
+ exclude=excluded_fields,
84
+ exclude_none=True,
85
+ )
86
+ # override the default output from pydantic by calling `to_dict()` of asset
87
+ if self.asset:
88
+ _dict['asset'] = self.asset.to_dict()
89
+ # set to None if deletion_date (nullable) is None
90
+ # and model_fields_set contains the field
91
+ if self.deletion_date is None and "deletion_date" in self.model_fields_set:
92
+ _dict['deletionDate'] = None
93
+
94
+ # set to None if deleter_id (nullable) is None
95
+ # and model_fields_set contains the field
96
+ if self.deleter_id is None and "deleter_id" in self.model_fields_set:
97
+ _dict['deleterId'] = None
98
+
99
+ return _dict
100
+
101
+ @classmethod
102
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
103
+ """Create an instance of Datapoint from a dict"""
104
+ if obj is None:
105
+ return None
106
+
107
+ if not isinstance(obj, dict):
108
+ return cls.model_validate(obj)
109
+
110
+ _obj = cls.model_validate({
111
+ "_t": obj.get("_t") if obj.get("_t") is not None else 'Datapoint',
112
+ "asset": DatapointAsset.from_dict(obj["asset"]) if obj.get("asset") is not None else None,
113
+ "datasetId": obj.get("datasetId"),
114
+ "id": obj.get("id"),
115
+ "deletionDate": obj.get("deletionDate"),
116
+ "deleterId": obj.get("deleterId"),
117
+ "createdAt": obj.get("createdAt")
118
+ })
119
+ return _obj
120
+
121
+
@@ -0,0 +1,170 @@
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 openapi_client.models.file_asset import FileAsset
21
+ from openapi_client.models.null_asset import NullAsset
22
+ from openapi_client.models.text_asset import TextAsset
23
+ from pydantic import StrictStr, Field
24
+ from typing import Union, List, Set, Optional, Dict
25
+ from typing_extensions import Literal, Self
26
+
27
+ DATAPOINTASSET_ONE_OF_SCHEMAS = ["FileAsset", "MultiAsset", "NullAsset", "TextAsset"]
28
+
29
+ class DatapointAsset(BaseModel):
30
+ """
31
+ DatapointAsset
32
+ """
33
+ # data type: FileAsset
34
+ oneof_schema_1_validator: Optional[FileAsset] = None
35
+ # data type: MultiAsset
36
+ oneof_schema_2_validator: Optional[MultiAsset] = None
37
+ # data type: NullAsset
38
+ oneof_schema_3_validator: Optional[NullAsset] = None
39
+ # data type: TextAsset
40
+ oneof_schema_4_validator: Optional[TextAsset] = None
41
+ actual_instance: Optional[Union[FileAsset, MultiAsset, NullAsset, TextAsset]] = None
42
+ one_of_schemas: Set[str] = { "FileAsset", "MultiAsset", "NullAsset", "TextAsset" }
43
+
44
+ model_config = ConfigDict(
45
+ validate_assignment=True,
46
+ protected_namespaces=(),
47
+ )
48
+
49
+
50
+ discriminator_value_class_map: Dict[str, str] = {
51
+ }
52
+
53
+ def __init__(self, *args, **kwargs) -> None:
54
+ if args:
55
+ if len(args) > 1:
56
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
57
+ if kwargs:
58
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
59
+ super().__init__(actual_instance=args[0])
60
+ else:
61
+ super().__init__(**kwargs)
62
+
63
+ @field_validator('actual_instance')
64
+ def actual_instance_must_validate_oneof(cls, v):
65
+ instance = DatapointAsset.model_construct()
66
+ error_messages = []
67
+ match = 0
68
+ # validate data type: FileAsset
69
+ if not isinstance(v, FileAsset):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `FileAsset`")
71
+ else:
72
+ match += 1
73
+ # validate data type: MultiAsset
74
+ if not isinstance(v, MultiAsset):
75
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MultiAsset`")
76
+ else:
77
+ match += 1
78
+ # validate data type: NullAsset
79
+ if not isinstance(v, NullAsset):
80
+ error_messages.append(f"Error! Input type `{type(v)}` is not `NullAsset`")
81
+ else:
82
+ match += 1
83
+ # validate data type: TextAsset
84
+ if not isinstance(v, TextAsset):
85
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TextAsset`")
86
+ else:
87
+ match += 1
88
+ if match > 1:
89
+ # more than 1 match
90
+ raise ValueError("Multiple matches found when setting `actual_instance` in DatapointAsset with oneOf schemas: FileAsset, MultiAsset, NullAsset, TextAsset. Details: " + ", ".join(error_messages))
91
+ elif match == 0:
92
+ # no match
93
+ raise ValueError("No match found when setting `actual_instance` in DatapointAsset with oneOf schemas: FileAsset, MultiAsset, NullAsset, TextAsset. Details: " + ", ".join(error_messages))
94
+ else:
95
+ return v
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
99
+ return cls.from_json(json.dumps(obj))
100
+
101
+ @classmethod
102
+ def from_json(cls, json_str: str) -> Self:
103
+ """Returns the object represented by the json string"""
104
+ instance = cls.model_construct()
105
+ error_messages = []
106
+ match = 0
107
+
108
+ # deserialize data into FileAsset
109
+ try:
110
+ instance.actual_instance = FileAsset.from_json(json_str)
111
+ match += 1
112
+ except (ValidationError, ValueError) as e:
113
+ error_messages.append(str(e))
114
+ # deserialize data into MultiAsset
115
+ try:
116
+ instance.actual_instance = MultiAsset.from_json(json_str)
117
+ match += 1
118
+ except (ValidationError, ValueError) as e:
119
+ error_messages.append(str(e))
120
+ # deserialize data into NullAsset
121
+ try:
122
+ instance.actual_instance = NullAsset.from_json(json_str)
123
+ match += 1
124
+ except (ValidationError, ValueError) as e:
125
+ error_messages.append(str(e))
126
+ # deserialize data into TextAsset
127
+ try:
128
+ instance.actual_instance = TextAsset.from_json(json_str)
129
+ match += 1
130
+ except (ValidationError, ValueError) as e:
131
+ error_messages.append(str(e))
132
+
133
+ if match > 1:
134
+ # more than 1 match
135
+ raise ValueError("Multiple matches found when deserializing the JSON string into DatapointAsset with oneOf schemas: FileAsset, MultiAsset, NullAsset, TextAsset. Details: " + ", ".join(error_messages))
136
+ elif match == 0:
137
+ # no match
138
+ raise ValueError("No match found when deserializing the JSON string into DatapointAsset with oneOf schemas: FileAsset, MultiAsset, NullAsset, TextAsset. Details: " + ", ".join(error_messages))
139
+ else:
140
+ return instance
141
+
142
+ def to_json(self) -> str:
143
+ """Returns the JSON representation of the actual instance"""
144
+ if self.actual_instance is None:
145
+ return "null"
146
+
147
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
148
+ return self.actual_instance.to_json()
149
+ else:
150
+ return json.dumps(self.actual_instance)
151
+
152
+ def to_dict(self) -> Optional[Union[Dict[str, Any], FileAsset, MultiAsset, NullAsset, TextAsset]]:
153
+ """Returns the dict representation of the actual instance"""
154
+ if self.actual_instance is None:
155
+ return None
156
+
157
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
158
+ return self.actual_instance.to_dict()
159
+ else:
160
+ # primitive type
161
+ return self.actual_instance
162
+
163
+ def to_str(self) -> str:
164
+ """Returns the string representation of the actual instance"""
165
+ return pprint.pformat(self.model_dump())
166
+
167
+ from openapi_client.models.multi_asset import MultiAsset
168
+ # TODO: Rewrite to not use raise_errors
169
+ DatapointAsset.model_rebuild(raise_errors=False)
170
+
@@ -0,0 +1,126 @@
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 openapi_client.models.datapoint import Datapoint
21
+ from pydantic import StrictStr, Field
22
+ from typing import Union, List, Set, Optional, Dict
23
+ from typing_extensions import Literal, Self
24
+
25
+ DATAPOINTGETBYIDGET200RESPONSE_ONE_OF_SCHEMAS = ["Datapoint"]
26
+
27
+ class DatapointGetByIdGet200Response(BaseModel):
28
+ """
29
+ DatapointGetByIdGet200Response
30
+ """
31
+ # data type: Datapoint
32
+ oneof_schema_1_validator: Optional[Datapoint] = None
33
+ actual_instance: Optional[Union[Datapoint]] = None
34
+ one_of_schemas: Set[str] = { "Datapoint" }
35
+
36
+ model_config = ConfigDict(
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ discriminator_value_class_map: Dict[str, str] = {
43
+ }
44
+
45
+ def __init__(self, *args, **kwargs) -> None:
46
+ if args:
47
+ if len(args) > 1:
48
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
49
+ if kwargs:
50
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
51
+ super().__init__(actual_instance=args[0])
52
+ else:
53
+ super().__init__(**kwargs)
54
+
55
+ @field_validator('actual_instance')
56
+ def actual_instance_must_validate_oneof(cls, v):
57
+ instance = DatapointGetByIdGet200Response.model_construct()
58
+ error_messages = []
59
+ match = 0
60
+ # validate data type: Datapoint
61
+ if not isinstance(v, Datapoint):
62
+ error_messages.append(f"Error! Input type `{type(v)}` is not `Datapoint`")
63
+ else:
64
+ match += 1
65
+ if match > 1:
66
+ # more than 1 match
67
+ raise ValueError("Multiple matches found when setting `actual_instance` in DatapointGetByIdGet200Response with oneOf schemas: Datapoint. Details: " + ", ".join(error_messages))
68
+ elif match == 0:
69
+ # no match
70
+ raise ValueError("No match found when setting `actual_instance` in DatapointGetByIdGet200Response with oneOf schemas: Datapoint. Details: " + ", ".join(error_messages))
71
+ else:
72
+ return v
73
+
74
+ @classmethod
75
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
76
+ return cls.from_json(json.dumps(obj))
77
+
78
+ @classmethod
79
+ def from_json(cls, json_str: str) -> Self:
80
+ """Returns the object represented by the json string"""
81
+ instance = cls.model_construct()
82
+ error_messages = []
83
+ match = 0
84
+
85
+ # deserialize data into Datapoint
86
+ try:
87
+ instance.actual_instance = Datapoint.from_json(json_str)
88
+ match += 1
89
+ except (ValidationError, ValueError) as e:
90
+ error_messages.append(str(e))
91
+
92
+ if match > 1:
93
+ # more than 1 match
94
+ raise ValueError("Multiple matches found when deserializing the JSON string into DatapointGetByIdGet200Response with oneOf schemas: Datapoint. Details: " + ", ".join(error_messages))
95
+ elif match == 0:
96
+ # no match
97
+ raise ValueError("No match found when deserializing the JSON string into DatapointGetByIdGet200Response with oneOf schemas: Datapoint. Details: " + ", ".join(error_messages))
98
+ else:
99
+ return instance
100
+
101
+ def to_json(self) -> str:
102
+ """Returns the JSON representation of the actual instance"""
103
+ if self.actual_instance is None:
104
+ return "null"
105
+
106
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
107
+ return self.actual_instance.to_json()
108
+ else:
109
+ return json.dumps(self.actual_instance)
110
+
111
+ def to_dict(self) -> Optional[Union[Dict[str, Any], Datapoint]]:
112
+ """Returns the dict representation of the actual instance"""
113
+ if self.actual_instance is None:
114
+ return None
115
+
116
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
117
+ return self.actual_instance.to_dict()
118
+ else:
119
+ # primitive type
120
+ return self.actual_instance
121
+
122
+ def to_str(self) -> str:
123
+ """Returns the string representation of the actual instance"""
124
+ return pprint.pformat(self.model_dump())
125
+
126
+
@@ -0,0 +1,97 @@
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 openapi_client.models.datapoint_metadata_model_metadata_inner import DatapointMetadataModelMetadataInner
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class DatapointMetadataModel(BaseModel):
27
+ """
28
+ The model for creating a datapoint.
29
+ """ # noqa: E501
30
+ dataset_id: StrictStr = Field(description="The id of the dataset to create the datapoint in.", alias="datasetId")
31
+ metadata: List[DatapointMetadataModelMetadataInner] = Field(description="The metadata of the datapoint.")
32
+ __properties: ClassVar[List[str]] = ["datasetId", "metadata"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of DatapointMetadataModel from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of each item in metadata (list)
74
+ _items = []
75
+ if self.metadata:
76
+ for _item_metadata in self.metadata:
77
+ if _item_metadata:
78
+ _items.append(_item_metadata.to_dict())
79
+ _dict['metadata'] = _items
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of DatapointMetadataModel 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
+ "datasetId": obj.get("datasetId"),
93
+ "metadata": [DatapointMetadataModelMetadataInner.from_dict(_item) for _item in obj["metadata"]] if obj.get("metadata") is not None else None
94
+ })
95
+ return _obj
96
+
97
+
@@ -0,0 +1,168 @@
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 openapi_client.models.private_text_metadata_input import PrivateTextMetadataInput
21
+ from openapi_client.models.prompt_metadata_input import PromptMetadataInput
22
+ from openapi_client.models.public_text_metadata_input import PublicTextMetadataInput
23
+ from openapi_client.models.transcription_metadata_input import TranscriptionMetadataInput
24
+ from pydantic import StrictStr, Field
25
+ from typing import Union, List, Set, Optional, Dict
26
+ from typing_extensions import Literal, Self
27
+
28
+ DATAPOINTMETADATAMODELMETADATAINNER_ONE_OF_SCHEMAS = ["PrivateTextMetadataInput", "PromptMetadataInput", "PublicTextMetadataInput", "TranscriptionMetadataInput"]
29
+
30
+ class DatapointMetadataModelMetadataInner(BaseModel):
31
+ """
32
+ DatapointMetadataModelMetadataInner
33
+ """
34
+ # data type: PrivateTextMetadataInput
35
+ oneof_schema_1_validator: Optional[PrivateTextMetadataInput] = None
36
+ # data type: PromptMetadataInput
37
+ oneof_schema_2_validator: Optional[PromptMetadataInput] = None
38
+ # data type: PublicTextMetadataInput
39
+ oneof_schema_3_validator: Optional[PublicTextMetadataInput] = None
40
+ # data type: TranscriptionMetadataInput
41
+ oneof_schema_4_validator: Optional[TranscriptionMetadataInput] = None
42
+ actual_instance: Optional[Union[PrivateTextMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput]] = None
43
+ one_of_schemas: Set[str] = { "PrivateTextMetadataInput", "PromptMetadataInput", "PublicTextMetadataInput", "TranscriptionMetadataInput" }
44
+
45
+ model_config = ConfigDict(
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ discriminator_value_class_map: Dict[str, str] = {
52
+ }
53
+
54
+ def __init__(self, *args, **kwargs) -> None:
55
+ if args:
56
+ if len(args) > 1:
57
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
58
+ if kwargs:
59
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
60
+ super().__init__(actual_instance=args[0])
61
+ else:
62
+ super().__init__(**kwargs)
63
+
64
+ @field_validator('actual_instance')
65
+ def actual_instance_must_validate_oneof(cls, v):
66
+ instance = DatapointMetadataModelMetadataInner.model_construct()
67
+ error_messages = []
68
+ match = 0
69
+ # validate data type: PrivateTextMetadataInput
70
+ if not isinstance(v, PrivateTextMetadataInput):
71
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PrivateTextMetadataInput`")
72
+ else:
73
+ match += 1
74
+ # validate data type: PromptMetadataInput
75
+ if not isinstance(v, PromptMetadataInput):
76
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PromptMetadataInput`")
77
+ else:
78
+ match += 1
79
+ # validate data type: PublicTextMetadataInput
80
+ if not isinstance(v, PublicTextMetadataInput):
81
+ error_messages.append(f"Error! Input type `{type(v)}` is not `PublicTextMetadataInput`")
82
+ else:
83
+ match += 1
84
+ # validate data type: TranscriptionMetadataInput
85
+ if not isinstance(v, TranscriptionMetadataInput):
86
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TranscriptionMetadataInput`")
87
+ else:
88
+ match += 1
89
+ if match > 1:
90
+ # more than 1 match
91
+ raise ValueError("Multiple matches found when setting `actual_instance` in DatapointMetadataModelMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
92
+ elif match == 0:
93
+ # no match
94
+ raise ValueError("No match found when setting `actual_instance` in DatapointMetadataModelMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
95
+ else:
96
+ return v
97
+
98
+ @classmethod
99
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
100
+ return cls.from_json(json.dumps(obj))
101
+
102
+ @classmethod
103
+ def from_json(cls, json_str: str) -> Self:
104
+ """Returns the object represented by the json string"""
105
+ instance = cls.model_construct()
106
+ error_messages = []
107
+ match = 0
108
+
109
+ # deserialize data into PrivateTextMetadataInput
110
+ try:
111
+ instance.actual_instance = PrivateTextMetadataInput.from_json(json_str)
112
+ match += 1
113
+ except (ValidationError, ValueError) as e:
114
+ error_messages.append(str(e))
115
+ # deserialize data into PromptMetadataInput
116
+ try:
117
+ instance.actual_instance = PromptMetadataInput.from_json(json_str)
118
+ match += 1
119
+ except (ValidationError, ValueError) as e:
120
+ error_messages.append(str(e))
121
+ # deserialize data into PublicTextMetadataInput
122
+ try:
123
+ instance.actual_instance = PublicTextMetadataInput.from_json(json_str)
124
+ match += 1
125
+ except (ValidationError, ValueError) as e:
126
+ error_messages.append(str(e))
127
+ # deserialize data into TranscriptionMetadataInput
128
+ try:
129
+ instance.actual_instance = TranscriptionMetadataInput.from_json(json_str)
130
+ match += 1
131
+ except (ValidationError, ValueError) as e:
132
+ error_messages.append(str(e))
133
+
134
+ if match > 1:
135
+ # more than 1 match
136
+ raise ValueError("Multiple matches found when deserializing the JSON string into DatapointMetadataModelMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
137
+ elif match == 0:
138
+ # no match
139
+ raise ValueError("No match found when deserializing the JSON string into DatapointMetadataModelMetadataInner with oneOf schemas: PrivateTextMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput. Details: " + ", ".join(error_messages))
140
+ else:
141
+ return instance
142
+
143
+ def to_json(self) -> str:
144
+ """Returns the JSON representation of the actual instance"""
145
+ if self.actual_instance is None:
146
+ return "null"
147
+
148
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
149
+ return self.actual_instance.to_json()
150
+ else:
151
+ return json.dumps(self.actual_instance)
152
+
153
+ def to_dict(self) -> Optional[Union[Dict[str, Any], PrivateTextMetadataInput, PromptMetadataInput, PublicTextMetadataInput, TranscriptionMetadataInput]]:
154
+ """Returns the dict representation of the actual instance"""
155
+ if self.actual_instance is None:
156
+ return None
157
+
158
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
159
+ return self.actual_instance.to_dict()
160
+ else:
161
+ # primitive type
162
+ return self.actual_instance
163
+
164
+ def to_str(self) -> str:
165
+ """Returns the string representation of the actual instance"""
166
+ return pprint.pformat(self.model_dump())
167
+
168
+