qi-compute-api-client 0.4.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 (166) hide show
  1. compute_api_client/__init__.py +23 -20
  2. compute_api_client/api/__init__.py +5 -6
  3. compute_api_client/api/algorithms_api.py +1334 -554
  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 +1069 -436
  8. compute_api_client/api/files_api.py +1076 -436
  9. compute_api_client/api/final_results_api.py +737 -339
  10. compute_api_client/api/jobs_api.py +1653 -0
  11. compute_api_client/api/languages_api.py +557 -218
  12. compute_api_client/api/members_api.py +1058 -436
  13. compute_api_client/api/metadata_api.py +737 -338
  14. compute_api_client/api/permissions_api.py +1056 -422
  15. compute_api_client/api/projects_api.py +1605 -677
  16. compute_api_client/api/reservations_api.py +1125 -428
  17. compute_api_client/api/results_api.py +739 -338
  18. compute_api_client/api/teams_api.py +568 -221
  19. compute_api_client/api/transactions_api.py +680 -219
  20. compute_api_client/api/users_api.py +1091 -436
  21. compute_api_client/api_client.py +347 -305
  22. compute_api_client/api_response.py +21 -0
  23. compute_api_client/configuration.py +55 -68
  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/BatchJobsApi.md +524 -0
  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 +40 -74
  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 +20 -17
  90. compute_api_client/models/__init__.py +17 -15
  91. compute_api_client/models/algorithm.py +79 -238
  92. compute_api_client/models/algorithm_in.py +77 -205
  93. compute_api_client/models/algorithm_type.py +22 -88
  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 +73 -231
  103. compute_api_client/models/commit_in.py +68 -170
  104. compute_api_client/models/compile_stage.py +24 -90
  105. compute_api_client/models/domain.py +23 -89
  106. compute_api_client/models/file.py +75 -289
  107. compute_api_client/models/file_in.py +73 -255
  108. compute_api_client/models/final_result.py +69 -199
  109. compute_api_client/models/final_result_in.py +64 -138
  110. compute_api_client/models/http_not_found_error.py +61 -106
  111. compute_api_client/models/http_validation_error.py +70 -106
  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 +68 -173
  117. compute_api_client/models/location_inner.py +126 -85
  118. compute_api_client/models/member.py +71 -237
  119. compute_api_client/models/member_in.py +69 -204
  120. compute_api_client/models/metadata.py +69 -199
  121. compute_api_client/models/metadata_in.py +69 -138
  122. compute_api_client/models/permission.py +68 -173
  123. compute_api_client/models/permission_group.py +66 -143
  124. compute_api_client/models/project.py +75 -257
  125. compute_api_client/models/project_in.py +70 -196
  126. compute_api_client/models/project_patch.py +90 -193
  127. compute_api_client/models/reservation.py +80 -291
  128. compute_api_client/models/reservation_in.py +69 -201
  129. compute_api_client/models/result.py +102 -360
  130. compute_api_client/models/result_in.py +96 -293
  131. compute_api_client/models/role.py +22 -88
  132. compute_api_client/models/share_type.py +23 -89
  133. compute_api_client/models/team.py +70 -199
  134. compute_api_client/models/transaction.py +94 -300
  135. compute_api_client/models/user.py +76 -277
  136. compute_api_client/models/user_in.py +74 -244
  137. compute_api_client/models/validation_error.py +74 -161
  138. compute_api_client/rest.py +56 -115
  139. {qi_compute_api_client-0.4.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/BatchRunsApi.md +0 -600
  148. compute_api_client/docs/Run.md +0 -18
  149. compute_api_client/docs/RunIn.md +0 -13
  150. compute_api_client/docs/Runtime.md +0 -16
  151. compute_api_client/docs/RuntimeApi.md +0 -229
  152. compute_api_client/docs/RuntimeType.md +0 -19
  153. compute_api_client/docs/RuntimeWithAuthentication.md +0 -17
  154. compute_api_client/models/batch_run.py +0 -423
  155. compute_api_client/models/batch_run_in.py +0 -171
  156. compute_api_client/models/batch_run_status.py +0 -114
  157. compute_api_client/models/run.py +0 -345
  158. compute_api_client/models/run_in.py +0 -202
  159. compute_api_client/models/run_status.py +0 -114
  160. compute_api_client/models/runtime.py +0 -290
  161. compute_api_client/models/runtime_status.py +0 -113
  162. compute_api_client/models/runtime_type.py +0 -357
  163. compute_api_client/models/runtime_with_authentication.py +0 -320
  164. qi_compute_api_client-0.4.0.dist-info/RECORD +0 -137
  165. {qi_compute_api_client-0.4.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/LICENSE.md +0 -0
  166. {qi_compute_api_client-0.4.0.dist-info → qi_compute_api_client-0.17.0.dist-info}/WHEEL +0 -0
@@ -1,584 +1,1239 @@
1
1
  # coding: utf-8
2
2
 
3
3
  """
4
- Compute Job Manager
4
+ Quantum Inspire 2
5
5
 
6
- No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
7
 
8
8
  The version of the OpenAPI document: 0.1.0
9
- Generated by: https://openapi-generator.tech
10
- """
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
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
11
20
 
21
+ try:
22
+ from typing import Annotated
23
+ except ImportError:
24
+ from typing_extensions import Annotated
12
25
 
13
- from __future__ import absolute_import
26
+ from pydantic import StrictBool, StrictInt, StrictStr
14
27
 
15
- import re # noqa: F401
28
+ from typing import List, Optional
16
29
 
17
- # python 2 and python 3 compatibility library
18
- import six
30
+ from compute_api_client.models.user import User
31
+ from compute_api_client.models.user_in import UserIn
19
32
 
20
33
  from compute_api_client.api_client import ApiClient
21
- from compute_api_client.exceptions import ( # noqa: F401
22
- ApiTypeError,
23
- ApiValueError
24
- )
34
+ from compute_api_client.api_response import ApiResponse
35
+ from compute_api_client.rest import RESTResponseType
25
36
 
26
37
 
27
- class UsersApi(object):
38
+ class UsersApi:
28
39
  """NOTE: This class is auto generated by OpenAPI Generator
29
40
  Ref: https://openapi-generator.tech
30
41
 
31
42
  Do not edit the class manually.
32
43
  """
33
44
 
34
- def __init__(self, api_client=None):
45
+ def __init__(self, api_client=None) -> None:
35
46
  if api_client is None:
36
- api_client = ApiClient()
47
+ api_client = ApiClient.get_default()
37
48
  self.api_client = api_client
38
49
 
39
- def create_user_users_post(self, user_in, **kwargs): # noqa: E501
40
- """Create user # noqa: E501
41
50
 
42
- Create new user. # noqa: E501
43
- This method makes a synchronous HTTP request by default. To make an
44
- asynchronous HTTP request, please pass async_req=True
51
+ @validate_call
52
+ async def create_user_users_post(
53
+ self,
54
+ user_in: UserIn,
55
+ _request_timeout: Union[
56
+ None,
57
+ Annotated[StrictFloat, Field(gt=0)],
58
+ Tuple[
59
+ Annotated[StrictFloat, Field(gt=0)],
60
+ Annotated[StrictFloat, Field(gt=0)]
61
+ ]
62
+ ] = None,
63
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
64
+ _content_type: Optional[StrictStr] = None,
65
+ _headers: Optional[Dict[StrictStr, Any]] = None,
66
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
67
+ ) -> User:
68
+ """Create user
69
+
70
+ Create new user.
71
+
72
+ :param user_in: (required)
73
+ :type user_in: UserIn
74
+ :param _request_timeout: timeout setting for this request. If one
75
+ number provided, it will be total request
76
+ timeout. It can also be a pair (tuple) of
77
+ (connection, read) timeouts.
78
+ :type _request_timeout: int, tuple(int, int), optional
79
+ :param _request_auth: set to override the auth_settings for an a single
80
+ request; this effectively ignores the
81
+ authentication in the spec for a single request.
82
+ :type _request_auth: dict, optional
83
+ :param _content_type: force content-type for the request.
84
+ :type _content_type: str, Optional
85
+ :param _headers: set to override the headers for a single
86
+ request; this effectively ignores the headers
87
+ in the spec for a single request.
88
+ :type _headers: dict, optional
89
+ :param _host_index: set to override the host_index for a single
90
+ request; this effectively ignores the host_index
91
+ in the spec for a single request.
92
+ :type _host_index: int, optional
93
+ :return: Returns the result object.
94
+ """ # noqa: E501
95
+
96
+ _param = self._create_user_users_post_serialize(
97
+ user_in=user_in,
98
+ _request_auth=_request_auth,
99
+ _content_type=_content_type,
100
+ _headers=_headers,
101
+ _host_index=_host_index
102
+ )
103
+
104
+ _response_types_map: Dict[str, Optional[str]] = {
105
+ '201': "User",
106
+ '422': "HTTPValidationError"
107
+
108
+ }
109
+ response_data = await self.api_client.call_api(
110
+ *_param,
111
+ _request_timeout=_request_timeout
112
+ )
113
+ await response_data.read()
114
+ return self.api_client.response_deserialize(
115
+ response_data=response_data,
116
+ response_types_map=_response_types_map,
117
+ ).data
118
+
119
+
120
+ @validate_call
121
+ async def create_user_users_post_with_http_info(
122
+ self,
123
+ user_in: UserIn,
124
+ _request_timeout: Union[
125
+ None,
126
+ Annotated[StrictFloat, Field(gt=0)],
127
+ Tuple[
128
+ Annotated[StrictFloat, Field(gt=0)],
129
+ Annotated[StrictFloat, Field(gt=0)]
130
+ ]
131
+ ] = None,
132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
133
+ _content_type: Optional[StrictStr] = None,
134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
136
+ ) -> ApiResponse[User]:
137
+ """Create user
45
138
 
46
- >>> thread = api.create_user_users_post(user_in, async_req=True)
47
- >>> result = thread.get()
139
+ Create new user.
48
140
 
49
141
  :param user_in: (required)
50
142
  :type user_in: UserIn
51
- :param async_req: Whether to execute the request asynchronously.
52
- :type async_req: bool, optional
53
- :param _preload_content: if False, the urllib3.HTTPResponse object will
54
- be returned without reading/decoding response
55
- data. Default is True.
56
- :type _preload_content: bool, optional
57
143
  :param _request_timeout: timeout setting for this request. If one
58
144
  number provided, it will be total request
59
145
  timeout. It can also be a pair (tuple) of
60
146
  (connection, read) timeouts.
147
+ :type _request_timeout: int, tuple(int, int), optional
148
+ :param _request_auth: set to override the auth_settings for an a single
149
+ request; this effectively ignores the
150
+ authentication in the spec for a single request.
151
+ :type _request_auth: dict, optional
152
+ :param _content_type: force content-type for the request.
153
+ :type _content_type: str, Optional
154
+ :param _headers: set to override the headers for a single
155
+ request; this effectively ignores the headers
156
+ in the spec for a single request.
157
+ :type _headers: dict, optional
158
+ :param _host_index: set to override the host_index for a single
159
+ request; this effectively ignores the host_index
160
+ in the spec for a single request.
161
+ :type _host_index: int, optional
61
162
  :return: Returns the result object.
62
- If the method is called asynchronously,
63
- returns the request thread.
64
- :rtype: User
65
- """
66
- kwargs['_return_http_data_only'] = True
67
- return self.create_user_users_post_with_http_info(user_in, **kwargs) # noqa: E501
163
+ """ # noqa: E501
164
+
165
+ _param = self._create_user_users_post_serialize(
166
+ user_in=user_in,
167
+ _request_auth=_request_auth,
168
+ _content_type=_content_type,
169
+ _headers=_headers,
170
+ _host_index=_host_index
171
+ )
68
172
 
69
- def create_user_users_post_with_http_info(self, user_in, **kwargs): # noqa: E501
70
- """Create user # noqa: E501
173
+ _response_types_map: Dict[str, Optional[str]] = {
174
+ '201': "User",
175
+ '422': "HTTPValidationError"
176
+
177
+ }
178
+ response_data = await self.api_client.call_api(
179
+ *_param,
180
+ _request_timeout=_request_timeout
181
+ )
182
+ await response_data.read()
183
+ return self.api_client.response_deserialize(
184
+ response_data=response_data,
185
+ response_types_map=_response_types_map,
186
+ )
71
187
 
72
- Create new user. # noqa: E501
73
- This method makes a synchronous HTTP request by default. To make an
74
- asynchronous HTTP request, please pass async_req=True
75
188
 
76
- >>> thread = api.create_user_users_post_with_http_info(user_in, async_req=True)
77
- >>> result = thread.get()
189
+ @validate_call
190
+ async def create_user_users_post_without_preload_content(
191
+ self,
192
+ user_in: UserIn,
193
+ _request_timeout: Union[
194
+ None,
195
+ Annotated[StrictFloat, Field(gt=0)],
196
+ Tuple[
197
+ Annotated[StrictFloat, Field(gt=0)],
198
+ Annotated[StrictFloat, Field(gt=0)]
199
+ ]
200
+ ] = None,
201
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
202
+ _content_type: Optional[StrictStr] = None,
203
+ _headers: Optional[Dict[StrictStr, Any]] = None,
204
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
205
+ ) -> RESTResponseType:
206
+ """Create user
207
+
208
+ Create new user.
78
209
 
79
210
  :param user_in: (required)
80
211
  :type user_in: UserIn
81
- :param async_req: Whether to execute the request asynchronously.
82
- :type async_req: bool, optional
83
- :param _return_http_data_only: response data without head status code
84
- and headers
85
- :type _return_http_data_only: bool, optional
86
- :param _preload_content: if False, the urllib3.HTTPResponse object will
87
- be returned without reading/decoding response
88
- data. Default is True.
89
- :type _preload_content: bool, optional
90
212
  :param _request_timeout: timeout setting for this request. If one
91
213
  number provided, it will be total request
92
214
  timeout. It can also be a pair (tuple) of
93
215
  (connection, read) timeouts.
216
+ :type _request_timeout: int, tuple(int, int), optional
94
217
  :param _request_auth: set to override the auth_settings for an a single
95
- request; this effectively ignores the authentication
96
- in the spec for a single request.
218
+ request; this effectively ignores the
219
+ authentication in the spec for a single request.
97
220
  :type _request_auth: dict, optional
98
- :type _content_type: string, optional: force content-type for the request
221
+ :param _content_type: force content-type for the request.
222
+ :type _content_type: str, Optional
223
+ :param _headers: set to override the headers for a single
224
+ request; this effectively ignores the headers
225
+ in the spec for a single request.
226
+ :type _headers: dict, optional
227
+ :param _host_index: set to override the host_index for a single
228
+ request; this effectively ignores the host_index
229
+ in the spec for a single request.
230
+ :type _host_index: int, optional
99
231
  :return: Returns the result object.
100
- If the method is called asynchronously,
101
- returns the request thread.
102
- :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
103
- """
232
+ """ # noqa: E501
233
+
234
+ _param = self._create_user_users_post_serialize(
235
+ user_in=user_in,
236
+ _request_auth=_request_auth,
237
+ _content_type=_content_type,
238
+ _headers=_headers,
239
+ _host_index=_host_index
240
+ )
104
241
 
105
- local_var_params = locals()
242
+ _response_types_map: Dict[str, Optional[str]] = {
243
+ '201': "User",
244
+ '422': "HTTPValidationError"
245
+
246
+ }
247
+ response_data = await self.api_client.call_api(
248
+ *_param,
249
+ _request_timeout=_request_timeout
250
+ )
251
+ return response_data.response
106
252
 
107
- all_params = [
108
- 'user_in'
109
- ]
110
- all_params.extend(
253
+
254
+ def _create_user_users_post_serialize(
255
+ self,
256
+ user_in,
257
+ _request_auth,
258
+ _content_type,
259
+ _headers,
260
+ _host_index,
261
+ ) -> Tuple:
262
+
263
+ _host = None
264
+
265
+ _collection_formats: Dict[str, str] = {
266
+
267
+ }
268
+
269
+ _path_params: Dict[str, str] = {}
270
+ _query_params: List[Tuple[str, str]] = []
271
+ _header_params: Dict[str, Optional[str]] = _headers or {}
272
+ _form_params: List[Tuple[str, str]] = []
273
+ _files: Dict[str, str] = {}
274
+ _body_params: Optional[bytes] = None
275
+
276
+ # process the path parameters
277
+ # process the query parameters
278
+ # process the header parameters
279
+ # process the form parameters
280
+ # process the body parameter
281
+ if user_in is not None:
282
+ _body_params = user_in
283
+
284
+
285
+ # set the HTTP header `Accept`
286
+ _header_params['Accept'] = self.api_client.select_header_accept(
111
287
  [
112
- 'async_req',
113
- '_return_http_data_only',
114
- '_preload_content',
115
- '_request_timeout',
116
- '_request_auth',
117
- '_content_type',
118
- '_headers'
288
+ 'application/json'
119
289
  ]
120
290
  )
121
291
 
122
- for key, val in six.iteritems(local_var_params['kwargs']):
123
- if key not in all_params:
124
- raise ApiTypeError(
125
- "Got an unexpected keyword argument '%s'"
126
- " to method create_user_users_post" % key
292
+ # set the HTTP header `Content-Type`
293
+ if _content_type:
294
+ _header_params['Content-Type'] = _content_type
295
+ else:
296
+ _default_content_type = (
297
+ self.api_client.select_header_content_type(
298
+ [
299
+ 'application/json'
300
+ ]
127
301
  )
128
- local_var_params[key] = val
129
- del local_var_params['kwargs']
130
- # verify the required parameter 'user_in' is set
131
- if self.api_client.client_side_validation and local_var_params.get('user_in') is None: # noqa: E501
132
- raise ApiValueError("Missing the required parameter `user_in` when calling `create_user_users_post`") # noqa: E501
302
+ )
303
+ if _default_content_type is not None:
304
+ _header_params['Content-Type'] = _default_content_type
133
305
 
134
- collection_formats = {}
306
+ # authentication setting
307
+ _auth_settings: List[str] = [
308
+ 'user'
309
+ ]
135
310
 
136
- path_params = {}
311
+ return self.api_client.param_serialize(
312
+ method='POST',
313
+ resource_path='/users',
314
+ path_params=_path_params,
315
+ query_params=_query_params,
316
+ header_params=_header_params,
317
+ body=_body_params,
318
+ post_params=_form_params,
319
+ files=_files,
320
+ auth_settings=_auth_settings,
321
+ collection_formats=_collection_formats,
322
+ _host=_host,
323
+ _request_auth=_request_auth
324
+ )
137
325
 
138
- query_params = []
139
326
 
140
- header_params = dict(local_var_params.get('_headers', {}))
141
327
 
142
- form_params = []
143
- local_var_files = {}
144
328
 
145
- body_params = None
146
- if 'user_in' in local_var_params:
147
- body_params = local_var_params['user_in']
148
- # HTTP header `Accept`
149
- header_params['Accept'] = self.api_client.select_header_accept(
150
- ['application/json']) # noqa: E501
329
+ @validate_call
330
+ async def delete_user_users_id_delete(
331
+ self,
332
+ id: StrictInt,
333
+ _request_timeout: Union[
334
+ None,
335
+ Annotated[StrictFloat, Field(gt=0)],
336
+ Tuple[
337
+ Annotated[StrictFloat, Field(gt=0)],
338
+ Annotated[StrictFloat, Field(gt=0)]
339
+ ]
340
+ ] = None,
341
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
342
+ _content_type: Optional[StrictStr] = None,
343
+ _headers: Optional[Dict[StrictStr, Any]] = None,
344
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
345
+ ) -> None:
346
+ """Destroy user
151
347
 
152
- # HTTP header `Content-Type`
153
- content_types_list = local_var_params.get('_content_type',
154
- self.api_client.select_header_content_type(
155
- ['application/json'],
156
- 'POST', body_params)) # noqa: E501
157
- if content_types_list:
158
- header_params['Content-Type'] = content_types_list
348
+ Delete a user.
159
349
 
160
- # Authentication setting
161
- auth_settings = ['user'] # noqa: E501
350
+ :param id: (required)
351
+ :type id: int
352
+ :param _request_timeout: timeout setting for this request. If one
353
+ number provided, it will be total request
354
+ timeout. It can also be a pair (tuple) of
355
+ (connection, read) timeouts.
356
+ :type _request_timeout: int, tuple(int, int), optional
357
+ :param _request_auth: set to override the auth_settings for an a single
358
+ request; this effectively ignores the
359
+ authentication in the spec for a single request.
360
+ :type _request_auth: dict, optional
361
+ :param _content_type: force content-type for the request.
362
+ :type _content_type: str, Optional
363
+ :param _headers: set to override the headers for a single
364
+ request; this effectively ignores the headers
365
+ in the spec for a single request.
366
+ :type _headers: dict, optional
367
+ :param _host_index: set to override the host_index for a single
368
+ request; this effectively ignores the host_index
369
+ in the spec for a single request.
370
+ :type _host_index: int, optional
371
+ :return: Returns the result object.
372
+ """ # noqa: E501
373
+
374
+ _param = self._delete_user_users_id_delete_serialize(
375
+ id=id,
376
+ _request_auth=_request_auth,
377
+ _content_type=_content_type,
378
+ _headers=_headers,
379
+ _host_index=_host_index
380
+ )
162
381
 
163
- response_types_map = {
164
- 201: "User",
165
- 422: "HTTPValidationError",
382
+ _response_types_map: Dict[str, Optional[str]] = {
383
+
166
384
  }
385
+ response_data = await self.api_client.call_api(
386
+ *_param,
387
+ _request_timeout=_request_timeout
388
+ )
389
+ await response_data.read()
390
+ return self.api_client.response_deserialize(
391
+ response_data=response_data,
392
+ response_types_map=_response_types_map,
393
+ ).data
394
+
395
+
396
+ @validate_call
397
+ async def delete_user_users_id_delete_with_http_info(
398
+ self,
399
+ id: StrictInt,
400
+ _request_timeout: Union[
401
+ None,
402
+ Annotated[StrictFloat, Field(gt=0)],
403
+ Tuple[
404
+ Annotated[StrictFloat, Field(gt=0)],
405
+ Annotated[StrictFloat, Field(gt=0)]
406
+ ]
407
+ ] = None,
408
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
409
+ _content_type: Optional[StrictStr] = None,
410
+ _headers: Optional[Dict[StrictStr, Any]] = None,
411
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
412
+ ) -> ApiResponse[None]:
413
+ """Destroy user
167
414
 
168
- return self.api_client.call_api(
169
- '/users', 'POST',
170
- path_params,
171
- query_params,
172
- header_params,
173
- body=body_params,
174
- post_params=form_params,
175
- files=local_var_files,
176
- response_types_map=response_types_map,
177
- auth_settings=auth_settings,
178
- async_req=local_var_params.get('async_req'),
179
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
180
- _preload_content=local_var_params.get('_preload_content', True),
181
- _request_timeout=local_var_params.get('_request_timeout'),
182
- collection_formats=collection_formats,
183
- _request_auth=local_var_params.get('_request_auth'))
184
-
185
- def delete_user_users_id_delete(self, id, **kwargs): # noqa: E501
186
- """Destroy user # noqa: E501
187
-
188
- Delete a user. # noqa: E501
189
- This method makes a synchronous HTTP request by default. To make an
190
- asynchronous HTTP request, please pass async_req=True
191
-
192
- >>> thread = api.delete_user_users_id_delete(id, async_req=True)
193
- >>> result = thread.get()
415
+ Delete a user.
194
416
 
195
417
  :param id: (required)
196
418
  :type id: int
197
- :param async_req: Whether to execute the request asynchronously.
198
- :type async_req: bool, optional
199
- :param _preload_content: if False, the urllib3.HTTPResponse object will
200
- be returned without reading/decoding response
201
- data. Default is True.
202
- :type _preload_content: bool, optional
203
419
  :param _request_timeout: timeout setting for this request. If one
204
420
  number provided, it will be total request
205
421
  timeout. It can also be a pair (tuple) of
206
422
  (connection, read) timeouts.
423
+ :type _request_timeout: int, tuple(int, int), optional
424
+ :param _request_auth: set to override the auth_settings for an a single
425
+ request; this effectively ignores the
426
+ authentication in the spec for a single request.
427
+ :type _request_auth: dict, optional
428
+ :param _content_type: force content-type for the request.
429
+ :type _content_type: str, Optional
430
+ :param _headers: set to override the headers for a single
431
+ request; this effectively ignores the headers
432
+ in the spec for a single request.
433
+ :type _headers: dict, optional
434
+ :param _host_index: set to override the host_index for a single
435
+ request; this effectively ignores the host_index
436
+ in the spec for a single request.
437
+ :type _host_index: int, optional
207
438
  :return: Returns the result object.
208
- If the method is called asynchronously,
209
- returns the request thread.
210
- :rtype: None
211
- """
212
- kwargs['_return_http_data_only'] = True
213
- return self.delete_user_users_id_delete_with_http_info(id, **kwargs) # noqa: E501
439
+ """ # noqa: E501
440
+
441
+ _param = self._delete_user_users_id_delete_serialize(
442
+ id=id,
443
+ _request_auth=_request_auth,
444
+ _content_type=_content_type,
445
+ _headers=_headers,
446
+ _host_index=_host_index
447
+ )
448
+
449
+ _response_types_map: Dict[str, Optional[str]] = {
450
+
451
+ }
452
+ response_data = await self.api_client.call_api(
453
+ *_param,
454
+ _request_timeout=_request_timeout
455
+ )
456
+ await response_data.read()
457
+ return self.api_client.response_deserialize(
458
+ response_data=response_data,
459
+ response_types_map=_response_types_map,
460
+ )
214
461
 
215
- def delete_user_users_id_delete_with_http_info(self, id, **kwargs): # noqa: E501
216
- """Destroy user # noqa: E501
217
462
 
218
- Delete a user. # noqa: E501
219
- This method makes a synchronous HTTP request by default. To make an
220
- asynchronous HTTP request, please pass async_req=True
463
+ @validate_call
464
+ async def delete_user_users_id_delete_without_preload_content(
465
+ self,
466
+ id: StrictInt,
467
+ _request_timeout: Union[
468
+ None,
469
+ Annotated[StrictFloat, Field(gt=0)],
470
+ Tuple[
471
+ Annotated[StrictFloat, Field(gt=0)],
472
+ Annotated[StrictFloat, Field(gt=0)]
473
+ ]
474
+ ] = None,
475
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
476
+ _content_type: Optional[StrictStr] = None,
477
+ _headers: Optional[Dict[StrictStr, Any]] = None,
478
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
479
+ ) -> RESTResponseType:
480
+ """Destroy user
221
481
 
222
- >>> thread = api.delete_user_users_id_delete_with_http_info(id, async_req=True)
223
- >>> result = thread.get()
482
+ Delete a user.
224
483
 
225
484
  :param id: (required)
226
485
  :type id: int
227
- :param async_req: Whether to execute the request asynchronously.
228
- :type async_req: bool, optional
229
- :param _return_http_data_only: response data without head status code
230
- and headers
231
- :type _return_http_data_only: bool, optional
232
- :param _preload_content: if False, the urllib3.HTTPResponse object will
233
- be returned without reading/decoding response
234
- data. Default is True.
235
- :type _preload_content: bool, optional
236
486
  :param _request_timeout: timeout setting for this request. If one
237
487
  number provided, it will be total request
238
488
  timeout. It can also be a pair (tuple) of
239
489
  (connection, read) timeouts.
490
+ :type _request_timeout: int, tuple(int, int), optional
240
491
  :param _request_auth: set to override the auth_settings for an a single
241
- request; this effectively ignores the authentication
242
- in the spec for a single request.
492
+ request; this effectively ignores the
493
+ authentication in the spec for a single request.
243
494
  :type _request_auth: dict, optional
244
- :type _content_type: string, optional: force content-type for the request
495
+ :param _content_type: force content-type for the request.
496
+ :type _content_type: str, Optional
497
+ :param _headers: set to override the headers for a single
498
+ request; this effectively ignores the headers
499
+ in the spec for a single request.
500
+ :type _headers: dict, optional
501
+ :param _host_index: set to override the host_index for a single
502
+ request; this effectively ignores the host_index
503
+ in the spec for a single request.
504
+ :type _host_index: int, optional
245
505
  :return: Returns the result object.
246
- If the method is called asynchronously,
247
- returns the request thread.
248
- :rtype: None
249
- """
506
+ """ # noqa: E501
507
+
508
+ _param = self._delete_user_users_id_delete_serialize(
509
+ id=id,
510
+ _request_auth=_request_auth,
511
+ _content_type=_content_type,
512
+ _headers=_headers,
513
+ _host_index=_host_index
514
+ )
250
515
 
251
- local_var_params = locals()
516
+ _response_types_map: Dict[str, Optional[str]] = {
517
+
518
+ }
519
+ response_data = await self.api_client.call_api(
520
+ *_param,
521
+ _request_timeout=_request_timeout
522
+ )
523
+ return response_data.response
252
524
 
253
- all_params = [
254
- 'id'
255
- ]
256
- all_params.extend(
525
+
526
+ def _delete_user_users_id_delete_serialize(
527
+ self,
528
+ id,
529
+ _request_auth,
530
+ _content_type,
531
+ _headers,
532
+ _host_index,
533
+ ) -> Tuple:
534
+
535
+ _host = None
536
+
537
+ _collection_formats: Dict[str, str] = {
538
+
539
+ }
540
+
541
+ _path_params: Dict[str, str] = {}
542
+ _query_params: List[Tuple[str, str]] = []
543
+ _header_params: Dict[str, Optional[str]] = _headers or {}
544
+ _form_params: List[Tuple[str, str]] = []
545
+ _files: Dict[str, str] = {}
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
+ _header_params['Accept'] = self.api_client.select_header_accept(
257
559
  [
258
- 'async_req',
259
- '_return_http_data_only',
260
- '_preload_content',
261
- '_request_timeout',
262
- '_request_auth',
263
- '_content_type',
264
- '_headers'
560
+ 'application/json'
265
561
  ]
266
562
  )
267
563
 
268
- for key, val in six.iteritems(local_var_params['kwargs']):
269
- if key not in all_params:
270
- raise ApiTypeError(
271
- "Got an unexpected keyword argument '%s'"
272
- " to method delete_user_users_id_delete" % key
273
- )
274
- local_var_params[key] = val
275
- del local_var_params['kwargs']
276
- # verify the required parameter 'id' is set
277
- if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501
278
- raise ApiValueError("Missing the required parameter `id` when calling `delete_user_users_id_delete`") # noqa: E501
279
-
280
- collection_formats = {}
281
-
282
- path_params = {}
283
- if 'id' in local_var_params:
284
- path_params['id'] = local_var_params['id'] # noqa: E501
285
-
286
- query_params = []
287
-
288
- header_params = dict(local_var_params.get('_headers', {}))
289
-
290
- form_params = []
291
- local_var_files = {}
292
-
293
- body_params = None
294
- # HTTP header `Accept`
295
- header_params['Accept'] = self.api_client.select_header_accept(
296
- ['application/json']) # noqa: E501
297
-
298
- # Authentication setting
299
- auth_settings = ['user'] # noqa: E501
300
-
301
- response_types_map = {}
302
-
303
- return self.api_client.call_api(
304
- '/users/{id}', 'DELETE',
305
- path_params,
306
- query_params,
307
- header_params,
308
- body=body_params,
309
- post_params=form_params,
310
- files=local_var_files,
311
- response_types_map=response_types_map,
312
- auth_settings=auth_settings,
313
- async_req=local_var_params.get('async_req'),
314
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
315
- _preload_content=local_var_params.get('_preload_content', True),
316
- _request_timeout=local_var_params.get('_request_timeout'),
317
- collection_formats=collection_formats,
318
- _request_auth=local_var_params.get('_request_auth'))
319
-
320
- def read_user_users_id_get(self, id, **kwargs): # noqa: E501
321
- """Retrieve user # noqa: E501
322
-
323
- Get user by ID. # noqa: E501
324
- This method makes a synchronous HTTP request by default. To make an
325
- asynchronous HTTP request, please pass async_req=True
326
-
327
- >>> thread = api.read_user_users_id_get(id, async_req=True)
328
- >>> result = thread.get()
564
+
565
+ # authentication setting
566
+ _auth_settings: List[str] = [
567
+ 'user'
568
+ ]
569
+
570
+ return self.api_client.param_serialize(
571
+ method='DELETE',
572
+ resource_path='/users/{id}',
573
+ path_params=_path_params,
574
+ query_params=_query_params,
575
+ header_params=_header_params,
576
+ body=_body_params,
577
+ post_params=_form_params,
578
+ files=_files,
579
+ auth_settings=_auth_settings,
580
+ collection_formats=_collection_formats,
581
+ _host=_host,
582
+ _request_auth=_request_auth
583
+ )
584
+
585
+
586
+
587
+
588
+ @validate_call
589
+ async def read_user_users_id_get(
590
+ self,
591
+ id: StrictInt,
592
+ _request_timeout: Union[
593
+ None,
594
+ Annotated[StrictFloat, Field(gt=0)],
595
+ Tuple[
596
+ Annotated[StrictFloat, Field(gt=0)],
597
+ Annotated[StrictFloat, Field(gt=0)]
598
+ ]
599
+ ] = None,
600
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
601
+ _content_type: Optional[StrictStr] = None,
602
+ _headers: Optional[Dict[StrictStr, Any]] = None,
603
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
604
+ ) -> User:
605
+ """Retrieve user
606
+
607
+ Get user by ID.
329
608
 
330
609
  :param id: (required)
331
610
  :type id: int
332
- :param async_req: Whether to execute the request asynchronously.
333
- :type async_req: bool, optional
334
- :param _preload_content: if False, the urllib3.HTTPResponse object will
335
- be returned without reading/decoding response
336
- data. Default is True.
337
- :type _preload_content: bool, optional
338
611
  :param _request_timeout: timeout setting for this request. If one
339
612
  number provided, it will be total request
340
613
  timeout. It can also be a pair (tuple) of
341
614
  (connection, read) timeouts.
615
+ :type _request_timeout: int, tuple(int, int), optional
616
+ :param _request_auth: set to override the auth_settings for an a single
617
+ request; this effectively ignores the
618
+ authentication in the spec for a single request.
619
+ :type _request_auth: dict, optional
620
+ :param _content_type: force content-type for the request.
621
+ :type _content_type: str, Optional
622
+ :param _headers: set to override the headers for a single
623
+ request; this effectively ignores the headers
624
+ in the spec for a single request.
625
+ :type _headers: dict, optional
626
+ :param _host_index: set to override the host_index for a single
627
+ request; this effectively ignores the host_index
628
+ in the spec for a single request.
629
+ :type _host_index: int, optional
342
630
  :return: Returns the result object.
343
- If the method is called asynchronously,
344
- returns the request thread.
345
- :rtype: User
346
- """
347
- kwargs['_return_http_data_only'] = True
348
- return self.read_user_users_id_get_with_http_info(id, **kwargs) # noqa: E501
349
-
350
- def read_user_users_id_get_with_http_info(self, id, **kwargs): # noqa: E501
351
- """Retrieve user # noqa: E501
631
+ """ # noqa: E501
632
+
633
+ _param = self._read_user_users_id_get_serialize(
634
+ id=id,
635
+ _request_auth=_request_auth,
636
+ _content_type=_content_type,
637
+ _headers=_headers,
638
+ _host_index=_host_index
639
+ )
352
640
 
353
- Get user by ID. # noqa: E501
354
- This method makes a synchronous HTTP request by default. To make an
355
- asynchronous HTTP request, please pass async_req=True
641
+ _response_types_map: Dict[str, Optional[str]] = {
642
+ '200': "User",
643
+ '404': "HTTPNotFoundError",
644
+ '422': "HTTPValidationError"
645
+
646
+ }
647
+ response_data = await self.api_client.call_api(
648
+ *_param,
649
+ _request_timeout=_request_timeout
650
+ )
651
+ await response_data.read()
652
+ return self.api_client.response_deserialize(
653
+ response_data=response_data,
654
+ response_types_map=_response_types_map,
655
+ ).data
656
+
657
+
658
+ @validate_call
659
+ async def read_user_users_id_get_with_http_info(
660
+ self,
661
+ id: StrictInt,
662
+ _request_timeout: Union[
663
+ None,
664
+ Annotated[StrictFloat, Field(gt=0)],
665
+ Tuple[
666
+ Annotated[StrictFloat, Field(gt=0)],
667
+ Annotated[StrictFloat, Field(gt=0)]
668
+ ]
669
+ ] = None,
670
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
671
+ _content_type: Optional[StrictStr] = None,
672
+ _headers: Optional[Dict[StrictStr, Any]] = None,
673
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
674
+ ) -> ApiResponse[User]:
675
+ """Retrieve user
356
676
 
357
- >>> thread = api.read_user_users_id_get_with_http_info(id, async_req=True)
358
- >>> result = thread.get()
677
+ Get user by ID.
359
678
 
360
679
  :param id: (required)
361
680
  :type id: int
362
- :param async_req: Whether to execute the request asynchronously.
363
- :type async_req: bool, optional
364
- :param _return_http_data_only: response data without head status code
365
- and headers
366
- :type _return_http_data_only: bool, optional
367
- :param _preload_content: if False, the urllib3.HTTPResponse object will
368
- be returned without reading/decoding response
369
- data. Default is True.
370
- :type _preload_content: bool, optional
371
681
  :param _request_timeout: timeout setting for this request. If one
372
682
  number provided, it will be total request
373
683
  timeout. It can also be a pair (tuple) of
374
684
  (connection, read) timeouts.
685
+ :type _request_timeout: int, tuple(int, int), optional
375
686
  :param _request_auth: set to override the auth_settings for an a single
376
- request; this effectively ignores the authentication
377
- in the spec for a single request.
687
+ request; this effectively ignores the
688
+ authentication in the spec for a single request.
378
689
  :type _request_auth: dict, optional
379
- :type _content_type: string, optional: force content-type for the request
690
+ :param _content_type: force content-type for the request.
691
+ :type _content_type: str, Optional
692
+ :param _headers: set to override the headers for a single
693
+ request; this effectively ignores the headers
694
+ in the spec for a single request.
695
+ :type _headers: dict, optional
696
+ :param _host_index: set to override the host_index for a single
697
+ request; this effectively ignores the host_index
698
+ in the spec for a single request.
699
+ :type _host_index: int, optional
380
700
  :return: Returns the result object.
381
- If the method is called asynchronously,
382
- returns the request thread.
383
- :rtype: tuple(User, status_code(int), headers(HTTPHeaderDict))
384
- """
701
+ """ # noqa: E501
702
+
703
+ _param = self._read_user_users_id_get_serialize(
704
+ id=id,
705
+ _request_auth=_request_auth,
706
+ _content_type=_content_type,
707
+ _headers=_headers,
708
+ _host_index=_host_index
709
+ )
710
+
711
+ _response_types_map: Dict[str, Optional[str]] = {
712
+ '200': "User",
713
+ '404': "HTTPNotFoundError",
714
+ '422': "HTTPValidationError"
715
+
716
+ }
717
+ response_data = await self.api_client.call_api(
718
+ *_param,
719
+ _request_timeout=_request_timeout
720
+ )
721
+ await response_data.read()
722
+ return self.api_client.response_deserialize(
723
+ response_data=response_data,
724
+ response_types_map=_response_types_map,
725
+ )
385
726
 
386
- local_var_params = locals()
387
727
 
388
- all_params = [
389
- 'id'
390
- ]
391
- all_params.extend(
392
- [
393
- 'async_req',
394
- '_return_http_data_only',
395
- '_preload_content',
396
- '_request_timeout',
397
- '_request_auth',
398
- '_content_type',
399
- '_headers'
728
+ @validate_call
729
+ async def read_user_users_id_get_without_preload_content(
730
+ self,
731
+ id: StrictInt,
732
+ _request_timeout: Union[
733
+ None,
734
+ Annotated[StrictFloat, Field(gt=0)],
735
+ Tuple[
736
+ Annotated[StrictFloat, Field(gt=0)],
737
+ Annotated[StrictFloat, Field(gt=0)]
400
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 user
746
+
747
+ Get user by ID.
748
+
749
+ :param id: (required)
750
+ :type id: int
751
+ :param _request_timeout: timeout setting for this request. If one
752
+ number provided, it will be total request
753
+ timeout. It can also be a pair (tuple) of
754
+ (connection, read) timeouts.
755
+ :type _request_timeout: int, tuple(int, int), optional
756
+ :param _request_auth: set to override the auth_settings for an a single
757
+ request; this effectively ignores the
758
+ authentication in the spec for a single request.
759
+ :type _request_auth: dict, optional
760
+ :param _content_type: force content-type for the request.
761
+ :type _content_type: str, Optional
762
+ :param _headers: set to override the headers for a single
763
+ request; this effectively ignores the headers
764
+ in the spec for a single request.
765
+ :type _headers: dict, optional
766
+ :param _host_index: set to override the host_index for a single
767
+ request; this effectively ignores the host_index
768
+ in the spec for a single request.
769
+ :type _host_index: int, optional
770
+ :return: Returns the result object.
771
+ """ # noqa: E501
772
+
773
+ _param = self._read_user_users_id_get_serialize(
774
+ id=id,
775
+ _request_auth=_request_auth,
776
+ _content_type=_content_type,
777
+ _headers=_headers,
778
+ _host_index=_host_index
401
779
  )
402
780
 
403
- for key, val in six.iteritems(local_var_params['kwargs']):
404
- if key not in all_params:
405
- raise ApiTypeError(
406
- "Got an unexpected keyword argument '%s'"
407
- " to method read_user_users_id_get" % key
408
- )
409
- local_var_params[key] = val
410
- del local_var_params['kwargs']
411
- # verify the required parameter 'id' is set
412
- if self.api_client.client_side_validation and local_var_params.get('id') is None: # noqa: E501
413
- raise ApiValueError("Missing the required parameter `id` when calling `read_user_users_id_get`") # noqa: E501
781
+ _response_types_map: Dict[str, Optional[str]] = {
782
+ '200': "User",
783
+ '404': "HTTPNotFoundError",
784
+ '422': "HTTPValidationError"
785
+
786
+ }
787
+ response_data = await self.api_client.call_api(
788
+ *_param,
789
+ _request_timeout=_request_timeout
790
+ )
791
+ return response_data.response
414
792
 
415
- collection_formats = {}
416
793
 
417
- path_params = {}
418
- if 'id' in local_var_params:
419
- path_params['id'] = local_var_params['id'] # noqa: E501
794
+ def _read_user_users_id_get_serialize(
795
+ self,
796
+ id,
797
+ _request_auth,
798
+ _content_type,
799
+ _headers,
800
+ _host_index,
801
+ ) -> Tuple:
420
802
 
421
- query_params = []
803
+ _host = None
422
804
 
423
- header_params = dict(local_var_params.get('_headers', {}))
805
+ _collection_formats: Dict[str, str] = {
806
+
807
+ }
424
808
 
425
- form_params = []
426
- local_var_files = {}
809
+ _path_params: Dict[str, str] = {}
810
+ _query_params: List[Tuple[str, str]] = []
811
+ _header_params: Dict[str, Optional[str]] = _headers or {}
812
+ _form_params: List[Tuple[str, str]] = []
813
+ _files: Dict[str, str] = {}
814
+ _body_params: Optional[bytes] = None
427
815
 
428
- body_params = None
429
- # HTTP header `Accept`
430
- header_params['Accept'] = self.api_client.select_header_accept(
431
- ['application/json']) # noqa: E501
816
+ # process the path parameters
817
+ if id is not None:
818
+ _path_params['id'] = id
819
+ # process the query parameters
820
+ # process the header parameters
821
+ # process the form parameters
822
+ # process the body parameter
823
+
824
+
825
+ # set the HTTP header `Accept`
826
+ _header_params['Accept'] = self.api_client.select_header_accept(
827
+ [
828
+ 'application/json'
829
+ ]
830
+ )
831
+
832
+
833
+ # authentication setting
834
+ _auth_settings: List[str] = [
835
+ 'user'
836
+ ]
837
+
838
+ return self.api_client.param_serialize(
839
+ method='GET',
840
+ resource_path='/users/{id}',
841
+ path_params=_path_params,
842
+ query_params=_query_params,
843
+ header_params=_header_params,
844
+ body=_body_params,
845
+ post_params=_form_params,
846
+ files=_files,
847
+ auth_settings=_auth_settings,
848
+ collection_formats=_collection_formats,
849
+ _host=_host,
850
+ _request_auth=_request_auth
851
+ )
432
852
 
433
- # Authentication setting
434
- auth_settings = ['user'] # noqa: E501
435
853
 
436
- response_types_map = {
437
- 200: "User",
438
- 404: "HTTPNotFoundError",
439
- 422: "HTTPValidationError",
440
- }
441
854
 
442
- return self.api_client.call_api(
443
- '/users/{id}', 'GET',
444
- path_params,
445
- query_params,
446
- header_params,
447
- body=body_params,
448
- post_params=form_params,
449
- files=local_var_files,
450
- response_types_map=response_types_map,
451
- auth_settings=auth_settings,
452
- async_req=local_var_params.get('async_req'),
453
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
454
- _preload_content=local_var_params.get('_preload_content', True),
455
- _request_timeout=local_var_params.get('_request_timeout'),
456
- collection_formats=collection_formats,
457
- _request_auth=local_var_params.get('_request_auth'))
458
-
459
- def read_users_users_get(self, **kwargs): # noqa: E501
460
- """List users # noqa: E501
461
-
462
- Read users. # noqa: E501
463
- This method makes a synchronous HTTP request by default. To make an
464
- asynchronous HTTP request, please pass async_req=True
465
-
466
- >>> thread = api.read_users_users_get(async_req=True)
467
- >>> result = thread.get()
468
-
469
- :param async_req: Whether to execute the request asynchronously.
470
- :type async_req: bool, optional
471
- :param _preload_content: if False, the urllib3.HTTPResponse object will
472
- be returned without reading/decoding response
473
- data. Default is True.
474
- :type _preload_content: bool, optional
855
+
856
+ @validate_call
857
+ async def read_users_users_get(
858
+ self,
859
+ latest: Optional[StrictBool] = None,
860
+ id: Optional[StrictInt] = None,
861
+ full_name: Optional[StrictStr] = None,
862
+ email: Optional[StrictStr] = None,
863
+ is_superuser: Optional[StrictBool] = None,
864
+ is_staff: Optional[StrictBool] = None,
865
+ is_active: Optional[StrictBool] = None,
866
+ is_confirmed: Optional[StrictBool] = None,
867
+ _request_timeout: Union[
868
+ None,
869
+ Annotated[StrictFloat, Field(gt=0)],
870
+ Tuple[
871
+ Annotated[StrictFloat, Field(gt=0)],
872
+ Annotated[StrictFloat, Field(gt=0)]
873
+ ]
874
+ ] = None,
875
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
876
+ _content_type: Optional[StrictStr] = None,
877
+ _headers: Optional[Dict[StrictStr, Any]] = None,
878
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
879
+ ) -> List[User]:
880
+ """List users
881
+
882
+ Read users.
883
+
884
+ :param latest:
885
+ :type latest: bool
886
+ :param id:
887
+ :type id: int
888
+ :param full_name:
889
+ :type full_name: str
890
+ :param email:
891
+ :type email: str
892
+ :param is_superuser:
893
+ :type is_superuser: bool
894
+ :param is_staff:
895
+ :type is_staff: bool
896
+ :param is_active:
897
+ :type is_active: bool
898
+ :param is_confirmed:
899
+ :type is_confirmed: bool
475
900
  :param _request_timeout: timeout setting for this request. If one
476
901
  number provided, it will be total request
477
902
  timeout. It can also be a pair (tuple) of
478
903
  (connection, read) timeouts.
904
+ :type _request_timeout: int, tuple(int, int), optional
905
+ :param _request_auth: set to override the auth_settings for an a single
906
+ request; this effectively ignores the
907
+ authentication in the spec for a single request.
908
+ :type _request_auth: dict, optional
909
+ :param _content_type: force content-type for the request.
910
+ :type _content_type: str, Optional
911
+ :param _headers: set to override the headers for a single
912
+ request; this effectively ignores the headers
913
+ in the spec for a single request.
914
+ :type _headers: dict, optional
915
+ :param _host_index: set to override the host_index for a single
916
+ request; this effectively ignores the host_index
917
+ in the spec for a single request.
918
+ :type _host_index: int, optional
479
919
  :return: Returns the result object.
480
- If the method is called asynchronously,
481
- returns the request thread.
482
- :rtype: list[User]
483
- """
484
- kwargs['_return_http_data_only'] = True
485
- return self.read_users_users_get_with_http_info(**kwargs) # noqa: E501
486
-
487
- def read_users_users_get_with_http_info(self, **kwargs): # noqa: E501
488
- """List users # noqa: E501
489
-
490
- Read users. # noqa: E501
491
- This method makes a synchronous HTTP request by default. To make an
492
- asynchronous HTTP request, please pass async_req=True
493
-
494
- >>> thread = api.read_users_users_get_with_http_info(async_req=True)
495
- >>> result = thread.get()
496
-
497
- :param async_req: Whether to execute the request asynchronously.
498
- :type async_req: bool, optional
499
- :param _return_http_data_only: response data without head status code
500
- and headers
501
- :type _return_http_data_only: bool, optional
502
- :param _preload_content: if False, the urllib3.HTTPResponse object will
503
- be returned without reading/decoding response
504
- data. Default is True.
505
- :type _preload_content: bool, optional
920
+ """ # noqa: E501
921
+
922
+ _param = self._read_users_users_get_serialize(
923
+ latest=latest,
924
+ id=id,
925
+ full_name=full_name,
926
+ email=email,
927
+ is_superuser=is_superuser,
928
+ is_staff=is_staff,
929
+ is_active=is_active,
930
+ is_confirmed=is_confirmed,
931
+ _request_auth=_request_auth,
932
+ _content_type=_content_type,
933
+ _headers=_headers,
934
+ _host_index=_host_index
935
+ )
936
+
937
+ _response_types_map: Dict[str, Optional[str]] = {
938
+ '200': "List[User]",
939
+ '422': "HTTPValidationError"
940
+
941
+ }
942
+ response_data = await self.api_client.call_api(
943
+ *_param,
944
+ _request_timeout=_request_timeout
945
+ )
946
+ await response_data.read()
947
+ return self.api_client.response_deserialize(
948
+ response_data=response_data,
949
+ response_types_map=_response_types_map,
950
+ ).data
951
+
952
+
953
+ @validate_call
954
+ async def read_users_users_get_with_http_info(
955
+ self,
956
+ latest: Optional[StrictBool] = None,
957
+ id: Optional[StrictInt] = None,
958
+ full_name: Optional[StrictStr] = None,
959
+ email: Optional[StrictStr] = None,
960
+ is_superuser: Optional[StrictBool] = None,
961
+ is_staff: Optional[StrictBool] = None,
962
+ is_active: Optional[StrictBool] = None,
963
+ is_confirmed: Optional[StrictBool] = None,
964
+ _request_timeout: Union[
965
+ None,
966
+ Annotated[StrictFloat, Field(gt=0)],
967
+ Tuple[
968
+ Annotated[StrictFloat, Field(gt=0)],
969
+ Annotated[StrictFloat, Field(gt=0)]
970
+ ]
971
+ ] = None,
972
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
973
+ _content_type: Optional[StrictStr] = None,
974
+ _headers: Optional[Dict[StrictStr, Any]] = None,
975
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
976
+ ) -> ApiResponse[List[User]]:
977
+ """List users
978
+
979
+ Read users.
980
+
981
+ :param latest:
982
+ :type latest: bool
983
+ :param id:
984
+ :type id: int
985
+ :param full_name:
986
+ :type full_name: str
987
+ :param email:
988
+ :type email: str
989
+ :param is_superuser:
990
+ :type is_superuser: bool
991
+ :param is_staff:
992
+ :type is_staff: bool
993
+ :param is_active:
994
+ :type is_active: bool
995
+ :param is_confirmed:
996
+ :type is_confirmed: bool
506
997
  :param _request_timeout: timeout setting for this request. If one
507
998
  number provided, it will be total request
508
999
  timeout. It can also be a pair (tuple) of
509
1000
  (connection, read) timeouts.
1001
+ :type _request_timeout: int, tuple(int, int), optional
510
1002
  :param _request_auth: set to override the auth_settings for an a single
511
- request; this effectively ignores the authentication
512
- in the spec for a single request.
1003
+ request; this effectively ignores the
1004
+ authentication in the spec for a single request.
513
1005
  :type _request_auth: dict, optional
514
- :type _content_type: string, optional: force content-type for the request
1006
+ :param _content_type: force content-type for the request.
1007
+ :type _content_type: str, Optional
1008
+ :param _headers: set to override the headers for a single
1009
+ request; this effectively ignores the headers
1010
+ in the spec for a single request.
1011
+ :type _headers: dict, optional
1012
+ :param _host_index: set to override the host_index for a single
1013
+ request; this effectively ignores the host_index
1014
+ in the spec for a single request.
1015
+ :type _host_index: int, optional
515
1016
  :return: Returns the result object.
516
- If the method is called asynchronously,
517
- returns the request thread.
518
- :rtype: tuple(list[User], status_code(int), headers(HTTPHeaderDict))
519
- """
520
-
521
- local_var_params = locals()
522
-
523
- all_params = [
524
- ]
525
- all_params.extend(
526
- [
527
- 'async_req',
528
- '_return_http_data_only',
529
- '_preload_content',
530
- '_request_timeout',
531
- '_request_auth',
532
- '_content_type',
533
- '_headers'
534
- ]
1017
+ """ # noqa: E501
1018
+
1019
+ _param = self._read_users_users_get_serialize(
1020
+ latest=latest,
1021
+ id=id,
1022
+ full_name=full_name,
1023
+ email=email,
1024
+ is_superuser=is_superuser,
1025
+ is_staff=is_staff,
1026
+ is_active=is_active,
1027
+ is_confirmed=is_confirmed,
1028
+ _request_auth=_request_auth,
1029
+ _content_type=_content_type,
1030
+ _headers=_headers,
1031
+ _host_index=_host_index
535
1032
  )
536
1033
 
537
- for key, val in six.iteritems(local_var_params['kwargs']):
538
- if key not in all_params:
539
- raise ApiTypeError(
540
- "Got an unexpected keyword argument '%s'"
541
- " to method read_users_users_get" % key
542
- )
543
- local_var_params[key] = val
544
- del local_var_params['kwargs']
1034
+ _response_types_map: Dict[str, Optional[str]] = {
1035
+ '200': "List[User]",
1036
+ '422': "HTTPValidationError"
1037
+
1038
+ }
1039
+ response_data = await self.api_client.call_api(
1040
+ *_param,
1041
+ _request_timeout=_request_timeout
1042
+ )
1043
+ await response_data.read()
1044
+ return self.api_client.response_deserialize(
1045
+ response_data=response_data,
1046
+ response_types_map=_response_types_map,
1047
+ )
545
1048
 
546
- collection_formats = {}
547
1049
 
548
- path_params = {}
1050
+ @validate_call
1051
+ async def read_users_users_get_without_preload_content(
1052
+ self,
1053
+ latest: Optional[StrictBool] = None,
1054
+ id: Optional[StrictInt] = None,
1055
+ full_name: Optional[StrictStr] = None,
1056
+ email: Optional[StrictStr] = None,
1057
+ is_superuser: Optional[StrictBool] = None,
1058
+ is_staff: Optional[StrictBool] = None,
1059
+ is_active: Optional[StrictBool] = None,
1060
+ is_confirmed: Optional[StrictBool] = None,
1061
+ _request_timeout: Union[
1062
+ None,
1063
+ Annotated[StrictFloat, Field(gt=0)],
1064
+ Tuple[
1065
+ Annotated[StrictFloat, Field(gt=0)],
1066
+ Annotated[StrictFloat, Field(gt=0)]
1067
+ ]
1068
+ ] = None,
1069
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1070
+ _content_type: Optional[StrictStr] = None,
1071
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1072
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1073
+ ) -> RESTResponseType:
1074
+ """List users
1075
+
1076
+ Read users.
1077
+
1078
+ :param latest:
1079
+ :type latest: bool
1080
+ :param id:
1081
+ :type id: int
1082
+ :param full_name:
1083
+ :type full_name: str
1084
+ :param email:
1085
+ :type email: str
1086
+ :param is_superuser:
1087
+ :type is_superuser: bool
1088
+ :param is_staff:
1089
+ :type is_staff: bool
1090
+ :param is_active:
1091
+ :type is_active: bool
1092
+ :param is_confirmed:
1093
+ :type is_confirmed: bool
1094
+ :param _request_timeout: timeout setting for this request. If one
1095
+ number provided, it will be total request
1096
+ timeout. It can also be a pair (tuple) of
1097
+ (connection, read) timeouts.
1098
+ :type _request_timeout: int, tuple(int, int), optional
1099
+ :param _request_auth: set to override the auth_settings for an a single
1100
+ request; this effectively ignores the
1101
+ authentication in the spec for a single request.
1102
+ :type _request_auth: dict, optional
1103
+ :param _content_type: force content-type for the request.
1104
+ :type _content_type: str, Optional
1105
+ :param _headers: set to override the headers for a single
1106
+ request; this effectively ignores the headers
1107
+ in the spec for a single request.
1108
+ :type _headers: dict, optional
1109
+ :param _host_index: set to override the host_index for a single
1110
+ request; this effectively ignores the host_index
1111
+ in the spec for a single request.
1112
+ :type _host_index: int, optional
1113
+ :return: Returns the result object.
1114
+ """ # noqa: E501
1115
+
1116
+ _param = self._read_users_users_get_serialize(
1117
+ latest=latest,
1118
+ id=id,
1119
+ full_name=full_name,
1120
+ email=email,
1121
+ is_superuser=is_superuser,
1122
+ is_staff=is_staff,
1123
+ is_active=is_active,
1124
+ is_confirmed=is_confirmed,
1125
+ _request_auth=_request_auth,
1126
+ _content_type=_content_type,
1127
+ _headers=_headers,
1128
+ _host_index=_host_index
1129
+ )
549
1130
 
550
- query_params = []
1131
+ _response_types_map: Dict[str, Optional[str]] = {
1132
+ '200': "List[User]",
1133
+ '422': "HTTPValidationError"
1134
+
1135
+ }
1136
+ response_data = await self.api_client.call_api(
1137
+ *_param,
1138
+ _request_timeout=_request_timeout
1139
+ )
1140
+ return response_data.response
1141
+
1142
+
1143
+ def _read_users_users_get_serialize(
1144
+ self,
1145
+ latest,
1146
+ id,
1147
+ full_name,
1148
+ email,
1149
+ is_superuser,
1150
+ is_staff,
1151
+ is_active,
1152
+ is_confirmed,
1153
+ _request_auth,
1154
+ _content_type,
1155
+ _headers,
1156
+ _host_index,
1157
+ ) -> Tuple:
1158
+
1159
+ _host = None
1160
+
1161
+ _collection_formats: Dict[str, str] = {
1162
+
1163
+ }
551
1164
 
552
- header_params = dict(local_var_params.get('_headers', {}))
1165
+ _path_params: Dict[str, str] = {}
1166
+ _query_params: List[Tuple[str, str]] = []
1167
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1168
+ _form_params: List[Tuple[str, str]] = []
1169
+ _files: Dict[str, str] = {}
1170
+ _body_params: Optional[bytes] = None
1171
+
1172
+ # process the path parameters
1173
+ # process the query parameters
1174
+ if latest is not None:
1175
+
1176
+ _query_params.append(('latest', latest))
1177
+
1178
+ if id is not None:
1179
+
1180
+ _query_params.append(('id', id))
1181
+
1182
+ if full_name is not None:
1183
+
1184
+ _query_params.append(('full_name', full_name))
1185
+
1186
+ if email is not None:
1187
+
1188
+ _query_params.append(('email', email))
1189
+
1190
+ if is_superuser is not None:
1191
+
1192
+ _query_params.append(('is_superuser', is_superuser))
1193
+
1194
+ if is_staff is not None:
1195
+
1196
+ _query_params.append(('is_staff', is_staff))
1197
+
1198
+ if is_active is not None:
1199
+
1200
+ _query_params.append(('is_active', is_active))
1201
+
1202
+ if is_confirmed is not None:
1203
+
1204
+ _query_params.append(('is_confirmed', is_confirmed))
1205
+
1206
+ # process the header parameters
1207
+ # process the form parameters
1208
+ # process the body parameter
1209
+
1210
+
1211
+ # set the HTTP header `Accept`
1212
+ _header_params['Accept'] = self.api_client.select_header_accept(
1213
+ [
1214
+ 'application/json'
1215
+ ]
1216
+ )
553
1217
 
554
- form_params = []
555
- local_var_files = {}
556
1218
 
557
- body_params = None
558
- # HTTP header `Accept`
559
- header_params['Accept'] = self.api_client.select_header_accept(
560
- ['application/json']) # noqa: E501
1219
+ # authentication setting
1220
+ _auth_settings: List[str] = [
1221
+ 'user'
1222
+ ]
561
1223
 
562
- # Authentication setting
563
- auth_settings = ['user'] # noqa: E501
1224
+ return self.api_client.param_serialize(
1225
+ method='GET',
1226
+ resource_path='/users',
1227
+ path_params=_path_params,
1228
+ query_params=_query_params,
1229
+ header_params=_header_params,
1230
+ body=_body_params,
1231
+ post_params=_form_params,
1232
+ files=_files,
1233
+ auth_settings=_auth_settings,
1234
+ collection_formats=_collection_formats,
1235
+ _host=_host,
1236
+ _request_auth=_request_auth
1237
+ )
564
1238
 
565
- response_types_map = {
566
- 200: "list[User]",
567
- }
568
1239
 
569
- return self.api_client.call_api(
570
- '/users', 'GET',
571
- path_params,
572
- query_params,
573
- header_params,
574
- body=body_params,
575
- post_params=form_params,
576
- files=local_var_files,
577
- response_types_map=response_types_map,
578
- auth_settings=auth_settings,
579
- async_req=local_var_params.get('async_req'),
580
- _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
581
- _preload_content=local_var_params.get('_preload_content', True),
582
- _request_timeout=local_var_params.get('_request_timeout'),
583
- collection_formats=collection_formats,
584
- _request_auth=local_var_params.get('_request_auth'))