mixpeek 0.17.9__py3-none-any.whl → 0.18.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.
- mixpeek/_version.py +2 -2
- mixpeek/assets.py +14 -14
- mixpeek/collections.py +10 -10
- mixpeek/{feature_extractors.py → featureextractors.py} +2 -2
- mixpeek/features.py +348 -8
- mixpeek/{ingest_assets.py → ingestassets.py} +6 -6
- mixpeek/namespaces.py +12 -12
- mixpeek/organizations.py +10 -626
- mixpeek/sdk.py +9 -6
- mixpeek/tasks.py +6 -6
- mixpeek/taxonomies.py +686 -0
- mixpeek/{taxonomy_entities.py → taxonomyentities.py} +14 -690
- mixpeek/users.py +626 -0
- {mixpeek-0.17.9.dist-info → mixpeek-0.18.0.dist-info}/METADATA +57 -54
- {mixpeek-0.17.9.dist-info → mixpeek-0.18.0.dist-info}/RECORD +16 -15
- mixpeek/feature_search.py +0 -350
- {mixpeek-0.17.9.dist-info → mixpeek-0.18.0.dist-info}/WHEEL +0 -0
mixpeek/organizations.py
CHANGED
@@ -10,7 +10,7 @@ from typing import Any, List, Mapping, Optional, Union
|
|
10
10
|
|
11
11
|
|
12
12
|
class Organizations(BaseSDK):
|
13
|
-
def
|
13
|
+
def get(
|
14
14
|
self,
|
15
15
|
*,
|
16
16
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
@@ -106,7 +106,7 @@ class Organizations(BaseSDK):
|
|
106
106
|
http_res,
|
107
107
|
)
|
108
108
|
|
109
|
-
async def
|
109
|
+
async def get_async(
|
110
110
|
self,
|
111
111
|
*,
|
112
112
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
@@ -202,7 +202,7 @@ class Organizations(BaseSDK):
|
|
202
202
|
http_res,
|
203
203
|
)
|
204
204
|
|
205
|
-
def
|
205
|
+
def get_usage(
|
206
206
|
self,
|
207
207
|
*,
|
208
208
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
@@ -298,7 +298,7 @@ class Organizations(BaseSDK):
|
|
298
298
|
http_res,
|
299
299
|
)
|
300
300
|
|
301
|
-
async def
|
301
|
+
async def get_usage_async(
|
302
302
|
self,
|
303
303
|
*,
|
304
304
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
@@ -394,413 +394,7 @@ class Organizations(BaseSDK):
|
|
394
394
|
http_res,
|
395
395
|
)
|
396
396
|
|
397
|
-
def
|
398
|
-
self,
|
399
|
-
*,
|
400
|
-
user_email: str,
|
401
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
402
|
-
server_url: Optional[str] = None,
|
403
|
-
timeout_ms: Optional[int] = None,
|
404
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
405
|
-
) -> models.UserModelOutput:
|
406
|
-
r"""Get User
|
407
|
-
|
408
|
-
:param user_email:
|
409
|
-
:param retries: Override the default retry configuration for this method
|
410
|
-
:param server_url: Override the default server URL for this method
|
411
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
412
|
-
:param http_headers: Additional headers to set or replace on requests.
|
413
|
-
"""
|
414
|
-
base_url = None
|
415
|
-
url_variables = None
|
416
|
-
if timeout_ms is None:
|
417
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
418
|
-
|
419
|
-
if server_url is not None:
|
420
|
-
base_url = server_url
|
421
|
-
|
422
|
-
request = models.GetUserV1OrganizationsUsersUserEmailGetRequest(
|
423
|
-
user_email=user_email,
|
424
|
-
)
|
425
|
-
|
426
|
-
req = self._build_request(
|
427
|
-
method="GET",
|
428
|
-
path="/v1/organizations/users/{user_email}",
|
429
|
-
base_url=base_url,
|
430
|
-
url_variables=url_variables,
|
431
|
-
request=request,
|
432
|
-
request_body_required=False,
|
433
|
-
request_has_path_params=True,
|
434
|
-
request_has_query_params=True,
|
435
|
-
user_agent_header="user-agent",
|
436
|
-
accept_header_value="application/json",
|
437
|
-
http_headers=http_headers,
|
438
|
-
security=self.sdk_configuration.security,
|
439
|
-
timeout_ms=timeout_ms,
|
440
|
-
)
|
441
|
-
|
442
|
-
if retries == UNSET:
|
443
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
444
|
-
retries = self.sdk_configuration.retry_config
|
445
|
-
|
446
|
-
retry_config = None
|
447
|
-
if isinstance(retries, utils.RetryConfig):
|
448
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
449
|
-
|
450
|
-
http_res = self.do_request(
|
451
|
-
hook_ctx=HookContext(
|
452
|
-
operation_id="get_user_v1_organizations_users__user_email__get",
|
453
|
-
oauth2_scopes=[],
|
454
|
-
security_source=get_security_from_env(
|
455
|
-
self.sdk_configuration.security, models.Security
|
456
|
-
),
|
457
|
-
),
|
458
|
-
request=req,
|
459
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
460
|
-
retry_config=retry_config,
|
461
|
-
)
|
462
|
-
|
463
|
-
data: Any = None
|
464
|
-
if utils.match_response(http_res, "200", "application/json"):
|
465
|
-
return utils.unmarshal_json(http_res.text, models.UserModelOutput)
|
466
|
-
if utils.match_response(
|
467
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
468
|
-
):
|
469
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
470
|
-
raise models.ErrorResponse(data=data)
|
471
|
-
if utils.match_response(http_res, "422", "application/json"):
|
472
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
473
|
-
raise models.HTTPValidationError(data=data)
|
474
|
-
if utils.match_response(http_res, "500", "application/json"):
|
475
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
476
|
-
raise models.ErrorResponse(data=data)
|
477
|
-
if utils.match_response(http_res, "4XX", "*"):
|
478
|
-
http_res_text = utils.stream_to_text(http_res)
|
479
|
-
raise models.APIError(
|
480
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
481
|
-
)
|
482
|
-
if utils.match_response(http_res, "5XX", "*"):
|
483
|
-
http_res_text = utils.stream_to_text(http_res)
|
484
|
-
raise models.APIError(
|
485
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
486
|
-
)
|
487
|
-
|
488
|
-
content_type = http_res.headers.get("Content-Type")
|
489
|
-
http_res_text = utils.stream_to_text(http_res)
|
490
|
-
raise models.APIError(
|
491
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
492
|
-
http_res.status_code,
|
493
|
-
http_res_text,
|
494
|
-
http_res,
|
495
|
-
)
|
496
|
-
|
497
|
-
async def get_user_v1_organizations_users_user_email_get_async(
|
498
|
-
self,
|
499
|
-
*,
|
500
|
-
user_email: str,
|
501
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
502
|
-
server_url: Optional[str] = None,
|
503
|
-
timeout_ms: Optional[int] = None,
|
504
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
505
|
-
) -> models.UserModelOutput:
|
506
|
-
r"""Get User
|
507
|
-
|
508
|
-
:param user_email:
|
509
|
-
:param retries: Override the default retry configuration for this method
|
510
|
-
:param server_url: Override the default server URL for this method
|
511
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
512
|
-
:param http_headers: Additional headers to set or replace on requests.
|
513
|
-
"""
|
514
|
-
base_url = None
|
515
|
-
url_variables = None
|
516
|
-
if timeout_ms is None:
|
517
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
518
|
-
|
519
|
-
if server_url is not None:
|
520
|
-
base_url = server_url
|
521
|
-
|
522
|
-
request = models.GetUserV1OrganizationsUsersUserEmailGetRequest(
|
523
|
-
user_email=user_email,
|
524
|
-
)
|
525
|
-
|
526
|
-
req = self._build_request_async(
|
527
|
-
method="GET",
|
528
|
-
path="/v1/organizations/users/{user_email}",
|
529
|
-
base_url=base_url,
|
530
|
-
url_variables=url_variables,
|
531
|
-
request=request,
|
532
|
-
request_body_required=False,
|
533
|
-
request_has_path_params=True,
|
534
|
-
request_has_query_params=True,
|
535
|
-
user_agent_header="user-agent",
|
536
|
-
accept_header_value="application/json",
|
537
|
-
http_headers=http_headers,
|
538
|
-
security=self.sdk_configuration.security,
|
539
|
-
timeout_ms=timeout_ms,
|
540
|
-
)
|
541
|
-
|
542
|
-
if retries == UNSET:
|
543
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
544
|
-
retries = self.sdk_configuration.retry_config
|
545
|
-
|
546
|
-
retry_config = None
|
547
|
-
if isinstance(retries, utils.RetryConfig):
|
548
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
549
|
-
|
550
|
-
http_res = await self.do_request_async(
|
551
|
-
hook_ctx=HookContext(
|
552
|
-
operation_id="get_user_v1_organizations_users__user_email__get",
|
553
|
-
oauth2_scopes=[],
|
554
|
-
security_source=get_security_from_env(
|
555
|
-
self.sdk_configuration.security, models.Security
|
556
|
-
),
|
557
|
-
),
|
558
|
-
request=req,
|
559
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
560
|
-
retry_config=retry_config,
|
561
|
-
)
|
562
|
-
|
563
|
-
data: Any = None
|
564
|
-
if utils.match_response(http_res, "200", "application/json"):
|
565
|
-
return utils.unmarshal_json(http_res.text, models.UserModelOutput)
|
566
|
-
if utils.match_response(
|
567
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
568
|
-
):
|
569
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
570
|
-
raise models.ErrorResponse(data=data)
|
571
|
-
if utils.match_response(http_res, "422", "application/json"):
|
572
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
573
|
-
raise models.HTTPValidationError(data=data)
|
574
|
-
if utils.match_response(http_res, "500", "application/json"):
|
575
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
576
|
-
raise models.ErrorResponse(data=data)
|
577
|
-
if utils.match_response(http_res, "4XX", "*"):
|
578
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
579
|
-
raise models.APIError(
|
580
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
581
|
-
)
|
582
|
-
if utils.match_response(http_res, "5XX", "*"):
|
583
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
584
|
-
raise models.APIError(
|
585
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
586
|
-
)
|
587
|
-
|
588
|
-
content_type = http_res.headers.get("Content-Type")
|
589
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
590
|
-
raise models.APIError(
|
591
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
592
|
-
http_res.status_code,
|
593
|
-
http_res_text,
|
594
|
-
http_res,
|
595
|
-
)
|
596
|
-
|
597
|
-
def delete_user_v1_organizations_users_user_email_delete(
|
598
|
-
self,
|
599
|
-
*,
|
600
|
-
user_email: str,
|
601
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
602
|
-
server_url: Optional[str] = None,
|
603
|
-
timeout_ms: Optional[int] = None,
|
604
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
605
|
-
) -> Any:
|
606
|
-
r"""Delete User
|
607
|
-
|
608
|
-
**Requirements:**
|
609
|
-
- Required permissions: admin
|
610
|
-
|
611
|
-
:param user_email:
|
612
|
-
:param retries: Override the default retry configuration for this method
|
613
|
-
:param server_url: Override the default server URL for this method
|
614
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
615
|
-
:param http_headers: Additional headers to set or replace on requests.
|
616
|
-
"""
|
617
|
-
base_url = None
|
618
|
-
url_variables = None
|
619
|
-
if timeout_ms is None:
|
620
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
621
|
-
|
622
|
-
if server_url is not None:
|
623
|
-
base_url = server_url
|
624
|
-
|
625
|
-
request = models.DeleteUserV1OrganizationsUsersUserEmailDeleteRequest(
|
626
|
-
user_email=user_email,
|
627
|
-
)
|
628
|
-
|
629
|
-
req = self._build_request(
|
630
|
-
method="DELETE",
|
631
|
-
path="/v1/organizations/users/{user_email}",
|
632
|
-
base_url=base_url,
|
633
|
-
url_variables=url_variables,
|
634
|
-
request=request,
|
635
|
-
request_body_required=False,
|
636
|
-
request_has_path_params=True,
|
637
|
-
request_has_query_params=True,
|
638
|
-
user_agent_header="user-agent",
|
639
|
-
accept_header_value="application/json",
|
640
|
-
http_headers=http_headers,
|
641
|
-
security=self.sdk_configuration.security,
|
642
|
-
timeout_ms=timeout_ms,
|
643
|
-
)
|
644
|
-
|
645
|
-
if retries == UNSET:
|
646
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
647
|
-
retries = self.sdk_configuration.retry_config
|
648
|
-
|
649
|
-
retry_config = None
|
650
|
-
if isinstance(retries, utils.RetryConfig):
|
651
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
652
|
-
|
653
|
-
http_res = self.do_request(
|
654
|
-
hook_ctx=HookContext(
|
655
|
-
operation_id="delete_user_v1_organizations_users__user_email__delete",
|
656
|
-
oauth2_scopes=[],
|
657
|
-
security_source=get_security_from_env(
|
658
|
-
self.sdk_configuration.security, models.Security
|
659
|
-
),
|
660
|
-
),
|
661
|
-
request=req,
|
662
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
663
|
-
retry_config=retry_config,
|
664
|
-
)
|
665
|
-
|
666
|
-
data: Any = None
|
667
|
-
if utils.match_response(http_res, "200", "application/json"):
|
668
|
-
return utils.unmarshal_json(http_res.text, Any)
|
669
|
-
if utils.match_response(
|
670
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
671
|
-
):
|
672
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
673
|
-
raise models.ErrorResponse(data=data)
|
674
|
-
if utils.match_response(http_res, "422", "application/json"):
|
675
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
676
|
-
raise models.HTTPValidationError(data=data)
|
677
|
-
if utils.match_response(http_res, "500", "application/json"):
|
678
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
679
|
-
raise models.ErrorResponse(data=data)
|
680
|
-
if utils.match_response(http_res, "4XX", "*"):
|
681
|
-
http_res_text = utils.stream_to_text(http_res)
|
682
|
-
raise models.APIError(
|
683
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
684
|
-
)
|
685
|
-
if utils.match_response(http_res, "5XX", "*"):
|
686
|
-
http_res_text = utils.stream_to_text(http_res)
|
687
|
-
raise models.APIError(
|
688
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
689
|
-
)
|
690
|
-
|
691
|
-
content_type = http_res.headers.get("Content-Type")
|
692
|
-
http_res_text = utils.stream_to_text(http_res)
|
693
|
-
raise models.APIError(
|
694
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
695
|
-
http_res.status_code,
|
696
|
-
http_res_text,
|
697
|
-
http_res,
|
698
|
-
)
|
699
|
-
|
700
|
-
async def delete_user_v1_organizations_users_user_email_delete_async(
|
701
|
-
self,
|
702
|
-
*,
|
703
|
-
user_email: str,
|
704
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
705
|
-
server_url: Optional[str] = None,
|
706
|
-
timeout_ms: Optional[int] = None,
|
707
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
708
|
-
) -> Any:
|
709
|
-
r"""Delete User
|
710
|
-
|
711
|
-
**Requirements:**
|
712
|
-
- Required permissions: admin
|
713
|
-
|
714
|
-
:param user_email:
|
715
|
-
:param retries: Override the default retry configuration for this method
|
716
|
-
:param server_url: Override the default server URL for this method
|
717
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
718
|
-
:param http_headers: Additional headers to set or replace on requests.
|
719
|
-
"""
|
720
|
-
base_url = None
|
721
|
-
url_variables = None
|
722
|
-
if timeout_ms is None:
|
723
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
724
|
-
|
725
|
-
if server_url is not None:
|
726
|
-
base_url = server_url
|
727
|
-
|
728
|
-
request = models.DeleteUserV1OrganizationsUsersUserEmailDeleteRequest(
|
729
|
-
user_email=user_email,
|
730
|
-
)
|
731
|
-
|
732
|
-
req = self._build_request_async(
|
733
|
-
method="DELETE",
|
734
|
-
path="/v1/organizations/users/{user_email}",
|
735
|
-
base_url=base_url,
|
736
|
-
url_variables=url_variables,
|
737
|
-
request=request,
|
738
|
-
request_body_required=False,
|
739
|
-
request_has_path_params=True,
|
740
|
-
request_has_query_params=True,
|
741
|
-
user_agent_header="user-agent",
|
742
|
-
accept_header_value="application/json",
|
743
|
-
http_headers=http_headers,
|
744
|
-
security=self.sdk_configuration.security,
|
745
|
-
timeout_ms=timeout_ms,
|
746
|
-
)
|
747
|
-
|
748
|
-
if retries == UNSET:
|
749
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
750
|
-
retries = self.sdk_configuration.retry_config
|
751
|
-
|
752
|
-
retry_config = None
|
753
|
-
if isinstance(retries, utils.RetryConfig):
|
754
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
755
|
-
|
756
|
-
http_res = await self.do_request_async(
|
757
|
-
hook_ctx=HookContext(
|
758
|
-
operation_id="delete_user_v1_organizations_users__user_email__delete",
|
759
|
-
oauth2_scopes=[],
|
760
|
-
security_source=get_security_from_env(
|
761
|
-
self.sdk_configuration.security, models.Security
|
762
|
-
),
|
763
|
-
),
|
764
|
-
request=req,
|
765
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
766
|
-
retry_config=retry_config,
|
767
|
-
)
|
768
|
-
|
769
|
-
data: Any = None
|
770
|
-
if utils.match_response(http_res, "200", "application/json"):
|
771
|
-
return utils.unmarshal_json(http_res.text, Any)
|
772
|
-
if utils.match_response(
|
773
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
774
|
-
):
|
775
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
776
|
-
raise models.ErrorResponse(data=data)
|
777
|
-
if utils.match_response(http_res, "422", "application/json"):
|
778
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
779
|
-
raise models.HTTPValidationError(data=data)
|
780
|
-
if utils.match_response(http_res, "500", "application/json"):
|
781
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
782
|
-
raise models.ErrorResponse(data=data)
|
783
|
-
if utils.match_response(http_res, "4XX", "*"):
|
784
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
785
|
-
raise models.APIError(
|
786
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
787
|
-
)
|
788
|
-
if utils.match_response(http_res, "5XX", "*"):
|
789
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
790
|
-
raise models.APIError(
|
791
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
792
|
-
)
|
793
|
-
|
794
|
-
content_type = http_res.headers.get("Content-Type")
|
795
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
796
|
-
raise models.APIError(
|
797
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
798
|
-
http_res.status_code,
|
799
|
-
http_res_text,
|
800
|
-
http_res,
|
801
|
-
)
|
802
|
-
|
803
|
-
def add_user_v1_organizations_users_post(
|
397
|
+
def add_user(
|
804
398
|
self,
|
805
399
|
*,
|
806
400
|
email: str,
|
@@ -924,7 +518,7 @@ class Organizations(BaseSDK):
|
|
924
518
|
http_res,
|
925
519
|
)
|
926
520
|
|
927
|
-
async def
|
521
|
+
async def add_user_async(
|
928
522
|
self,
|
929
523
|
*,
|
930
524
|
email: str,
|
@@ -1048,217 +642,7 @@ class Organizations(BaseSDK):
|
|
1048
642
|
http_res,
|
1049
643
|
)
|
1050
644
|
|
1051
|
-
def
|
1052
|
-
self,
|
1053
|
-
*,
|
1054
|
-
user_email: str,
|
1055
|
-
key_name: Optional[str] = "default",
|
1056
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1057
|
-
server_url: Optional[str] = None,
|
1058
|
-
timeout_ms: Optional[int] = None,
|
1059
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
1060
|
-
) -> models.APIKey:
|
1061
|
-
r"""Create Api Key
|
1062
|
-
|
1063
|
-
Create a new API key for a specific user
|
1064
|
-
|
1065
|
-
:param user_email:
|
1066
|
-
:param key_name:
|
1067
|
-
:param retries: Override the default retry configuration for this method
|
1068
|
-
:param server_url: Override the default server URL for this method
|
1069
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1070
|
-
:param http_headers: Additional headers to set or replace on requests.
|
1071
|
-
"""
|
1072
|
-
base_url = None
|
1073
|
-
url_variables = None
|
1074
|
-
if timeout_ms is None:
|
1075
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
1076
|
-
|
1077
|
-
if server_url is not None:
|
1078
|
-
base_url = server_url
|
1079
|
-
|
1080
|
-
request = models.CreateAPIKeyV1OrganizationsUsersUserEmailAPIKeysPostRequest(
|
1081
|
-
user_email=user_email,
|
1082
|
-
key_name=key_name,
|
1083
|
-
)
|
1084
|
-
|
1085
|
-
req = self._build_request(
|
1086
|
-
method="POST",
|
1087
|
-
path="/v1/organizations/users/{user_email}/api-keys",
|
1088
|
-
base_url=base_url,
|
1089
|
-
url_variables=url_variables,
|
1090
|
-
request=request,
|
1091
|
-
request_body_required=False,
|
1092
|
-
request_has_path_params=True,
|
1093
|
-
request_has_query_params=True,
|
1094
|
-
user_agent_header="user-agent",
|
1095
|
-
accept_header_value="application/json",
|
1096
|
-
http_headers=http_headers,
|
1097
|
-
security=self.sdk_configuration.security,
|
1098
|
-
timeout_ms=timeout_ms,
|
1099
|
-
)
|
1100
|
-
|
1101
|
-
if retries == UNSET:
|
1102
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
1103
|
-
retries = self.sdk_configuration.retry_config
|
1104
|
-
|
1105
|
-
retry_config = None
|
1106
|
-
if isinstance(retries, utils.RetryConfig):
|
1107
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1108
|
-
|
1109
|
-
http_res = self.do_request(
|
1110
|
-
hook_ctx=HookContext(
|
1111
|
-
operation_id="create_api_key_v1_organizations_users__user_email__api_keys_post",
|
1112
|
-
oauth2_scopes=[],
|
1113
|
-
security_source=get_security_from_env(
|
1114
|
-
self.sdk_configuration.security, models.Security
|
1115
|
-
),
|
1116
|
-
),
|
1117
|
-
request=req,
|
1118
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
1119
|
-
retry_config=retry_config,
|
1120
|
-
)
|
1121
|
-
|
1122
|
-
data: Any = None
|
1123
|
-
if utils.match_response(http_res, "200", "application/json"):
|
1124
|
-
return utils.unmarshal_json(http_res.text, models.APIKey)
|
1125
|
-
if utils.match_response(
|
1126
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
1127
|
-
):
|
1128
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1129
|
-
raise models.ErrorResponse(data=data)
|
1130
|
-
if utils.match_response(http_res, "422", "application/json"):
|
1131
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
1132
|
-
raise models.HTTPValidationError(data=data)
|
1133
|
-
if utils.match_response(http_res, "500", "application/json"):
|
1134
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1135
|
-
raise models.ErrorResponse(data=data)
|
1136
|
-
if utils.match_response(http_res, "4XX", "*"):
|
1137
|
-
http_res_text = utils.stream_to_text(http_res)
|
1138
|
-
raise models.APIError(
|
1139
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1140
|
-
)
|
1141
|
-
if utils.match_response(http_res, "5XX", "*"):
|
1142
|
-
http_res_text = utils.stream_to_text(http_res)
|
1143
|
-
raise models.APIError(
|
1144
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1145
|
-
)
|
1146
|
-
|
1147
|
-
content_type = http_res.headers.get("Content-Type")
|
1148
|
-
http_res_text = utils.stream_to_text(http_res)
|
1149
|
-
raise models.APIError(
|
1150
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1151
|
-
http_res.status_code,
|
1152
|
-
http_res_text,
|
1153
|
-
http_res,
|
1154
|
-
)
|
1155
|
-
|
1156
|
-
async def create_api_key_v1_organizations_users_user_email_api_keys_post_async(
|
1157
|
-
self,
|
1158
|
-
*,
|
1159
|
-
user_email: str,
|
1160
|
-
key_name: Optional[str] = "default",
|
1161
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1162
|
-
server_url: Optional[str] = None,
|
1163
|
-
timeout_ms: Optional[int] = None,
|
1164
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
1165
|
-
) -> models.APIKey:
|
1166
|
-
r"""Create Api Key
|
1167
|
-
|
1168
|
-
Create a new API key for a specific user
|
1169
|
-
|
1170
|
-
:param user_email:
|
1171
|
-
:param key_name:
|
1172
|
-
:param retries: Override the default retry configuration for this method
|
1173
|
-
:param server_url: Override the default server URL for this method
|
1174
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1175
|
-
:param http_headers: Additional headers to set or replace on requests.
|
1176
|
-
"""
|
1177
|
-
base_url = None
|
1178
|
-
url_variables = None
|
1179
|
-
if timeout_ms is None:
|
1180
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
1181
|
-
|
1182
|
-
if server_url is not None:
|
1183
|
-
base_url = server_url
|
1184
|
-
|
1185
|
-
request = models.CreateAPIKeyV1OrganizationsUsersUserEmailAPIKeysPostRequest(
|
1186
|
-
user_email=user_email,
|
1187
|
-
key_name=key_name,
|
1188
|
-
)
|
1189
|
-
|
1190
|
-
req = self._build_request_async(
|
1191
|
-
method="POST",
|
1192
|
-
path="/v1/organizations/users/{user_email}/api-keys",
|
1193
|
-
base_url=base_url,
|
1194
|
-
url_variables=url_variables,
|
1195
|
-
request=request,
|
1196
|
-
request_body_required=False,
|
1197
|
-
request_has_path_params=True,
|
1198
|
-
request_has_query_params=True,
|
1199
|
-
user_agent_header="user-agent",
|
1200
|
-
accept_header_value="application/json",
|
1201
|
-
http_headers=http_headers,
|
1202
|
-
security=self.sdk_configuration.security,
|
1203
|
-
timeout_ms=timeout_ms,
|
1204
|
-
)
|
1205
|
-
|
1206
|
-
if retries == UNSET:
|
1207
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
1208
|
-
retries = self.sdk_configuration.retry_config
|
1209
|
-
|
1210
|
-
retry_config = None
|
1211
|
-
if isinstance(retries, utils.RetryConfig):
|
1212
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1213
|
-
|
1214
|
-
http_res = await self.do_request_async(
|
1215
|
-
hook_ctx=HookContext(
|
1216
|
-
operation_id="create_api_key_v1_organizations_users__user_email__api_keys_post",
|
1217
|
-
oauth2_scopes=[],
|
1218
|
-
security_source=get_security_from_env(
|
1219
|
-
self.sdk_configuration.security, models.Security
|
1220
|
-
),
|
1221
|
-
),
|
1222
|
-
request=req,
|
1223
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
1224
|
-
retry_config=retry_config,
|
1225
|
-
)
|
1226
|
-
|
1227
|
-
data: Any = None
|
1228
|
-
if utils.match_response(http_res, "200", "application/json"):
|
1229
|
-
return utils.unmarshal_json(http_res.text, models.APIKey)
|
1230
|
-
if utils.match_response(
|
1231
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
1232
|
-
):
|
1233
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1234
|
-
raise models.ErrorResponse(data=data)
|
1235
|
-
if utils.match_response(http_res, "422", "application/json"):
|
1236
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
1237
|
-
raise models.HTTPValidationError(data=data)
|
1238
|
-
if utils.match_response(http_res, "500", "application/json"):
|
1239
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1240
|
-
raise models.ErrorResponse(data=data)
|
1241
|
-
if utils.match_response(http_res, "4XX", "*"):
|
1242
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1243
|
-
raise models.APIError(
|
1244
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1245
|
-
)
|
1246
|
-
if utils.match_response(http_res, "5XX", "*"):
|
1247
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1248
|
-
raise models.APIError(
|
1249
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1250
|
-
)
|
1251
|
-
|
1252
|
-
content_type = http_res.headers.get("Content-Type")
|
1253
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1254
|
-
raise models.APIError(
|
1255
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1256
|
-
http_res.status_code,
|
1257
|
-
http_res_text,
|
1258
|
-
http_res,
|
1259
|
-
)
|
1260
|
-
|
1261
|
-
def delete_api_key_v1_organizations_users_user_email_api_keys_key_name_delete(
|
645
|
+
def delete_api_key(
|
1262
646
|
self,
|
1263
647
|
*,
|
1264
648
|
user_email: str,
|
@@ -1365,7 +749,7 @@ class Organizations(BaseSDK):
|
|
1365
749
|
http_res,
|
1366
750
|
)
|
1367
751
|
|
1368
|
-
async def
|
752
|
+
async def delete_api_key_async(
|
1369
753
|
self,
|
1370
754
|
*,
|
1371
755
|
user_email: str,
|
@@ -1472,7 +856,7 @@ class Organizations(BaseSDK):
|
|
1472
856
|
http_res,
|
1473
857
|
)
|
1474
858
|
|
1475
|
-
def
|
859
|
+
def update_api_key(
|
1476
860
|
self,
|
1477
861
|
*,
|
1478
862
|
user_email: str,
|
@@ -1590,7 +974,7 @@ class Organizations(BaseSDK):
|
|
1590
974
|
http_res,
|
1591
975
|
)
|
1592
976
|
|
1593
|
-
async def
|
977
|
+
async def update_api_key_async(
|
1594
978
|
self,
|
1595
979
|
*,
|
1596
980
|
user_email: str,
|