crypticorn 2.0.0__py3-none-any.whl → 2.1.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.
@@ -17,12 +17,22 @@ from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
19
  from pydantic import Field, StrictStr
20
- from typing import Optional
20
+ from typing import Any, List, Optional
21
21
  from typing_extensions import Annotated
22
22
  from crypticorn.auth.client.models.authorize_user200_response import (
23
23
  AuthorizeUser200Response,
24
24
  )
25
25
  from crypticorn.auth.client.models.authorize_user_request import AuthorizeUserRequest
26
+ from crypticorn.auth.client.models.create_api_key200_response import (
27
+ CreateApiKey200Response,
28
+ )
29
+ from crypticorn.auth.client.models.create_api_key_request import CreateApiKeyRequest
30
+ from crypticorn.auth.client.models.get_api_keys200_response_inner import (
31
+ GetApiKeys200ResponseInner,
32
+ )
33
+ from crypticorn.auth.client.models.oauth_callback200_response import (
34
+ OauthCallback200Response,
35
+ )
26
36
  from crypticorn.auth.client.models.refresh_token_info200_response import (
27
37
  RefreshTokenInfo200Response,
28
38
  )
@@ -128,13 +138,754 @@ class AuthApi:
128
138
  _content_type: Optional[StrictStr] = None,
129
139
  _headers: Optional[Dict[StrictStr, Any]] = None,
130
140
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
131
- ) -> ApiResponse[AuthorizeUser200Response]:
132
- """Authorize a user
141
+ ) -> ApiResponse[AuthorizeUser200Response]:
142
+ """Authorize a user
143
+
144
+ Authorize a user with email and password from the login page, uses a captcha to prevent bots.
145
+
146
+ :param authorize_user_request: (required)
147
+ :type authorize_user_request: AuthorizeUserRequest
148
+ :param _request_timeout: timeout setting for this request. If one
149
+ number provided, it will be total request
150
+ timeout. It can also be a pair (tuple) of
151
+ (connection, read) timeouts.
152
+ :type _request_timeout: int, tuple(int, int), optional
153
+ :param _request_auth: set to override the auth_settings for an a single
154
+ request; this effectively ignores the
155
+ authentication in the spec for a single request.
156
+ :type _request_auth: dict, optional
157
+ :param _content_type: force content-type for the request.
158
+ :type _content_type: str, Optional
159
+ :param _headers: set to override the headers for a single
160
+ request; this effectively ignores the headers
161
+ in the spec for a single request.
162
+ :type _headers: dict, optional
163
+ :param _host_index: set to override the host_index for a single
164
+ request; this effectively ignores the host_index
165
+ in the spec for a single request.
166
+ :type _host_index: int, optional
167
+ :return: Returns the result object.
168
+ """ # noqa: E501
169
+
170
+ _param = self._authorize_user_serialize(
171
+ authorize_user_request=authorize_user_request,
172
+ _request_auth=_request_auth,
173
+ _content_type=_content_type,
174
+ _headers=_headers,
175
+ _host_index=_host_index,
176
+ )
177
+
178
+ _response_types_map: Dict[str, Optional[str]] = {
179
+ "200": "AuthorizeUser200Response",
180
+ }
181
+ response_data = await self.api_client.call_api(
182
+ *_param, _request_timeout=_request_timeout
183
+ )
184
+ await response_data.read()
185
+ return self.api_client.response_deserialize(
186
+ response_data=response_data,
187
+ response_types_map=_response_types_map,
188
+ )
189
+
190
+ @validate_call
191
+ async def authorize_user_without_preload_content(
192
+ self,
193
+ authorize_user_request: AuthorizeUserRequest,
194
+ _request_timeout: Union[
195
+ None,
196
+ Annotated[StrictFloat, Field(gt=0)],
197
+ Tuple[
198
+ Annotated[StrictFloat, Field(gt=0)], 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
+ """Authorize a user
207
+
208
+ Authorize a user with email and password from the login page, uses a captcha to prevent bots.
209
+
210
+ :param authorize_user_request: (required)
211
+ :type authorize_user_request: AuthorizeUserRequest
212
+ :param _request_timeout: timeout setting for this request. If one
213
+ number provided, it will be total request
214
+ timeout. It can also be a pair (tuple) of
215
+ (connection, read) timeouts.
216
+ :type _request_timeout: int, tuple(int, int), optional
217
+ :param _request_auth: set to override the auth_settings for an a single
218
+ request; this effectively ignores the
219
+ authentication in the spec for a single request.
220
+ :type _request_auth: dict, optional
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
231
+ :return: Returns the result object.
232
+ """ # noqa: E501
233
+
234
+ _param = self._authorize_user_serialize(
235
+ authorize_user_request=authorize_user_request,
236
+ _request_auth=_request_auth,
237
+ _content_type=_content_type,
238
+ _headers=_headers,
239
+ _host_index=_host_index,
240
+ )
241
+
242
+ _response_types_map: Dict[str, Optional[str]] = {
243
+ "200": "AuthorizeUser200Response",
244
+ }
245
+ response_data = await self.api_client.call_api(
246
+ *_param, _request_timeout=_request_timeout
247
+ )
248
+ return response_data.response
249
+
250
+ def _authorize_user_serialize(
251
+ self,
252
+ authorize_user_request,
253
+ _request_auth,
254
+ _content_type,
255
+ _headers,
256
+ _host_index,
257
+ ) -> RequestSerialized:
258
+
259
+ _host = None
260
+
261
+ _collection_formats: Dict[str, str] = {}
262
+
263
+ _path_params: Dict[str, str] = {}
264
+ _query_params: List[Tuple[str, str]] = []
265
+ _header_params: Dict[str, Optional[str]] = _headers or {}
266
+ _form_params: List[Tuple[str, str]] = []
267
+ _files: Dict[
268
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
269
+ ] = {}
270
+ _body_params: Optional[bytes] = None
271
+
272
+ # process the path parameters
273
+ # process the query parameters
274
+ # process the header parameters
275
+ # process the form parameters
276
+ # process the body parameter
277
+ if authorize_user_request is not None:
278
+ _body_params = authorize_user_request
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
+ ["application/json"]
284
+ )
285
+
286
+ # set the HTTP header `Content-Type`
287
+ if _content_type:
288
+ _header_params["Content-Type"] = _content_type
289
+ else:
290
+ _default_content_type = self.api_client.select_header_content_type(
291
+ ["application/json"]
292
+ )
293
+ if _default_content_type is not None:
294
+ _header_params["Content-Type"] = _default_content_type
295
+
296
+ # authentication setting
297
+ _auth_settings: List[str] = []
298
+
299
+ return self.api_client.param_serialize(
300
+ method="POST",
301
+ resource_path="/authorize",
302
+ path_params=_path_params,
303
+ query_params=_query_params,
304
+ header_params=_header_params,
305
+ body=_body_params,
306
+ post_params=_form_params,
307
+ files=_files,
308
+ auth_settings=_auth_settings,
309
+ collection_formats=_collection_formats,
310
+ _host=_host,
311
+ _request_auth=_request_auth,
312
+ )
313
+
314
+ @validate_call
315
+ async def create_api_key(
316
+ self,
317
+ create_api_key_request: CreateApiKeyRequest,
318
+ _request_timeout: Union[
319
+ None,
320
+ Annotated[StrictFloat, Field(gt=0)],
321
+ Tuple[
322
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
323
+ ],
324
+ ] = None,
325
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
326
+ _content_type: Optional[StrictStr] = None,
327
+ _headers: Optional[Dict[StrictStr, Any]] = None,
328
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
329
+ ) -> CreateApiKey200Response:
330
+ """Create API Key
331
+
332
+ Creates a new API key for the user.
333
+
334
+ :param create_api_key_request: (required)
335
+ :type create_api_key_request: CreateApiKeyRequest
336
+ :param _request_timeout: timeout setting for this request. If one
337
+ number provided, it will be total request
338
+ timeout. It can also be a pair (tuple) of
339
+ (connection, read) timeouts.
340
+ :type _request_timeout: int, tuple(int, int), optional
341
+ :param _request_auth: set to override the auth_settings for an a single
342
+ request; this effectively ignores the
343
+ authentication in the spec for a single request.
344
+ :type _request_auth: dict, optional
345
+ :param _content_type: force content-type for the request.
346
+ :type _content_type: str, Optional
347
+ :param _headers: set to override the headers for a single
348
+ request; this effectively ignores the headers
349
+ in the spec for a single request.
350
+ :type _headers: dict, optional
351
+ :param _host_index: set to override the host_index for a single
352
+ request; this effectively ignores the host_index
353
+ in the spec for a single request.
354
+ :type _host_index: int, optional
355
+ :return: Returns the result object.
356
+ """ # noqa: E501
357
+
358
+ _param = self._create_api_key_serialize(
359
+ create_api_key_request=create_api_key_request,
360
+ _request_auth=_request_auth,
361
+ _content_type=_content_type,
362
+ _headers=_headers,
363
+ _host_index=_host_index,
364
+ )
365
+
366
+ _response_types_map: Dict[str, Optional[str]] = {
367
+ "200": "CreateApiKey200Response",
368
+ }
369
+ response_data = await self.api_client.call_api(
370
+ *_param, _request_timeout=_request_timeout
371
+ )
372
+ await response_data.read()
373
+ return self.api_client.response_deserialize(
374
+ response_data=response_data,
375
+ response_types_map=_response_types_map,
376
+ ).data
377
+
378
+ @validate_call
379
+ async def create_api_key_with_http_info(
380
+ self,
381
+ create_api_key_request: CreateApiKeyRequest,
382
+ _request_timeout: Union[
383
+ None,
384
+ Annotated[StrictFloat, Field(gt=0)],
385
+ Tuple[
386
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
387
+ ],
388
+ ] = None,
389
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
390
+ _content_type: Optional[StrictStr] = None,
391
+ _headers: Optional[Dict[StrictStr, Any]] = None,
392
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
393
+ ) -> ApiResponse[CreateApiKey200Response]:
394
+ """Create API Key
395
+
396
+ Creates a new API key for the user.
397
+
398
+ :param create_api_key_request: (required)
399
+ :type create_api_key_request: CreateApiKeyRequest
400
+ :param _request_timeout: timeout setting for this request. If one
401
+ number provided, it will be total request
402
+ timeout. It can also be a pair (tuple) of
403
+ (connection, read) timeouts.
404
+ :type _request_timeout: int, tuple(int, int), optional
405
+ :param _request_auth: set to override the auth_settings for an a single
406
+ request; this effectively ignores the
407
+ authentication in the spec for a single request.
408
+ :type _request_auth: dict, optional
409
+ :param _content_type: force content-type for the request.
410
+ :type _content_type: str, Optional
411
+ :param _headers: set to override the headers for a single
412
+ request; this effectively ignores the headers
413
+ in the spec for a single request.
414
+ :type _headers: dict, optional
415
+ :param _host_index: set to override the host_index for a single
416
+ request; this effectively ignores the host_index
417
+ in the spec for a single request.
418
+ :type _host_index: int, optional
419
+ :return: Returns the result object.
420
+ """ # noqa: E501
421
+
422
+ _param = self._create_api_key_serialize(
423
+ create_api_key_request=create_api_key_request,
424
+ _request_auth=_request_auth,
425
+ _content_type=_content_type,
426
+ _headers=_headers,
427
+ _host_index=_host_index,
428
+ )
429
+
430
+ _response_types_map: Dict[str, Optional[str]] = {
431
+ "200": "CreateApiKey200Response",
432
+ }
433
+ response_data = await self.api_client.call_api(
434
+ *_param, _request_timeout=_request_timeout
435
+ )
436
+ await response_data.read()
437
+ return self.api_client.response_deserialize(
438
+ response_data=response_data,
439
+ response_types_map=_response_types_map,
440
+ )
441
+
442
+ @validate_call
443
+ async def create_api_key_without_preload_content(
444
+ self,
445
+ create_api_key_request: CreateApiKeyRequest,
446
+ _request_timeout: Union[
447
+ None,
448
+ Annotated[StrictFloat, Field(gt=0)],
449
+ Tuple[
450
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
451
+ ],
452
+ ] = None,
453
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
454
+ _content_type: Optional[StrictStr] = None,
455
+ _headers: Optional[Dict[StrictStr, Any]] = None,
456
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
457
+ ) -> RESTResponseType:
458
+ """Create API Key
459
+
460
+ Creates a new API key for the user.
461
+
462
+ :param create_api_key_request: (required)
463
+ :type create_api_key_request: CreateApiKeyRequest
464
+ :param _request_timeout: timeout setting for this request. If one
465
+ number provided, it will be total request
466
+ timeout. It can also be a pair (tuple) of
467
+ (connection, read) timeouts.
468
+ :type _request_timeout: int, tuple(int, int), optional
469
+ :param _request_auth: set to override the auth_settings for an a single
470
+ request; this effectively ignores the
471
+ authentication in the spec for a single request.
472
+ :type _request_auth: dict, optional
473
+ :param _content_type: force content-type for the request.
474
+ :type _content_type: str, Optional
475
+ :param _headers: set to override the headers for a single
476
+ request; this effectively ignores the headers
477
+ in the spec for a single request.
478
+ :type _headers: dict, optional
479
+ :param _host_index: set to override the host_index for a single
480
+ request; this effectively ignores the host_index
481
+ in the spec for a single request.
482
+ :type _host_index: int, optional
483
+ :return: Returns the result object.
484
+ """ # noqa: E501
485
+
486
+ _param = self._create_api_key_serialize(
487
+ create_api_key_request=create_api_key_request,
488
+ _request_auth=_request_auth,
489
+ _content_type=_content_type,
490
+ _headers=_headers,
491
+ _host_index=_host_index,
492
+ )
493
+
494
+ _response_types_map: Dict[str, Optional[str]] = {
495
+ "200": "CreateApiKey200Response",
496
+ }
497
+ response_data = await self.api_client.call_api(
498
+ *_param, _request_timeout=_request_timeout
499
+ )
500
+ return response_data.response
501
+
502
+ def _create_api_key_serialize(
503
+ self,
504
+ create_api_key_request,
505
+ _request_auth,
506
+ _content_type,
507
+ _headers,
508
+ _host_index,
509
+ ) -> RequestSerialized:
510
+
511
+ _host = None
512
+
513
+ _collection_formats: Dict[str, str] = {}
514
+
515
+ _path_params: Dict[str, str] = {}
516
+ _query_params: List[Tuple[str, str]] = []
517
+ _header_params: Dict[str, Optional[str]] = _headers or {}
518
+ _form_params: List[Tuple[str, str]] = []
519
+ _files: Dict[
520
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
521
+ ] = {}
522
+ _body_params: Optional[bytes] = None
523
+
524
+ # process the path parameters
525
+ # process the query parameters
526
+ # process the header parameters
527
+ # process the form parameters
528
+ # process the body parameter
529
+ if create_api_key_request is not None:
530
+ _body_params = create_api_key_request
531
+
532
+ # set the HTTP header `Accept`
533
+ if "Accept" not in _header_params:
534
+ _header_params["Accept"] = self.api_client.select_header_accept(
535
+ ["application/json"]
536
+ )
537
+
538
+ # set the HTTP header `Content-Type`
539
+ if _content_type:
540
+ _header_params["Content-Type"] = _content_type
541
+ else:
542
+ _default_content_type = self.api_client.select_header_content_type(
543
+ ["application/json"]
544
+ )
545
+ if _default_content_type is not None:
546
+ _header_params["Content-Type"] = _default_content_type
547
+
548
+ # authentication setting
549
+ _auth_settings: List[str] = ["HTTPBearer"]
550
+
551
+ return self.api_client.param_serialize(
552
+ method="POST",
553
+ resource_path="/create-api-key",
554
+ path_params=_path_params,
555
+ query_params=_query_params,
556
+ header_params=_header_params,
557
+ body=_body_params,
558
+ post_params=_form_params,
559
+ files=_files,
560
+ auth_settings=_auth_settings,
561
+ collection_formats=_collection_formats,
562
+ _host=_host,
563
+ _request_auth=_request_auth,
564
+ )
565
+
566
+ @validate_call
567
+ async def delete_api_key(
568
+ self,
569
+ id: StrictStr,
570
+ _request_timeout: Union[
571
+ None,
572
+ Annotated[StrictFloat, Field(gt=0)],
573
+ Tuple[
574
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
575
+ ],
576
+ ] = None,
577
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
578
+ _content_type: Optional[StrictStr] = None,
579
+ _headers: Optional[Dict[StrictStr, Any]] = None,
580
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
581
+ ) -> object:
582
+ """Delete API Key
583
+
584
+ Deletes an API key for the user.
585
+
586
+ :param id: (required)
587
+ :type id: str
588
+ :param _request_timeout: timeout setting for this request. If one
589
+ number provided, it will be total request
590
+ timeout. It can also be a pair (tuple) of
591
+ (connection, read) timeouts.
592
+ :type _request_timeout: int, tuple(int, int), optional
593
+ :param _request_auth: set to override the auth_settings for an a single
594
+ request; this effectively ignores the
595
+ authentication in the spec for a single request.
596
+ :type _request_auth: dict, optional
597
+ :param _content_type: force content-type for the request.
598
+ :type _content_type: str, Optional
599
+ :param _headers: set to override the headers for a single
600
+ request; this effectively ignores the headers
601
+ in the spec for a single request.
602
+ :type _headers: dict, optional
603
+ :param _host_index: set to override the host_index for a single
604
+ request; this effectively ignores the host_index
605
+ in the spec for a single request.
606
+ :type _host_index: int, optional
607
+ :return: Returns the result object.
608
+ """ # noqa: E501
609
+
610
+ _param = self._delete_api_key_serialize(
611
+ id=id,
612
+ _request_auth=_request_auth,
613
+ _content_type=_content_type,
614
+ _headers=_headers,
615
+ _host_index=_host_index,
616
+ )
617
+
618
+ _response_types_map: Dict[str, Optional[str]] = {
619
+ "200": "object",
620
+ }
621
+ response_data = await self.api_client.call_api(
622
+ *_param, _request_timeout=_request_timeout
623
+ )
624
+ await response_data.read()
625
+ return self.api_client.response_deserialize(
626
+ response_data=response_data,
627
+ response_types_map=_response_types_map,
628
+ ).data
629
+
630
+ @validate_call
631
+ async def delete_api_key_with_http_info(
632
+ self,
633
+ id: StrictStr,
634
+ _request_timeout: Union[
635
+ None,
636
+ Annotated[StrictFloat, Field(gt=0)],
637
+ Tuple[
638
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
639
+ ],
640
+ ] = None,
641
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
642
+ _content_type: Optional[StrictStr] = None,
643
+ _headers: Optional[Dict[StrictStr, Any]] = None,
644
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
645
+ ) -> ApiResponse[object]:
646
+ """Delete API Key
647
+
648
+ Deletes an API key for the user.
649
+
650
+ :param id: (required)
651
+ :type id: str
652
+ :param _request_timeout: timeout setting for this request. If one
653
+ number provided, it will be total request
654
+ timeout. It can also be a pair (tuple) of
655
+ (connection, read) timeouts.
656
+ :type _request_timeout: int, tuple(int, int), optional
657
+ :param _request_auth: set to override the auth_settings for an a single
658
+ request; this effectively ignores the
659
+ authentication in the spec for a single request.
660
+ :type _request_auth: dict, optional
661
+ :param _content_type: force content-type for the request.
662
+ :type _content_type: str, Optional
663
+ :param _headers: set to override the headers for a single
664
+ request; this effectively ignores the headers
665
+ in the spec for a single request.
666
+ :type _headers: dict, optional
667
+ :param _host_index: set to override the host_index for a single
668
+ request; this effectively ignores the host_index
669
+ in the spec for a single request.
670
+ :type _host_index: int, optional
671
+ :return: Returns the result object.
672
+ """ # noqa: E501
673
+
674
+ _param = self._delete_api_key_serialize(
675
+ id=id,
676
+ _request_auth=_request_auth,
677
+ _content_type=_content_type,
678
+ _headers=_headers,
679
+ _host_index=_host_index,
680
+ )
681
+
682
+ _response_types_map: Dict[str, Optional[str]] = {
683
+ "200": "object",
684
+ }
685
+ response_data = await self.api_client.call_api(
686
+ *_param, _request_timeout=_request_timeout
687
+ )
688
+ await response_data.read()
689
+ return self.api_client.response_deserialize(
690
+ response_data=response_data,
691
+ response_types_map=_response_types_map,
692
+ )
693
+
694
+ @validate_call
695
+ async def delete_api_key_without_preload_content(
696
+ self,
697
+ id: StrictStr,
698
+ _request_timeout: Union[
699
+ None,
700
+ Annotated[StrictFloat, Field(gt=0)],
701
+ Tuple[
702
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
703
+ ],
704
+ ] = None,
705
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
706
+ _content_type: Optional[StrictStr] = None,
707
+ _headers: Optional[Dict[StrictStr, Any]] = None,
708
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
709
+ ) -> RESTResponseType:
710
+ """Delete API Key
711
+
712
+ Deletes an API key for the user.
713
+
714
+ :param id: (required)
715
+ :type id: str
716
+ :param _request_timeout: timeout setting for this request. If one
717
+ number provided, it will be total request
718
+ timeout. It can also be a pair (tuple) of
719
+ (connection, read) timeouts.
720
+ :type _request_timeout: int, tuple(int, int), optional
721
+ :param _request_auth: set to override the auth_settings for an a single
722
+ request; this effectively ignores the
723
+ authentication in the spec for a single request.
724
+ :type _request_auth: dict, optional
725
+ :param _content_type: force content-type for the request.
726
+ :type _content_type: str, Optional
727
+ :param _headers: set to override the headers for a single
728
+ request; this effectively ignores the headers
729
+ in the spec for a single request.
730
+ :type _headers: dict, optional
731
+ :param _host_index: set to override the host_index for a single
732
+ request; this effectively ignores the host_index
733
+ in the spec for a single request.
734
+ :type _host_index: int, optional
735
+ :return: Returns the result object.
736
+ """ # noqa: E501
737
+
738
+ _param = self._delete_api_key_serialize(
739
+ id=id,
740
+ _request_auth=_request_auth,
741
+ _content_type=_content_type,
742
+ _headers=_headers,
743
+ _host_index=_host_index,
744
+ )
745
+
746
+ _response_types_map: Dict[str, Optional[str]] = {
747
+ "200": "object",
748
+ }
749
+ response_data = await self.api_client.call_api(
750
+ *_param, _request_timeout=_request_timeout
751
+ )
752
+ return response_data.response
753
+
754
+ def _delete_api_key_serialize(
755
+ self,
756
+ id,
757
+ _request_auth,
758
+ _content_type,
759
+ _headers,
760
+ _host_index,
761
+ ) -> RequestSerialized:
762
+
763
+ _host = None
764
+
765
+ _collection_formats: Dict[str, str] = {}
766
+
767
+ _path_params: Dict[str, str] = {}
768
+ _query_params: List[Tuple[str, str]] = []
769
+ _header_params: Dict[str, Optional[str]] = _headers or {}
770
+ _form_params: List[Tuple[str, str]] = []
771
+ _files: Dict[
772
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
773
+ ] = {}
774
+ _body_params: Optional[bytes] = None
775
+
776
+ # process the path parameters
777
+ # process the query parameters
778
+ if id is not None:
779
+
780
+ _query_params.append(("id", id))
781
+
782
+ # process the header parameters
783
+ # process the form parameters
784
+ # process the body parameter
785
+
786
+ # set the HTTP header `Accept`
787
+ if "Accept" not in _header_params:
788
+ _header_params["Accept"] = self.api_client.select_header_accept(
789
+ ["application/json"]
790
+ )
791
+
792
+ # authentication setting
793
+ _auth_settings: List[str] = ["HTTPBearer"]
794
+
795
+ return self.api_client.param_serialize(
796
+ method="DELETE",
797
+ resource_path="/delete-api-key",
798
+ path_params=_path_params,
799
+ query_params=_query_params,
800
+ header_params=_header_params,
801
+ body=_body_params,
802
+ post_params=_form_params,
803
+ files=_files,
804
+ auth_settings=_auth_settings,
805
+ collection_formats=_collection_formats,
806
+ _host=_host,
807
+ _request_auth=_request_auth,
808
+ )
809
+
810
+ @validate_call
811
+ async def get_api_keys(
812
+ self,
813
+ _request_timeout: Union[
814
+ None,
815
+ Annotated[StrictFloat, Field(gt=0)],
816
+ Tuple[
817
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
818
+ ],
819
+ ] = None,
820
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
821
+ _content_type: Optional[StrictStr] = None,
822
+ _headers: Optional[Dict[StrictStr, Any]] = None,
823
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
824
+ ) -> List[GetApiKeys200ResponseInner]:
825
+ """Get API Keys
826
+
827
+ Gets all API keys for the user.
828
+
829
+ :param _request_timeout: timeout setting for this request. If one
830
+ number provided, it will be total request
831
+ timeout. It can also be a pair (tuple) of
832
+ (connection, read) timeouts.
833
+ :type _request_timeout: int, tuple(int, int), optional
834
+ :param _request_auth: set to override the auth_settings for an a single
835
+ request; this effectively ignores the
836
+ authentication in the spec for a single request.
837
+ :type _request_auth: dict, optional
838
+ :param _content_type: force content-type for the request.
839
+ :type _content_type: str, Optional
840
+ :param _headers: set to override the headers for a single
841
+ request; this effectively ignores the headers
842
+ in the spec for a single request.
843
+ :type _headers: dict, optional
844
+ :param _host_index: set to override the host_index for a single
845
+ request; this effectively ignores the host_index
846
+ in the spec for a single request.
847
+ :type _host_index: int, optional
848
+ :return: Returns the result object.
849
+ """ # noqa: E501
850
+
851
+ _param = self._get_api_keys_serialize(
852
+ _request_auth=_request_auth,
853
+ _content_type=_content_type,
854
+ _headers=_headers,
855
+ _host_index=_host_index,
856
+ )
857
+
858
+ _response_types_map: Dict[str, Optional[str]] = {
859
+ "200": "List[GetApiKeys200ResponseInner]",
860
+ }
861
+ response_data = await self.api_client.call_api(
862
+ *_param, _request_timeout=_request_timeout
863
+ )
864
+ await response_data.read()
865
+ return self.api_client.response_deserialize(
866
+ response_data=response_data,
867
+ response_types_map=_response_types_map,
868
+ ).data
869
+
870
+ @validate_call
871
+ async def get_api_keys_with_http_info(
872
+ self,
873
+ _request_timeout: Union[
874
+ None,
875
+ Annotated[StrictFloat, Field(gt=0)],
876
+ Tuple[
877
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
878
+ ],
879
+ ] = None,
880
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
881
+ _content_type: Optional[StrictStr] = None,
882
+ _headers: Optional[Dict[StrictStr, Any]] = None,
883
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
884
+ ) -> ApiResponse[List[GetApiKeys200ResponseInner]]:
885
+ """Get API Keys
133
886
 
134
- Authorize a user with email and password from the login page, uses a captcha to prevent bots.
887
+ Gets all API keys for the user.
135
888
 
136
- :param authorize_user_request: (required)
137
- :type authorize_user_request: AuthorizeUserRequest
138
889
  :param _request_timeout: timeout setting for this request. If one
139
890
  number provided, it will be total request
140
891
  timeout. It can also be a pair (tuple) of
@@ -157,8 +908,7 @@ class AuthApi:
157
908
  :return: Returns the result object.
158
909
  """ # noqa: E501
159
910
 
160
- _param = self._authorize_user_serialize(
161
- authorize_user_request=authorize_user_request,
911
+ _param = self._get_api_keys_serialize(
162
912
  _request_auth=_request_auth,
163
913
  _content_type=_content_type,
164
914
  _headers=_headers,
@@ -166,7 +916,7 @@ class AuthApi:
166
916
  )
167
917
 
168
918
  _response_types_map: Dict[str, Optional[str]] = {
169
- "200": "AuthorizeUser200Response",
919
+ "200": "List[GetApiKeys200ResponseInner]",
170
920
  }
171
921
  response_data = await self.api_client.call_api(
172
922
  *_param, _request_timeout=_request_timeout
@@ -178,9 +928,8 @@ class AuthApi:
178
928
  )
179
929
 
180
930
  @validate_call
181
- async def authorize_user_without_preload_content(
931
+ async def get_api_keys_without_preload_content(
182
932
  self,
183
- authorize_user_request: AuthorizeUserRequest,
184
933
  _request_timeout: Union[
185
934
  None,
186
935
  Annotated[StrictFloat, Field(gt=0)],
@@ -193,12 +942,10 @@ class AuthApi:
193
942
  _headers: Optional[Dict[StrictStr, Any]] = None,
194
943
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
195
944
  ) -> RESTResponseType:
196
- """Authorize a user
945
+ """Get API Keys
197
946
 
198
- Authorize a user with email and password from the login page, uses a captcha to prevent bots.
947
+ Gets all API keys for the user.
199
948
 
200
- :param authorize_user_request: (required)
201
- :type authorize_user_request: AuthorizeUserRequest
202
949
  :param _request_timeout: timeout setting for this request. If one
203
950
  number provided, it will be total request
204
951
  timeout. It can also be a pair (tuple) of
@@ -221,8 +968,7 @@ class AuthApi:
221
968
  :return: Returns the result object.
222
969
  """ # noqa: E501
223
970
 
224
- _param = self._authorize_user_serialize(
225
- authorize_user_request=authorize_user_request,
971
+ _param = self._get_api_keys_serialize(
226
972
  _request_auth=_request_auth,
227
973
  _content_type=_content_type,
228
974
  _headers=_headers,
@@ -230,16 +976,15 @@ class AuthApi:
230
976
  )
231
977
 
232
978
  _response_types_map: Dict[str, Optional[str]] = {
233
- "200": "AuthorizeUser200Response",
979
+ "200": "List[GetApiKeys200ResponseInner]",
234
980
  }
235
981
  response_data = await self.api_client.call_api(
236
982
  *_param, _request_timeout=_request_timeout
237
983
  )
238
984
  return response_data.response
239
985
 
240
- def _authorize_user_serialize(
986
+ def _get_api_keys_serialize(
241
987
  self,
242
- authorize_user_request,
243
988
  _request_auth,
244
989
  _content_type,
245
990
  _headers,
@@ -264,8 +1009,6 @@ class AuthApi:
264
1009
  # process the header parameters
265
1010
  # process the form parameters
266
1011
  # process the body parameter
267
- if authorize_user_request is not None:
268
- _body_params = authorize_user_request
269
1012
 
270
1013
  # set the HTTP header `Accept`
271
1014
  if "Accept" not in _header_params:
@@ -273,22 +1016,12 @@ class AuthApi:
273
1016
  ["application/json"]
274
1017
  )
275
1018
 
276
- # set the HTTP header `Content-Type`
277
- if _content_type:
278
- _header_params["Content-Type"] = _content_type
279
- else:
280
- _default_content_type = self.api_client.select_header_content_type(
281
- ["application/json"]
282
- )
283
- if _default_content_type is not None:
284
- _header_params["Content-Type"] = _default_content_type
285
-
286
1019
  # authentication setting
287
- _auth_settings: List[str] = []
1020
+ _auth_settings: List[str] = ["HTTPBearer"]
288
1021
 
289
1022
  return self.api_client.param_serialize(
290
- method="POST",
291
- resource_path="/authorize",
1023
+ method="GET",
1024
+ resource_path="/get-api-keys",
292
1025
  path_params=_path_params,
293
1026
  query_params=_query_params,
294
1027
  header_params=_header_params,
@@ -564,7 +1297,7 @@ class AuthApi:
564
1297
  _content_type: Optional[StrictStr] = None,
565
1298
  _headers: Optional[Dict[StrictStr, Any]] = None,
566
1299
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
567
- ) -> AuthorizeUser200Response:
1300
+ ) -> OauthCallback200Response:
568
1301
  """OAuth Callback
569
1302
 
570
1303
  Handles the OAuth callback from Google.
@@ -614,7 +1347,7 @@ class AuthApi:
614
1347
  )
615
1348
 
616
1349
  _response_types_map: Dict[str, Optional[str]] = {
617
- "200": "AuthorizeUser200Response",
1350
+ "200": "OauthCallback200Response",
618
1351
  }
619
1352
  response_data = await self.api_client.call_api(
620
1353
  *_param, _request_timeout=_request_timeout
@@ -644,7 +1377,7 @@ class AuthApi:
644
1377
  _content_type: Optional[StrictStr] = None,
645
1378
  _headers: Optional[Dict[StrictStr, Any]] = None,
646
1379
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
647
- ) -> ApiResponse[AuthorizeUser200Response]:
1380
+ ) -> ApiResponse[OauthCallback200Response]:
648
1381
  """OAuth Callback
649
1382
 
650
1383
  Handles the OAuth callback from Google.
@@ -694,7 +1427,7 @@ class AuthApi:
694
1427
  )
695
1428
 
696
1429
  _response_types_map: Dict[str, Optional[str]] = {
697
- "200": "AuthorizeUser200Response",
1430
+ "200": "OauthCallback200Response",
698
1431
  }
699
1432
  response_data = await self.api_client.call_api(
700
1433
  *_param, _request_timeout=_request_timeout
@@ -774,7 +1507,7 @@ class AuthApi:
774
1507
  )
775
1508
 
776
1509
  _response_types_map: Dict[str, Optional[str]] = {
777
- "200": "AuthorizeUser200Response",
1510
+ "200": "OauthCallback200Response",
778
1511
  }
779
1512
  response_data = await self.api_client.call_api(
780
1513
  *_param, _request_timeout=_request_timeout
@@ -1876,9 +2609,9 @@ class AuthApi:
1876
2609
  _headers: Optional[Dict[StrictStr, Any]] = None,
1877
2610
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1878
2611
  ) -> Verify200Response:
1879
- """Verify
2612
+ """Verify Bearer Token
1880
2613
 
1881
- Verifies the user is authenticated.
2614
+ Verifies the bearer token is valid.
1882
2615
 
1883
2616
  :param _request_timeout: timeout setting for this request. If one
1884
2617
  number provided, it will be total request
@@ -1936,9 +2669,9 @@ class AuthApi:
1936
2669
  _headers: Optional[Dict[StrictStr, Any]] = None,
1937
2670
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1938
2671
  ) -> ApiResponse[Verify200Response]:
1939
- """Verify
2672
+ """Verify Bearer Token
1940
2673
 
1941
- Verifies the user is authenticated.
2674
+ Verifies the bearer token is valid.
1942
2675
 
1943
2676
  :param _request_timeout: timeout setting for this request. If one
1944
2677
  number provided, it will be total request
@@ -1996,9 +2729,9 @@ class AuthApi:
1996
2729
  _headers: Optional[Dict[StrictStr, Any]] = None,
1997
2730
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1998
2731
  ) -> RESTResponseType:
1999
- """Verify
2732
+ """Verify Bearer Token
2000
2733
 
2001
- Verifies the user is authenticated.
2734
+ Verifies the bearer token is valid.
2002
2735
 
2003
2736
  :param _request_timeout: timeout setting for this request. If one
2004
2737
  number provided, it will be total request
@@ -2087,3 +2820,247 @@ class AuthApi:
2087
2820
  _host=_host,
2088
2821
  _request_auth=_request_auth,
2089
2822
  )
2823
+
2824
+ @validate_call
2825
+ async def verify_api_key(
2826
+ self,
2827
+ api_key: StrictStr,
2828
+ _request_timeout: Union[
2829
+ None,
2830
+ Annotated[StrictFloat, Field(gt=0)],
2831
+ Tuple[
2832
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2833
+ ],
2834
+ ] = None,
2835
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2836
+ _content_type: Optional[StrictStr] = None,
2837
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2838
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2839
+ ) -> Verify200Response:
2840
+ """Verify API Key
2841
+
2842
+ Verifies the API key is valid.
2843
+
2844
+ :param api_key: (required)
2845
+ :type api_key: str
2846
+ :param _request_timeout: timeout setting for this request. If one
2847
+ number provided, it will be total request
2848
+ timeout. It can also be a pair (tuple) of
2849
+ (connection, read) timeouts.
2850
+ :type _request_timeout: int, tuple(int, int), optional
2851
+ :param _request_auth: set to override the auth_settings for an a single
2852
+ request; this effectively ignores the
2853
+ authentication in the spec for a single request.
2854
+ :type _request_auth: dict, optional
2855
+ :param _content_type: force content-type for the request.
2856
+ :type _content_type: str, Optional
2857
+ :param _headers: set to override the headers for a single
2858
+ request; this effectively ignores the headers
2859
+ in the spec for a single request.
2860
+ :type _headers: dict, optional
2861
+ :param _host_index: set to override the host_index for a single
2862
+ request; this effectively ignores the host_index
2863
+ in the spec for a single request.
2864
+ :type _host_index: int, optional
2865
+ :return: Returns the result object.
2866
+ """ # noqa: E501
2867
+
2868
+ _param = self._verify_api_key_serialize(
2869
+ api_key=api_key,
2870
+ _request_auth=_request_auth,
2871
+ _content_type=_content_type,
2872
+ _headers=_headers,
2873
+ _host_index=_host_index,
2874
+ )
2875
+
2876
+ _response_types_map: Dict[str, Optional[str]] = {
2877
+ "200": "Verify200Response",
2878
+ }
2879
+ response_data = await self.api_client.call_api(
2880
+ *_param, _request_timeout=_request_timeout
2881
+ )
2882
+ await response_data.read()
2883
+ return self.api_client.response_deserialize(
2884
+ response_data=response_data,
2885
+ response_types_map=_response_types_map,
2886
+ ).data
2887
+
2888
+ @validate_call
2889
+ async def verify_api_key_with_http_info(
2890
+ self,
2891
+ api_key: StrictStr,
2892
+ _request_timeout: Union[
2893
+ None,
2894
+ Annotated[StrictFloat, Field(gt=0)],
2895
+ Tuple[
2896
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2897
+ ],
2898
+ ] = None,
2899
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2900
+ _content_type: Optional[StrictStr] = None,
2901
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2902
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2903
+ ) -> ApiResponse[Verify200Response]:
2904
+ """Verify API Key
2905
+
2906
+ Verifies the API key is valid.
2907
+
2908
+ :param api_key: (required)
2909
+ :type api_key: str
2910
+ :param _request_timeout: timeout setting for this request. If one
2911
+ number provided, it will be total request
2912
+ timeout. It can also be a pair (tuple) of
2913
+ (connection, read) timeouts.
2914
+ :type _request_timeout: int, tuple(int, int), optional
2915
+ :param _request_auth: set to override the auth_settings for an a single
2916
+ request; this effectively ignores the
2917
+ authentication in the spec for a single request.
2918
+ :type _request_auth: dict, optional
2919
+ :param _content_type: force content-type for the request.
2920
+ :type _content_type: str, Optional
2921
+ :param _headers: set to override the headers for a single
2922
+ request; this effectively ignores the headers
2923
+ in the spec for a single request.
2924
+ :type _headers: dict, optional
2925
+ :param _host_index: set to override the host_index for a single
2926
+ request; this effectively ignores the host_index
2927
+ in the spec for a single request.
2928
+ :type _host_index: int, optional
2929
+ :return: Returns the result object.
2930
+ """ # noqa: E501
2931
+
2932
+ _param = self._verify_api_key_serialize(
2933
+ api_key=api_key,
2934
+ _request_auth=_request_auth,
2935
+ _content_type=_content_type,
2936
+ _headers=_headers,
2937
+ _host_index=_host_index,
2938
+ )
2939
+
2940
+ _response_types_map: Dict[str, Optional[str]] = {
2941
+ "200": "Verify200Response",
2942
+ }
2943
+ response_data = await self.api_client.call_api(
2944
+ *_param, _request_timeout=_request_timeout
2945
+ )
2946
+ await response_data.read()
2947
+ return self.api_client.response_deserialize(
2948
+ response_data=response_data,
2949
+ response_types_map=_response_types_map,
2950
+ )
2951
+
2952
+ @validate_call
2953
+ async def verify_api_key_without_preload_content(
2954
+ self,
2955
+ api_key: StrictStr,
2956
+ _request_timeout: Union[
2957
+ None,
2958
+ Annotated[StrictFloat, Field(gt=0)],
2959
+ Tuple[
2960
+ Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]
2961
+ ],
2962
+ ] = None,
2963
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2964
+ _content_type: Optional[StrictStr] = None,
2965
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2966
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2967
+ ) -> RESTResponseType:
2968
+ """Verify API Key
2969
+
2970
+ Verifies the API key is valid.
2971
+
2972
+ :param api_key: (required)
2973
+ :type api_key: str
2974
+ :param _request_timeout: timeout setting for this request. If one
2975
+ number provided, it will be total request
2976
+ timeout. It can also be a pair (tuple) of
2977
+ (connection, read) timeouts.
2978
+ :type _request_timeout: int, tuple(int, int), optional
2979
+ :param _request_auth: set to override the auth_settings for an a single
2980
+ request; this effectively ignores the
2981
+ authentication in the spec for a single request.
2982
+ :type _request_auth: dict, optional
2983
+ :param _content_type: force content-type for the request.
2984
+ :type _content_type: str, Optional
2985
+ :param _headers: set to override the headers for a single
2986
+ request; this effectively ignores the headers
2987
+ in the spec for a single request.
2988
+ :type _headers: dict, optional
2989
+ :param _host_index: set to override the host_index for a single
2990
+ request; this effectively ignores the host_index
2991
+ in the spec for a single request.
2992
+ :type _host_index: int, optional
2993
+ :return: Returns the result object.
2994
+ """ # noqa: E501
2995
+
2996
+ _param = self._verify_api_key_serialize(
2997
+ api_key=api_key,
2998
+ _request_auth=_request_auth,
2999
+ _content_type=_content_type,
3000
+ _headers=_headers,
3001
+ _host_index=_host_index,
3002
+ )
3003
+
3004
+ _response_types_map: Dict[str, Optional[str]] = {
3005
+ "200": "Verify200Response",
3006
+ }
3007
+ response_data = await self.api_client.call_api(
3008
+ *_param, _request_timeout=_request_timeout
3009
+ )
3010
+ return response_data.response
3011
+
3012
+ def _verify_api_key_serialize(
3013
+ self,
3014
+ api_key,
3015
+ _request_auth,
3016
+ _content_type,
3017
+ _headers,
3018
+ _host_index,
3019
+ ) -> RequestSerialized:
3020
+
3021
+ _host = None
3022
+
3023
+ _collection_formats: Dict[str, str] = {}
3024
+
3025
+ _path_params: Dict[str, str] = {}
3026
+ _query_params: List[Tuple[str, str]] = []
3027
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3028
+ _form_params: List[Tuple[str, str]] = []
3029
+ _files: Dict[
3030
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3031
+ ] = {}
3032
+ _body_params: Optional[bytes] = None
3033
+
3034
+ # process the path parameters
3035
+ # process the query parameters
3036
+ if api_key is not None:
3037
+
3038
+ _query_params.append(("apiKey", api_key))
3039
+
3040
+ # process the header parameters
3041
+ # process the form parameters
3042
+ # process the body parameter
3043
+
3044
+ # set the HTTP header `Accept`
3045
+ if "Accept" not in _header_params:
3046
+ _header_params["Accept"] = self.api_client.select_header_accept(
3047
+ ["application/json"]
3048
+ )
3049
+
3050
+ # authentication setting
3051
+ _auth_settings: List[str] = []
3052
+
3053
+ return self.api_client.param_serialize(
3054
+ method="GET",
3055
+ resource_path="/verify-api-key",
3056
+ path_params=_path_params,
3057
+ query_params=_query_params,
3058
+ header_params=_header_params,
3059
+ body=_body_params,
3060
+ post_params=_form_params,
3061
+ files=_files,
3062
+ auth_settings=_auth_settings,
3063
+ collection_formats=_collection_formats,
3064
+ _host=_host,
3065
+ _request_auth=_request_auth,
3066
+ )