qi-compute-api-client 0.7.0__py3-none-any.whl → 0.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of qi-compute-api-client might be problematic. Click here for more details.

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