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,2290 @@
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
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBytes, StrictStr
20
+ from typing import List, Optional, Tuple, Union
21
+ from typing_extensions import Annotated
22
+ from openapi_client.models.datapoint_metadata_model import DatapointMetadataModel
23
+ from openapi_client.models.get_dataset_by_id_result import GetDatasetByIdResult
24
+ from openapi_client.models.import_from_file_result import ImportFromFileResult
25
+ from openapi_client.models.upload_datapoints_result import UploadDatapointsResult
26
+ from openapi_client.models.upload_files_from_s3_bucket_model import UploadFilesFromS3BucketModel
27
+ from openapi_client.models.upload_text_sources_to_dataset_model import UploadTextSourcesToDatasetModel
28
+
29
+ from openapi_client.api_client import ApiClient, RequestSerialized
30
+ from openapi_client.api_response import ApiResponse
31
+ from openapi_client.rest import RESTResponseType
32
+
33
+
34
+ class DatasetApi:
35
+ """NOTE: This class is auto generated by OpenAPI Generator
36
+ Ref: https://openapi-generator.tech
37
+
38
+ Do not edit the class manually.
39
+ """
40
+
41
+ def __init__(self, api_client=None) -> None:
42
+ if api_client is None:
43
+ api_client = ApiClient.get_default()
44
+ self.api_client = api_client
45
+
46
+
47
+ @validate_call
48
+ def dataset_create_datapoint_post(
49
+ self,
50
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
51
+ model: Optional[DatapointMetadataModel] = None,
52
+ _request_timeout: Union[
53
+ None,
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Tuple[
56
+ Annotated[StrictFloat, Field(gt=0)],
57
+ Annotated[StrictFloat, Field(gt=0)]
58
+ ]
59
+ ] = None,
60
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
61
+ _content_type: Optional[StrictStr] = None,
62
+ _headers: Optional[Dict[StrictStr, Any]] = None,
63
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
64
+ ) -> UploadDatapointsResult:
65
+ """Creates a single datapoint.
66
+
67
+ If multiple files are uploaded, a multi asset datapoint will be created.
68
+
69
+ :param files:
70
+ :type files: List[bytearray]
71
+ :param model:
72
+ :type model: DatapointMetadataModel
73
+ :param _request_timeout: timeout setting for this request. If one
74
+ number provided, it will be total request
75
+ timeout. It can also be a pair (tuple) of
76
+ (connection, read) timeouts.
77
+ :type _request_timeout: int, tuple(int, int), optional
78
+ :param _request_auth: set to override the auth_settings for an a single
79
+ request; this effectively ignores the
80
+ authentication in the spec for a single request.
81
+ :type _request_auth: dict, optional
82
+ :param _content_type: force content-type for the request.
83
+ :type _content_type: str, Optional
84
+ :param _headers: set to override the headers for a single
85
+ request; this effectively ignores the headers
86
+ in the spec for a single request.
87
+ :type _headers: dict, optional
88
+ :param _host_index: set to override the host_index for a single
89
+ request; this effectively ignores the host_index
90
+ in the spec for a single request.
91
+ :type _host_index: int, optional
92
+ :return: Returns the result object.
93
+ """ # noqa: E501
94
+
95
+ _param = self._dataset_create_datapoint_post_serialize(
96
+ files=files,
97
+ model=model,
98
+ _request_auth=_request_auth,
99
+ _content_type=_content_type,
100
+ _headers=_headers,
101
+ _host_index=_host_index
102
+ )
103
+
104
+ _response_types_map: Dict[str, Optional[str]] = {
105
+ '200': "UploadDatapointsResult",
106
+ }
107
+ response_data = self.api_client.call_api(
108
+ *_param,
109
+ _request_timeout=_request_timeout
110
+ )
111
+ response_data.read()
112
+ return self.api_client.response_deserialize(
113
+ response_data=response_data,
114
+ response_types_map=_response_types_map,
115
+ ).data
116
+
117
+
118
+ @validate_call
119
+ def dataset_create_datapoint_post_with_http_info(
120
+ self,
121
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
122
+ model: Optional[DatapointMetadataModel] = None,
123
+ _request_timeout: Union[
124
+ None,
125
+ Annotated[StrictFloat, Field(gt=0)],
126
+ Tuple[
127
+ Annotated[StrictFloat, Field(gt=0)],
128
+ Annotated[StrictFloat, Field(gt=0)]
129
+ ]
130
+ ] = None,
131
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
132
+ _content_type: Optional[StrictStr] = None,
133
+ _headers: Optional[Dict[StrictStr, Any]] = None,
134
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
135
+ ) -> ApiResponse[UploadDatapointsResult]:
136
+ """Creates a single datapoint.
137
+
138
+ If multiple files are uploaded, a multi asset datapoint will be created.
139
+
140
+ :param files:
141
+ :type files: List[bytearray]
142
+ :param model:
143
+ :type model: DatapointMetadataModel
144
+ :param _request_timeout: timeout setting for this request. If one
145
+ number provided, it will be total request
146
+ timeout. It can also be a pair (tuple) of
147
+ (connection, read) timeouts.
148
+ :type _request_timeout: int, tuple(int, int), optional
149
+ :param _request_auth: set to override the auth_settings for an a single
150
+ request; this effectively ignores the
151
+ authentication in the spec for a single request.
152
+ :type _request_auth: dict, optional
153
+ :param _content_type: force content-type for the request.
154
+ :type _content_type: str, Optional
155
+ :param _headers: set to override the headers for a single
156
+ request; this effectively ignores the headers
157
+ in the spec for a single request.
158
+ :type _headers: dict, optional
159
+ :param _host_index: set to override the host_index for a single
160
+ request; this effectively ignores the host_index
161
+ in the spec for a single request.
162
+ :type _host_index: int, optional
163
+ :return: Returns the result object.
164
+ """ # noqa: E501
165
+
166
+ _param = self._dataset_create_datapoint_post_serialize(
167
+ files=files,
168
+ model=model,
169
+ _request_auth=_request_auth,
170
+ _content_type=_content_type,
171
+ _headers=_headers,
172
+ _host_index=_host_index
173
+ )
174
+
175
+ _response_types_map: Dict[str, Optional[str]] = {
176
+ '200': "UploadDatapointsResult",
177
+ }
178
+ response_data = self.api_client.call_api(
179
+ *_param,
180
+ _request_timeout=_request_timeout
181
+ )
182
+ response_data.read()
183
+ return self.api_client.response_deserialize(
184
+ response_data=response_data,
185
+ response_types_map=_response_types_map,
186
+ )
187
+
188
+
189
+ @validate_call
190
+ def dataset_create_datapoint_post_without_preload_content(
191
+ self,
192
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
193
+ model: Optional[DatapointMetadataModel] = None,
194
+ _request_timeout: Union[
195
+ None,
196
+ Annotated[StrictFloat, Field(gt=0)],
197
+ Tuple[
198
+ Annotated[StrictFloat, Field(gt=0)],
199
+ Annotated[StrictFloat, Field(gt=0)]
200
+ ]
201
+ ] = None,
202
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
203
+ _content_type: Optional[StrictStr] = None,
204
+ _headers: Optional[Dict[StrictStr, Any]] = None,
205
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
206
+ ) -> RESTResponseType:
207
+ """Creates a single datapoint.
208
+
209
+ If multiple files are uploaded, a multi asset datapoint will be created.
210
+
211
+ :param files:
212
+ :type files: List[bytearray]
213
+ :param model:
214
+ :type model: DatapointMetadataModel
215
+ :param _request_timeout: timeout setting for this request. If one
216
+ number provided, it will be total request
217
+ timeout. It can also be a pair (tuple) of
218
+ (connection, read) timeouts.
219
+ :type _request_timeout: int, tuple(int, int), optional
220
+ :param _request_auth: set to override the auth_settings for an a single
221
+ request; this effectively ignores the
222
+ authentication in the spec for a single request.
223
+ :type _request_auth: dict, optional
224
+ :param _content_type: force content-type for the request.
225
+ :type _content_type: str, Optional
226
+ :param _headers: set to override the headers for a single
227
+ request; this effectively ignores the headers
228
+ in the spec for a single request.
229
+ :type _headers: dict, optional
230
+ :param _host_index: set to override the host_index for a single
231
+ request; this effectively ignores the host_index
232
+ in the spec for a single request.
233
+ :type _host_index: int, optional
234
+ :return: Returns the result object.
235
+ """ # noqa: E501
236
+
237
+ _param = self._dataset_create_datapoint_post_serialize(
238
+ files=files,
239
+ model=model,
240
+ _request_auth=_request_auth,
241
+ _content_type=_content_type,
242
+ _headers=_headers,
243
+ _host_index=_host_index
244
+ )
245
+
246
+ _response_types_map: Dict[str, Optional[str]] = {
247
+ '200': "UploadDatapointsResult",
248
+ }
249
+ response_data = self.api_client.call_api(
250
+ *_param,
251
+ _request_timeout=_request_timeout
252
+ )
253
+ return response_data.response
254
+
255
+
256
+ def _dataset_create_datapoint_post_serialize(
257
+ self,
258
+ files,
259
+ model,
260
+ _request_auth,
261
+ _content_type,
262
+ _headers,
263
+ _host_index,
264
+ ) -> RequestSerialized:
265
+
266
+ _host = None
267
+
268
+ _collection_formats: Dict[str, str] = {
269
+ 'files': 'multi',
270
+ }
271
+
272
+ _path_params: Dict[str, str] = {}
273
+ _query_params: List[Tuple[str, str]] = []
274
+ _header_params: Dict[str, Optional[str]] = _headers or {}
275
+ _form_params: List[Tuple[str, str]] = []
276
+ _files: Dict[
277
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
278
+ ] = {}
279
+ _body_params: Optional[bytes] = None
280
+
281
+ # process the path parameters
282
+ # process the query parameters
283
+ # process the header parameters
284
+ # process the form parameters
285
+ if files is not None:
286
+ _files['files'] = files
287
+ if model is not None:
288
+ _form_params.append(('model', model))
289
+ # process the body parameter
290
+
291
+
292
+ # set the HTTP header `Accept`
293
+ if 'Accept' not in _header_params:
294
+ _header_params['Accept'] = self.api_client.select_header_accept(
295
+ [
296
+ 'text/plain',
297
+ 'application/json',
298
+ 'text/json'
299
+ ]
300
+ )
301
+
302
+ # set the HTTP header `Content-Type`
303
+ if _content_type:
304
+ _header_params['Content-Type'] = _content_type
305
+ else:
306
+ _default_content_type = (
307
+ self.api_client.select_header_content_type(
308
+ [
309
+ 'multipart/form-data'
310
+ ]
311
+ )
312
+ )
313
+ if _default_content_type is not None:
314
+ _header_params['Content-Type'] = _default_content_type
315
+
316
+ # authentication setting
317
+ _auth_settings: List[str] = [
318
+ 'bearer'
319
+ ]
320
+
321
+ return self.api_client.param_serialize(
322
+ method='POST',
323
+ resource_path='/Dataset/CreateDatapoint',
324
+ path_params=_path_params,
325
+ query_params=_query_params,
326
+ header_params=_header_params,
327
+ body=_body_params,
328
+ post_params=_form_params,
329
+ files=_files,
330
+ auth_settings=_auth_settings,
331
+ collection_formats=_collection_formats,
332
+ _host=_host,
333
+ _request_auth=_request_auth
334
+ )
335
+
336
+
337
+
338
+
339
+ @validate_call
340
+ def dataset_get_by_id_get(
341
+ self,
342
+ id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to get.")] = None,
343
+ _request_timeout: Union[
344
+ None,
345
+ Annotated[StrictFloat, Field(gt=0)],
346
+ Tuple[
347
+ Annotated[StrictFloat, Field(gt=0)],
348
+ Annotated[StrictFloat, Field(gt=0)]
349
+ ]
350
+ ] = None,
351
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
352
+ _content_type: Optional[StrictStr] = None,
353
+ _headers: Optional[Dict[StrictStr, Any]] = None,
354
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
355
+ ) -> GetDatasetByIdResult:
356
+ """Gets a dataset by its id.
357
+
358
+
359
+ :param id: The id of the dataset to get.
360
+ :type id: str
361
+ :param _request_timeout: timeout setting for this request. If one
362
+ number provided, it will be total request
363
+ timeout. It can also be a pair (tuple) of
364
+ (connection, read) timeouts.
365
+ :type _request_timeout: int, tuple(int, int), optional
366
+ :param _request_auth: set to override the auth_settings for an a single
367
+ request; this effectively ignores the
368
+ authentication in the spec for a single request.
369
+ :type _request_auth: dict, optional
370
+ :param _content_type: force content-type for the request.
371
+ :type _content_type: str, Optional
372
+ :param _headers: set to override the headers for a single
373
+ request; this effectively ignores the headers
374
+ in the spec for a single request.
375
+ :type _headers: dict, optional
376
+ :param _host_index: set to override the host_index for a single
377
+ request; this effectively ignores the host_index
378
+ in the spec for a single request.
379
+ :type _host_index: int, optional
380
+ :return: Returns the result object.
381
+ """ # noqa: E501
382
+
383
+ _param = self._dataset_get_by_id_get_serialize(
384
+ id=id,
385
+ _request_auth=_request_auth,
386
+ _content_type=_content_type,
387
+ _headers=_headers,
388
+ _host_index=_host_index
389
+ )
390
+
391
+ _response_types_map: Dict[str, Optional[str]] = {
392
+ '200': "GetDatasetByIdResult",
393
+ }
394
+ response_data = self.api_client.call_api(
395
+ *_param,
396
+ _request_timeout=_request_timeout
397
+ )
398
+ response_data.read()
399
+ return self.api_client.response_deserialize(
400
+ response_data=response_data,
401
+ response_types_map=_response_types_map,
402
+ ).data
403
+
404
+
405
+ @validate_call
406
+ def dataset_get_by_id_get_with_http_info(
407
+ self,
408
+ id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to get.")] = None,
409
+ _request_timeout: Union[
410
+ None,
411
+ Annotated[StrictFloat, Field(gt=0)],
412
+ Tuple[
413
+ Annotated[StrictFloat, Field(gt=0)],
414
+ Annotated[StrictFloat, Field(gt=0)]
415
+ ]
416
+ ] = None,
417
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
418
+ _content_type: Optional[StrictStr] = None,
419
+ _headers: Optional[Dict[StrictStr, Any]] = None,
420
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
421
+ ) -> ApiResponse[GetDatasetByIdResult]:
422
+ """Gets a dataset by its id.
423
+
424
+
425
+ :param id: The id of the dataset to get.
426
+ :type id: str
427
+ :param _request_timeout: timeout setting for this request. If one
428
+ number provided, it will be total request
429
+ timeout. It can also be a pair (tuple) of
430
+ (connection, read) timeouts.
431
+ :type _request_timeout: int, tuple(int, int), optional
432
+ :param _request_auth: set to override the auth_settings for an a single
433
+ request; this effectively ignores the
434
+ authentication in the spec for a single request.
435
+ :type _request_auth: dict, optional
436
+ :param _content_type: force content-type for the request.
437
+ :type _content_type: str, Optional
438
+ :param _headers: set to override the headers for a single
439
+ request; this effectively ignores the headers
440
+ in the spec for a single request.
441
+ :type _headers: dict, optional
442
+ :param _host_index: set to override the host_index for a single
443
+ request; this effectively ignores the host_index
444
+ in the spec for a single request.
445
+ :type _host_index: int, optional
446
+ :return: Returns the result object.
447
+ """ # noqa: E501
448
+
449
+ _param = self._dataset_get_by_id_get_serialize(
450
+ id=id,
451
+ _request_auth=_request_auth,
452
+ _content_type=_content_type,
453
+ _headers=_headers,
454
+ _host_index=_host_index
455
+ )
456
+
457
+ _response_types_map: Dict[str, Optional[str]] = {
458
+ '200': "GetDatasetByIdResult",
459
+ }
460
+ response_data = self.api_client.call_api(
461
+ *_param,
462
+ _request_timeout=_request_timeout
463
+ )
464
+ response_data.read()
465
+ return self.api_client.response_deserialize(
466
+ response_data=response_data,
467
+ response_types_map=_response_types_map,
468
+ )
469
+
470
+
471
+ @validate_call
472
+ def dataset_get_by_id_get_without_preload_content(
473
+ self,
474
+ id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to get.")] = None,
475
+ _request_timeout: Union[
476
+ None,
477
+ Annotated[StrictFloat, Field(gt=0)],
478
+ Tuple[
479
+ Annotated[StrictFloat, Field(gt=0)],
480
+ Annotated[StrictFloat, Field(gt=0)]
481
+ ]
482
+ ] = None,
483
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
484
+ _content_type: Optional[StrictStr] = None,
485
+ _headers: Optional[Dict[StrictStr, Any]] = None,
486
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
487
+ ) -> RESTResponseType:
488
+ """Gets a dataset by its id.
489
+
490
+
491
+ :param id: The id of the dataset to get.
492
+ :type id: str
493
+ :param _request_timeout: timeout setting for this request. If one
494
+ number provided, it will be total request
495
+ timeout. It can also be a pair (tuple) of
496
+ (connection, read) timeouts.
497
+ :type _request_timeout: int, tuple(int, int), optional
498
+ :param _request_auth: set to override the auth_settings for an a single
499
+ request; this effectively ignores the
500
+ authentication in the spec for a single request.
501
+ :type _request_auth: dict, optional
502
+ :param _content_type: force content-type for the request.
503
+ :type _content_type: str, Optional
504
+ :param _headers: set to override the headers for a single
505
+ request; this effectively ignores the headers
506
+ in the spec for a single request.
507
+ :type _headers: dict, optional
508
+ :param _host_index: set to override the host_index for a single
509
+ request; this effectively ignores the host_index
510
+ in the spec for a single request.
511
+ :type _host_index: int, optional
512
+ :return: Returns the result object.
513
+ """ # noqa: E501
514
+
515
+ _param = self._dataset_get_by_id_get_serialize(
516
+ id=id,
517
+ _request_auth=_request_auth,
518
+ _content_type=_content_type,
519
+ _headers=_headers,
520
+ _host_index=_host_index
521
+ )
522
+
523
+ _response_types_map: Dict[str, Optional[str]] = {
524
+ '200': "GetDatasetByIdResult",
525
+ }
526
+ response_data = self.api_client.call_api(
527
+ *_param,
528
+ _request_timeout=_request_timeout
529
+ )
530
+ return response_data.response
531
+
532
+
533
+ def _dataset_get_by_id_get_serialize(
534
+ self,
535
+ id,
536
+ _request_auth,
537
+ _content_type,
538
+ _headers,
539
+ _host_index,
540
+ ) -> RequestSerialized:
541
+
542
+ _host = None
543
+
544
+ _collection_formats: Dict[str, str] = {
545
+ }
546
+
547
+ _path_params: Dict[str, str] = {}
548
+ _query_params: List[Tuple[str, str]] = []
549
+ _header_params: Dict[str, Optional[str]] = _headers or {}
550
+ _form_params: List[Tuple[str, str]] = []
551
+ _files: Dict[
552
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
553
+ ] = {}
554
+ _body_params: Optional[bytes] = None
555
+
556
+ # process the path parameters
557
+ # process the query parameters
558
+ if id is not None:
559
+
560
+ _query_params.append(('id', id))
561
+
562
+ # process the header parameters
563
+ # process the form parameters
564
+ # process the body parameter
565
+
566
+
567
+ # set the HTTP header `Accept`
568
+ if 'Accept' not in _header_params:
569
+ _header_params['Accept'] = self.api_client.select_header_accept(
570
+ [
571
+ 'text/plain',
572
+ 'application/json',
573
+ 'text/json'
574
+ ]
575
+ )
576
+
577
+
578
+ # authentication setting
579
+ _auth_settings: List[str] = [
580
+ 'bearer'
581
+ ]
582
+
583
+ return self.api_client.param_serialize(
584
+ method='GET',
585
+ resource_path='/Dataset/GetById',
586
+ path_params=_path_params,
587
+ query_params=_query_params,
588
+ header_params=_header_params,
589
+ body=_body_params,
590
+ post_params=_form_params,
591
+ files=_files,
592
+ auth_settings=_auth_settings,
593
+ collection_formats=_collection_formats,
594
+ _host=_host,
595
+ _request_auth=_request_auth
596
+ )
597
+
598
+
599
+
600
+
601
+ @validate_call
602
+ def dataset_import_post(
603
+ self,
604
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to import the datapoints to.")] = None,
605
+ file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
606
+ _request_timeout: Union[
607
+ None,
608
+ Annotated[StrictFloat, Field(gt=0)],
609
+ Tuple[
610
+ Annotated[StrictFloat, Field(gt=0)],
611
+ Annotated[StrictFloat, Field(gt=0)]
612
+ ]
613
+ ] = None,
614
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
615
+ _content_type: Optional[StrictStr] = None,
616
+ _headers: Optional[Dict[StrictStr, Any]] = None,
617
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
618
+ ) -> ImportFromFileResult:
619
+ """Imports datapoints from a csv file.
620
+
621
+
622
+ :param dataset_id: The id of the dataset to import the datapoints to.
623
+ :type dataset_id: str
624
+ :param file:
625
+ :type file: bytearray
626
+ :param _request_timeout: timeout setting for this request. If one
627
+ number provided, it will be total request
628
+ timeout. It can also be a pair (tuple) of
629
+ (connection, read) timeouts.
630
+ :type _request_timeout: int, tuple(int, int), optional
631
+ :param _request_auth: set to override the auth_settings for an a single
632
+ request; this effectively ignores the
633
+ authentication in the spec for a single request.
634
+ :type _request_auth: dict, optional
635
+ :param _content_type: force content-type for the request.
636
+ :type _content_type: str, Optional
637
+ :param _headers: set to override the headers for a single
638
+ request; this effectively ignores the headers
639
+ in the spec for a single request.
640
+ :type _headers: dict, optional
641
+ :param _host_index: set to override the host_index for a single
642
+ request; this effectively ignores the host_index
643
+ in the spec for a single request.
644
+ :type _host_index: int, optional
645
+ :return: Returns the result object.
646
+ """ # noqa: E501
647
+
648
+ _param = self._dataset_import_post_serialize(
649
+ dataset_id=dataset_id,
650
+ file=file,
651
+ _request_auth=_request_auth,
652
+ _content_type=_content_type,
653
+ _headers=_headers,
654
+ _host_index=_host_index
655
+ )
656
+
657
+ _response_types_map: Dict[str, Optional[str]] = {
658
+ '200': "ImportFromFileResult",
659
+ }
660
+ response_data = self.api_client.call_api(
661
+ *_param,
662
+ _request_timeout=_request_timeout
663
+ )
664
+ response_data.read()
665
+ return self.api_client.response_deserialize(
666
+ response_data=response_data,
667
+ response_types_map=_response_types_map,
668
+ ).data
669
+
670
+
671
+ @validate_call
672
+ def dataset_import_post_with_http_info(
673
+ self,
674
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to import the datapoints to.")] = None,
675
+ file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
676
+ _request_timeout: Union[
677
+ None,
678
+ Annotated[StrictFloat, Field(gt=0)],
679
+ Tuple[
680
+ Annotated[StrictFloat, Field(gt=0)],
681
+ Annotated[StrictFloat, Field(gt=0)]
682
+ ]
683
+ ] = None,
684
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
685
+ _content_type: Optional[StrictStr] = None,
686
+ _headers: Optional[Dict[StrictStr, Any]] = None,
687
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
688
+ ) -> ApiResponse[ImportFromFileResult]:
689
+ """Imports datapoints from a csv file.
690
+
691
+
692
+ :param dataset_id: The id of the dataset to import the datapoints to.
693
+ :type dataset_id: str
694
+ :param file:
695
+ :type file: bytearray
696
+ :param _request_timeout: timeout setting for this request. If one
697
+ number provided, it will be total request
698
+ timeout. It can also be a pair (tuple) of
699
+ (connection, read) timeouts.
700
+ :type _request_timeout: int, tuple(int, int), optional
701
+ :param _request_auth: set to override the auth_settings for an a single
702
+ request; this effectively ignores the
703
+ authentication in the spec for a single request.
704
+ :type _request_auth: dict, optional
705
+ :param _content_type: force content-type for the request.
706
+ :type _content_type: str, Optional
707
+ :param _headers: set to override the headers for a single
708
+ request; this effectively ignores the headers
709
+ in the spec for a single request.
710
+ :type _headers: dict, optional
711
+ :param _host_index: set to override the host_index for a single
712
+ request; this effectively ignores the host_index
713
+ in the spec for a single request.
714
+ :type _host_index: int, optional
715
+ :return: Returns the result object.
716
+ """ # noqa: E501
717
+
718
+ _param = self._dataset_import_post_serialize(
719
+ dataset_id=dataset_id,
720
+ file=file,
721
+ _request_auth=_request_auth,
722
+ _content_type=_content_type,
723
+ _headers=_headers,
724
+ _host_index=_host_index
725
+ )
726
+
727
+ _response_types_map: Dict[str, Optional[str]] = {
728
+ '200': "ImportFromFileResult",
729
+ }
730
+ response_data = self.api_client.call_api(
731
+ *_param,
732
+ _request_timeout=_request_timeout
733
+ )
734
+ response_data.read()
735
+ return self.api_client.response_deserialize(
736
+ response_data=response_data,
737
+ response_types_map=_response_types_map,
738
+ )
739
+
740
+
741
+ @validate_call
742
+ def dataset_import_post_without_preload_content(
743
+ self,
744
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to import the datapoints to.")] = None,
745
+ file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
746
+ _request_timeout: Union[
747
+ None,
748
+ Annotated[StrictFloat, Field(gt=0)],
749
+ Tuple[
750
+ Annotated[StrictFloat, Field(gt=0)],
751
+ Annotated[StrictFloat, Field(gt=0)]
752
+ ]
753
+ ] = None,
754
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
755
+ _content_type: Optional[StrictStr] = None,
756
+ _headers: Optional[Dict[StrictStr, Any]] = None,
757
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
758
+ ) -> RESTResponseType:
759
+ """Imports datapoints from a csv file.
760
+
761
+
762
+ :param dataset_id: The id of the dataset to import the datapoints to.
763
+ :type dataset_id: str
764
+ :param file:
765
+ :type file: bytearray
766
+ :param _request_timeout: timeout setting for this request. If one
767
+ number provided, it will be total request
768
+ timeout. It can also be a pair (tuple) of
769
+ (connection, read) timeouts.
770
+ :type _request_timeout: int, tuple(int, int), optional
771
+ :param _request_auth: set to override the auth_settings for an a single
772
+ request; this effectively ignores the
773
+ authentication in the spec for a single request.
774
+ :type _request_auth: dict, optional
775
+ :param _content_type: force content-type for the request.
776
+ :type _content_type: str, Optional
777
+ :param _headers: set to override the headers for a single
778
+ request; this effectively ignores the headers
779
+ in the spec for a single request.
780
+ :type _headers: dict, optional
781
+ :param _host_index: set to override the host_index for a single
782
+ request; this effectively ignores the host_index
783
+ in the spec for a single request.
784
+ :type _host_index: int, optional
785
+ :return: Returns the result object.
786
+ """ # noqa: E501
787
+
788
+ _param = self._dataset_import_post_serialize(
789
+ dataset_id=dataset_id,
790
+ file=file,
791
+ _request_auth=_request_auth,
792
+ _content_type=_content_type,
793
+ _headers=_headers,
794
+ _host_index=_host_index
795
+ )
796
+
797
+ _response_types_map: Dict[str, Optional[str]] = {
798
+ '200': "ImportFromFileResult",
799
+ }
800
+ response_data = self.api_client.call_api(
801
+ *_param,
802
+ _request_timeout=_request_timeout
803
+ )
804
+ return response_data.response
805
+
806
+
807
+ def _dataset_import_post_serialize(
808
+ self,
809
+ dataset_id,
810
+ file,
811
+ _request_auth,
812
+ _content_type,
813
+ _headers,
814
+ _host_index,
815
+ ) -> RequestSerialized:
816
+
817
+ _host = None
818
+
819
+ _collection_formats: Dict[str, str] = {
820
+ }
821
+
822
+ _path_params: Dict[str, str] = {}
823
+ _query_params: List[Tuple[str, str]] = []
824
+ _header_params: Dict[str, Optional[str]] = _headers or {}
825
+ _form_params: List[Tuple[str, str]] = []
826
+ _files: Dict[
827
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
828
+ ] = {}
829
+ _body_params: Optional[bytes] = None
830
+
831
+ # process the path parameters
832
+ # process the query parameters
833
+ if dataset_id is not None:
834
+
835
+ _query_params.append(('datasetId', dataset_id))
836
+
837
+ # process the header parameters
838
+ # process the form parameters
839
+ if file is not None:
840
+ _files['file'] = file
841
+ # process the body parameter
842
+
843
+
844
+ # set the HTTP header `Accept`
845
+ if 'Accept' not in _header_params:
846
+ _header_params['Accept'] = self.api_client.select_header_accept(
847
+ [
848
+ 'text/plain',
849
+ 'application/json',
850
+ 'text/json'
851
+ ]
852
+ )
853
+
854
+ # set the HTTP header `Content-Type`
855
+ if _content_type:
856
+ _header_params['Content-Type'] = _content_type
857
+ else:
858
+ _default_content_type = (
859
+ self.api_client.select_header_content_type(
860
+ [
861
+ 'multipart/form-data'
862
+ ]
863
+ )
864
+ )
865
+ if _default_content_type is not None:
866
+ _header_params['Content-Type'] = _default_content_type
867
+
868
+ # authentication setting
869
+ _auth_settings: List[str] = [
870
+ 'bearer'
871
+ ]
872
+
873
+ return self.api_client.param_serialize(
874
+ method='POST',
875
+ resource_path='/Dataset/Import',
876
+ path_params=_path_params,
877
+ query_params=_query_params,
878
+ header_params=_header_params,
879
+ body=_body_params,
880
+ post_params=_form_params,
881
+ files=_files,
882
+ auth_settings=_auth_settings,
883
+ collection_formats=_collection_formats,
884
+ _host=_host,
885
+ _request_auth=_request_auth
886
+ )
887
+
888
+
889
+
890
+
891
+ @validate_call
892
+ def dataset_update_name_post(
893
+ self,
894
+ id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to update.")] = None,
895
+ name: Annotated[Optional[StrictStr], Field(description="The new name of the dataset.")] = None,
896
+ _request_timeout: Union[
897
+ None,
898
+ Annotated[StrictFloat, Field(gt=0)],
899
+ Tuple[
900
+ Annotated[StrictFloat, Field(gt=0)],
901
+ Annotated[StrictFloat, Field(gt=0)]
902
+ ]
903
+ ] = None,
904
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
905
+ _content_type: Optional[StrictStr] = None,
906
+ _headers: Optional[Dict[StrictStr, Any]] = None,
907
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
908
+ ) -> None:
909
+ """Updates the name of a dataset.
910
+
911
+
912
+ :param id: The id of the dataset to update.
913
+ :type id: str
914
+ :param name: The new name of the dataset.
915
+ :type name: str
916
+ :param _request_timeout: timeout setting for this request. If one
917
+ number provided, it will be total request
918
+ timeout. It can also be a pair (tuple) of
919
+ (connection, read) timeouts.
920
+ :type _request_timeout: int, tuple(int, int), optional
921
+ :param _request_auth: set to override the auth_settings for an a single
922
+ request; this effectively ignores the
923
+ authentication in the spec for a single request.
924
+ :type _request_auth: dict, optional
925
+ :param _content_type: force content-type for the request.
926
+ :type _content_type: str, Optional
927
+ :param _headers: set to override the headers for a single
928
+ request; this effectively ignores the headers
929
+ in the spec for a single request.
930
+ :type _headers: dict, optional
931
+ :param _host_index: set to override the host_index for a single
932
+ request; this effectively ignores the host_index
933
+ in the spec for a single request.
934
+ :type _host_index: int, optional
935
+ :return: Returns the result object.
936
+ """ # noqa: E501
937
+
938
+ _param = self._dataset_update_name_post_serialize(
939
+ id=id,
940
+ name=name,
941
+ _request_auth=_request_auth,
942
+ _content_type=_content_type,
943
+ _headers=_headers,
944
+ _host_index=_host_index
945
+ )
946
+
947
+ _response_types_map: Dict[str, Optional[str]] = {
948
+ '200': None,
949
+ }
950
+ response_data = self.api_client.call_api(
951
+ *_param,
952
+ _request_timeout=_request_timeout
953
+ )
954
+ response_data.read()
955
+ return self.api_client.response_deserialize(
956
+ response_data=response_data,
957
+ response_types_map=_response_types_map,
958
+ ).data
959
+
960
+
961
+ @validate_call
962
+ def dataset_update_name_post_with_http_info(
963
+ self,
964
+ id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to update.")] = None,
965
+ name: Annotated[Optional[StrictStr], Field(description="The new name of the dataset.")] = None,
966
+ _request_timeout: Union[
967
+ None,
968
+ Annotated[StrictFloat, Field(gt=0)],
969
+ Tuple[
970
+ Annotated[StrictFloat, Field(gt=0)],
971
+ Annotated[StrictFloat, Field(gt=0)]
972
+ ]
973
+ ] = None,
974
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
975
+ _content_type: Optional[StrictStr] = None,
976
+ _headers: Optional[Dict[StrictStr, Any]] = None,
977
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
978
+ ) -> ApiResponse[None]:
979
+ """Updates the name of a dataset.
980
+
981
+
982
+ :param id: The id of the dataset to update.
983
+ :type id: str
984
+ :param name: The new name of the dataset.
985
+ :type name: str
986
+ :param _request_timeout: timeout setting for this request. If one
987
+ number provided, it will be total request
988
+ timeout. It can also be a pair (tuple) of
989
+ (connection, read) timeouts.
990
+ :type _request_timeout: int, tuple(int, int), optional
991
+ :param _request_auth: set to override the auth_settings for an a single
992
+ request; this effectively ignores the
993
+ authentication in the spec for a single request.
994
+ :type _request_auth: dict, optional
995
+ :param _content_type: force content-type for the request.
996
+ :type _content_type: str, Optional
997
+ :param _headers: set to override the headers for a single
998
+ request; this effectively ignores the headers
999
+ in the spec for a single request.
1000
+ :type _headers: dict, optional
1001
+ :param _host_index: set to override the host_index for a single
1002
+ request; this effectively ignores the host_index
1003
+ in the spec for a single request.
1004
+ :type _host_index: int, optional
1005
+ :return: Returns the result object.
1006
+ """ # noqa: E501
1007
+
1008
+ _param = self._dataset_update_name_post_serialize(
1009
+ id=id,
1010
+ name=name,
1011
+ _request_auth=_request_auth,
1012
+ _content_type=_content_type,
1013
+ _headers=_headers,
1014
+ _host_index=_host_index
1015
+ )
1016
+
1017
+ _response_types_map: Dict[str, Optional[str]] = {
1018
+ '200': None,
1019
+ }
1020
+ response_data = self.api_client.call_api(
1021
+ *_param,
1022
+ _request_timeout=_request_timeout
1023
+ )
1024
+ response_data.read()
1025
+ return self.api_client.response_deserialize(
1026
+ response_data=response_data,
1027
+ response_types_map=_response_types_map,
1028
+ )
1029
+
1030
+
1031
+ @validate_call
1032
+ def dataset_update_name_post_without_preload_content(
1033
+ self,
1034
+ id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to update.")] = None,
1035
+ name: Annotated[Optional[StrictStr], Field(description="The new name of the dataset.")] = None,
1036
+ _request_timeout: Union[
1037
+ None,
1038
+ Annotated[StrictFloat, Field(gt=0)],
1039
+ Tuple[
1040
+ Annotated[StrictFloat, Field(gt=0)],
1041
+ Annotated[StrictFloat, Field(gt=0)]
1042
+ ]
1043
+ ] = None,
1044
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1045
+ _content_type: Optional[StrictStr] = None,
1046
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1047
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1048
+ ) -> RESTResponseType:
1049
+ """Updates the name of a dataset.
1050
+
1051
+
1052
+ :param id: The id of the dataset to update.
1053
+ :type id: str
1054
+ :param name: The new name of the dataset.
1055
+ :type name: str
1056
+ :param _request_timeout: timeout setting for this request. If one
1057
+ number provided, it will be total request
1058
+ timeout. It can also be a pair (tuple) of
1059
+ (connection, read) timeouts.
1060
+ :type _request_timeout: int, tuple(int, int), optional
1061
+ :param _request_auth: set to override the auth_settings for an a single
1062
+ request; this effectively ignores the
1063
+ authentication in the spec for a single request.
1064
+ :type _request_auth: dict, optional
1065
+ :param _content_type: force content-type for the request.
1066
+ :type _content_type: str, Optional
1067
+ :param _headers: set to override the headers for a single
1068
+ request; this effectively ignores the headers
1069
+ in the spec for a single request.
1070
+ :type _headers: dict, optional
1071
+ :param _host_index: set to override the host_index for a single
1072
+ request; this effectively ignores the host_index
1073
+ in the spec for a single request.
1074
+ :type _host_index: int, optional
1075
+ :return: Returns the result object.
1076
+ """ # noqa: E501
1077
+
1078
+ _param = self._dataset_update_name_post_serialize(
1079
+ id=id,
1080
+ name=name,
1081
+ _request_auth=_request_auth,
1082
+ _content_type=_content_type,
1083
+ _headers=_headers,
1084
+ _host_index=_host_index
1085
+ )
1086
+
1087
+ _response_types_map: Dict[str, Optional[str]] = {
1088
+ '200': None,
1089
+ }
1090
+ response_data = self.api_client.call_api(
1091
+ *_param,
1092
+ _request_timeout=_request_timeout
1093
+ )
1094
+ return response_data.response
1095
+
1096
+
1097
+ def _dataset_update_name_post_serialize(
1098
+ self,
1099
+ id,
1100
+ name,
1101
+ _request_auth,
1102
+ _content_type,
1103
+ _headers,
1104
+ _host_index,
1105
+ ) -> RequestSerialized:
1106
+
1107
+ _host = None
1108
+
1109
+ _collection_formats: Dict[str, str] = {
1110
+ }
1111
+
1112
+ _path_params: Dict[str, str] = {}
1113
+ _query_params: List[Tuple[str, str]] = []
1114
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1115
+ _form_params: List[Tuple[str, str]] = []
1116
+ _files: Dict[
1117
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1118
+ ] = {}
1119
+ _body_params: Optional[bytes] = None
1120
+
1121
+ # process the path parameters
1122
+ # process the query parameters
1123
+ if id is not None:
1124
+
1125
+ _query_params.append(('id', id))
1126
+
1127
+ if name is not None:
1128
+
1129
+ _query_params.append(('name', name))
1130
+
1131
+ # process the header parameters
1132
+ # process the form parameters
1133
+ # process the body parameter
1134
+
1135
+
1136
+
1137
+
1138
+ # authentication setting
1139
+ _auth_settings: List[str] = [
1140
+ 'bearer'
1141
+ ]
1142
+
1143
+ return self.api_client.param_serialize(
1144
+ method='POST',
1145
+ resource_path='/Dataset/UpdateName',
1146
+ path_params=_path_params,
1147
+ query_params=_query_params,
1148
+ header_params=_header_params,
1149
+ body=_body_params,
1150
+ post_params=_form_params,
1151
+ files=_files,
1152
+ auth_settings=_auth_settings,
1153
+ collection_formats=_collection_formats,
1154
+ _host=_host,
1155
+ _request_auth=_request_auth
1156
+ )
1157
+
1158
+
1159
+
1160
+
1161
+ @validate_call
1162
+ def dataset_upload_datapoint_post(
1163
+ self,
1164
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to upload the datapoint to.")] = None,
1165
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1166
+ _request_timeout: Union[
1167
+ None,
1168
+ Annotated[StrictFloat, Field(gt=0)],
1169
+ Tuple[
1170
+ Annotated[StrictFloat, Field(gt=0)],
1171
+ Annotated[StrictFloat, Field(gt=0)]
1172
+ ]
1173
+ ] = None,
1174
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1175
+ _content_type: Optional[StrictStr] = None,
1176
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1177
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1178
+ ) -> UploadDatapointsResult:
1179
+ """Creates a new multi asset datapoint.
1180
+
1181
+
1182
+ :param dataset_id: The id of the dataset to upload the datapoint to.
1183
+ :type dataset_id: str
1184
+ :param files:
1185
+ :type files: List[bytearray]
1186
+ :param _request_timeout: timeout setting for this request. If one
1187
+ number provided, it will be total request
1188
+ timeout. It can also be a pair (tuple) of
1189
+ (connection, read) timeouts.
1190
+ :type _request_timeout: int, tuple(int, int), optional
1191
+ :param _request_auth: set to override the auth_settings for an a single
1192
+ request; this effectively ignores the
1193
+ authentication in the spec for a single request.
1194
+ :type _request_auth: dict, optional
1195
+ :param _content_type: force content-type for the request.
1196
+ :type _content_type: str, Optional
1197
+ :param _headers: set to override the headers for a single
1198
+ request; this effectively ignores the headers
1199
+ in the spec for a single request.
1200
+ :type _headers: dict, optional
1201
+ :param _host_index: set to override the host_index for a single
1202
+ request; this effectively ignores the host_index
1203
+ in the spec for a single request.
1204
+ :type _host_index: int, optional
1205
+ :return: Returns the result object.
1206
+ """ # noqa: E501
1207
+
1208
+ _param = self._dataset_upload_datapoint_post_serialize(
1209
+ dataset_id=dataset_id,
1210
+ files=files,
1211
+ _request_auth=_request_auth,
1212
+ _content_type=_content_type,
1213
+ _headers=_headers,
1214
+ _host_index=_host_index
1215
+ )
1216
+
1217
+ _response_types_map: Dict[str, Optional[str]] = {
1218
+ '200': "UploadDatapointsResult",
1219
+ }
1220
+ response_data = self.api_client.call_api(
1221
+ *_param,
1222
+ _request_timeout=_request_timeout
1223
+ )
1224
+ response_data.read()
1225
+ return self.api_client.response_deserialize(
1226
+ response_data=response_data,
1227
+ response_types_map=_response_types_map,
1228
+ ).data
1229
+
1230
+
1231
+ @validate_call
1232
+ def dataset_upload_datapoint_post_with_http_info(
1233
+ self,
1234
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to upload the datapoint to.")] = None,
1235
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1236
+ _request_timeout: Union[
1237
+ None,
1238
+ Annotated[StrictFloat, Field(gt=0)],
1239
+ Tuple[
1240
+ Annotated[StrictFloat, Field(gt=0)],
1241
+ Annotated[StrictFloat, Field(gt=0)]
1242
+ ]
1243
+ ] = None,
1244
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1245
+ _content_type: Optional[StrictStr] = None,
1246
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1247
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1248
+ ) -> ApiResponse[UploadDatapointsResult]:
1249
+ """Creates a new multi asset datapoint.
1250
+
1251
+
1252
+ :param dataset_id: The id of the dataset to upload the datapoint to.
1253
+ :type dataset_id: str
1254
+ :param files:
1255
+ :type files: List[bytearray]
1256
+ :param _request_timeout: timeout setting for this request. If one
1257
+ number provided, it will be total request
1258
+ timeout. It can also be a pair (tuple) of
1259
+ (connection, read) timeouts.
1260
+ :type _request_timeout: int, tuple(int, int), optional
1261
+ :param _request_auth: set to override the auth_settings for an a single
1262
+ request; this effectively ignores the
1263
+ authentication in the spec for a single request.
1264
+ :type _request_auth: dict, optional
1265
+ :param _content_type: force content-type for the request.
1266
+ :type _content_type: str, Optional
1267
+ :param _headers: set to override the headers for a single
1268
+ request; this effectively ignores the headers
1269
+ in the spec for a single request.
1270
+ :type _headers: dict, optional
1271
+ :param _host_index: set to override the host_index for a single
1272
+ request; this effectively ignores the host_index
1273
+ in the spec for a single request.
1274
+ :type _host_index: int, optional
1275
+ :return: Returns the result object.
1276
+ """ # noqa: E501
1277
+
1278
+ _param = self._dataset_upload_datapoint_post_serialize(
1279
+ dataset_id=dataset_id,
1280
+ files=files,
1281
+ _request_auth=_request_auth,
1282
+ _content_type=_content_type,
1283
+ _headers=_headers,
1284
+ _host_index=_host_index
1285
+ )
1286
+
1287
+ _response_types_map: Dict[str, Optional[str]] = {
1288
+ '200': "UploadDatapointsResult",
1289
+ }
1290
+ response_data = self.api_client.call_api(
1291
+ *_param,
1292
+ _request_timeout=_request_timeout
1293
+ )
1294
+ response_data.read()
1295
+ return self.api_client.response_deserialize(
1296
+ response_data=response_data,
1297
+ response_types_map=_response_types_map,
1298
+ )
1299
+
1300
+
1301
+ @validate_call
1302
+ def dataset_upload_datapoint_post_without_preload_content(
1303
+ self,
1304
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to upload the datapoint to.")] = None,
1305
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1306
+ _request_timeout: Union[
1307
+ None,
1308
+ Annotated[StrictFloat, Field(gt=0)],
1309
+ Tuple[
1310
+ Annotated[StrictFloat, Field(gt=0)],
1311
+ Annotated[StrictFloat, Field(gt=0)]
1312
+ ]
1313
+ ] = None,
1314
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1315
+ _content_type: Optional[StrictStr] = None,
1316
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1317
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1318
+ ) -> RESTResponseType:
1319
+ """Creates a new multi asset datapoint.
1320
+
1321
+
1322
+ :param dataset_id: The id of the dataset to upload the datapoint to.
1323
+ :type dataset_id: str
1324
+ :param files:
1325
+ :type files: List[bytearray]
1326
+ :param _request_timeout: timeout setting for this request. If one
1327
+ number provided, it will be total request
1328
+ timeout. It can also be a pair (tuple) of
1329
+ (connection, read) timeouts.
1330
+ :type _request_timeout: int, tuple(int, int), optional
1331
+ :param _request_auth: set to override the auth_settings for an a single
1332
+ request; this effectively ignores the
1333
+ authentication in the spec for a single request.
1334
+ :type _request_auth: dict, optional
1335
+ :param _content_type: force content-type for the request.
1336
+ :type _content_type: str, Optional
1337
+ :param _headers: set to override the headers for a single
1338
+ request; this effectively ignores the headers
1339
+ in the spec for a single request.
1340
+ :type _headers: dict, optional
1341
+ :param _host_index: set to override the host_index for a single
1342
+ request; this effectively ignores the host_index
1343
+ in the spec for a single request.
1344
+ :type _host_index: int, optional
1345
+ :return: Returns the result object.
1346
+ """ # noqa: E501
1347
+
1348
+ _param = self._dataset_upload_datapoint_post_serialize(
1349
+ dataset_id=dataset_id,
1350
+ files=files,
1351
+ _request_auth=_request_auth,
1352
+ _content_type=_content_type,
1353
+ _headers=_headers,
1354
+ _host_index=_host_index
1355
+ )
1356
+
1357
+ _response_types_map: Dict[str, Optional[str]] = {
1358
+ '200': "UploadDatapointsResult",
1359
+ }
1360
+ response_data = self.api_client.call_api(
1361
+ *_param,
1362
+ _request_timeout=_request_timeout
1363
+ )
1364
+ return response_data.response
1365
+
1366
+
1367
+ def _dataset_upload_datapoint_post_serialize(
1368
+ self,
1369
+ dataset_id,
1370
+ files,
1371
+ _request_auth,
1372
+ _content_type,
1373
+ _headers,
1374
+ _host_index,
1375
+ ) -> RequestSerialized:
1376
+
1377
+ _host = None
1378
+
1379
+ _collection_formats: Dict[str, str] = {
1380
+ 'files': 'multi',
1381
+ }
1382
+
1383
+ _path_params: Dict[str, str] = {}
1384
+ _query_params: List[Tuple[str, str]] = []
1385
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1386
+ _form_params: List[Tuple[str, str]] = []
1387
+ _files: Dict[
1388
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1389
+ ] = {}
1390
+ _body_params: Optional[bytes] = None
1391
+
1392
+ # process the path parameters
1393
+ # process the query parameters
1394
+ if dataset_id is not None:
1395
+
1396
+ _query_params.append(('datasetId', dataset_id))
1397
+
1398
+ # process the header parameters
1399
+ # process the form parameters
1400
+ if files is not None:
1401
+ _files['files'] = files
1402
+ # process the body parameter
1403
+
1404
+
1405
+ # set the HTTP header `Accept`
1406
+ if 'Accept' not in _header_params:
1407
+ _header_params['Accept'] = self.api_client.select_header_accept(
1408
+ [
1409
+ 'text/plain',
1410
+ 'application/json',
1411
+ 'text/json'
1412
+ ]
1413
+ )
1414
+
1415
+ # set the HTTP header `Content-Type`
1416
+ if _content_type:
1417
+ _header_params['Content-Type'] = _content_type
1418
+ else:
1419
+ _default_content_type = (
1420
+ self.api_client.select_header_content_type(
1421
+ [
1422
+ 'multipart/form-data'
1423
+ ]
1424
+ )
1425
+ )
1426
+ if _default_content_type is not None:
1427
+ _header_params['Content-Type'] = _default_content_type
1428
+
1429
+ # authentication setting
1430
+ _auth_settings: List[str] = [
1431
+ 'bearer'
1432
+ ]
1433
+
1434
+ return self.api_client.param_serialize(
1435
+ method='POST',
1436
+ resource_path='/Dataset/UploadDatapoint',
1437
+ path_params=_path_params,
1438
+ query_params=_query_params,
1439
+ header_params=_header_params,
1440
+ body=_body_params,
1441
+ post_params=_form_params,
1442
+ files=_files,
1443
+ auth_settings=_auth_settings,
1444
+ collection_formats=_collection_formats,
1445
+ _host=_host,
1446
+ _request_auth=_request_auth
1447
+ )
1448
+
1449
+
1450
+
1451
+
1452
+ @validate_call
1453
+ def dataset_upload_files_from_s3_post(
1454
+ self,
1455
+ upload_files_from_s3_bucket_model: Annotated[Optional[UploadFilesFromS3BucketModel], Field(description="The body of the request.")] = None,
1456
+ _request_timeout: Union[
1457
+ None,
1458
+ Annotated[StrictFloat, Field(gt=0)],
1459
+ Tuple[
1460
+ Annotated[StrictFloat, Field(gt=0)],
1461
+ Annotated[StrictFloat, Field(gt=0)]
1462
+ ]
1463
+ ] = None,
1464
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1465
+ _content_type: Optional[StrictStr] = None,
1466
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1467
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1468
+ ) -> UploadDatapointsResult:
1469
+ """Uploads files from an S3 bucket to a dataset.
1470
+
1471
+ A new datapoint will be created for each file in the bucket.
1472
+
1473
+ :param upload_files_from_s3_bucket_model: The body of the request.
1474
+ :type upload_files_from_s3_bucket_model: UploadFilesFromS3BucketModel
1475
+ :param _request_timeout: timeout setting for this request. If one
1476
+ number provided, it will be total request
1477
+ timeout. It can also be a pair (tuple) of
1478
+ (connection, read) timeouts.
1479
+ :type _request_timeout: int, tuple(int, int), optional
1480
+ :param _request_auth: set to override the auth_settings for an a single
1481
+ request; this effectively ignores the
1482
+ authentication in the spec for a single request.
1483
+ :type _request_auth: dict, optional
1484
+ :param _content_type: force content-type for the request.
1485
+ :type _content_type: str, Optional
1486
+ :param _headers: set to override the headers for a single
1487
+ request; this effectively ignores the headers
1488
+ in the spec for a single request.
1489
+ :type _headers: dict, optional
1490
+ :param _host_index: set to override the host_index for a single
1491
+ request; this effectively ignores the host_index
1492
+ in the spec for a single request.
1493
+ :type _host_index: int, optional
1494
+ :return: Returns the result object.
1495
+ """ # noqa: E501
1496
+
1497
+ _param = self._dataset_upload_files_from_s3_post_serialize(
1498
+ upload_files_from_s3_bucket_model=upload_files_from_s3_bucket_model,
1499
+ _request_auth=_request_auth,
1500
+ _content_type=_content_type,
1501
+ _headers=_headers,
1502
+ _host_index=_host_index
1503
+ )
1504
+
1505
+ _response_types_map: Dict[str, Optional[str]] = {
1506
+ '200': "UploadDatapointsResult",
1507
+ }
1508
+ response_data = self.api_client.call_api(
1509
+ *_param,
1510
+ _request_timeout=_request_timeout
1511
+ )
1512
+ response_data.read()
1513
+ return self.api_client.response_deserialize(
1514
+ response_data=response_data,
1515
+ response_types_map=_response_types_map,
1516
+ ).data
1517
+
1518
+
1519
+ @validate_call
1520
+ def dataset_upload_files_from_s3_post_with_http_info(
1521
+ self,
1522
+ upload_files_from_s3_bucket_model: Annotated[Optional[UploadFilesFromS3BucketModel], Field(description="The body of the request.")] = None,
1523
+ _request_timeout: Union[
1524
+ None,
1525
+ Annotated[StrictFloat, Field(gt=0)],
1526
+ Tuple[
1527
+ Annotated[StrictFloat, Field(gt=0)],
1528
+ Annotated[StrictFloat, Field(gt=0)]
1529
+ ]
1530
+ ] = None,
1531
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1532
+ _content_type: Optional[StrictStr] = None,
1533
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1534
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1535
+ ) -> ApiResponse[UploadDatapointsResult]:
1536
+ """Uploads files from an S3 bucket to a dataset.
1537
+
1538
+ A new datapoint will be created for each file in the bucket.
1539
+
1540
+ :param upload_files_from_s3_bucket_model: The body of the request.
1541
+ :type upload_files_from_s3_bucket_model: UploadFilesFromS3BucketModel
1542
+ :param _request_timeout: timeout setting for this request. If one
1543
+ number provided, it will be total request
1544
+ timeout. It can also be a pair (tuple) of
1545
+ (connection, read) timeouts.
1546
+ :type _request_timeout: int, tuple(int, int), optional
1547
+ :param _request_auth: set to override the auth_settings for an a single
1548
+ request; this effectively ignores the
1549
+ authentication in the spec for a single request.
1550
+ :type _request_auth: dict, optional
1551
+ :param _content_type: force content-type for the request.
1552
+ :type _content_type: str, Optional
1553
+ :param _headers: set to override the headers for a single
1554
+ request; this effectively ignores the headers
1555
+ in the spec for a single request.
1556
+ :type _headers: dict, optional
1557
+ :param _host_index: set to override the host_index for a single
1558
+ request; this effectively ignores the host_index
1559
+ in the spec for a single request.
1560
+ :type _host_index: int, optional
1561
+ :return: Returns the result object.
1562
+ """ # noqa: E501
1563
+
1564
+ _param = self._dataset_upload_files_from_s3_post_serialize(
1565
+ upload_files_from_s3_bucket_model=upload_files_from_s3_bucket_model,
1566
+ _request_auth=_request_auth,
1567
+ _content_type=_content_type,
1568
+ _headers=_headers,
1569
+ _host_index=_host_index
1570
+ )
1571
+
1572
+ _response_types_map: Dict[str, Optional[str]] = {
1573
+ '200': "UploadDatapointsResult",
1574
+ }
1575
+ response_data = self.api_client.call_api(
1576
+ *_param,
1577
+ _request_timeout=_request_timeout
1578
+ )
1579
+ response_data.read()
1580
+ return self.api_client.response_deserialize(
1581
+ response_data=response_data,
1582
+ response_types_map=_response_types_map,
1583
+ )
1584
+
1585
+
1586
+ @validate_call
1587
+ def dataset_upload_files_from_s3_post_without_preload_content(
1588
+ self,
1589
+ upload_files_from_s3_bucket_model: Annotated[Optional[UploadFilesFromS3BucketModel], Field(description="The body of the request.")] = None,
1590
+ _request_timeout: Union[
1591
+ None,
1592
+ Annotated[StrictFloat, Field(gt=0)],
1593
+ Tuple[
1594
+ Annotated[StrictFloat, Field(gt=0)],
1595
+ Annotated[StrictFloat, Field(gt=0)]
1596
+ ]
1597
+ ] = None,
1598
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1599
+ _content_type: Optional[StrictStr] = None,
1600
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1601
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1602
+ ) -> RESTResponseType:
1603
+ """Uploads files from an S3 bucket to a dataset.
1604
+
1605
+ A new datapoint will be created for each file in the bucket.
1606
+
1607
+ :param upload_files_from_s3_bucket_model: The body of the request.
1608
+ :type upload_files_from_s3_bucket_model: UploadFilesFromS3BucketModel
1609
+ :param _request_timeout: timeout setting for this request. If one
1610
+ number provided, it will be total request
1611
+ timeout. It can also be a pair (tuple) of
1612
+ (connection, read) timeouts.
1613
+ :type _request_timeout: int, tuple(int, int), optional
1614
+ :param _request_auth: set to override the auth_settings for an a single
1615
+ request; this effectively ignores the
1616
+ authentication in the spec for a single request.
1617
+ :type _request_auth: dict, optional
1618
+ :param _content_type: force content-type for the request.
1619
+ :type _content_type: str, Optional
1620
+ :param _headers: set to override the headers for a single
1621
+ request; this effectively ignores the headers
1622
+ in the spec for a single request.
1623
+ :type _headers: dict, optional
1624
+ :param _host_index: set to override the host_index for a single
1625
+ request; this effectively ignores the host_index
1626
+ in the spec for a single request.
1627
+ :type _host_index: int, optional
1628
+ :return: Returns the result object.
1629
+ """ # noqa: E501
1630
+
1631
+ _param = self._dataset_upload_files_from_s3_post_serialize(
1632
+ upload_files_from_s3_bucket_model=upload_files_from_s3_bucket_model,
1633
+ _request_auth=_request_auth,
1634
+ _content_type=_content_type,
1635
+ _headers=_headers,
1636
+ _host_index=_host_index
1637
+ )
1638
+
1639
+ _response_types_map: Dict[str, Optional[str]] = {
1640
+ '200': "UploadDatapointsResult",
1641
+ }
1642
+ response_data = self.api_client.call_api(
1643
+ *_param,
1644
+ _request_timeout=_request_timeout
1645
+ )
1646
+ return response_data.response
1647
+
1648
+
1649
+ def _dataset_upload_files_from_s3_post_serialize(
1650
+ self,
1651
+ upload_files_from_s3_bucket_model,
1652
+ _request_auth,
1653
+ _content_type,
1654
+ _headers,
1655
+ _host_index,
1656
+ ) -> RequestSerialized:
1657
+
1658
+ _host = None
1659
+
1660
+ _collection_formats: Dict[str, str] = {
1661
+ }
1662
+
1663
+ _path_params: Dict[str, str] = {}
1664
+ _query_params: List[Tuple[str, str]] = []
1665
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1666
+ _form_params: List[Tuple[str, str]] = []
1667
+ _files: Dict[
1668
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1669
+ ] = {}
1670
+ _body_params: Optional[bytes] = None
1671
+
1672
+ # process the path parameters
1673
+ # process the query parameters
1674
+ # process the header parameters
1675
+ # process the form parameters
1676
+ # process the body parameter
1677
+ if upload_files_from_s3_bucket_model is not None:
1678
+ _body_params = upload_files_from_s3_bucket_model
1679
+
1680
+
1681
+ # set the HTTP header `Accept`
1682
+ if 'Accept' not in _header_params:
1683
+ _header_params['Accept'] = self.api_client.select_header_accept(
1684
+ [
1685
+ 'text/plain',
1686
+ 'application/json',
1687
+ 'text/json'
1688
+ ]
1689
+ )
1690
+
1691
+ # set the HTTP header `Content-Type`
1692
+ if _content_type:
1693
+ _header_params['Content-Type'] = _content_type
1694
+ else:
1695
+ _default_content_type = (
1696
+ self.api_client.select_header_content_type(
1697
+ [
1698
+ 'application/json',
1699
+ 'text/json',
1700
+ 'application/*+json'
1701
+ ]
1702
+ )
1703
+ )
1704
+ if _default_content_type is not None:
1705
+ _header_params['Content-Type'] = _default_content_type
1706
+
1707
+ # authentication setting
1708
+ _auth_settings: List[str] = [
1709
+ 'bearer'
1710
+ ]
1711
+
1712
+ return self.api_client.param_serialize(
1713
+ method='POST',
1714
+ resource_path='/Dataset/UploadFilesFromS3',
1715
+ path_params=_path_params,
1716
+ query_params=_query_params,
1717
+ header_params=_header_params,
1718
+ body=_body_params,
1719
+ post_params=_form_params,
1720
+ files=_files,
1721
+ auth_settings=_auth_settings,
1722
+ collection_formats=_collection_formats,
1723
+ _host=_host,
1724
+ _request_auth=_request_auth
1725
+ )
1726
+
1727
+
1728
+
1729
+
1730
+ @validate_call
1731
+ def dataset_upload_images_to_dataset_post(
1732
+ self,
1733
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to upload the images to.")] = None,
1734
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1735
+ _request_timeout: Union[
1736
+ None,
1737
+ Annotated[StrictFloat, Field(gt=0)],
1738
+ Tuple[
1739
+ Annotated[StrictFloat, Field(gt=0)],
1740
+ Annotated[StrictFloat, Field(gt=0)]
1741
+ ]
1742
+ ] = None,
1743
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1744
+ _content_type: Optional[StrictStr] = None,
1745
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1746
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1747
+ ) -> None:
1748
+ """Uploads images to a dataset.
1749
+
1750
+ If multiple files are uploaded, a new datapoint will be created for each file.
1751
+
1752
+ :param dataset_id: The id of the dataset to upload the images to.
1753
+ :type dataset_id: str
1754
+ :param files:
1755
+ :type files: List[bytearray]
1756
+ :param _request_timeout: timeout setting for this request. If one
1757
+ number provided, it will be total request
1758
+ timeout. It can also be a pair (tuple) of
1759
+ (connection, read) timeouts.
1760
+ :type _request_timeout: int, tuple(int, int), optional
1761
+ :param _request_auth: set to override the auth_settings for an a single
1762
+ request; this effectively ignores the
1763
+ authentication in the spec for a single request.
1764
+ :type _request_auth: dict, optional
1765
+ :param _content_type: force content-type for the request.
1766
+ :type _content_type: str, Optional
1767
+ :param _headers: set to override the headers for a single
1768
+ request; this effectively ignores the headers
1769
+ in the spec for a single request.
1770
+ :type _headers: dict, optional
1771
+ :param _host_index: set to override the host_index for a single
1772
+ request; this effectively ignores the host_index
1773
+ in the spec for a single request.
1774
+ :type _host_index: int, optional
1775
+ :return: Returns the result object.
1776
+ """ # noqa: E501
1777
+
1778
+ _param = self._dataset_upload_images_to_dataset_post_serialize(
1779
+ dataset_id=dataset_id,
1780
+ files=files,
1781
+ _request_auth=_request_auth,
1782
+ _content_type=_content_type,
1783
+ _headers=_headers,
1784
+ _host_index=_host_index
1785
+ )
1786
+
1787
+ _response_types_map: Dict[str, Optional[str]] = {
1788
+ '200': None,
1789
+ }
1790
+ response_data = self.api_client.call_api(
1791
+ *_param,
1792
+ _request_timeout=_request_timeout
1793
+ )
1794
+ response_data.read()
1795
+ return self.api_client.response_deserialize(
1796
+ response_data=response_data,
1797
+ response_types_map=_response_types_map,
1798
+ ).data
1799
+
1800
+
1801
+ @validate_call
1802
+ def dataset_upload_images_to_dataset_post_with_http_info(
1803
+ self,
1804
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to upload the images to.")] = None,
1805
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1806
+ _request_timeout: Union[
1807
+ None,
1808
+ Annotated[StrictFloat, Field(gt=0)],
1809
+ Tuple[
1810
+ Annotated[StrictFloat, Field(gt=0)],
1811
+ Annotated[StrictFloat, Field(gt=0)]
1812
+ ]
1813
+ ] = None,
1814
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1815
+ _content_type: Optional[StrictStr] = None,
1816
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1817
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1818
+ ) -> ApiResponse[None]:
1819
+ """Uploads images to a dataset.
1820
+
1821
+ If multiple files are uploaded, a new datapoint will be created for each file.
1822
+
1823
+ :param dataset_id: The id of the dataset to upload the images to.
1824
+ :type dataset_id: str
1825
+ :param files:
1826
+ :type files: List[bytearray]
1827
+ :param _request_timeout: timeout setting for this request. If one
1828
+ number provided, it will be total request
1829
+ timeout. It can also be a pair (tuple) of
1830
+ (connection, read) timeouts.
1831
+ :type _request_timeout: int, tuple(int, int), optional
1832
+ :param _request_auth: set to override the auth_settings for an a single
1833
+ request; this effectively ignores the
1834
+ authentication in the spec for a single request.
1835
+ :type _request_auth: dict, optional
1836
+ :param _content_type: force content-type for the request.
1837
+ :type _content_type: str, Optional
1838
+ :param _headers: set to override the headers for a single
1839
+ request; this effectively ignores the headers
1840
+ in the spec for a single request.
1841
+ :type _headers: dict, optional
1842
+ :param _host_index: set to override the host_index for a single
1843
+ request; this effectively ignores the host_index
1844
+ in the spec for a single request.
1845
+ :type _host_index: int, optional
1846
+ :return: Returns the result object.
1847
+ """ # noqa: E501
1848
+
1849
+ _param = self._dataset_upload_images_to_dataset_post_serialize(
1850
+ dataset_id=dataset_id,
1851
+ files=files,
1852
+ _request_auth=_request_auth,
1853
+ _content_type=_content_type,
1854
+ _headers=_headers,
1855
+ _host_index=_host_index
1856
+ )
1857
+
1858
+ _response_types_map: Dict[str, Optional[str]] = {
1859
+ '200': None,
1860
+ }
1861
+ response_data = self.api_client.call_api(
1862
+ *_param,
1863
+ _request_timeout=_request_timeout
1864
+ )
1865
+ response_data.read()
1866
+ return self.api_client.response_deserialize(
1867
+ response_data=response_data,
1868
+ response_types_map=_response_types_map,
1869
+ )
1870
+
1871
+
1872
+ @validate_call
1873
+ def dataset_upload_images_to_dataset_post_without_preload_content(
1874
+ self,
1875
+ dataset_id: Annotated[Optional[StrictStr], Field(description="The id of the dataset to upload the images to.")] = None,
1876
+ files: Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]] = None,
1877
+ _request_timeout: Union[
1878
+ None,
1879
+ Annotated[StrictFloat, Field(gt=0)],
1880
+ Tuple[
1881
+ Annotated[StrictFloat, Field(gt=0)],
1882
+ Annotated[StrictFloat, Field(gt=0)]
1883
+ ]
1884
+ ] = None,
1885
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1886
+ _content_type: Optional[StrictStr] = None,
1887
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1888
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1889
+ ) -> RESTResponseType:
1890
+ """Uploads images to a dataset.
1891
+
1892
+ If multiple files are uploaded, a new datapoint will be created for each file.
1893
+
1894
+ :param dataset_id: The id of the dataset to upload the images to.
1895
+ :type dataset_id: str
1896
+ :param files:
1897
+ :type files: List[bytearray]
1898
+ :param _request_timeout: timeout setting for this request. If one
1899
+ number provided, it will be total request
1900
+ timeout. It can also be a pair (tuple) of
1901
+ (connection, read) timeouts.
1902
+ :type _request_timeout: int, tuple(int, int), optional
1903
+ :param _request_auth: set to override the auth_settings for an a single
1904
+ request; this effectively ignores the
1905
+ authentication in the spec for a single request.
1906
+ :type _request_auth: dict, optional
1907
+ :param _content_type: force content-type for the request.
1908
+ :type _content_type: str, Optional
1909
+ :param _headers: set to override the headers for a single
1910
+ request; this effectively ignores the headers
1911
+ in the spec for a single request.
1912
+ :type _headers: dict, optional
1913
+ :param _host_index: set to override the host_index for a single
1914
+ request; this effectively ignores the host_index
1915
+ in the spec for a single request.
1916
+ :type _host_index: int, optional
1917
+ :return: Returns the result object.
1918
+ """ # noqa: E501
1919
+
1920
+ _param = self._dataset_upload_images_to_dataset_post_serialize(
1921
+ dataset_id=dataset_id,
1922
+ files=files,
1923
+ _request_auth=_request_auth,
1924
+ _content_type=_content_type,
1925
+ _headers=_headers,
1926
+ _host_index=_host_index
1927
+ )
1928
+
1929
+ _response_types_map: Dict[str, Optional[str]] = {
1930
+ '200': None,
1931
+ }
1932
+ response_data = self.api_client.call_api(
1933
+ *_param,
1934
+ _request_timeout=_request_timeout
1935
+ )
1936
+ return response_data.response
1937
+
1938
+
1939
+ def _dataset_upload_images_to_dataset_post_serialize(
1940
+ self,
1941
+ dataset_id,
1942
+ files,
1943
+ _request_auth,
1944
+ _content_type,
1945
+ _headers,
1946
+ _host_index,
1947
+ ) -> RequestSerialized:
1948
+
1949
+ _host = None
1950
+
1951
+ _collection_formats: Dict[str, str] = {
1952
+ 'files': 'multi',
1953
+ }
1954
+
1955
+ _path_params: Dict[str, str] = {}
1956
+ _query_params: List[Tuple[str, str]] = []
1957
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1958
+ _form_params: List[Tuple[str, str]] = []
1959
+ _files: Dict[
1960
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1961
+ ] = {}
1962
+ _body_params: Optional[bytes] = None
1963
+
1964
+ # process the path parameters
1965
+ # process the query parameters
1966
+ if dataset_id is not None:
1967
+
1968
+ _query_params.append(('datasetId', dataset_id))
1969
+
1970
+ # process the header parameters
1971
+ # process the form parameters
1972
+ if files is not None:
1973
+ _files['files'] = files
1974
+ # process the body parameter
1975
+
1976
+
1977
+
1978
+ # set the HTTP header `Content-Type`
1979
+ if _content_type:
1980
+ _header_params['Content-Type'] = _content_type
1981
+ else:
1982
+ _default_content_type = (
1983
+ self.api_client.select_header_content_type(
1984
+ [
1985
+ 'multipart/form-data'
1986
+ ]
1987
+ )
1988
+ )
1989
+ if _default_content_type is not None:
1990
+ _header_params['Content-Type'] = _default_content_type
1991
+
1992
+ # authentication setting
1993
+ _auth_settings: List[str] = [
1994
+ 'bearer'
1995
+ ]
1996
+
1997
+ return self.api_client.param_serialize(
1998
+ method='POST',
1999
+ resource_path='/Dataset/UploadImagesToDataset',
2000
+ path_params=_path_params,
2001
+ query_params=_query_params,
2002
+ header_params=_header_params,
2003
+ body=_body_params,
2004
+ post_params=_form_params,
2005
+ files=_files,
2006
+ auth_settings=_auth_settings,
2007
+ collection_formats=_collection_formats,
2008
+ _host=_host,
2009
+ _request_auth=_request_auth
2010
+ )
2011
+
2012
+
2013
+
2014
+
2015
+ @validate_call
2016
+ def dataset_upload_text_sources_to_dataset_post(
2017
+ self,
2018
+ upload_text_sources_to_dataset_model: Annotated[Optional[UploadTextSourcesToDatasetModel], Field(description="The body of the request.")] = None,
2019
+ _request_timeout: Union[
2020
+ None,
2021
+ Annotated[StrictFloat, Field(gt=0)],
2022
+ Tuple[
2023
+ Annotated[StrictFloat, Field(gt=0)],
2024
+ Annotated[StrictFloat, Field(gt=0)]
2025
+ ]
2026
+ ] = None,
2027
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2028
+ _content_type: Optional[StrictStr] = None,
2029
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2030
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2031
+ ) -> UploadDatapointsResult:
2032
+ """Creates new datapoints from text sources.
2033
+
2034
+ If multiple text sources are uploaded, a new datapoint will be created for each text source.
2035
+
2036
+ :param upload_text_sources_to_dataset_model: The body of the request.
2037
+ :type upload_text_sources_to_dataset_model: UploadTextSourcesToDatasetModel
2038
+ :param _request_timeout: timeout setting for this request. If one
2039
+ number provided, it will be total request
2040
+ timeout. It can also be a pair (tuple) of
2041
+ (connection, read) timeouts.
2042
+ :type _request_timeout: int, tuple(int, int), optional
2043
+ :param _request_auth: set to override the auth_settings for an a single
2044
+ request; this effectively ignores the
2045
+ authentication in the spec for a single request.
2046
+ :type _request_auth: dict, optional
2047
+ :param _content_type: force content-type for the request.
2048
+ :type _content_type: str, Optional
2049
+ :param _headers: set to override the headers for a single
2050
+ request; this effectively ignores the headers
2051
+ in the spec for a single request.
2052
+ :type _headers: dict, optional
2053
+ :param _host_index: set to override the host_index for a single
2054
+ request; this effectively ignores the host_index
2055
+ in the spec for a single request.
2056
+ :type _host_index: int, optional
2057
+ :return: Returns the result object.
2058
+ """ # noqa: E501
2059
+
2060
+ _param = self._dataset_upload_text_sources_to_dataset_post_serialize(
2061
+ upload_text_sources_to_dataset_model=upload_text_sources_to_dataset_model,
2062
+ _request_auth=_request_auth,
2063
+ _content_type=_content_type,
2064
+ _headers=_headers,
2065
+ _host_index=_host_index
2066
+ )
2067
+
2068
+ _response_types_map: Dict[str, Optional[str]] = {
2069
+ '200': "UploadDatapointsResult",
2070
+ }
2071
+ response_data = self.api_client.call_api(
2072
+ *_param,
2073
+ _request_timeout=_request_timeout
2074
+ )
2075
+ response_data.read()
2076
+ return self.api_client.response_deserialize(
2077
+ response_data=response_data,
2078
+ response_types_map=_response_types_map,
2079
+ ).data
2080
+
2081
+
2082
+ @validate_call
2083
+ def dataset_upload_text_sources_to_dataset_post_with_http_info(
2084
+ self,
2085
+ upload_text_sources_to_dataset_model: Annotated[Optional[UploadTextSourcesToDatasetModel], Field(description="The body of the request.")] = None,
2086
+ _request_timeout: Union[
2087
+ None,
2088
+ Annotated[StrictFloat, Field(gt=0)],
2089
+ Tuple[
2090
+ Annotated[StrictFloat, Field(gt=0)],
2091
+ Annotated[StrictFloat, Field(gt=0)]
2092
+ ]
2093
+ ] = None,
2094
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2095
+ _content_type: Optional[StrictStr] = None,
2096
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2097
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2098
+ ) -> ApiResponse[UploadDatapointsResult]:
2099
+ """Creates new datapoints from text sources.
2100
+
2101
+ If multiple text sources are uploaded, a new datapoint will be created for each text source.
2102
+
2103
+ :param upload_text_sources_to_dataset_model: The body of the request.
2104
+ :type upload_text_sources_to_dataset_model: UploadTextSourcesToDatasetModel
2105
+ :param _request_timeout: timeout setting for this request. If one
2106
+ number provided, it will be total request
2107
+ timeout. It can also be a pair (tuple) of
2108
+ (connection, read) timeouts.
2109
+ :type _request_timeout: int, tuple(int, int), optional
2110
+ :param _request_auth: set to override the auth_settings for an a single
2111
+ request; this effectively ignores the
2112
+ authentication in the spec for a single request.
2113
+ :type _request_auth: dict, optional
2114
+ :param _content_type: force content-type for the request.
2115
+ :type _content_type: str, Optional
2116
+ :param _headers: set to override the headers for a single
2117
+ request; this effectively ignores the headers
2118
+ in the spec for a single request.
2119
+ :type _headers: dict, optional
2120
+ :param _host_index: set to override the host_index for a single
2121
+ request; this effectively ignores the host_index
2122
+ in the spec for a single request.
2123
+ :type _host_index: int, optional
2124
+ :return: Returns the result object.
2125
+ """ # noqa: E501
2126
+
2127
+ _param = self._dataset_upload_text_sources_to_dataset_post_serialize(
2128
+ upload_text_sources_to_dataset_model=upload_text_sources_to_dataset_model,
2129
+ _request_auth=_request_auth,
2130
+ _content_type=_content_type,
2131
+ _headers=_headers,
2132
+ _host_index=_host_index
2133
+ )
2134
+
2135
+ _response_types_map: Dict[str, Optional[str]] = {
2136
+ '200': "UploadDatapointsResult",
2137
+ }
2138
+ response_data = self.api_client.call_api(
2139
+ *_param,
2140
+ _request_timeout=_request_timeout
2141
+ )
2142
+ response_data.read()
2143
+ return self.api_client.response_deserialize(
2144
+ response_data=response_data,
2145
+ response_types_map=_response_types_map,
2146
+ )
2147
+
2148
+
2149
+ @validate_call
2150
+ def dataset_upload_text_sources_to_dataset_post_without_preload_content(
2151
+ self,
2152
+ upload_text_sources_to_dataset_model: Annotated[Optional[UploadTextSourcesToDatasetModel], Field(description="The body of the request.")] = None,
2153
+ _request_timeout: Union[
2154
+ None,
2155
+ Annotated[StrictFloat, Field(gt=0)],
2156
+ Tuple[
2157
+ Annotated[StrictFloat, Field(gt=0)],
2158
+ Annotated[StrictFloat, Field(gt=0)]
2159
+ ]
2160
+ ] = None,
2161
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2162
+ _content_type: Optional[StrictStr] = None,
2163
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2164
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2165
+ ) -> RESTResponseType:
2166
+ """Creates new datapoints from text sources.
2167
+
2168
+ If multiple text sources are uploaded, a new datapoint will be created for each text source.
2169
+
2170
+ :param upload_text_sources_to_dataset_model: The body of the request.
2171
+ :type upload_text_sources_to_dataset_model: UploadTextSourcesToDatasetModel
2172
+ :param _request_timeout: timeout setting for this request. If one
2173
+ number provided, it will be total request
2174
+ timeout. It can also be a pair (tuple) of
2175
+ (connection, read) timeouts.
2176
+ :type _request_timeout: int, tuple(int, int), optional
2177
+ :param _request_auth: set to override the auth_settings for an a single
2178
+ request; this effectively ignores the
2179
+ authentication in the spec for a single request.
2180
+ :type _request_auth: dict, optional
2181
+ :param _content_type: force content-type for the request.
2182
+ :type _content_type: str, Optional
2183
+ :param _headers: set to override the headers for a single
2184
+ request; this effectively ignores the headers
2185
+ in the spec for a single request.
2186
+ :type _headers: dict, optional
2187
+ :param _host_index: set to override the host_index for a single
2188
+ request; this effectively ignores the host_index
2189
+ in the spec for a single request.
2190
+ :type _host_index: int, optional
2191
+ :return: Returns the result object.
2192
+ """ # noqa: E501
2193
+
2194
+ _param = self._dataset_upload_text_sources_to_dataset_post_serialize(
2195
+ upload_text_sources_to_dataset_model=upload_text_sources_to_dataset_model,
2196
+ _request_auth=_request_auth,
2197
+ _content_type=_content_type,
2198
+ _headers=_headers,
2199
+ _host_index=_host_index
2200
+ )
2201
+
2202
+ _response_types_map: Dict[str, Optional[str]] = {
2203
+ '200': "UploadDatapointsResult",
2204
+ }
2205
+ response_data = self.api_client.call_api(
2206
+ *_param,
2207
+ _request_timeout=_request_timeout
2208
+ )
2209
+ return response_data.response
2210
+
2211
+
2212
+ def _dataset_upload_text_sources_to_dataset_post_serialize(
2213
+ self,
2214
+ upload_text_sources_to_dataset_model,
2215
+ _request_auth,
2216
+ _content_type,
2217
+ _headers,
2218
+ _host_index,
2219
+ ) -> RequestSerialized:
2220
+
2221
+ _host = None
2222
+
2223
+ _collection_formats: Dict[str, str] = {
2224
+ }
2225
+
2226
+ _path_params: Dict[str, str] = {}
2227
+ _query_params: List[Tuple[str, str]] = []
2228
+ _header_params: Dict[str, Optional[str]] = _headers or {}
2229
+ _form_params: List[Tuple[str, str]] = []
2230
+ _files: Dict[
2231
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
2232
+ ] = {}
2233
+ _body_params: Optional[bytes] = None
2234
+
2235
+ # process the path parameters
2236
+ # process the query parameters
2237
+ # process the header parameters
2238
+ # process the form parameters
2239
+ # process the body parameter
2240
+ if upload_text_sources_to_dataset_model is not None:
2241
+ _body_params = upload_text_sources_to_dataset_model
2242
+
2243
+
2244
+ # set the HTTP header `Accept`
2245
+ if 'Accept' not in _header_params:
2246
+ _header_params['Accept'] = self.api_client.select_header_accept(
2247
+ [
2248
+ 'text/plain',
2249
+ 'application/json',
2250
+ 'text/json'
2251
+ ]
2252
+ )
2253
+
2254
+ # set the HTTP header `Content-Type`
2255
+ if _content_type:
2256
+ _header_params['Content-Type'] = _content_type
2257
+ else:
2258
+ _default_content_type = (
2259
+ self.api_client.select_header_content_type(
2260
+ [
2261
+ 'application/json',
2262
+ 'text/json',
2263
+ 'application/*+json'
2264
+ ]
2265
+ )
2266
+ )
2267
+ if _default_content_type is not None:
2268
+ _header_params['Content-Type'] = _default_content_type
2269
+
2270
+ # authentication setting
2271
+ _auth_settings: List[str] = [
2272
+ 'bearer'
2273
+ ]
2274
+
2275
+ return self.api_client.param_serialize(
2276
+ method='POST',
2277
+ resource_path='/Dataset/UploadTextSourcesToDataset',
2278
+ path_params=_path_params,
2279
+ query_params=_query_params,
2280
+ header_params=_header_params,
2281
+ body=_body_params,
2282
+ post_params=_form_params,
2283
+ files=_files,
2284
+ auth_settings=_auth_settings,
2285
+ collection_formats=_collection_formats,
2286
+ _host=_host,
2287
+ _request_auth=_request_auth
2288
+ )
2289
+
2290
+