qi-compute-api-client 0.56.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. compute_api_client/__init__.py +219 -0
  2. compute_api_client/api/__init__.py +23 -0
  3. compute_api_client/api/algorithms_api.py +1603 -0
  4. compute_api_client/api/auth_config_api.py +278 -0
  5. compute_api_client/api/backend_api.py +1540 -0
  6. compute_api_client/api/backend_types_api.py +1178 -0
  7. compute_api_client/api/batch_jobs_api.py +2224 -0
  8. compute_api_client/api/commits_api.py +1565 -0
  9. compute_api_client/api/files_api.py +1307 -0
  10. compute_api_client/api/final_results_api.py +847 -0
  11. compute_api_client/api/health_api.py +281 -0
  12. compute_api_client/api/jobs_api.py +1787 -0
  13. compute_api_client/api/languages_api.py +692 -0
  14. compute_api_client/api/members_api.py +1238 -0
  15. compute_api_client/api/metadata_api.py +930 -0
  16. compute_api_client/api/permissions_api.py +1295 -0
  17. compute_api_client/api/projects_api.py +1889 -0
  18. compute_api_client/api/reservations_api.py +1324 -0
  19. compute_api_client/api/results_api.py +1702 -0
  20. compute_api_client/api/teams_api.py +692 -0
  21. compute_api_client/api/transactions_api.py +805 -0
  22. compute_api_client/api/users_api.py +1305 -0
  23. compute_api_client/api_client.py +804 -0
  24. compute_api_client/api_response.py +21 -0
  25. compute_api_client/configuration.py +606 -0
  26. compute_api_client/docs/Algorithm.md +34 -0
  27. compute_api_client/docs/AlgorithmIn.md +33 -0
  28. compute_api_client/docs/AlgorithmType.md +12 -0
  29. compute_api_client/docs/AlgorithmsApi.md +428 -0
  30. compute_api_client/docs/AuthConfig.md +31 -0
  31. compute_api_client/docs/AuthConfigApi.md +71 -0
  32. compute_api_client/docs/Backend.md +35 -0
  33. compute_api_client/docs/BackendApi.md +418 -0
  34. compute_api_client/docs/BackendIn.md +34 -0
  35. compute_api_client/docs/BackendMessage.md +29 -0
  36. compute_api_client/docs/BackendPatch.md +31 -0
  37. compute_api_client/docs/BackendStatus.md +16 -0
  38. compute_api_client/docs/BackendType.md +48 -0
  39. compute_api_client/docs/BackendTypePatch.md +45 -0
  40. compute_api_client/docs/BackendTypesApi.md +289 -0
  41. compute_api_client/docs/BackendWithAuthentication.md +36 -0
  42. compute_api_client/docs/BatchJob.md +39 -0
  43. compute_api_client/docs/BatchJobIn.md +29 -0
  44. compute_api_client/docs/BatchJobStatus.md +18 -0
  45. compute_api_client/docs/BatchJobsApi.md +600 -0
  46. compute_api_client/docs/Commit.md +33 -0
  47. compute_api_client/docs/CommitIn.md +30 -0
  48. compute_api_client/docs/CommitsApi.md +425 -0
  49. compute_api_client/docs/CompilePayload.md +30 -0
  50. compute_api_client/docs/CompileStage.md +18 -0
  51. compute_api_client/docs/Domain.md +14 -0
  52. compute_api_client/docs/File.md +36 -0
  53. compute_api_client/docs/FileIn.md +35 -0
  54. compute_api_client/docs/FilesApi.md +346 -0
  55. compute_api_client/docs/FinalResult.md +32 -0
  56. compute_api_client/docs/FinalResultIn.md +30 -0
  57. compute_api_client/docs/FinalResultsApi.md +248 -0
  58. compute_api_client/docs/HTTPBadRequestError.md +29 -0
  59. compute_api_client/docs/HTTPNotFoundError.md +29 -0
  60. compute_api_client/docs/HTTPValidationError.md +29 -0
  61. compute_api_client/docs/HealthApi.md +72 -0
  62. compute_api_client/docs/Job.md +42 -0
  63. compute_api_client/docs/JobIn.md +32 -0
  64. compute_api_client/docs/JobPatch.md +34 -0
  65. compute_api_client/docs/JobStatus.md +18 -0
  66. compute_api_client/docs/JobsApi.md +460 -0
  67. compute_api_client/docs/Language.md +31 -0
  68. compute_api_client/docs/LanguagesApi.md +177 -0
  69. compute_api_client/docs/LocationInner.md +27 -0
  70. compute_api_client/docs/Member.md +33 -0
  71. compute_api_client/docs/MemberId.md +28 -0
  72. compute_api_client/docs/MemberIn.md +32 -0
  73. compute_api_client/docs/MembersApi.md +331 -0
  74. compute_api_client/docs/PageAlgorithm.md +33 -0
  75. compute_api_client/docs/PageBackend.md +33 -0
  76. compute_api_client/docs/PageBackendType.md +33 -0
  77. compute_api_client/docs/PageBatchJob.md +33 -0
  78. compute_api_client/docs/PageCommit.md +33 -0
  79. compute_api_client/docs/PageFile.md +33 -0
  80. compute_api_client/docs/PageJob.md +33 -0
  81. compute_api_client/docs/PageLanguage.md +33 -0
  82. compute_api_client/docs/PageMember.md +33 -0
  83. compute_api_client/docs/PageMetadata.md +32 -0
  84. compute_api_client/docs/PagePermission.md +33 -0
  85. compute_api_client/docs/PagePermissionGroup.md +33 -0
  86. compute_api_client/docs/PageProject.md +33 -0
  87. compute_api_client/docs/PageReservation.md +33 -0
  88. compute_api_client/docs/PageResult.md +33 -0
  89. compute_api_client/docs/PageTeam.md +33 -0
  90. compute_api_client/docs/PageTransaction.md +33 -0
  91. compute_api_client/docs/PageUser.md +33 -0
  92. compute_api_client/docs/Permission.md +31 -0
  93. compute_api_client/docs/PermissionGroup.md +30 -0
  94. compute_api_client/docs/PermissionsApi.md +340 -0
  95. compute_api_client/docs/Project.md +34 -0
  96. compute_api_client/docs/ProjectIn.md +32 -0
  97. compute_api_client/docs/ProjectPatch.md +32 -0
  98. compute_api_client/docs/ProjectsApi.md +502 -0
  99. compute_api_client/docs/Reservation.md +35 -0
  100. compute_api_client/docs/ReservationIn.md +32 -0
  101. compute_api_client/docs/ReservationsApi.md +341 -0
  102. compute_api_client/docs/Result.md +36 -0
  103. compute_api_client/docs/ResultIn.md +34 -0
  104. compute_api_client/docs/ResultsApi.md +439 -0
  105. compute_api_client/docs/Role.md +12 -0
  106. compute_api_client/docs/ShareType.md +14 -0
  107. compute_api_client/docs/Team.md +32 -0
  108. compute_api_client/docs/TeamsApi.md +177 -0
  109. compute_api_client/docs/Transaction.md +35 -0
  110. compute_api_client/docs/TransactionDomain.md +28 -0
  111. compute_api_client/docs/TransactionsApi.md +190 -0
  112. compute_api_client/docs/User.md +36 -0
  113. compute_api_client/docs/UserIn.md +35 -0
  114. compute_api_client/docs/UsersApi.md +338 -0
  115. compute_api_client/docs/ValidationError.md +31 -0
  116. compute_api_client/docs/ValidationErrorLocInner.md +28 -0
  117. compute_api_client/exceptions.py +216 -0
  118. compute_api_client/models/__init__.py +84 -0
  119. compute_api_client/models/algorithm.py +105 -0
  120. compute_api_client/models/algorithm_in.py +103 -0
  121. compute_api_client/models/algorithm_type.py +37 -0
  122. compute_api_client/models/auth_config.py +91 -0
  123. compute_api_client/models/backend.py +106 -0
  124. compute_api_client/models/backend_in.py +104 -0
  125. compute_api_client/models/backend_message.py +87 -0
  126. compute_api_client/models/backend_patch.py +112 -0
  127. compute_api_client/models/backend_status.py +39 -0
  128. compute_api_client/models/backend_type.py +145 -0
  129. compute_api_client/models/backend_type_patch.py +205 -0
  130. compute_api_client/models/backend_with_authentication.py +108 -0
  131. compute_api_client/models/batch_job.py +130 -0
  132. compute_api_client/models/batch_job_in.py +87 -0
  133. compute_api_client/models/batch_job_status.py +40 -0
  134. compute_api_client/models/commit.py +97 -0
  135. compute_api_client/models/commit_in.py +89 -0
  136. compute_api_client/models/compile_payload.py +95 -0
  137. compute_api_client/models/compile_stage.py +40 -0
  138. compute_api_client/models/domain.py +38 -0
  139. compute_api_client/models/file.py +108 -0
  140. compute_api_client/models/file_in.py +106 -0
  141. compute_api_client/models/final_result.py +94 -0
  142. compute_api_client/models/final_result_in.py +89 -0
  143. compute_api_client/models/http_bad_request_error.py +87 -0
  144. compute_api_client/models/http_not_found_error.py +87 -0
  145. compute_api_client/models/http_validation_error.py +95 -0
  146. compute_api_client/models/job.py +131 -0
  147. compute_api_client/models/job_in.py +98 -0
  148. compute_api_client/models/job_patch.py +99 -0
  149. compute_api_client/models/job_status.py +40 -0
  150. compute_api_client/models/language.py +92 -0
  151. compute_api_client/models/location_inner.py +144 -0
  152. compute_api_client/models/member.py +96 -0
  153. compute_api_client/models/member_id.py +144 -0
  154. compute_api_client/models/member_in.py +94 -0
  155. compute_api_client/models/metadata.py +93 -0
  156. compute_api_client/models/metadata_in.py +94 -0
  157. compute_api_client/models/page_algorithm.py +104 -0
  158. compute_api_client/models/page_backend.py +104 -0
  159. compute_api_client/models/page_backend_type.py +104 -0
  160. compute_api_client/models/page_batch_job.py +104 -0
  161. compute_api_client/models/page_commit.py +104 -0
  162. compute_api_client/models/page_file.py +104 -0
  163. compute_api_client/models/page_job.py +104 -0
  164. compute_api_client/models/page_language.py +104 -0
  165. compute_api_client/models/page_member.py +104 -0
  166. compute_api_client/models/page_metadata.py +125 -0
  167. compute_api_client/models/page_permission.py +104 -0
  168. compute_api_client/models/page_permission_group.py +104 -0
  169. compute_api_client/models/page_project.py +104 -0
  170. compute_api_client/models/page_reservation.py +104 -0
  171. compute_api_client/models/page_result.py +104 -0
  172. compute_api_client/models/page_team.py +104 -0
  173. compute_api_client/models/page_transaction.py +104 -0
  174. compute_api_client/models/page_user.py +104 -0
  175. compute_api_client/models/permission.py +92 -0
  176. compute_api_client/models/permission_group.py +90 -0
  177. compute_api_client/models/project.py +99 -0
  178. compute_api_client/models/project_in.py +94 -0
  179. compute_api_client/models/project_patch.py +114 -0
  180. compute_api_client/models/reservation.py +105 -0
  181. compute_api_client/models/reservation_in.py +94 -0
  182. compute_api_client/models/result.py +122 -0
  183. compute_api_client/models/result_in.py +117 -0
  184. compute_api_client/models/role.py +37 -0
  185. compute_api_client/models/share_type.py +38 -0
  186. compute_api_client/models/team.py +94 -0
  187. compute_api_client/models/transaction.py +117 -0
  188. compute_api_client/models/transaction_domain.py +142 -0
  189. compute_api_client/models/user.py +102 -0
  190. compute_api_client/models/user_in.py +100 -0
  191. compute_api_client/models/validation_error.py +99 -0
  192. compute_api_client/models/validation_error_loc_inner.py +138 -0
  193. compute_api_client/rest.py +213 -0
  194. qi2_shared/__init__.py +0 -0
  195. qi2_shared/authentication.py +66 -0
  196. qi2_shared/client.py +52 -0
  197. qi2_shared/hybrid/__init__.py +0 -0
  198. qi2_shared/hybrid/quantum_interface.py +45 -0
  199. qi2_shared/pagination.py +44 -0
  200. qi2_shared/settings.py +68 -0
  201. qi2_shared/utils.py +13 -0
  202. qi_compute_api_client-0.56.0.dist-info/METADATA +266 -0
  203. qi_compute_api_client-0.56.0.dist-info/RECORD +205 -0
  204. qi_compute_api_client-0.56.0.dist-info/WHEEL +4 -0
  205. qi_compute_api_client-0.56.0.dist-info/licenses/LICENSE.md +142 -0
@@ -0,0 +1,1603 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
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, StrictBool, StrictInt, StrictStr
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from compute_api_client.models.algorithm import Algorithm
23
+ from compute_api_client.models.algorithm_in import AlgorithmIn
24
+ from compute_api_client.models.algorithm_type import AlgorithmType
25
+ from compute_api_client.models.page_algorithm import PageAlgorithm
26
+ from compute_api_client.models.share_type import ShareType
27
+
28
+ from compute_api_client.api_client import ApiClient, RequestSerialized
29
+ from compute_api_client.api_response import ApiResponse
30
+ from compute_api_client.rest import RESTResponseType
31
+
32
+
33
+ class AlgorithmsApi:
34
+ """NOTE: This class is auto generated by OpenAPI Generator
35
+ Ref: https://openapi-generator.tech
36
+
37
+ Do not edit the class manually.
38
+ """
39
+
40
+ def __init__(self, api_client=None) -> None:
41
+ if api_client is None:
42
+ api_client = ApiClient.get_default()
43
+ self.api_client = api_client
44
+
45
+
46
+ @validate_call
47
+ async def create_algorithm_algorithms_post(
48
+ self,
49
+ algorithm_in: AlgorithmIn,
50
+ _request_timeout: Union[
51
+ None,
52
+ Annotated[StrictFloat, Field(gt=0)],
53
+ Tuple[
54
+ Annotated[StrictFloat, Field(gt=0)],
55
+ Annotated[StrictFloat, Field(gt=0)]
56
+ ]
57
+ ] = None,
58
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
59
+ _content_type: Optional[StrictStr] = None,
60
+ _headers: Optional[Dict[StrictStr, Any]] = None,
61
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
62
+ ) -> Algorithm:
63
+ """Create algorithm
64
+
65
+ Create new algorithm.
66
+
67
+ :param algorithm_in: (required)
68
+ :type algorithm_in: AlgorithmIn
69
+ :param _request_timeout: timeout setting for this request. If one
70
+ number provided, it will be total request
71
+ timeout. It can also be a pair (tuple) of
72
+ (connection, read) timeouts.
73
+ :type _request_timeout: int, tuple(int, int), optional
74
+ :param _request_auth: set to override the auth_settings for an a single
75
+ request; this effectively ignores the
76
+ authentication in the spec for a single request.
77
+ :type _request_auth: dict, optional
78
+ :param _content_type: force content-type for the request.
79
+ :type _content_type: str, Optional
80
+ :param _headers: set to override the headers for a single
81
+ request; this effectively ignores the headers
82
+ in the spec for a single request.
83
+ :type _headers: dict, optional
84
+ :param _host_index: set to override the host_index for a single
85
+ request; this effectively ignores the host_index
86
+ in the spec for a single request.
87
+ :type _host_index: int, optional
88
+ :return: Returns the result object.
89
+ """ # noqa: E501
90
+
91
+ _param = self._create_algorithm_algorithms_post_serialize(
92
+ algorithm_in=algorithm_in,
93
+ _request_auth=_request_auth,
94
+ _content_type=_content_type,
95
+ _headers=_headers,
96
+ _host_index=_host_index
97
+ )
98
+
99
+ _response_types_map: Dict[str, Optional[str]] = {
100
+ '201': "Algorithm",
101
+ '422': "HTTPValidationError",
102
+ }
103
+ response_data = await self.api_client.call_api(
104
+ *_param,
105
+ _request_timeout=_request_timeout
106
+ )
107
+ await response_data.read()
108
+ return self.api_client.response_deserialize(
109
+ response_data=response_data,
110
+ response_types_map=_response_types_map,
111
+ ).data
112
+
113
+
114
+ @validate_call
115
+ async def create_algorithm_algorithms_post_with_http_info(
116
+ self,
117
+ algorithm_in: AlgorithmIn,
118
+ _request_timeout: Union[
119
+ None,
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Tuple[
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Annotated[StrictFloat, Field(gt=0)]
124
+ ]
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[Algorithm]:
131
+ """Create algorithm
132
+
133
+ Create new algorithm.
134
+
135
+ :param algorithm_in: (required)
136
+ :type algorithm_in: AlgorithmIn
137
+ :param _request_timeout: timeout setting for this request. If one
138
+ number provided, it will be total request
139
+ timeout. It can also be a pair (tuple) of
140
+ (connection, read) timeouts.
141
+ :type _request_timeout: int, tuple(int, int), optional
142
+ :param _request_auth: set to override the auth_settings for an a single
143
+ request; this effectively ignores the
144
+ authentication in the spec for a single request.
145
+ :type _request_auth: dict, optional
146
+ :param _content_type: force content-type for the request.
147
+ :type _content_type: str, Optional
148
+ :param _headers: set to override the headers for a single
149
+ request; this effectively ignores the headers
150
+ in the spec for a single request.
151
+ :type _headers: dict, optional
152
+ :param _host_index: set to override the host_index for a single
153
+ request; this effectively ignores the host_index
154
+ in the spec for a single request.
155
+ :type _host_index: int, optional
156
+ :return: Returns the result object.
157
+ """ # noqa: E501
158
+
159
+ _param = self._create_algorithm_algorithms_post_serialize(
160
+ algorithm_in=algorithm_in,
161
+ _request_auth=_request_auth,
162
+ _content_type=_content_type,
163
+ _headers=_headers,
164
+ _host_index=_host_index
165
+ )
166
+
167
+ _response_types_map: Dict[str, Optional[str]] = {
168
+ '201': "Algorithm",
169
+ '422': "HTTPValidationError",
170
+ }
171
+ response_data = await self.api_client.call_api(
172
+ *_param,
173
+ _request_timeout=_request_timeout
174
+ )
175
+ await response_data.read()
176
+ return self.api_client.response_deserialize(
177
+ response_data=response_data,
178
+ response_types_map=_response_types_map,
179
+ )
180
+
181
+
182
+ @validate_call
183
+ async def create_algorithm_algorithms_post_without_preload_content(
184
+ self,
185
+ algorithm_in: AlgorithmIn,
186
+ _request_timeout: Union[
187
+ None,
188
+ Annotated[StrictFloat, Field(gt=0)],
189
+ Tuple[
190
+ Annotated[StrictFloat, Field(gt=0)],
191
+ Annotated[StrictFloat, Field(gt=0)]
192
+ ]
193
+ ] = None,
194
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
195
+ _content_type: Optional[StrictStr] = None,
196
+ _headers: Optional[Dict[StrictStr, Any]] = None,
197
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
198
+ ) -> RESTResponseType:
199
+ """Create algorithm
200
+
201
+ Create new algorithm.
202
+
203
+ :param algorithm_in: (required)
204
+ :type algorithm_in: AlgorithmIn
205
+ :param _request_timeout: timeout setting for this request. If one
206
+ number provided, it will be total request
207
+ timeout. It can also be a pair (tuple) of
208
+ (connection, read) timeouts.
209
+ :type _request_timeout: int, tuple(int, int), optional
210
+ :param _request_auth: set to override the auth_settings for an a single
211
+ request; this effectively ignores the
212
+ authentication in the spec for a single request.
213
+ :type _request_auth: dict, optional
214
+ :param _content_type: force content-type for the request.
215
+ :type _content_type: str, Optional
216
+ :param _headers: set to override the headers for a single
217
+ request; this effectively ignores the headers
218
+ in the spec for a single request.
219
+ :type _headers: dict, optional
220
+ :param _host_index: set to override the host_index for a single
221
+ request; this effectively ignores the host_index
222
+ in the spec for a single request.
223
+ :type _host_index: int, optional
224
+ :return: Returns the result object.
225
+ """ # noqa: E501
226
+
227
+ _param = self._create_algorithm_algorithms_post_serialize(
228
+ algorithm_in=algorithm_in,
229
+ _request_auth=_request_auth,
230
+ _content_type=_content_type,
231
+ _headers=_headers,
232
+ _host_index=_host_index
233
+ )
234
+
235
+ _response_types_map: Dict[str, Optional[str]] = {
236
+ '201': "Algorithm",
237
+ '422': "HTTPValidationError",
238
+ }
239
+ response_data = await self.api_client.call_api(
240
+ *_param,
241
+ _request_timeout=_request_timeout
242
+ )
243
+ return response_data.response
244
+
245
+
246
+ def _create_algorithm_algorithms_post_serialize(
247
+ self,
248
+ algorithm_in,
249
+ _request_auth,
250
+ _content_type,
251
+ _headers,
252
+ _host_index,
253
+ ) -> RequestSerialized:
254
+
255
+ _host = None
256
+
257
+ _collection_formats: Dict[str, str] = {
258
+ }
259
+
260
+ _path_params: Dict[str, str] = {}
261
+ _query_params: List[Tuple[str, str]] = []
262
+ _header_params: Dict[str, Optional[str]] = _headers or {}
263
+ _form_params: List[Tuple[str, str]] = []
264
+ _files: Dict[
265
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
266
+ ] = {}
267
+ _body_params: Optional[bytes] = None
268
+
269
+ # process the path parameters
270
+ # process the query parameters
271
+ # process the header parameters
272
+ # process the form parameters
273
+ # process the body parameter
274
+ if algorithm_in is not None:
275
+ _body_params = algorithm_in
276
+
277
+
278
+ # set the HTTP header `Accept`
279
+ if 'Accept' not in _header_params:
280
+ _header_params['Accept'] = self.api_client.select_header_accept(
281
+ [
282
+ 'application/json'
283
+ ]
284
+ )
285
+
286
+ # set the HTTP header `Content-Type`
287
+ if _content_type:
288
+ _header_params['Content-Type'] = _content_type
289
+ else:
290
+ _default_content_type = (
291
+ self.api_client.select_header_content_type(
292
+ [
293
+ 'application/json'
294
+ ]
295
+ )
296
+ )
297
+ if _default_content_type is not None:
298
+ _header_params['Content-Type'] = _default_content_type
299
+
300
+ # authentication setting
301
+ _auth_settings: List[str] = [
302
+ 'user_bearer'
303
+ ]
304
+
305
+ return self.api_client.param_serialize(
306
+ method='POST',
307
+ resource_path='/algorithms',
308
+ path_params=_path_params,
309
+ query_params=_query_params,
310
+ header_params=_header_params,
311
+ body=_body_params,
312
+ post_params=_form_params,
313
+ files=_files,
314
+ auth_settings=_auth_settings,
315
+ collection_formats=_collection_formats,
316
+ _host=_host,
317
+ _request_auth=_request_auth
318
+ )
319
+
320
+
321
+
322
+
323
+ @validate_call
324
+ async def delete_algorithm_algorithms_id_delete(
325
+ self,
326
+ id: StrictInt,
327
+ _request_timeout: Union[
328
+ None,
329
+ Annotated[StrictFloat, Field(gt=0)],
330
+ Tuple[
331
+ Annotated[StrictFloat, Field(gt=0)],
332
+ Annotated[StrictFloat, Field(gt=0)]
333
+ ]
334
+ ] = None,
335
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
336
+ _content_type: Optional[StrictStr] = None,
337
+ _headers: Optional[Dict[StrictStr, Any]] = None,
338
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
339
+ ) -> None:
340
+ """Destroy algorithm
341
+
342
+ Delete an algorithm.
343
+
344
+ :param id: (required)
345
+ :type id: int
346
+ :param _request_timeout: timeout setting for this request. If one
347
+ number provided, it will be total request
348
+ timeout. It can also be a pair (tuple) of
349
+ (connection, read) timeouts.
350
+ :type _request_timeout: int, tuple(int, int), optional
351
+ :param _request_auth: set to override the auth_settings for an a single
352
+ request; this effectively ignores the
353
+ authentication in the spec for a single request.
354
+ :type _request_auth: dict, optional
355
+ :param _content_type: force content-type for the request.
356
+ :type _content_type: str, Optional
357
+ :param _headers: set to override the headers for a single
358
+ request; this effectively ignores the headers
359
+ in the spec for a single request.
360
+ :type _headers: dict, optional
361
+ :param _host_index: set to override the host_index for a single
362
+ request; this effectively ignores the host_index
363
+ in the spec for a single request.
364
+ :type _host_index: int, optional
365
+ :return: Returns the result object.
366
+ """ # noqa: E501
367
+
368
+ _param = self._delete_algorithm_algorithms_id_delete_serialize(
369
+ id=id,
370
+ _request_auth=_request_auth,
371
+ _content_type=_content_type,
372
+ _headers=_headers,
373
+ _host_index=_host_index
374
+ )
375
+
376
+ _response_types_map: Dict[str, Optional[str]] = {
377
+ '204': None,
378
+ '404': "HTTPNotFoundError",
379
+ '422': "HTTPValidationError",
380
+ }
381
+ response_data = await self.api_client.call_api(
382
+ *_param,
383
+ _request_timeout=_request_timeout
384
+ )
385
+ await response_data.read()
386
+ return self.api_client.response_deserialize(
387
+ response_data=response_data,
388
+ response_types_map=_response_types_map,
389
+ ).data
390
+
391
+
392
+ @validate_call
393
+ async def delete_algorithm_algorithms_id_delete_with_http_info(
394
+ self,
395
+ id: StrictInt,
396
+ _request_timeout: Union[
397
+ None,
398
+ Annotated[StrictFloat, Field(gt=0)],
399
+ Tuple[
400
+ Annotated[StrictFloat, Field(gt=0)],
401
+ Annotated[StrictFloat, Field(gt=0)]
402
+ ]
403
+ ] = None,
404
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
405
+ _content_type: Optional[StrictStr] = None,
406
+ _headers: Optional[Dict[StrictStr, Any]] = None,
407
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
408
+ ) -> ApiResponse[None]:
409
+ """Destroy algorithm
410
+
411
+ Delete an algorithm.
412
+
413
+ :param id: (required)
414
+ :type id: int
415
+ :param _request_timeout: timeout setting for this request. If one
416
+ number provided, it will be total request
417
+ timeout. It can also be a pair (tuple) of
418
+ (connection, read) timeouts.
419
+ :type _request_timeout: int, tuple(int, int), optional
420
+ :param _request_auth: set to override the auth_settings for an a single
421
+ request; this effectively ignores the
422
+ authentication in the spec for a single request.
423
+ :type _request_auth: dict, optional
424
+ :param _content_type: force content-type for the request.
425
+ :type _content_type: str, Optional
426
+ :param _headers: set to override the headers for a single
427
+ request; this effectively ignores the headers
428
+ in the spec for a single request.
429
+ :type _headers: dict, optional
430
+ :param _host_index: set to override the host_index for a single
431
+ request; this effectively ignores the host_index
432
+ in the spec for a single request.
433
+ :type _host_index: int, optional
434
+ :return: Returns the result object.
435
+ """ # noqa: E501
436
+
437
+ _param = self._delete_algorithm_algorithms_id_delete_serialize(
438
+ id=id,
439
+ _request_auth=_request_auth,
440
+ _content_type=_content_type,
441
+ _headers=_headers,
442
+ _host_index=_host_index
443
+ )
444
+
445
+ _response_types_map: Dict[str, Optional[str]] = {
446
+ '204': None,
447
+ '404': "HTTPNotFoundError",
448
+ '422': "HTTPValidationError",
449
+ }
450
+ response_data = await self.api_client.call_api(
451
+ *_param,
452
+ _request_timeout=_request_timeout
453
+ )
454
+ await response_data.read()
455
+ return self.api_client.response_deserialize(
456
+ response_data=response_data,
457
+ response_types_map=_response_types_map,
458
+ )
459
+
460
+
461
+ @validate_call
462
+ async def delete_algorithm_algorithms_id_delete_without_preload_content(
463
+ self,
464
+ id: StrictInt,
465
+ _request_timeout: Union[
466
+ None,
467
+ Annotated[StrictFloat, Field(gt=0)],
468
+ Tuple[
469
+ Annotated[StrictFloat, Field(gt=0)],
470
+ Annotated[StrictFloat, Field(gt=0)]
471
+ ]
472
+ ] = None,
473
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
474
+ _content_type: Optional[StrictStr] = None,
475
+ _headers: Optional[Dict[StrictStr, Any]] = None,
476
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
477
+ ) -> RESTResponseType:
478
+ """Destroy algorithm
479
+
480
+ Delete an algorithm.
481
+
482
+ :param id: (required)
483
+ :type id: int
484
+ :param _request_timeout: timeout setting for this request. If one
485
+ number provided, it will be total request
486
+ timeout. It can also be a pair (tuple) of
487
+ (connection, read) timeouts.
488
+ :type _request_timeout: int, tuple(int, int), optional
489
+ :param _request_auth: set to override the auth_settings for an a single
490
+ request; this effectively ignores the
491
+ authentication in the spec for a single request.
492
+ :type _request_auth: dict, optional
493
+ :param _content_type: force content-type for the request.
494
+ :type _content_type: str, Optional
495
+ :param _headers: set to override the headers for a single
496
+ request; this effectively ignores the headers
497
+ in the spec for a single request.
498
+ :type _headers: dict, optional
499
+ :param _host_index: set to override the host_index for a single
500
+ request; this effectively ignores the host_index
501
+ in the spec for a single request.
502
+ :type _host_index: int, optional
503
+ :return: Returns the result object.
504
+ """ # noqa: E501
505
+
506
+ _param = self._delete_algorithm_algorithms_id_delete_serialize(
507
+ id=id,
508
+ _request_auth=_request_auth,
509
+ _content_type=_content_type,
510
+ _headers=_headers,
511
+ _host_index=_host_index
512
+ )
513
+
514
+ _response_types_map: Dict[str, Optional[str]] = {
515
+ '204': None,
516
+ '404': "HTTPNotFoundError",
517
+ '422': "HTTPValidationError",
518
+ }
519
+ response_data = await self.api_client.call_api(
520
+ *_param,
521
+ _request_timeout=_request_timeout
522
+ )
523
+ return response_data.response
524
+
525
+
526
+ def _delete_algorithm_algorithms_id_delete_serialize(
527
+ self,
528
+ id,
529
+ _request_auth,
530
+ _content_type,
531
+ _headers,
532
+ _host_index,
533
+ ) -> RequestSerialized:
534
+
535
+ _host = None
536
+
537
+ _collection_formats: Dict[str, str] = {
538
+ }
539
+
540
+ _path_params: Dict[str, str] = {}
541
+ _query_params: List[Tuple[str, str]] = []
542
+ _header_params: Dict[str, Optional[str]] = _headers or {}
543
+ _form_params: List[Tuple[str, str]] = []
544
+ _files: Dict[
545
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
546
+ ] = {}
547
+ _body_params: Optional[bytes] = None
548
+
549
+ # process the path parameters
550
+ if id is not None:
551
+ _path_params['id'] = id
552
+ # process the query parameters
553
+ # process the header parameters
554
+ # process the form parameters
555
+ # process the body parameter
556
+
557
+
558
+ # set the HTTP header `Accept`
559
+ if 'Accept' not in _header_params:
560
+ _header_params['Accept'] = self.api_client.select_header_accept(
561
+ [
562
+ 'application/json'
563
+ ]
564
+ )
565
+
566
+
567
+ # authentication setting
568
+ _auth_settings: List[str] = [
569
+ 'user_bearer'
570
+ ]
571
+
572
+ return self.api_client.param_serialize(
573
+ method='DELETE',
574
+ resource_path='/algorithms/{id}',
575
+ path_params=_path_params,
576
+ query_params=_query_params,
577
+ header_params=_header_params,
578
+ body=_body_params,
579
+ post_params=_form_params,
580
+ files=_files,
581
+ auth_settings=_auth_settings,
582
+ collection_formats=_collection_formats,
583
+ _host=_host,
584
+ _request_auth=_request_auth
585
+ )
586
+
587
+
588
+
589
+
590
+ @validate_call
591
+ async def read_algorithm_algorithms_id_get(
592
+ self,
593
+ id: StrictInt,
594
+ _request_timeout: Union[
595
+ None,
596
+ Annotated[StrictFloat, Field(gt=0)],
597
+ Tuple[
598
+ Annotated[StrictFloat, Field(gt=0)],
599
+ Annotated[StrictFloat, Field(gt=0)]
600
+ ]
601
+ ] = None,
602
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
603
+ _content_type: Optional[StrictStr] = None,
604
+ _headers: Optional[Dict[StrictStr, Any]] = None,
605
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
606
+ ) -> Algorithm:
607
+ """Retrieve algorithm
608
+
609
+ Get algorithm by ID.
610
+
611
+ :param id: (required)
612
+ :type id: int
613
+ :param _request_timeout: timeout setting for this request. If one
614
+ number provided, it will be total request
615
+ timeout. It can also be a pair (tuple) of
616
+ (connection, read) timeouts.
617
+ :type _request_timeout: int, tuple(int, int), optional
618
+ :param _request_auth: set to override the auth_settings for an a single
619
+ request; this effectively ignores the
620
+ authentication in the spec for a single request.
621
+ :type _request_auth: dict, optional
622
+ :param _content_type: force content-type for the request.
623
+ :type _content_type: str, Optional
624
+ :param _headers: set to override the headers for a single
625
+ request; this effectively ignores the headers
626
+ in the spec for a single request.
627
+ :type _headers: dict, optional
628
+ :param _host_index: set to override the host_index for a single
629
+ request; this effectively ignores the host_index
630
+ in the spec for a single request.
631
+ :type _host_index: int, optional
632
+ :return: Returns the result object.
633
+ """ # noqa: E501
634
+
635
+ _param = self._read_algorithm_algorithms_id_get_serialize(
636
+ id=id,
637
+ _request_auth=_request_auth,
638
+ _content_type=_content_type,
639
+ _headers=_headers,
640
+ _host_index=_host_index
641
+ )
642
+
643
+ _response_types_map: Dict[str, Optional[str]] = {
644
+ '200': "Algorithm",
645
+ '404': "HTTPNotFoundError",
646
+ '422': "HTTPValidationError",
647
+ }
648
+ response_data = await self.api_client.call_api(
649
+ *_param,
650
+ _request_timeout=_request_timeout
651
+ )
652
+ await response_data.read()
653
+ return self.api_client.response_deserialize(
654
+ response_data=response_data,
655
+ response_types_map=_response_types_map,
656
+ ).data
657
+
658
+
659
+ @validate_call
660
+ async def read_algorithm_algorithms_id_get_with_http_info(
661
+ self,
662
+ id: StrictInt,
663
+ _request_timeout: Union[
664
+ None,
665
+ Annotated[StrictFloat, Field(gt=0)],
666
+ Tuple[
667
+ Annotated[StrictFloat, Field(gt=0)],
668
+ Annotated[StrictFloat, Field(gt=0)]
669
+ ]
670
+ ] = None,
671
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
672
+ _content_type: Optional[StrictStr] = None,
673
+ _headers: Optional[Dict[StrictStr, Any]] = None,
674
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
675
+ ) -> ApiResponse[Algorithm]:
676
+ """Retrieve algorithm
677
+
678
+ Get algorithm by ID.
679
+
680
+ :param id: (required)
681
+ :type id: int
682
+ :param _request_timeout: timeout setting for this request. If one
683
+ number provided, it will be total request
684
+ timeout. It can also be a pair (tuple) of
685
+ (connection, read) timeouts.
686
+ :type _request_timeout: int, tuple(int, int), optional
687
+ :param _request_auth: set to override the auth_settings for an a single
688
+ request; this effectively ignores the
689
+ authentication in the spec for a single request.
690
+ :type _request_auth: dict, optional
691
+ :param _content_type: force content-type for the request.
692
+ :type _content_type: str, Optional
693
+ :param _headers: set to override the headers for a single
694
+ request; this effectively ignores the headers
695
+ in the spec for a single request.
696
+ :type _headers: dict, optional
697
+ :param _host_index: set to override the host_index for a single
698
+ request; this effectively ignores the host_index
699
+ in the spec for a single request.
700
+ :type _host_index: int, optional
701
+ :return: Returns the result object.
702
+ """ # noqa: E501
703
+
704
+ _param = self._read_algorithm_algorithms_id_get_serialize(
705
+ id=id,
706
+ _request_auth=_request_auth,
707
+ _content_type=_content_type,
708
+ _headers=_headers,
709
+ _host_index=_host_index
710
+ )
711
+
712
+ _response_types_map: Dict[str, Optional[str]] = {
713
+ '200': "Algorithm",
714
+ '404': "HTTPNotFoundError",
715
+ '422': "HTTPValidationError",
716
+ }
717
+ response_data = await self.api_client.call_api(
718
+ *_param,
719
+ _request_timeout=_request_timeout
720
+ )
721
+ await response_data.read()
722
+ return self.api_client.response_deserialize(
723
+ response_data=response_data,
724
+ response_types_map=_response_types_map,
725
+ )
726
+
727
+
728
+ @validate_call
729
+ async def read_algorithm_algorithms_id_get_without_preload_content(
730
+ self,
731
+ id: StrictInt,
732
+ _request_timeout: Union[
733
+ None,
734
+ Annotated[StrictFloat, Field(gt=0)],
735
+ Tuple[
736
+ Annotated[StrictFloat, Field(gt=0)],
737
+ Annotated[StrictFloat, Field(gt=0)]
738
+ ]
739
+ ] = None,
740
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
741
+ _content_type: Optional[StrictStr] = None,
742
+ _headers: Optional[Dict[StrictStr, Any]] = None,
743
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
744
+ ) -> RESTResponseType:
745
+ """Retrieve algorithm
746
+
747
+ Get algorithm by ID.
748
+
749
+ :param id: (required)
750
+ :type id: int
751
+ :param _request_timeout: timeout setting for this request. If one
752
+ number provided, it will be total request
753
+ timeout. It can also be a pair (tuple) of
754
+ (connection, read) timeouts.
755
+ :type _request_timeout: int, tuple(int, int), optional
756
+ :param _request_auth: set to override the auth_settings for an a single
757
+ request; this effectively ignores the
758
+ authentication in the spec for a single request.
759
+ :type _request_auth: dict, optional
760
+ :param _content_type: force content-type for the request.
761
+ :type _content_type: str, Optional
762
+ :param _headers: set to override the headers for a single
763
+ request; this effectively ignores the headers
764
+ in the spec for a single request.
765
+ :type _headers: dict, optional
766
+ :param _host_index: set to override the host_index for a single
767
+ request; this effectively ignores the host_index
768
+ in the spec for a single request.
769
+ :type _host_index: int, optional
770
+ :return: Returns the result object.
771
+ """ # noqa: E501
772
+
773
+ _param = self._read_algorithm_algorithms_id_get_serialize(
774
+ id=id,
775
+ _request_auth=_request_auth,
776
+ _content_type=_content_type,
777
+ _headers=_headers,
778
+ _host_index=_host_index
779
+ )
780
+
781
+ _response_types_map: Dict[str, Optional[str]] = {
782
+ '200': "Algorithm",
783
+ '404': "HTTPNotFoundError",
784
+ '422': "HTTPValidationError",
785
+ }
786
+ response_data = await self.api_client.call_api(
787
+ *_param,
788
+ _request_timeout=_request_timeout
789
+ )
790
+ return response_data.response
791
+
792
+
793
+ def _read_algorithm_algorithms_id_get_serialize(
794
+ self,
795
+ id,
796
+ _request_auth,
797
+ _content_type,
798
+ _headers,
799
+ _host_index,
800
+ ) -> RequestSerialized:
801
+
802
+ _host = None
803
+
804
+ _collection_formats: Dict[str, str] = {
805
+ }
806
+
807
+ _path_params: Dict[str, str] = {}
808
+ _query_params: List[Tuple[str, str]] = []
809
+ _header_params: Dict[str, Optional[str]] = _headers or {}
810
+ _form_params: List[Tuple[str, str]] = []
811
+ _files: Dict[
812
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
813
+ ] = {}
814
+ _body_params: Optional[bytes] = None
815
+
816
+ # process the path parameters
817
+ if id is not None:
818
+ _path_params['id'] = id
819
+ # process the query parameters
820
+ # process the header parameters
821
+ # process the form parameters
822
+ # process the body parameter
823
+
824
+
825
+ # set the HTTP header `Accept`
826
+ if 'Accept' not in _header_params:
827
+ _header_params['Accept'] = self.api_client.select_header_accept(
828
+ [
829
+ 'application/json'
830
+ ]
831
+ )
832
+
833
+
834
+ # authentication setting
835
+ _auth_settings: List[str] = [
836
+ 'user_bearer',
837
+ 'backend'
838
+ ]
839
+
840
+ return self.api_client.param_serialize(
841
+ method='GET',
842
+ resource_path='/algorithms/{id}',
843
+ path_params=_path_params,
844
+ query_params=_query_params,
845
+ header_params=_header_params,
846
+ body=_body_params,
847
+ post_params=_form_params,
848
+ files=_files,
849
+ auth_settings=_auth_settings,
850
+ collection_formats=_collection_formats,
851
+ _host=_host,
852
+ _request_auth=_request_auth
853
+ )
854
+
855
+
856
+
857
+
858
+ @validate_call
859
+ async def read_algorithms_algorithms_get(
860
+ self,
861
+ search: Annotated[Optional[StrictStr], Field(description="Substring search for algorithm names")] = None,
862
+ id: Optional[StrictInt] = None,
863
+ project_id: Optional[StrictInt] = None,
864
+ type: Optional[AlgorithmType] = None,
865
+ shared: Optional[ShareType] = None,
866
+ link__isnull: Optional[StrictBool] = None,
867
+ link: Optional[StrictStr] = None,
868
+ name: Optional[StrictStr] = None,
869
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
870
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
871
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
872
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
873
+ _request_timeout: Union[
874
+ None,
875
+ Annotated[StrictFloat, Field(gt=0)],
876
+ Tuple[
877
+ Annotated[StrictFloat, Field(gt=0)],
878
+ Annotated[StrictFloat, Field(gt=0)]
879
+ ]
880
+ ] = None,
881
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
882
+ _content_type: Optional[StrictStr] = None,
883
+ _headers: Optional[Dict[StrictStr, Any]] = None,
884
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
885
+ ) -> PageAlgorithm:
886
+ """List algorithms
887
+
888
+ List algorithms.
889
+
890
+ :param search: Substring search for algorithm names
891
+ :type search: str
892
+ :param id:
893
+ :type id: int
894
+ :param project_id:
895
+ :type project_id: int
896
+ :param type:
897
+ :type type: AlgorithmType
898
+ :param shared:
899
+ :type shared: ShareType
900
+ :param link__isnull:
901
+ :type link__isnull: bool
902
+ :param link:
903
+ :type link: str
904
+ :param name:
905
+ :type name: str
906
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
907
+ :type sort_by: str
908
+ :param latest: If True gets the most recently created object.
909
+ :type latest: bool
910
+ :param page: Page number
911
+ :type page: int
912
+ :param size: Page size
913
+ :type size: int
914
+ :param _request_timeout: timeout setting for this request. If one
915
+ number provided, it will be total request
916
+ timeout. It can also be a pair (tuple) of
917
+ (connection, read) timeouts.
918
+ :type _request_timeout: int, tuple(int, int), optional
919
+ :param _request_auth: set to override the auth_settings for an a single
920
+ request; this effectively ignores the
921
+ authentication in the spec for a single request.
922
+ :type _request_auth: dict, optional
923
+ :param _content_type: force content-type for the request.
924
+ :type _content_type: str, Optional
925
+ :param _headers: set to override the headers for a single
926
+ request; this effectively ignores the headers
927
+ in the spec for a single request.
928
+ :type _headers: dict, optional
929
+ :param _host_index: set to override the host_index for a single
930
+ request; this effectively ignores the host_index
931
+ in the spec for a single request.
932
+ :type _host_index: int, optional
933
+ :return: Returns the result object.
934
+ """ # noqa: E501
935
+
936
+ _param = self._read_algorithms_algorithms_get_serialize(
937
+ search=search,
938
+ id=id,
939
+ project_id=project_id,
940
+ type=type,
941
+ shared=shared,
942
+ link__isnull=link__isnull,
943
+ link=link,
944
+ name=name,
945
+ sort_by=sort_by,
946
+ latest=latest,
947
+ page=page,
948
+ size=size,
949
+ _request_auth=_request_auth,
950
+ _content_type=_content_type,
951
+ _headers=_headers,
952
+ _host_index=_host_index
953
+ )
954
+
955
+ _response_types_map: Dict[str, Optional[str]] = {
956
+ '200': "PageAlgorithm",
957
+ '422': "HTTPValidationError",
958
+ }
959
+ response_data = await self.api_client.call_api(
960
+ *_param,
961
+ _request_timeout=_request_timeout
962
+ )
963
+ await response_data.read()
964
+ return self.api_client.response_deserialize(
965
+ response_data=response_data,
966
+ response_types_map=_response_types_map,
967
+ ).data
968
+
969
+
970
+ @validate_call
971
+ async def read_algorithms_algorithms_get_with_http_info(
972
+ self,
973
+ search: Annotated[Optional[StrictStr], Field(description="Substring search for algorithm names")] = None,
974
+ id: Optional[StrictInt] = None,
975
+ project_id: Optional[StrictInt] = None,
976
+ type: Optional[AlgorithmType] = None,
977
+ shared: Optional[ShareType] = None,
978
+ link__isnull: Optional[StrictBool] = None,
979
+ link: Optional[StrictStr] = None,
980
+ name: Optional[StrictStr] = None,
981
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
982
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
983
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
984
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
985
+ _request_timeout: Union[
986
+ None,
987
+ Annotated[StrictFloat, Field(gt=0)],
988
+ Tuple[
989
+ Annotated[StrictFloat, Field(gt=0)],
990
+ Annotated[StrictFloat, Field(gt=0)]
991
+ ]
992
+ ] = None,
993
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
994
+ _content_type: Optional[StrictStr] = None,
995
+ _headers: Optional[Dict[StrictStr, Any]] = None,
996
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
997
+ ) -> ApiResponse[PageAlgorithm]:
998
+ """List algorithms
999
+
1000
+ List algorithms.
1001
+
1002
+ :param search: Substring search for algorithm names
1003
+ :type search: str
1004
+ :param id:
1005
+ :type id: int
1006
+ :param project_id:
1007
+ :type project_id: int
1008
+ :param type:
1009
+ :type type: AlgorithmType
1010
+ :param shared:
1011
+ :type shared: ShareType
1012
+ :param link__isnull:
1013
+ :type link__isnull: bool
1014
+ :param link:
1015
+ :type link: str
1016
+ :param name:
1017
+ :type name: str
1018
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
1019
+ :type sort_by: str
1020
+ :param latest: If True gets the most recently created object.
1021
+ :type latest: bool
1022
+ :param page: Page number
1023
+ :type page: int
1024
+ :param size: Page size
1025
+ :type size: int
1026
+ :param _request_timeout: timeout setting for this request. If one
1027
+ number provided, it will be total request
1028
+ timeout. It can also be a pair (tuple) of
1029
+ (connection, read) timeouts.
1030
+ :type _request_timeout: int, tuple(int, int), optional
1031
+ :param _request_auth: set to override the auth_settings for an a single
1032
+ request; this effectively ignores the
1033
+ authentication in the spec for a single request.
1034
+ :type _request_auth: dict, optional
1035
+ :param _content_type: force content-type for the request.
1036
+ :type _content_type: str, Optional
1037
+ :param _headers: set to override the headers for a single
1038
+ request; this effectively ignores the headers
1039
+ in the spec for a single request.
1040
+ :type _headers: dict, optional
1041
+ :param _host_index: set to override the host_index for a single
1042
+ request; this effectively ignores the host_index
1043
+ in the spec for a single request.
1044
+ :type _host_index: int, optional
1045
+ :return: Returns the result object.
1046
+ """ # noqa: E501
1047
+
1048
+ _param = self._read_algorithms_algorithms_get_serialize(
1049
+ search=search,
1050
+ id=id,
1051
+ project_id=project_id,
1052
+ type=type,
1053
+ shared=shared,
1054
+ link__isnull=link__isnull,
1055
+ link=link,
1056
+ name=name,
1057
+ sort_by=sort_by,
1058
+ latest=latest,
1059
+ page=page,
1060
+ size=size,
1061
+ _request_auth=_request_auth,
1062
+ _content_type=_content_type,
1063
+ _headers=_headers,
1064
+ _host_index=_host_index
1065
+ )
1066
+
1067
+ _response_types_map: Dict[str, Optional[str]] = {
1068
+ '200': "PageAlgorithm",
1069
+ '422': "HTTPValidationError",
1070
+ }
1071
+ response_data = await self.api_client.call_api(
1072
+ *_param,
1073
+ _request_timeout=_request_timeout
1074
+ )
1075
+ await response_data.read()
1076
+ return self.api_client.response_deserialize(
1077
+ response_data=response_data,
1078
+ response_types_map=_response_types_map,
1079
+ )
1080
+
1081
+
1082
+ @validate_call
1083
+ async def read_algorithms_algorithms_get_without_preload_content(
1084
+ self,
1085
+ search: Annotated[Optional[StrictStr], Field(description="Substring search for algorithm names")] = None,
1086
+ id: Optional[StrictInt] = None,
1087
+ project_id: Optional[StrictInt] = None,
1088
+ type: Optional[AlgorithmType] = None,
1089
+ shared: Optional[ShareType] = None,
1090
+ link__isnull: Optional[StrictBool] = None,
1091
+ link: Optional[StrictStr] = None,
1092
+ name: Optional[StrictStr] = None,
1093
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
1094
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
1095
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
1096
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
1097
+ _request_timeout: Union[
1098
+ None,
1099
+ Annotated[StrictFloat, Field(gt=0)],
1100
+ Tuple[
1101
+ Annotated[StrictFloat, Field(gt=0)],
1102
+ Annotated[StrictFloat, Field(gt=0)]
1103
+ ]
1104
+ ] = None,
1105
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1106
+ _content_type: Optional[StrictStr] = None,
1107
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1108
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1109
+ ) -> RESTResponseType:
1110
+ """List algorithms
1111
+
1112
+ List algorithms.
1113
+
1114
+ :param search: Substring search for algorithm names
1115
+ :type search: str
1116
+ :param id:
1117
+ :type id: int
1118
+ :param project_id:
1119
+ :type project_id: int
1120
+ :param type:
1121
+ :type type: AlgorithmType
1122
+ :param shared:
1123
+ :type shared: ShareType
1124
+ :param link__isnull:
1125
+ :type link__isnull: bool
1126
+ :param link:
1127
+ :type link: str
1128
+ :param name:
1129
+ :type name: str
1130
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
1131
+ :type sort_by: str
1132
+ :param latest: If True gets the most recently created object.
1133
+ :type latest: bool
1134
+ :param page: Page number
1135
+ :type page: int
1136
+ :param size: Page size
1137
+ :type size: int
1138
+ :param _request_timeout: timeout setting for this request. If one
1139
+ number provided, it will be total request
1140
+ timeout. It can also be a pair (tuple) of
1141
+ (connection, read) timeouts.
1142
+ :type _request_timeout: int, tuple(int, int), optional
1143
+ :param _request_auth: set to override the auth_settings for an a single
1144
+ request; this effectively ignores the
1145
+ authentication in the spec for a single request.
1146
+ :type _request_auth: dict, optional
1147
+ :param _content_type: force content-type for the request.
1148
+ :type _content_type: str, Optional
1149
+ :param _headers: set to override the headers for a single
1150
+ request; this effectively ignores the headers
1151
+ in the spec for a single request.
1152
+ :type _headers: dict, optional
1153
+ :param _host_index: set to override the host_index for a single
1154
+ request; this effectively ignores the host_index
1155
+ in the spec for a single request.
1156
+ :type _host_index: int, optional
1157
+ :return: Returns the result object.
1158
+ """ # noqa: E501
1159
+
1160
+ _param = self._read_algorithms_algorithms_get_serialize(
1161
+ search=search,
1162
+ id=id,
1163
+ project_id=project_id,
1164
+ type=type,
1165
+ shared=shared,
1166
+ link__isnull=link__isnull,
1167
+ link=link,
1168
+ name=name,
1169
+ sort_by=sort_by,
1170
+ latest=latest,
1171
+ page=page,
1172
+ size=size,
1173
+ _request_auth=_request_auth,
1174
+ _content_type=_content_type,
1175
+ _headers=_headers,
1176
+ _host_index=_host_index
1177
+ )
1178
+
1179
+ _response_types_map: Dict[str, Optional[str]] = {
1180
+ '200': "PageAlgorithm",
1181
+ '422': "HTTPValidationError",
1182
+ }
1183
+ response_data = await self.api_client.call_api(
1184
+ *_param,
1185
+ _request_timeout=_request_timeout
1186
+ )
1187
+ return response_data.response
1188
+
1189
+
1190
+ def _read_algorithms_algorithms_get_serialize(
1191
+ self,
1192
+ search,
1193
+ id,
1194
+ project_id,
1195
+ type,
1196
+ shared,
1197
+ link__isnull,
1198
+ link,
1199
+ name,
1200
+ sort_by,
1201
+ latest,
1202
+ page,
1203
+ size,
1204
+ _request_auth,
1205
+ _content_type,
1206
+ _headers,
1207
+ _host_index,
1208
+ ) -> RequestSerialized:
1209
+
1210
+ _host = None
1211
+
1212
+ _collection_formats: Dict[str, str] = {
1213
+ }
1214
+
1215
+ _path_params: Dict[str, str] = {}
1216
+ _query_params: List[Tuple[str, str]] = []
1217
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1218
+ _form_params: List[Tuple[str, str]] = []
1219
+ _files: Dict[
1220
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1221
+ ] = {}
1222
+ _body_params: Optional[bytes] = None
1223
+
1224
+ # process the path parameters
1225
+ # process the query parameters
1226
+ if search is not None:
1227
+
1228
+ _query_params.append(('search', search))
1229
+
1230
+ if id is not None:
1231
+
1232
+ _query_params.append(('id', id))
1233
+
1234
+ if project_id is not None:
1235
+
1236
+ _query_params.append(('project_id', project_id))
1237
+
1238
+ if type is not None:
1239
+
1240
+ _query_params.append(('type', type.value))
1241
+
1242
+ if shared is not None:
1243
+
1244
+ _query_params.append(('shared', shared.value))
1245
+
1246
+ if link__isnull is not None:
1247
+
1248
+ _query_params.append(('link__isnull', link__isnull))
1249
+
1250
+ if link is not None:
1251
+
1252
+ _query_params.append(('link', link))
1253
+
1254
+ if name is not None:
1255
+
1256
+ _query_params.append(('name', name))
1257
+
1258
+ if sort_by is not None:
1259
+
1260
+ _query_params.append(('sort_by', sort_by))
1261
+
1262
+ if latest is not None:
1263
+
1264
+ _query_params.append(('latest', latest))
1265
+
1266
+ if page is not None:
1267
+
1268
+ _query_params.append(('page', page))
1269
+
1270
+ if size is not None:
1271
+
1272
+ _query_params.append(('size', size))
1273
+
1274
+ # process the header parameters
1275
+ # process the form parameters
1276
+ # process the body parameter
1277
+
1278
+
1279
+ # set the HTTP header `Accept`
1280
+ if 'Accept' not in _header_params:
1281
+ _header_params['Accept'] = self.api_client.select_header_accept(
1282
+ [
1283
+ 'application/json'
1284
+ ]
1285
+ )
1286
+
1287
+
1288
+ # authentication setting
1289
+ _auth_settings: List[str] = [
1290
+ 'user_bearer'
1291
+ ]
1292
+
1293
+ return self.api_client.param_serialize(
1294
+ method='GET',
1295
+ resource_path='/algorithms',
1296
+ path_params=_path_params,
1297
+ query_params=_query_params,
1298
+ header_params=_header_params,
1299
+ body=_body_params,
1300
+ post_params=_form_params,
1301
+ files=_files,
1302
+ auth_settings=_auth_settings,
1303
+ collection_formats=_collection_formats,
1304
+ _host=_host,
1305
+ _request_auth=_request_auth
1306
+ )
1307
+
1308
+
1309
+
1310
+
1311
+ @validate_call
1312
+ async def update_algorithm_algorithms_id_put(
1313
+ self,
1314
+ id: StrictInt,
1315
+ algorithm_in: AlgorithmIn,
1316
+ _request_timeout: Union[
1317
+ None,
1318
+ Annotated[StrictFloat, Field(gt=0)],
1319
+ Tuple[
1320
+ Annotated[StrictFloat, Field(gt=0)],
1321
+ Annotated[StrictFloat, Field(gt=0)]
1322
+ ]
1323
+ ] = None,
1324
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1325
+ _content_type: Optional[StrictStr] = None,
1326
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1327
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1328
+ ) -> Algorithm:
1329
+ """Update algorithm
1330
+
1331
+ Update an algorithm.
1332
+
1333
+ :param id: (required)
1334
+ :type id: int
1335
+ :param algorithm_in: (required)
1336
+ :type algorithm_in: AlgorithmIn
1337
+ :param _request_timeout: timeout setting for this request. If one
1338
+ number provided, it will be total request
1339
+ timeout. It can also be a pair (tuple) of
1340
+ (connection, read) timeouts.
1341
+ :type _request_timeout: int, tuple(int, int), optional
1342
+ :param _request_auth: set to override the auth_settings for an a single
1343
+ request; this effectively ignores the
1344
+ authentication in the spec for a single request.
1345
+ :type _request_auth: dict, optional
1346
+ :param _content_type: force content-type for the request.
1347
+ :type _content_type: str, Optional
1348
+ :param _headers: set to override the headers for a single
1349
+ request; this effectively ignores the headers
1350
+ in the spec for a single request.
1351
+ :type _headers: dict, optional
1352
+ :param _host_index: set to override the host_index for a single
1353
+ request; this effectively ignores the host_index
1354
+ in the spec for a single request.
1355
+ :type _host_index: int, optional
1356
+ :return: Returns the result object.
1357
+ """ # noqa: E501
1358
+
1359
+ _param = self._update_algorithm_algorithms_id_put_serialize(
1360
+ id=id,
1361
+ algorithm_in=algorithm_in,
1362
+ _request_auth=_request_auth,
1363
+ _content_type=_content_type,
1364
+ _headers=_headers,
1365
+ _host_index=_host_index
1366
+ )
1367
+
1368
+ _response_types_map: Dict[str, Optional[str]] = {
1369
+ '200': "Algorithm",
1370
+ '404': "HTTPNotFoundError",
1371
+ '422': "HTTPValidationError",
1372
+ }
1373
+ response_data = await self.api_client.call_api(
1374
+ *_param,
1375
+ _request_timeout=_request_timeout
1376
+ )
1377
+ await response_data.read()
1378
+ return self.api_client.response_deserialize(
1379
+ response_data=response_data,
1380
+ response_types_map=_response_types_map,
1381
+ ).data
1382
+
1383
+
1384
+ @validate_call
1385
+ async def update_algorithm_algorithms_id_put_with_http_info(
1386
+ self,
1387
+ id: StrictInt,
1388
+ algorithm_in: AlgorithmIn,
1389
+ _request_timeout: Union[
1390
+ None,
1391
+ Annotated[StrictFloat, Field(gt=0)],
1392
+ Tuple[
1393
+ Annotated[StrictFloat, Field(gt=0)],
1394
+ Annotated[StrictFloat, Field(gt=0)]
1395
+ ]
1396
+ ] = None,
1397
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1398
+ _content_type: Optional[StrictStr] = None,
1399
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1400
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1401
+ ) -> ApiResponse[Algorithm]:
1402
+ """Update algorithm
1403
+
1404
+ Update an algorithm.
1405
+
1406
+ :param id: (required)
1407
+ :type id: int
1408
+ :param algorithm_in: (required)
1409
+ :type algorithm_in: AlgorithmIn
1410
+ :param _request_timeout: timeout setting for this request. If one
1411
+ number provided, it will be total request
1412
+ timeout. It can also be a pair (tuple) of
1413
+ (connection, read) timeouts.
1414
+ :type _request_timeout: int, tuple(int, int), optional
1415
+ :param _request_auth: set to override the auth_settings for an a single
1416
+ request; this effectively ignores the
1417
+ authentication in the spec for a single request.
1418
+ :type _request_auth: dict, optional
1419
+ :param _content_type: force content-type for the request.
1420
+ :type _content_type: str, Optional
1421
+ :param _headers: set to override the headers for a single
1422
+ request; this effectively ignores the headers
1423
+ in the spec for a single request.
1424
+ :type _headers: dict, optional
1425
+ :param _host_index: set to override the host_index for a single
1426
+ request; this effectively ignores the host_index
1427
+ in the spec for a single request.
1428
+ :type _host_index: int, optional
1429
+ :return: Returns the result object.
1430
+ """ # noqa: E501
1431
+
1432
+ _param = self._update_algorithm_algorithms_id_put_serialize(
1433
+ id=id,
1434
+ algorithm_in=algorithm_in,
1435
+ _request_auth=_request_auth,
1436
+ _content_type=_content_type,
1437
+ _headers=_headers,
1438
+ _host_index=_host_index
1439
+ )
1440
+
1441
+ _response_types_map: Dict[str, Optional[str]] = {
1442
+ '200': "Algorithm",
1443
+ '404': "HTTPNotFoundError",
1444
+ '422': "HTTPValidationError",
1445
+ }
1446
+ response_data = await self.api_client.call_api(
1447
+ *_param,
1448
+ _request_timeout=_request_timeout
1449
+ )
1450
+ await response_data.read()
1451
+ return self.api_client.response_deserialize(
1452
+ response_data=response_data,
1453
+ response_types_map=_response_types_map,
1454
+ )
1455
+
1456
+
1457
+ @validate_call
1458
+ async def update_algorithm_algorithms_id_put_without_preload_content(
1459
+ self,
1460
+ id: StrictInt,
1461
+ algorithm_in: AlgorithmIn,
1462
+ _request_timeout: Union[
1463
+ None,
1464
+ Annotated[StrictFloat, Field(gt=0)],
1465
+ Tuple[
1466
+ Annotated[StrictFloat, Field(gt=0)],
1467
+ Annotated[StrictFloat, Field(gt=0)]
1468
+ ]
1469
+ ] = None,
1470
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1471
+ _content_type: Optional[StrictStr] = None,
1472
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1473
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1474
+ ) -> RESTResponseType:
1475
+ """Update algorithm
1476
+
1477
+ Update an algorithm.
1478
+
1479
+ :param id: (required)
1480
+ :type id: int
1481
+ :param algorithm_in: (required)
1482
+ :type algorithm_in: AlgorithmIn
1483
+ :param _request_timeout: timeout setting for this request. If one
1484
+ number provided, it will be total request
1485
+ timeout. It can also be a pair (tuple) of
1486
+ (connection, read) timeouts.
1487
+ :type _request_timeout: int, tuple(int, int), optional
1488
+ :param _request_auth: set to override the auth_settings for an a single
1489
+ request; this effectively ignores the
1490
+ authentication in the spec for a single request.
1491
+ :type _request_auth: dict, optional
1492
+ :param _content_type: force content-type for the request.
1493
+ :type _content_type: str, Optional
1494
+ :param _headers: set to override the headers for a single
1495
+ request; this effectively ignores the headers
1496
+ in the spec for a single request.
1497
+ :type _headers: dict, optional
1498
+ :param _host_index: set to override the host_index for a single
1499
+ request; this effectively ignores the host_index
1500
+ in the spec for a single request.
1501
+ :type _host_index: int, optional
1502
+ :return: Returns the result object.
1503
+ """ # noqa: E501
1504
+
1505
+ _param = self._update_algorithm_algorithms_id_put_serialize(
1506
+ id=id,
1507
+ algorithm_in=algorithm_in,
1508
+ _request_auth=_request_auth,
1509
+ _content_type=_content_type,
1510
+ _headers=_headers,
1511
+ _host_index=_host_index
1512
+ )
1513
+
1514
+ _response_types_map: Dict[str, Optional[str]] = {
1515
+ '200': "Algorithm",
1516
+ '404': "HTTPNotFoundError",
1517
+ '422': "HTTPValidationError",
1518
+ }
1519
+ response_data = await self.api_client.call_api(
1520
+ *_param,
1521
+ _request_timeout=_request_timeout
1522
+ )
1523
+ return response_data.response
1524
+
1525
+
1526
+ def _update_algorithm_algorithms_id_put_serialize(
1527
+ self,
1528
+ id,
1529
+ algorithm_in,
1530
+ _request_auth,
1531
+ _content_type,
1532
+ _headers,
1533
+ _host_index,
1534
+ ) -> RequestSerialized:
1535
+
1536
+ _host = None
1537
+
1538
+ _collection_formats: Dict[str, str] = {
1539
+ }
1540
+
1541
+ _path_params: Dict[str, str] = {}
1542
+ _query_params: List[Tuple[str, str]] = []
1543
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1544
+ _form_params: List[Tuple[str, str]] = []
1545
+ _files: Dict[
1546
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1547
+ ] = {}
1548
+ _body_params: Optional[bytes] = None
1549
+
1550
+ # process the path parameters
1551
+ if id is not None:
1552
+ _path_params['id'] = id
1553
+ # process the query parameters
1554
+ # process the header parameters
1555
+ # process the form parameters
1556
+ # process the body parameter
1557
+ if algorithm_in is not None:
1558
+ _body_params = algorithm_in
1559
+
1560
+
1561
+ # set the HTTP header `Accept`
1562
+ if 'Accept' not in _header_params:
1563
+ _header_params['Accept'] = self.api_client.select_header_accept(
1564
+ [
1565
+ 'application/json'
1566
+ ]
1567
+ )
1568
+
1569
+ # set the HTTP header `Content-Type`
1570
+ if _content_type:
1571
+ _header_params['Content-Type'] = _content_type
1572
+ else:
1573
+ _default_content_type = (
1574
+ self.api_client.select_header_content_type(
1575
+ [
1576
+ 'application/json'
1577
+ ]
1578
+ )
1579
+ )
1580
+ if _default_content_type is not None:
1581
+ _header_params['Content-Type'] = _default_content_type
1582
+
1583
+ # authentication setting
1584
+ _auth_settings: List[str] = [
1585
+ 'user_bearer'
1586
+ ]
1587
+
1588
+ return self.api_client.param_serialize(
1589
+ method='PUT',
1590
+ resource_path='/algorithms/{id}',
1591
+ path_params=_path_params,
1592
+ query_params=_query_params,
1593
+ header_params=_header_params,
1594
+ body=_body_params,
1595
+ post_params=_form_params,
1596
+ files=_files,
1597
+ auth_settings=_auth_settings,
1598
+ collection_formats=_collection_formats,
1599
+ _host=_host,
1600
+ _request_auth=_request_auth
1601
+ )
1602
+
1603
+