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,1295 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Quantum Inspire 2
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.1.0
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+ import warnings
15
+ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
+ from typing import Any, Dict, List, Optional, Tuple, Union
17
+ from typing_extensions import Annotated
18
+
19
+ from pydantic import Field, StrictBool, StrictInt, StrictStr
20
+ from typing import Optional
21
+ from typing_extensions import Annotated
22
+ from compute_api_client.models.page_permission import PagePermission
23
+ from compute_api_client.models.page_permission_group import PagePermissionGroup
24
+ from compute_api_client.models.permission import Permission
25
+ from compute_api_client.models.permission_group import PermissionGroup
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 PermissionsApi:
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 read_permission_group_permission_groups_id_get(
47
+ self,
48
+ id: StrictInt,
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
+ ) -> PermissionGroup:
62
+ """Retrieve permission groups
63
+
64
+ Get permission group by ID.
65
+
66
+ :param id: (required)
67
+ :type id: int
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._read_permission_group_permission_groups_id_get_serialize(
91
+ id=id,
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
+ '200': "PermissionGroup",
100
+ '404': "HTTPNotFoundError",
101
+ '422': "HTTPValidationError",
102
+ }
103
+ response_data = await self.api_client.call_api(
104
+ *_param,
105
+ _request_timeout=_request_timeout
106
+ )
107
+ await response_data.read()
108
+ return self.api_client.response_deserialize(
109
+ response_data=response_data,
110
+ response_types_map=_response_types_map,
111
+ ).data
112
+
113
+
114
+ @validate_call
115
+ async def read_permission_group_permission_groups_id_get_with_http_info(
116
+ self,
117
+ id: StrictInt,
118
+ _request_timeout: Union[
119
+ None,
120
+ Annotated[StrictFloat, Field(gt=0)],
121
+ Tuple[
122
+ Annotated[StrictFloat, Field(gt=0)],
123
+ Annotated[StrictFloat, Field(gt=0)]
124
+ ]
125
+ ] = None,
126
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
127
+ _content_type: Optional[StrictStr] = None,
128
+ _headers: Optional[Dict[StrictStr, Any]] = None,
129
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
130
+ ) -> ApiResponse[PermissionGroup]:
131
+ """Retrieve permission groups
132
+
133
+ Get permission group by ID.
134
+
135
+ :param id: (required)
136
+ :type id: int
137
+ :param _request_timeout: timeout setting for this request. If one
138
+ number provided, it will be total request
139
+ timeout. It can also be a pair (tuple) of
140
+ (connection, read) timeouts.
141
+ :type _request_timeout: int, tuple(int, int), optional
142
+ :param _request_auth: set to override the auth_settings for an a single
143
+ request; this effectively ignores the
144
+ authentication in the spec for a single request.
145
+ :type _request_auth: dict, optional
146
+ :param _content_type: force content-type for the request.
147
+ :type _content_type: str, Optional
148
+ :param _headers: set to override the headers for a single
149
+ request; this effectively ignores the headers
150
+ in the spec for a single request.
151
+ :type _headers: dict, optional
152
+ :param _host_index: set to override the host_index for a single
153
+ request; this effectively ignores the host_index
154
+ in the spec for a single request.
155
+ :type _host_index: int, optional
156
+ :return: Returns the result object.
157
+ """ # noqa: E501
158
+
159
+ _param = self._read_permission_group_permission_groups_id_get_serialize(
160
+ id=id,
161
+ _request_auth=_request_auth,
162
+ _content_type=_content_type,
163
+ _headers=_headers,
164
+ _host_index=_host_index
165
+ )
166
+
167
+ _response_types_map: Dict[str, Optional[str]] = {
168
+ '200': "PermissionGroup",
169
+ '404': "HTTPNotFoundError",
170
+ '422': "HTTPValidationError",
171
+ }
172
+ response_data = await self.api_client.call_api(
173
+ *_param,
174
+ _request_timeout=_request_timeout
175
+ )
176
+ await response_data.read()
177
+ return self.api_client.response_deserialize(
178
+ response_data=response_data,
179
+ response_types_map=_response_types_map,
180
+ )
181
+
182
+
183
+ @validate_call
184
+ async def read_permission_group_permission_groups_id_get_without_preload_content(
185
+ self,
186
+ id: StrictInt,
187
+ _request_timeout: Union[
188
+ None,
189
+ Annotated[StrictFloat, Field(gt=0)],
190
+ Tuple[
191
+ Annotated[StrictFloat, Field(gt=0)],
192
+ Annotated[StrictFloat, Field(gt=0)]
193
+ ]
194
+ ] = None,
195
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
196
+ _content_type: Optional[StrictStr] = None,
197
+ _headers: Optional[Dict[StrictStr, Any]] = None,
198
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
199
+ ) -> RESTResponseType:
200
+ """Retrieve permission groups
201
+
202
+ Get permission group by ID.
203
+
204
+ :param id: (required)
205
+ :type id: int
206
+ :param _request_timeout: timeout setting for this request. If one
207
+ number provided, it will be total request
208
+ timeout. It can also be a pair (tuple) of
209
+ (connection, read) timeouts.
210
+ :type _request_timeout: int, tuple(int, int), optional
211
+ :param _request_auth: set to override the auth_settings for an a single
212
+ request; this effectively ignores the
213
+ authentication in the spec for a single request.
214
+ :type _request_auth: dict, optional
215
+ :param _content_type: force content-type for the request.
216
+ :type _content_type: str, Optional
217
+ :param _headers: set to override the headers for a single
218
+ request; this effectively ignores the headers
219
+ in the spec for a single request.
220
+ :type _headers: dict, optional
221
+ :param _host_index: set to override the host_index for a single
222
+ request; this effectively ignores the host_index
223
+ in the spec for a single request.
224
+ :type _host_index: int, optional
225
+ :return: Returns the result object.
226
+ """ # noqa: E501
227
+
228
+ _param = self._read_permission_group_permission_groups_id_get_serialize(
229
+ id=id,
230
+ _request_auth=_request_auth,
231
+ _content_type=_content_type,
232
+ _headers=_headers,
233
+ _host_index=_host_index
234
+ )
235
+
236
+ _response_types_map: Dict[str, Optional[str]] = {
237
+ '200': "PermissionGroup",
238
+ '404': "HTTPNotFoundError",
239
+ '422': "HTTPValidationError",
240
+ }
241
+ response_data = await self.api_client.call_api(
242
+ *_param,
243
+ _request_timeout=_request_timeout
244
+ )
245
+ return response_data.response
246
+
247
+
248
+ def _read_permission_group_permission_groups_id_get_serialize(
249
+ self,
250
+ id,
251
+ _request_auth,
252
+ _content_type,
253
+ _headers,
254
+ _host_index,
255
+ ) -> RequestSerialized:
256
+
257
+ _host = None
258
+
259
+ _collection_formats: Dict[str, str] = {
260
+ }
261
+
262
+ _path_params: Dict[str, str] = {}
263
+ _query_params: List[Tuple[str, str]] = []
264
+ _header_params: Dict[str, Optional[str]] = _headers or {}
265
+ _form_params: List[Tuple[str, str]] = []
266
+ _files: Dict[
267
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
268
+ ] = {}
269
+ _body_params: Optional[bytes] = None
270
+
271
+ # process the path parameters
272
+ if id is not None:
273
+ _path_params['id'] = id
274
+ # process the query parameters
275
+ # process the header parameters
276
+ # process the form parameters
277
+ # process the body parameter
278
+
279
+
280
+ # set the HTTP header `Accept`
281
+ if 'Accept' not in _header_params:
282
+ _header_params['Accept'] = self.api_client.select_header_accept(
283
+ [
284
+ 'application/json'
285
+ ]
286
+ )
287
+
288
+
289
+ # authentication setting
290
+ _auth_settings: List[str] = [
291
+ 'user_bearer'
292
+ ]
293
+
294
+ return self.api_client.param_serialize(
295
+ method='GET',
296
+ resource_path='/permission_groups/{id}',
297
+ path_params=_path_params,
298
+ query_params=_query_params,
299
+ header_params=_header_params,
300
+ body=_body_params,
301
+ post_params=_form_params,
302
+ files=_files,
303
+ auth_settings=_auth_settings,
304
+ collection_formats=_collection_formats,
305
+ _host=_host,
306
+ _request_auth=_request_auth
307
+ )
308
+
309
+
310
+
311
+
312
+ @validate_call
313
+ async def read_permission_groups_permission_groups_get(
314
+ self,
315
+ id: Optional[StrictInt] = None,
316
+ name: Optional[StrictStr] = None,
317
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
318
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
319
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
320
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
321
+ _request_timeout: Union[
322
+ None,
323
+ Annotated[StrictFloat, Field(gt=0)],
324
+ Tuple[
325
+ Annotated[StrictFloat, Field(gt=0)],
326
+ Annotated[StrictFloat, Field(gt=0)]
327
+ ]
328
+ ] = None,
329
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
330
+ _content_type: Optional[StrictStr] = None,
331
+ _headers: Optional[Dict[StrictStr, Any]] = None,
332
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
333
+ ) -> PagePermissionGroup:
334
+ """List permission groups
335
+
336
+ Read permissions groups.
337
+
338
+ :param id:
339
+ :type id: int
340
+ :param name:
341
+ :type name: str
342
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
343
+ :type sort_by: str
344
+ :param latest: If True gets the most recently created object.
345
+ :type latest: bool
346
+ :param page: Page number
347
+ :type page: int
348
+ :param size: Page size
349
+ :type size: int
350
+ :param _request_timeout: timeout setting for this request. If one
351
+ number provided, it will be total request
352
+ timeout. It can also be a pair (tuple) of
353
+ (connection, read) timeouts.
354
+ :type _request_timeout: int, tuple(int, int), optional
355
+ :param _request_auth: set to override the auth_settings for an a single
356
+ request; this effectively ignores the
357
+ authentication in the spec for a single request.
358
+ :type _request_auth: dict, optional
359
+ :param _content_type: force content-type for the request.
360
+ :type _content_type: str, Optional
361
+ :param _headers: set to override the headers for a single
362
+ request; this effectively ignores the headers
363
+ in the spec for a single request.
364
+ :type _headers: dict, optional
365
+ :param _host_index: set to override the host_index for a single
366
+ request; this effectively ignores the host_index
367
+ in the spec for a single request.
368
+ :type _host_index: int, optional
369
+ :return: Returns the result object.
370
+ """ # noqa: E501
371
+
372
+ _param = self._read_permission_groups_permission_groups_get_serialize(
373
+ id=id,
374
+ name=name,
375
+ sort_by=sort_by,
376
+ latest=latest,
377
+ page=page,
378
+ size=size,
379
+ _request_auth=_request_auth,
380
+ _content_type=_content_type,
381
+ _headers=_headers,
382
+ _host_index=_host_index
383
+ )
384
+
385
+ _response_types_map: Dict[str, Optional[str]] = {
386
+ '200': "PagePermissionGroup",
387
+ '422': "HTTPValidationError",
388
+ }
389
+ response_data = await self.api_client.call_api(
390
+ *_param,
391
+ _request_timeout=_request_timeout
392
+ )
393
+ await response_data.read()
394
+ return self.api_client.response_deserialize(
395
+ response_data=response_data,
396
+ response_types_map=_response_types_map,
397
+ ).data
398
+
399
+
400
+ @validate_call
401
+ async def read_permission_groups_permission_groups_get_with_http_info(
402
+ self,
403
+ id: Optional[StrictInt] = None,
404
+ name: Optional[StrictStr] = None,
405
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
406
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
407
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
408
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
409
+ _request_timeout: Union[
410
+ None,
411
+ Annotated[StrictFloat, Field(gt=0)],
412
+ Tuple[
413
+ Annotated[StrictFloat, Field(gt=0)],
414
+ Annotated[StrictFloat, Field(gt=0)]
415
+ ]
416
+ ] = None,
417
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
418
+ _content_type: Optional[StrictStr] = None,
419
+ _headers: Optional[Dict[StrictStr, Any]] = None,
420
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
421
+ ) -> ApiResponse[PagePermissionGroup]:
422
+ """List permission groups
423
+
424
+ Read permissions groups.
425
+
426
+ :param id:
427
+ :type id: int
428
+ :param name:
429
+ :type name: str
430
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
431
+ :type sort_by: str
432
+ :param latest: If True gets the most recently created object.
433
+ :type latest: bool
434
+ :param page: Page number
435
+ :type page: int
436
+ :param size: Page size
437
+ :type size: int
438
+ :param _request_timeout: timeout setting for this request. If one
439
+ number provided, it will be total request
440
+ timeout. It can also be a pair (tuple) of
441
+ (connection, read) timeouts.
442
+ :type _request_timeout: int, tuple(int, int), optional
443
+ :param _request_auth: set to override the auth_settings for an a single
444
+ request; this effectively ignores the
445
+ authentication in the spec for a single request.
446
+ :type _request_auth: dict, optional
447
+ :param _content_type: force content-type for the request.
448
+ :type _content_type: str, Optional
449
+ :param _headers: set to override the headers for a single
450
+ request; this effectively ignores the headers
451
+ in the spec for a single request.
452
+ :type _headers: dict, optional
453
+ :param _host_index: set to override the host_index for a single
454
+ request; this effectively ignores the host_index
455
+ in the spec for a single request.
456
+ :type _host_index: int, optional
457
+ :return: Returns the result object.
458
+ """ # noqa: E501
459
+
460
+ _param = self._read_permission_groups_permission_groups_get_serialize(
461
+ id=id,
462
+ name=name,
463
+ sort_by=sort_by,
464
+ latest=latest,
465
+ page=page,
466
+ size=size,
467
+ _request_auth=_request_auth,
468
+ _content_type=_content_type,
469
+ _headers=_headers,
470
+ _host_index=_host_index
471
+ )
472
+
473
+ _response_types_map: Dict[str, Optional[str]] = {
474
+ '200': "PagePermissionGroup",
475
+ '422': "HTTPValidationError",
476
+ }
477
+ response_data = await self.api_client.call_api(
478
+ *_param,
479
+ _request_timeout=_request_timeout
480
+ )
481
+ await response_data.read()
482
+ return self.api_client.response_deserialize(
483
+ response_data=response_data,
484
+ response_types_map=_response_types_map,
485
+ )
486
+
487
+
488
+ @validate_call
489
+ async def read_permission_groups_permission_groups_get_without_preload_content(
490
+ self,
491
+ id: Optional[StrictInt] = None,
492
+ name: Optional[StrictStr] = None,
493
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
494
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
495
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
496
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
497
+ _request_timeout: Union[
498
+ None,
499
+ Annotated[StrictFloat, Field(gt=0)],
500
+ Tuple[
501
+ Annotated[StrictFloat, Field(gt=0)],
502
+ Annotated[StrictFloat, Field(gt=0)]
503
+ ]
504
+ ] = None,
505
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
506
+ _content_type: Optional[StrictStr] = None,
507
+ _headers: Optional[Dict[StrictStr, Any]] = None,
508
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
509
+ ) -> RESTResponseType:
510
+ """List permission groups
511
+
512
+ Read permissions groups.
513
+
514
+ :param id:
515
+ :type id: int
516
+ :param name:
517
+ :type name: str
518
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
519
+ :type sort_by: str
520
+ :param latest: If True gets the most recently created object.
521
+ :type latest: bool
522
+ :param page: Page number
523
+ :type page: int
524
+ :param size: Page size
525
+ :type size: int
526
+ :param _request_timeout: timeout setting for this request. If one
527
+ number provided, it will be total request
528
+ timeout. It can also be a pair (tuple) of
529
+ (connection, read) timeouts.
530
+ :type _request_timeout: int, tuple(int, int), optional
531
+ :param _request_auth: set to override the auth_settings for an a single
532
+ request; this effectively ignores the
533
+ authentication in the spec for a single request.
534
+ :type _request_auth: dict, optional
535
+ :param _content_type: force content-type for the request.
536
+ :type _content_type: str, Optional
537
+ :param _headers: set to override the headers for a single
538
+ request; this effectively ignores the headers
539
+ in the spec for a single request.
540
+ :type _headers: dict, optional
541
+ :param _host_index: set to override the host_index for a single
542
+ request; this effectively ignores the host_index
543
+ in the spec for a single request.
544
+ :type _host_index: int, optional
545
+ :return: Returns the result object.
546
+ """ # noqa: E501
547
+
548
+ _param = self._read_permission_groups_permission_groups_get_serialize(
549
+ id=id,
550
+ name=name,
551
+ sort_by=sort_by,
552
+ latest=latest,
553
+ page=page,
554
+ size=size,
555
+ _request_auth=_request_auth,
556
+ _content_type=_content_type,
557
+ _headers=_headers,
558
+ _host_index=_host_index
559
+ )
560
+
561
+ _response_types_map: Dict[str, Optional[str]] = {
562
+ '200': "PagePermissionGroup",
563
+ '422': "HTTPValidationError",
564
+ }
565
+ response_data = await self.api_client.call_api(
566
+ *_param,
567
+ _request_timeout=_request_timeout
568
+ )
569
+ return response_data.response
570
+
571
+
572
+ def _read_permission_groups_permission_groups_get_serialize(
573
+ self,
574
+ id,
575
+ name,
576
+ sort_by,
577
+ latest,
578
+ page,
579
+ size,
580
+ _request_auth,
581
+ _content_type,
582
+ _headers,
583
+ _host_index,
584
+ ) -> RequestSerialized:
585
+
586
+ _host = None
587
+
588
+ _collection_formats: Dict[str, str] = {
589
+ }
590
+
591
+ _path_params: Dict[str, str] = {}
592
+ _query_params: List[Tuple[str, str]] = []
593
+ _header_params: Dict[str, Optional[str]] = _headers or {}
594
+ _form_params: List[Tuple[str, str]] = []
595
+ _files: Dict[
596
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
597
+ ] = {}
598
+ _body_params: Optional[bytes] = None
599
+
600
+ # process the path parameters
601
+ # process the query parameters
602
+ if id is not None:
603
+
604
+ _query_params.append(('id', id))
605
+
606
+ if name is not None:
607
+
608
+ _query_params.append(('name', name))
609
+
610
+ if sort_by is not None:
611
+
612
+ _query_params.append(('sort_by', sort_by))
613
+
614
+ if latest is not None:
615
+
616
+ _query_params.append(('latest', latest))
617
+
618
+ if page is not None:
619
+
620
+ _query_params.append(('page', page))
621
+
622
+ if size is not None:
623
+
624
+ _query_params.append(('size', size))
625
+
626
+ # process the header parameters
627
+ # process the form parameters
628
+ # process the body parameter
629
+
630
+
631
+ # set the HTTP header `Accept`
632
+ if 'Accept' not in _header_params:
633
+ _header_params['Accept'] = self.api_client.select_header_accept(
634
+ [
635
+ 'application/json'
636
+ ]
637
+ )
638
+
639
+
640
+ # authentication setting
641
+ _auth_settings: List[str] = [
642
+ 'user_bearer'
643
+ ]
644
+
645
+ return self.api_client.param_serialize(
646
+ method='GET',
647
+ resource_path='/permission_groups/',
648
+ path_params=_path_params,
649
+ query_params=_query_params,
650
+ header_params=_header_params,
651
+ body=_body_params,
652
+ post_params=_form_params,
653
+ files=_files,
654
+ auth_settings=_auth_settings,
655
+ collection_formats=_collection_formats,
656
+ _host=_host,
657
+ _request_auth=_request_auth
658
+ )
659
+
660
+
661
+
662
+
663
+ @validate_call
664
+ async def read_permission_permissions_id_get(
665
+ self,
666
+ id: StrictInt,
667
+ _request_timeout: Union[
668
+ None,
669
+ Annotated[StrictFloat, Field(gt=0)],
670
+ Tuple[
671
+ Annotated[StrictFloat, Field(gt=0)],
672
+ Annotated[StrictFloat, Field(gt=0)]
673
+ ]
674
+ ] = None,
675
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
676
+ _content_type: Optional[StrictStr] = None,
677
+ _headers: Optional[Dict[StrictStr, Any]] = None,
678
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
679
+ ) -> Permission:
680
+ """Retrieve permissions
681
+
682
+ Get permission by ID.
683
+
684
+ :param id: (required)
685
+ :type id: int
686
+ :param _request_timeout: timeout setting for this request. If one
687
+ number provided, it will be total request
688
+ timeout. It can also be a pair (tuple) of
689
+ (connection, read) timeouts.
690
+ :type _request_timeout: int, tuple(int, int), optional
691
+ :param _request_auth: set to override the auth_settings for an a single
692
+ request; this effectively ignores the
693
+ authentication in the spec for a single request.
694
+ :type _request_auth: dict, optional
695
+ :param _content_type: force content-type for the request.
696
+ :type _content_type: str, Optional
697
+ :param _headers: set to override the headers for a single
698
+ request; this effectively ignores the headers
699
+ in the spec for a single request.
700
+ :type _headers: dict, optional
701
+ :param _host_index: set to override the host_index for a single
702
+ request; this effectively ignores the host_index
703
+ in the spec for a single request.
704
+ :type _host_index: int, optional
705
+ :return: Returns the result object.
706
+ """ # noqa: E501
707
+
708
+ _param = self._read_permission_permissions_id_get_serialize(
709
+ id=id,
710
+ _request_auth=_request_auth,
711
+ _content_type=_content_type,
712
+ _headers=_headers,
713
+ _host_index=_host_index
714
+ )
715
+
716
+ _response_types_map: Dict[str, Optional[str]] = {
717
+ '200': "Permission",
718
+ '404': "HTTPNotFoundError",
719
+ '422': "HTTPValidationError",
720
+ }
721
+ response_data = await self.api_client.call_api(
722
+ *_param,
723
+ _request_timeout=_request_timeout
724
+ )
725
+ await response_data.read()
726
+ return self.api_client.response_deserialize(
727
+ response_data=response_data,
728
+ response_types_map=_response_types_map,
729
+ ).data
730
+
731
+
732
+ @validate_call
733
+ async def read_permission_permissions_id_get_with_http_info(
734
+ self,
735
+ id: StrictInt,
736
+ _request_timeout: Union[
737
+ None,
738
+ Annotated[StrictFloat, Field(gt=0)],
739
+ Tuple[
740
+ Annotated[StrictFloat, Field(gt=0)],
741
+ Annotated[StrictFloat, Field(gt=0)]
742
+ ]
743
+ ] = None,
744
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
745
+ _content_type: Optional[StrictStr] = None,
746
+ _headers: Optional[Dict[StrictStr, Any]] = None,
747
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
748
+ ) -> ApiResponse[Permission]:
749
+ """Retrieve permissions
750
+
751
+ Get permission by ID.
752
+
753
+ :param id: (required)
754
+ :type id: int
755
+ :param _request_timeout: timeout setting for this request. If one
756
+ number provided, it will be total request
757
+ timeout. It can also be a pair (tuple) of
758
+ (connection, read) timeouts.
759
+ :type _request_timeout: int, tuple(int, int), optional
760
+ :param _request_auth: set to override the auth_settings for an a single
761
+ request; this effectively ignores the
762
+ authentication in the spec for a single request.
763
+ :type _request_auth: dict, optional
764
+ :param _content_type: force content-type for the request.
765
+ :type _content_type: str, Optional
766
+ :param _headers: set to override the headers for a single
767
+ request; this effectively ignores the headers
768
+ in the spec for a single request.
769
+ :type _headers: dict, optional
770
+ :param _host_index: set to override the host_index for a single
771
+ request; this effectively ignores the host_index
772
+ in the spec for a single request.
773
+ :type _host_index: int, optional
774
+ :return: Returns the result object.
775
+ """ # noqa: E501
776
+
777
+ _param = self._read_permission_permissions_id_get_serialize(
778
+ id=id,
779
+ _request_auth=_request_auth,
780
+ _content_type=_content_type,
781
+ _headers=_headers,
782
+ _host_index=_host_index
783
+ )
784
+
785
+ _response_types_map: Dict[str, Optional[str]] = {
786
+ '200': "Permission",
787
+ '404': "HTTPNotFoundError",
788
+ '422': "HTTPValidationError",
789
+ }
790
+ response_data = await self.api_client.call_api(
791
+ *_param,
792
+ _request_timeout=_request_timeout
793
+ )
794
+ await response_data.read()
795
+ return self.api_client.response_deserialize(
796
+ response_data=response_data,
797
+ response_types_map=_response_types_map,
798
+ )
799
+
800
+
801
+ @validate_call
802
+ async def read_permission_permissions_id_get_without_preload_content(
803
+ self,
804
+ id: StrictInt,
805
+ _request_timeout: Union[
806
+ None,
807
+ Annotated[StrictFloat, Field(gt=0)],
808
+ Tuple[
809
+ Annotated[StrictFloat, Field(gt=0)],
810
+ Annotated[StrictFloat, Field(gt=0)]
811
+ ]
812
+ ] = None,
813
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
814
+ _content_type: Optional[StrictStr] = None,
815
+ _headers: Optional[Dict[StrictStr, Any]] = None,
816
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
817
+ ) -> RESTResponseType:
818
+ """Retrieve permissions
819
+
820
+ Get permission by ID.
821
+
822
+ :param id: (required)
823
+ :type id: int
824
+ :param _request_timeout: timeout setting for this request. If one
825
+ number provided, it will be total request
826
+ timeout. It can also be a pair (tuple) of
827
+ (connection, read) timeouts.
828
+ :type _request_timeout: int, tuple(int, int), optional
829
+ :param _request_auth: set to override the auth_settings for an a single
830
+ request; this effectively ignores the
831
+ authentication in the spec for a single request.
832
+ :type _request_auth: dict, optional
833
+ :param _content_type: force content-type for the request.
834
+ :type _content_type: str, Optional
835
+ :param _headers: set to override the headers for a single
836
+ request; this effectively ignores the headers
837
+ in the spec for a single request.
838
+ :type _headers: dict, optional
839
+ :param _host_index: set to override the host_index for a single
840
+ request; this effectively ignores the host_index
841
+ in the spec for a single request.
842
+ :type _host_index: int, optional
843
+ :return: Returns the result object.
844
+ """ # noqa: E501
845
+
846
+ _param = self._read_permission_permissions_id_get_serialize(
847
+ id=id,
848
+ _request_auth=_request_auth,
849
+ _content_type=_content_type,
850
+ _headers=_headers,
851
+ _host_index=_host_index
852
+ )
853
+
854
+ _response_types_map: Dict[str, Optional[str]] = {
855
+ '200': "Permission",
856
+ '404': "HTTPNotFoundError",
857
+ '422': "HTTPValidationError",
858
+ }
859
+ response_data = await self.api_client.call_api(
860
+ *_param,
861
+ _request_timeout=_request_timeout
862
+ )
863
+ return response_data.response
864
+
865
+
866
+ def _read_permission_permissions_id_get_serialize(
867
+ self,
868
+ id,
869
+ _request_auth,
870
+ _content_type,
871
+ _headers,
872
+ _host_index,
873
+ ) -> RequestSerialized:
874
+
875
+ _host = None
876
+
877
+ _collection_formats: Dict[str, str] = {
878
+ }
879
+
880
+ _path_params: Dict[str, str] = {}
881
+ _query_params: List[Tuple[str, str]] = []
882
+ _header_params: Dict[str, Optional[str]] = _headers or {}
883
+ _form_params: List[Tuple[str, str]] = []
884
+ _files: Dict[
885
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
886
+ ] = {}
887
+ _body_params: Optional[bytes] = None
888
+
889
+ # process the path parameters
890
+ if id is not None:
891
+ _path_params['id'] = id
892
+ # process the query parameters
893
+ # process the header parameters
894
+ # process the form parameters
895
+ # process the body parameter
896
+
897
+
898
+ # set the HTTP header `Accept`
899
+ if 'Accept' not in _header_params:
900
+ _header_params['Accept'] = self.api_client.select_header_accept(
901
+ [
902
+ 'application/json'
903
+ ]
904
+ )
905
+
906
+
907
+ # authentication setting
908
+ _auth_settings: List[str] = [
909
+ 'user_bearer'
910
+ ]
911
+
912
+ return self.api_client.param_serialize(
913
+ method='GET',
914
+ resource_path='/permissions/{id}',
915
+ path_params=_path_params,
916
+ query_params=_query_params,
917
+ header_params=_header_params,
918
+ body=_body_params,
919
+ post_params=_form_params,
920
+ files=_files,
921
+ auth_settings=_auth_settings,
922
+ collection_formats=_collection_formats,
923
+ _host=_host,
924
+ _request_auth=_request_auth
925
+ )
926
+
927
+
928
+
929
+
930
+ @validate_call
931
+ async def read_permissions_permissions_get(
932
+ self,
933
+ id: Optional[StrictInt] = None,
934
+ permission: Optional[StrictStr] = None,
935
+ name: Optional[StrictStr] = None,
936
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
937
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
938
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
939
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
940
+ _request_timeout: Union[
941
+ None,
942
+ Annotated[StrictFloat, Field(gt=0)],
943
+ Tuple[
944
+ Annotated[StrictFloat, Field(gt=0)],
945
+ Annotated[StrictFloat, Field(gt=0)]
946
+ ]
947
+ ] = None,
948
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
949
+ _content_type: Optional[StrictStr] = None,
950
+ _headers: Optional[Dict[StrictStr, Any]] = None,
951
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
952
+ ) -> PagePermission:
953
+ """List permissions
954
+
955
+ Read permissions.
956
+
957
+ :param id:
958
+ :type id: int
959
+ :param permission:
960
+ :type permission: str
961
+ :param name:
962
+ :type name: str
963
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
964
+ :type sort_by: str
965
+ :param latest: If True gets the most recently created object.
966
+ :type latest: bool
967
+ :param page: Page number
968
+ :type page: int
969
+ :param size: Page size
970
+ :type size: int
971
+ :param _request_timeout: timeout setting for this request. If one
972
+ number provided, it will be total request
973
+ timeout. It can also be a pair (tuple) of
974
+ (connection, read) timeouts.
975
+ :type _request_timeout: int, tuple(int, int), optional
976
+ :param _request_auth: set to override the auth_settings for an a single
977
+ request; this effectively ignores the
978
+ authentication in the spec for a single request.
979
+ :type _request_auth: dict, optional
980
+ :param _content_type: force content-type for the request.
981
+ :type _content_type: str, Optional
982
+ :param _headers: set to override the headers for a single
983
+ request; this effectively ignores the headers
984
+ in the spec for a single request.
985
+ :type _headers: dict, optional
986
+ :param _host_index: set to override the host_index for a single
987
+ request; this effectively ignores the host_index
988
+ in the spec for a single request.
989
+ :type _host_index: int, optional
990
+ :return: Returns the result object.
991
+ """ # noqa: E501
992
+
993
+ _param = self._read_permissions_permissions_get_serialize(
994
+ id=id,
995
+ permission=permission,
996
+ name=name,
997
+ sort_by=sort_by,
998
+ latest=latest,
999
+ page=page,
1000
+ size=size,
1001
+ _request_auth=_request_auth,
1002
+ _content_type=_content_type,
1003
+ _headers=_headers,
1004
+ _host_index=_host_index
1005
+ )
1006
+
1007
+ _response_types_map: Dict[str, Optional[str]] = {
1008
+ '200': "PagePermission",
1009
+ '422': "HTTPValidationError",
1010
+ }
1011
+ response_data = await self.api_client.call_api(
1012
+ *_param,
1013
+ _request_timeout=_request_timeout
1014
+ )
1015
+ await response_data.read()
1016
+ return self.api_client.response_deserialize(
1017
+ response_data=response_data,
1018
+ response_types_map=_response_types_map,
1019
+ ).data
1020
+
1021
+
1022
+ @validate_call
1023
+ async def read_permissions_permissions_get_with_http_info(
1024
+ self,
1025
+ id: Optional[StrictInt] = None,
1026
+ permission: Optional[StrictStr] = None,
1027
+ name: Optional[StrictStr] = None,
1028
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
1029
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
1030
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
1031
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
1032
+ _request_timeout: Union[
1033
+ None,
1034
+ Annotated[StrictFloat, Field(gt=0)],
1035
+ Tuple[
1036
+ Annotated[StrictFloat, Field(gt=0)],
1037
+ Annotated[StrictFloat, Field(gt=0)]
1038
+ ]
1039
+ ] = None,
1040
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1041
+ _content_type: Optional[StrictStr] = None,
1042
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1043
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1044
+ ) -> ApiResponse[PagePermission]:
1045
+ """List permissions
1046
+
1047
+ Read permissions.
1048
+
1049
+ :param id:
1050
+ :type id: int
1051
+ :param permission:
1052
+ :type permission: str
1053
+ :param name:
1054
+ :type name: str
1055
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
1056
+ :type sort_by: str
1057
+ :param latest: If True gets the most recently created object.
1058
+ :type latest: bool
1059
+ :param page: Page number
1060
+ :type page: int
1061
+ :param size: Page size
1062
+ :type size: int
1063
+ :param _request_timeout: timeout setting for this request. If one
1064
+ number provided, it will be total request
1065
+ timeout. It can also be a pair (tuple) of
1066
+ (connection, read) timeouts.
1067
+ :type _request_timeout: int, tuple(int, int), optional
1068
+ :param _request_auth: set to override the auth_settings for an a single
1069
+ request; this effectively ignores the
1070
+ authentication in the spec for a single request.
1071
+ :type _request_auth: dict, optional
1072
+ :param _content_type: force content-type for the request.
1073
+ :type _content_type: str, Optional
1074
+ :param _headers: set to override the headers for a single
1075
+ request; this effectively ignores the headers
1076
+ in the spec for a single request.
1077
+ :type _headers: dict, optional
1078
+ :param _host_index: set to override the host_index for a single
1079
+ request; this effectively ignores the host_index
1080
+ in the spec for a single request.
1081
+ :type _host_index: int, optional
1082
+ :return: Returns the result object.
1083
+ """ # noqa: E501
1084
+
1085
+ _param = self._read_permissions_permissions_get_serialize(
1086
+ id=id,
1087
+ permission=permission,
1088
+ name=name,
1089
+ sort_by=sort_by,
1090
+ latest=latest,
1091
+ page=page,
1092
+ size=size,
1093
+ _request_auth=_request_auth,
1094
+ _content_type=_content_type,
1095
+ _headers=_headers,
1096
+ _host_index=_host_index
1097
+ )
1098
+
1099
+ _response_types_map: Dict[str, Optional[str]] = {
1100
+ '200': "PagePermission",
1101
+ '422': "HTTPValidationError",
1102
+ }
1103
+ response_data = await self.api_client.call_api(
1104
+ *_param,
1105
+ _request_timeout=_request_timeout
1106
+ )
1107
+ await response_data.read()
1108
+ return self.api_client.response_deserialize(
1109
+ response_data=response_data,
1110
+ response_types_map=_response_types_map,
1111
+ )
1112
+
1113
+
1114
+ @validate_call
1115
+ async def read_permissions_permissions_get_without_preload_content(
1116
+ self,
1117
+ id: Optional[StrictInt] = None,
1118
+ permission: Optional[StrictStr] = None,
1119
+ name: Optional[StrictStr] = None,
1120
+ sort_by: Annotated[Optional[StrictStr], Field(description="The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.")] = None,
1121
+ latest: Annotated[Optional[StrictBool], Field(description="If True gets the most recently created object.")] = None,
1122
+ page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number")] = None,
1123
+ size: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size")] = None,
1124
+ _request_timeout: Union[
1125
+ None,
1126
+ Annotated[StrictFloat, Field(gt=0)],
1127
+ Tuple[
1128
+ Annotated[StrictFloat, Field(gt=0)],
1129
+ Annotated[StrictFloat, Field(gt=0)]
1130
+ ]
1131
+ ] = None,
1132
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1133
+ _content_type: Optional[StrictStr] = None,
1134
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1135
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1136
+ ) -> RESTResponseType:
1137
+ """List permissions
1138
+
1139
+ Read permissions.
1140
+
1141
+ :param id:
1142
+ :type id: int
1143
+ :param permission:
1144
+ :type permission: str
1145
+ :param name:
1146
+ :type name: str
1147
+ :param sort_by: The field name to sort on. Prefix with '-' for descending order. E.g., '-created_on'.
1148
+ :type sort_by: str
1149
+ :param latest: If True gets the most recently created object.
1150
+ :type latest: bool
1151
+ :param page: Page number
1152
+ :type page: int
1153
+ :param size: Page size
1154
+ :type size: int
1155
+ :param _request_timeout: timeout setting for this request. If one
1156
+ number provided, it will be total request
1157
+ timeout. It can also be a pair (tuple) of
1158
+ (connection, read) timeouts.
1159
+ :type _request_timeout: int, tuple(int, int), optional
1160
+ :param _request_auth: set to override the auth_settings for an a single
1161
+ request; this effectively ignores the
1162
+ authentication in the spec for a single request.
1163
+ :type _request_auth: dict, optional
1164
+ :param _content_type: force content-type for the request.
1165
+ :type _content_type: str, Optional
1166
+ :param _headers: set to override the headers for a single
1167
+ request; this effectively ignores the headers
1168
+ in the spec for a single request.
1169
+ :type _headers: dict, optional
1170
+ :param _host_index: set to override the host_index for a single
1171
+ request; this effectively ignores the host_index
1172
+ in the spec for a single request.
1173
+ :type _host_index: int, optional
1174
+ :return: Returns the result object.
1175
+ """ # noqa: E501
1176
+
1177
+ _param = self._read_permissions_permissions_get_serialize(
1178
+ id=id,
1179
+ permission=permission,
1180
+ name=name,
1181
+ sort_by=sort_by,
1182
+ latest=latest,
1183
+ page=page,
1184
+ size=size,
1185
+ _request_auth=_request_auth,
1186
+ _content_type=_content_type,
1187
+ _headers=_headers,
1188
+ _host_index=_host_index
1189
+ )
1190
+
1191
+ _response_types_map: Dict[str, Optional[str]] = {
1192
+ '200': "PagePermission",
1193
+ '422': "HTTPValidationError",
1194
+ }
1195
+ response_data = await self.api_client.call_api(
1196
+ *_param,
1197
+ _request_timeout=_request_timeout
1198
+ )
1199
+ return response_data.response
1200
+
1201
+
1202
+ def _read_permissions_permissions_get_serialize(
1203
+ self,
1204
+ id,
1205
+ permission,
1206
+ name,
1207
+ sort_by,
1208
+ latest,
1209
+ page,
1210
+ size,
1211
+ _request_auth,
1212
+ _content_type,
1213
+ _headers,
1214
+ _host_index,
1215
+ ) -> RequestSerialized:
1216
+
1217
+ _host = None
1218
+
1219
+ _collection_formats: Dict[str, str] = {
1220
+ }
1221
+
1222
+ _path_params: Dict[str, str] = {}
1223
+ _query_params: List[Tuple[str, str]] = []
1224
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1225
+ _form_params: List[Tuple[str, str]] = []
1226
+ _files: Dict[
1227
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1228
+ ] = {}
1229
+ _body_params: Optional[bytes] = None
1230
+
1231
+ # process the path parameters
1232
+ # process the query parameters
1233
+ if id is not None:
1234
+
1235
+ _query_params.append(('id', id))
1236
+
1237
+ if permission is not None:
1238
+
1239
+ _query_params.append(('permission', permission))
1240
+
1241
+ if name is not None:
1242
+
1243
+ _query_params.append(('name', name))
1244
+
1245
+ if sort_by is not None:
1246
+
1247
+ _query_params.append(('sort_by', sort_by))
1248
+
1249
+ if latest is not None:
1250
+
1251
+ _query_params.append(('latest', latest))
1252
+
1253
+ if page is not None:
1254
+
1255
+ _query_params.append(('page', page))
1256
+
1257
+ if size is not None:
1258
+
1259
+ _query_params.append(('size', size))
1260
+
1261
+ # process the header parameters
1262
+ # process the form parameters
1263
+ # process the body parameter
1264
+
1265
+
1266
+ # set the HTTP header `Accept`
1267
+ if 'Accept' not in _header_params:
1268
+ _header_params['Accept'] = self.api_client.select_header_accept(
1269
+ [
1270
+ 'application/json'
1271
+ ]
1272
+ )
1273
+
1274
+
1275
+ # authentication setting
1276
+ _auth_settings: List[str] = [
1277
+ 'user_bearer'
1278
+ ]
1279
+
1280
+ return self.api_client.param_serialize(
1281
+ method='GET',
1282
+ resource_path='/permissions/',
1283
+ path_params=_path_params,
1284
+ query_params=_query_params,
1285
+ header_params=_header_params,
1286
+ body=_body_params,
1287
+ post_params=_form_params,
1288
+ files=_files,
1289
+ auth_settings=_auth_settings,
1290
+ collection_formats=_collection_formats,
1291
+ _host=_host,
1292
+ _request_auth=_request_auth
1293
+ )
1294
+
1295
+