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