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

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