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.
@@ -9,7 +9,7 @@ from typing import Any, List, Mapping, Optional, Union
9
9
 
10
10
 
11
11
  class TaxonomyEntities(BaseSDK):
12
- def create_taxonomy_v1_entities_taxonomies_post(
12
+ def create(
13
13
  self,
14
14
  *,
15
15
  taxonomy_name: str,
@@ -127,7 +127,7 @@ class TaxonomyEntities(BaseSDK):
127
127
  http_res,
128
128
  )
129
129
 
130
- async def create_taxonomy_v1_entities_taxonomies_post_async(
130
+ async def create_async(
131
131
  self,
132
132
  *,
133
133
  taxonomy_name: str,
@@ -245,7 +245,7 @@ class TaxonomyEntities(BaseSDK):
245
245
  http_res,
246
246
  )
247
247
 
248
- def list_taxonomies_v1_entities_taxonomies_get(
248
+ def list(
249
249
  self,
250
250
  *,
251
251
  offset_id: OptionalNullable[str] = UNSET,
@@ -353,7 +353,7 @@ class TaxonomyEntities(BaseSDK):
353
353
  http_res,
354
354
  )
355
355
 
356
- async def list_taxonomies_v1_entities_taxonomies_get_async(
356
+ async def list_async(
357
357
  self,
358
358
  *,
359
359
  offset_id: OptionalNullable[str] = UNSET,
@@ -461,683 +461,7 @@ class TaxonomyEntities(BaseSDK):
461
461
  http_res,
462
462
  )
463
463
 
464
- def get_taxonomy_v1_entities_taxonomies_taxonomy_get(
465
- self,
466
- *,
467
- taxonomy: str,
468
- x_namespace: OptionalNullable[str] = UNSET,
469
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
470
- server_url: Optional[str] = None,
471
- timeout_ms: Optional[int] = None,
472
- http_headers: Optional[Mapping[str, str]] = None,
473
- ) -> models.TaxonomyModel:
474
- r"""Get Taxonomy
475
-
476
- Get the complete taxonomy that contains the specified node
477
-
478
- :param taxonomy: The name or id of the taxonomy to find
479
- :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
480
- :param retries: Override the default retry configuration for this method
481
- :param server_url: Override the default server URL for this method
482
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
483
- :param http_headers: Additional headers to set or replace on requests.
484
- """
485
- base_url = None
486
- url_variables = None
487
- if timeout_ms is None:
488
- timeout_ms = self.sdk_configuration.timeout_ms
489
-
490
- if server_url is not None:
491
- base_url = server_url
492
-
493
- request = models.GetTaxonomyV1EntitiesTaxonomiesTaxonomyGetRequest(
494
- taxonomy=taxonomy,
495
- x_namespace=x_namespace,
496
- )
497
-
498
- req = self._build_request(
499
- method="GET",
500
- path="/v1/entities/taxonomies/{taxonomy}",
501
- base_url=base_url,
502
- url_variables=url_variables,
503
- request=request,
504
- request_body_required=False,
505
- request_has_path_params=True,
506
- request_has_query_params=True,
507
- user_agent_header="user-agent",
508
- accept_header_value="application/json",
509
- http_headers=http_headers,
510
- security=self.sdk_configuration.security,
511
- timeout_ms=timeout_ms,
512
- )
513
-
514
- if retries == UNSET:
515
- if self.sdk_configuration.retry_config is not UNSET:
516
- retries = self.sdk_configuration.retry_config
517
-
518
- retry_config = None
519
- if isinstance(retries, utils.RetryConfig):
520
- retry_config = (retries, ["429", "500", "502", "503", "504"])
521
-
522
- http_res = self.do_request(
523
- hook_ctx=HookContext(
524
- operation_id="get_taxonomy_v1_entities_taxonomies__taxonomy__get",
525
- oauth2_scopes=[],
526
- security_source=get_security_from_env(
527
- self.sdk_configuration.security, models.Security
528
- ),
529
- ),
530
- request=req,
531
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
532
- retry_config=retry_config,
533
- )
534
-
535
- data: Any = None
536
- if utils.match_response(http_res, "200", "application/json"):
537
- return utils.unmarshal_json(http_res.text, models.TaxonomyModel)
538
- if utils.match_response(
539
- http_res, ["400", "401", "403", "404"], "application/json"
540
- ):
541
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
542
- raise models.ErrorResponse(data=data)
543
- if utils.match_response(http_res, "422", "application/json"):
544
- data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
545
- raise models.HTTPValidationError(data=data)
546
- if utils.match_response(http_res, "500", "application/json"):
547
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
548
- raise models.ErrorResponse(data=data)
549
- if utils.match_response(http_res, "4XX", "*"):
550
- http_res_text = utils.stream_to_text(http_res)
551
- raise models.APIError(
552
- "API error occurred", http_res.status_code, http_res_text, http_res
553
- )
554
- if utils.match_response(http_res, "5XX", "*"):
555
- http_res_text = utils.stream_to_text(http_res)
556
- raise models.APIError(
557
- "API error occurred", http_res.status_code, http_res_text, http_res
558
- )
559
-
560
- content_type = http_res.headers.get("Content-Type")
561
- http_res_text = utils.stream_to_text(http_res)
562
- raise models.APIError(
563
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
564
- http_res.status_code,
565
- http_res_text,
566
- http_res,
567
- )
568
-
569
- async def get_taxonomy_v1_entities_taxonomies_taxonomy_get_async(
570
- self,
571
- *,
572
- taxonomy: str,
573
- x_namespace: OptionalNullable[str] = UNSET,
574
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
575
- server_url: Optional[str] = None,
576
- timeout_ms: Optional[int] = None,
577
- http_headers: Optional[Mapping[str, str]] = None,
578
- ) -> models.TaxonomyModel:
579
- r"""Get Taxonomy
580
-
581
- Get the complete taxonomy that contains the specified node
582
-
583
- :param taxonomy: The name or id of the taxonomy to find
584
- :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
585
- :param retries: Override the default retry configuration for this method
586
- :param server_url: Override the default server URL for this method
587
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
588
- :param http_headers: Additional headers to set or replace on requests.
589
- """
590
- base_url = None
591
- url_variables = None
592
- if timeout_ms is None:
593
- timeout_ms = self.sdk_configuration.timeout_ms
594
-
595
- if server_url is not None:
596
- base_url = server_url
597
-
598
- request = models.GetTaxonomyV1EntitiesTaxonomiesTaxonomyGetRequest(
599
- taxonomy=taxonomy,
600
- x_namespace=x_namespace,
601
- )
602
-
603
- req = self._build_request_async(
604
- method="GET",
605
- path="/v1/entities/taxonomies/{taxonomy}",
606
- base_url=base_url,
607
- url_variables=url_variables,
608
- request=request,
609
- request_body_required=False,
610
- request_has_path_params=True,
611
- request_has_query_params=True,
612
- user_agent_header="user-agent",
613
- accept_header_value="application/json",
614
- http_headers=http_headers,
615
- security=self.sdk_configuration.security,
616
- timeout_ms=timeout_ms,
617
- )
618
-
619
- if retries == UNSET:
620
- if self.sdk_configuration.retry_config is not UNSET:
621
- retries = self.sdk_configuration.retry_config
622
-
623
- retry_config = None
624
- if isinstance(retries, utils.RetryConfig):
625
- retry_config = (retries, ["429", "500", "502", "503", "504"])
626
-
627
- http_res = await self.do_request_async(
628
- hook_ctx=HookContext(
629
- operation_id="get_taxonomy_v1_entities_taxonomies__taxonomy__get",
630
- oauth2_scopes=[],
631
- security_source=get_security_from_env(
632
- self.sdk_configuration.security, models.Security
633
- ),
634
- ),
635
- request=req,
636
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
637
- retry_config=retry_config,
638
- )
639
-
640
- data: Any = None
641
- if utils.match_response(http_res, "200", "application/json"):
642
- return utils.unmarshal_json(http_res.text, models.TaxonomyModel)
643
- if utils.match_response(
644
- http_res, ["400", "401", "403", "404"], "application/json"
645
- ):
646
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
647
- raise models.ErrorResponse(data=data)
648
- if utils.match_response(http_res, "422", "application/json"):
649
- data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
650
- raise models.HTTPValidationError(data=data)
651
- if utils.match_response(http_res, "500", "application/json"):
652
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
653
- raise models.ErrorResponse(data=data)
654
- if utils.match_response(http_res, "4XX", "*"):
655
- http_res_text = await utils.stream_to_text_async(http_res)
656
- raise models.APIError(
657
- "API error occurred", http_res.status_code, http_res_text, http_res
658
- )
659
- if utils.match_response(http_res, "5XX", "*"):
660
- http_res_text = await utils.stream_to_text_async(http_res)
661
- raise models.APIError(
662
- "API error occurred", http_res.status_code, http_res_text, http_res
663
- )
664
-
665
- content_type = http_res.headers.get("Content-Type")
666
- http_res_text = await utils.stream_to_text_async(http_res)
667
- raise models.APIError(
668
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
669
- http_res.status_code,
670
- http_res_text,
671
- http_res,
672
- )
673
-
674
- def delete_taxonomy_v1_entities_taxonomies_taxonomy_delete(
675
- self,
676
- *,
677
- taxonomy: str,
678
- x_namespace: OptionalNullable[str] = UNSET,
679
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
680
- server_url: Optional[str] = None,
681
- timeout_ms: Optional[int] = None,
682
- http_headers: Optional[Mapping[str, str]] = None,
683
- ) -> models.GenericSuccessResponse:
684
- r"""Delete Taxonomy
685
-
686
- Delete an existing taxonomy and remove all associated node classifications from features.
687
-
688
- This operation:
689
- - Deletes the taxonomy and all its nodes
690
- - Removes any node classifications associated with this taxonomy from all features
691
- - This action cannot be undone
692
-
693
-
694
- **Requirements:**
695
- - Required permissions: write
696
-
697
- :param taxonomy: The ID or name of the taxonomy to delete
698
- :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
699
- :param retries: Override the default retry configuration for this method
700
- :param server_url: Override the default server URL for this method
701
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
702
- :param http_headers: Additional headers to set or replace on requests.
703
- """
704
- base_url = None
705
- url_variables = None
706
- if timeout_ms is None:
707
- timeout_ms = self.sdk_configuration.timeout_ms
708
-
709
- if server_url is not None:
710
- base_url = server_url
711
-
712
- request = models.DeleteTaxonomyV1EntitiesTaxonomiesTaxonomyDeleteRequest(
713
- taxonomy=taxonomy,
714
- x_namespace=x_namespace,
715
- )
716
-
717
- req = self._build_request(
718
- method="DELETE",
719
- path="/v1/entities/taxonomies/{taxonomy}",
720
- base_url=base_url,
721
- url_variables=url_variables,
722
- request=request,
723
- request_body_required=False,
724
- request_has_path_params=True,
725
- request_has_query_params=True,
726
- user_agent_header="user-agent",
727
- accept_header_value="application/json",
728
- http_headers=http_headers,
729
- security=self.sdk_configuration.security,
730
- timeout_ms=timeout_ms,
731
- )
732
-
733
- if retries == UNSET:
734
- if self.sdk_configuration.retry_config is not UNSET:
735
- retries = self.sdk_configuration.retry_config
736
-
737
- retry_config = None
738
- if isinstance(retries, utils.RetryConfig):
739
- retry_config = (retries, ["429", "500", "502", "503", "504"])
740
-
741
- http_res = self.do_request(
742
- hook_ctx=HookContext(
743
- operation_id="delete_taxonomy_v1_entities_taxonomies__taxonomy__delete",
744
- oauth2_scopes=[],
745
- security_source=get_security_from_env(
746
- self.sdk_configuration.security, models.Security
747
- ),
748
- ),
749
- request=req,
750
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
751
- retry_config=retry_config,
752
- )
753
-
754
- data: Any = None
755
- if utils.match_response(http_res, "200", "application/json"):
756
- return utils.unmarshal_json(http_res.text, models.GenericSuccessResponse)
757
- if utils.match_response(
758
- http_res, ["400", "401", "403", "404"], "application/json"
759
- ):
760
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
761
- raise models.ErrorResponse(data=data)
762
- if utils.match_response(http_res, "422", "application/json"):
763
- data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
764
- raise models.HTTPValidationError(data=data)
765
- if utils.match_response(http_res, "500", "application/json"):
766
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
767
- raise models.ErrorResponse(data=data)
768
- if utils.match_response(http_res, "4XX", "*"):
769
- http_res_text = utils.stream_to_text(http_res)
770
- raise models.APIError(
771
- "API error occurred", http_res.status_code, http_res_text, http_res
772
- )
773
- if utils.match_response(http_res, "5XX", "*"):
774
- http_res_text = utils.stream_to_text(http_res)
775
- raise models.APIError(
776
- "API error occurred", http_res.status_code, http_res_text, http_res
777
- )
778
-
779
- content_type = http_res.headers.get("Content-Type")
780
- http_res_text = utils.stream_to_text(http_res)
781
- raise models.APIError(
782
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
783
- http_res.status_code,
784
- http_res_text,
785
- http_res,
786
- )
787
-
788
- async def delete_taxonomy_v1_entities_taxonomies_taxonomy_delete_async(
789
- self,
790
- *,
791
- taxonomy: str,
792
- x_namespace: OptionalNullable[str] = UNSET,
793
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
794
- server_url: Optional[str] = None,
795
- timeout_ms: Optional[int] = None,
796
- http_headers: Optional[Mapping[str, str]] = None,
797
- ) -> models.GenericSuccessResponse:
798
- r"""Delete Taxonomy
799
-
800
- Delete an existing taxonomy and remove all associated node classifications from features.
801
-
802
- This operation:
803
- - Deletes the taxonomy and all its nodes
804
- - Removes any node classifications associated with this taxonomy from all features
805
- - This action cannot be undone
806
-
807
-
808
- **Requirements:**
809
- - Required permissions: write
810
-
811
- :param taxonomy: The ID or name of the taxonomy to delete
812
- :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
813
- :param retries: Override the default retry configuration for this method
814
- :param server_url: Override the default server URL for this method
815
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
816
- :param http_headers: Additional headers to set or replace on requests.
817
- """
818
- base_url = None
819
- url_variables = None
820
- if timeout_ms is None:
821
- timeout_ms = self.sdk_configuration.timeout_ms
822
-
823
- if server_url is not None:
824
- base_url = server_url
825
-
826
- request = models.DeleteTaxonomyV1EntitiesTaxonomiesTaxonomyDeleteRequest(
827
- taxonomy=taxonomy,
828
- x_namespace=x_namespace,
829
- )
830
-
831
- req = self._build_request_async(
832
- method="DELETE",
833
- path="/v1/entities/taxonomies/{taxonomy}",
834
- base_url=base_url,
835
- url_variables=url_variables,
836
- request=request,
837
- request_body_required=False,
838
- request_has_path_params=True,
839
- request_has_query_params=True,
840
- user_agent_header="user-agent",
841
- accept_header_value="application/json",
842
- http_headers=http_headers,
843
- security=self.sdk_configuration.security,
844
- timeout_ms=timeout_ms,
845
- )
846
-
847
- if retries == UNSET:
848
- if self.sdk_configuration.retry_config is not UNSET:
849
- retries = self.sdk_configuration.retry_config
850
-
851
- retry_config = None
852
- if isinstance(retries, utils.RetryConfig):
853
- retry_config = (retries, ["429", "500", "502", "503", "504"])
854
-
855
- http_res = await self.do_request_async(
856
- hook_ctx=HookContext(
857
- operation_id="delete_taxonomy_v1_entities_taxonomies__taxonomy__delete",
858
- oauth2_scopes=[],
859
- security_source=get_security_from_env(
860
- self.sdk_configuration.security, models.Security
861
- ),
862
- ),
863
- request=req,
864
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
865
- retry_config=retry_config,
866
- )
867
-
868
- data: Any = None
869
- if utils.match_response(http_res, "200", "application/json"):
870
- return utils.unmarshal_json(http_res.text, models.GenericSuccessResponse)
871
- if utils.match_response(
872
- http_res, ["400", "401", "403", "404"], "application/json"
873
- ):
874
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
875
- raise models.ErrorResponse(data=data)
876
- if utils.match_response(http_res, "422", "application/json"):
877
- data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
878
- raise models.HTTPValidationError(data=data)
879
- if utils.match_response(http_res, "500", "application/json"):
880
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
881
- raise models.ErrorResponse(data=data)
882
- if utils.match_response(http_res, "4XX", "*"):
883
- http_res_text = await utils.stream_to_text_async(http_res)
884
- raise models.APIError(
885
- "API error occurred", http_res.status_code, http_res_text, http_res
886
- )
887
- if utils.match_response(http_res, "5XX", "*"):
888
- http_res_text = await utils.stream_to_text_async(http_res)
889
- raise models.APIError(
890
- "API error occurred", http_res.status_code, http_res_text, http_res
891
- )
892
-
893
- content_type = http_res.headers.get("Content-Type")
894
- http_res_text = await utils.stream_to_text_async(http_res)
895
- raise models.APIError(
896
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
897
- http_res.status_code,
898
- http_res_text,
899
- http_res,
900
- )
901
-
902
- def update_taxonomy_v1_entities_taxonomies_taxonomy_patch(
903
- self,
904
- *,
905
- taxonomy: str,
906
- x_namespace: OptionalNullable[str] = UNSET,
907
- taxonomy_name: OptionalNullable[str] = UNSET,
908
- description: OptionalNullable[str] = UNSET,
909
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
910
- server_url: Optional[str] = None,
911
- timeout_ms: Optional[int] = None,
912
- http_headers: Optional[Mapping[str, str]] = None,
913
- ) -> models.TaxonomyModel:
914
- r"""Update Taxonomy
915
-
916
- Update an existing taxonomy's metadata
917
-
918
- **Requirements:**
919
- - Required permissions: write
920
-
921
- :param taxonomy: The ID or name of the taxonomy to update
922
- :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
923
- :param taxonomy_name: Updated taxonomy name (must not contain spaces or special characters)
924
- :param description: Updated taxonomy description
925
- :param retries: Override the default retry configuration for this method
926
- :param server_url: Override the default server URL for this method
927
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
928
- :param http_headers: Additional headers to set or replace on requests.
929
- """
930
- base_url = None
931
- url_variables = None
932
- if timeout_ms is None:
933
- timeout_ms = self.sdk_configuration.timeout_ms
934
-
935
- if server_url is not None:
936
- base_url = server_url
937
-
938
- request = models.UpdateTaxonomyV1EntitiesTaxonomiesTaxonomyPatchRequest(
939
- taxonomy=taxonomy,
940
- x_namespace=x_namespace,
941
- taxonomy_update=models.TaxonomyUpdate(
942
- taxonomy_name=taxonomy_name,
943
- description=description,
944
- ),
945
- )
946
-
947
- req = self._build_request(
948
- method="PATCH",
949
- path="/v1/entities/taxonomies/{taxonomy}",
950
- base_url=base_url,
951
- url_variables=url_variables,
952
- request=request,
953
- request_body_required=True,
954
- request_has_path_params=True,
955
- request_has_query_params=True,
956
- user_agent_header="user-agent",
957
- accept_header_value="application/json",
958
- http_headers=http_headers,
959
- security=self.sdk_configuration.security,
960
- get_serialized_body=lambda: utils.serialize_request_body(
961
- request.taxonomy_update, False, False, "json", models.TaxonomyUpdate
962
- ),
963
- timeout_ms=timeout_ms,
964
- )
965
-
966
- if retries == UNSET:
967
- if self.sdk_configuration.retry_config is not UNSET:
968
- retries = self.sdk_configuration.retry_config
969
-
970
- retry_config = None
971
- if isinstance(retries, utils.RetryConfig):
972
- retry_config = (retries, ["429", "500", "502", "503", "504"])
973
-
974
- http_res = self.do_request(
975
- hook_ctx=HookContext(
976
- operation_id="update_taxonomy_v1_entities_taxonomies__taxonomy__patch",
977
- oauth2_scopes=[],
978
- security_source=get_security_from_env(
979
- self.sdk_configuration.security, models.Security
980
- ),
981
- ),
982
- request=req,
983
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
984
- retry_config=retry_config,
985
- )
986
-
987
- data: Any = None
988
- if utils.match_response(http_res, "200", "application/json"):
989
- return utils.unmarshal_json(http_res.text, models.TaxonomyModel)
990
- if utils.match_response(
991
- http_res, ["400", "401", "403", "404"], "application/json"
992
- ):
993
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
994
- raise models.ErrorResponse(data=data)
995
- if utils.match_response(http_res, "422", "application/json"):
996
- data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
997
- raise models.HTTPValidationError(data=data)
998
- if utils.match_response(http_res, "500", "application/json"):
999
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
1000
- raise models.ErrorResponse(data=data)
1001
- if utils.match_response(http_res, "4XX", "*"):
1002
- http_res_text = utils.stream_to_text(http_res)
1003
- raise models.APIError(
1004
- "API error occurred", http_res.status_code, http_res_text, http_res
1005
- )
1006
- if utils.match_response(http_res, "5XX", "*"):
1007
- http_res_text = utils.stream_to_text(http_res)
1008
- raise models.APIError(
1009
- "API error occurred", http_res.status_code, http_res_text, http_res
1010
- )
1011
-
1012
- content_type = http_res.headers.get("Content-Type")
1013
- http_res_text = utils.stream_to_text(http_res)
1014
- raise models.APIError(
1015
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1016
- http_res.status_code,
1017
- http_res_text,
1018
- http_res,
1019
- )
1020
-
1021
- async def update_taxonomy_v1_entities_taxonomies_taxonomy_patch_async(
1022
- self,
1023
- *,
1024
- taxonomy: str,
1025
- x_namespace: OptionalNullable[str] = UNSET,
1026
- taxonomy_name: OptionalNullable[str] = UNSET,
1027
- description: OptionalNullable[str] = UNSET,
1028
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1029
- server_url: Optional[str] = None,
1030
- timeout_ms: Optional[int] = None,
1031
- http_headers: Optional[Mapping[str, str]] = None,
1032
- ) -> models.TaxonomyModel:
1033
- r"""Update Taxonomy
1034
-
1035
- Update an existing taxonomy's metadata
1036
-
1037
- **Requirements:**
1038
- - Required permissions: write
1039
-
1040
- :param taxonomy: The ID or name of the taxonomy to update
1041
- :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
1042
- :param taxonomy_name: Updated taxonomy name (must not contain spaces or special characters)
1043
- :param description: Updated taxonomy description
1044
- :param retries: Override the default retry configuration for this method
1045
- :param server_url: Override the default server URL for this method
1046
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1047
- :param http_headers: Additional headers to set or replace on requests.
1048
- """
1049
- base_url = None
1050
- url_variables = None
1051
- if timeout_ms is None:
1052
- timeout_ms = self.sdk_configuration.timeout_ms
1053
-
1054
- if server_url is not None:
1055
- base_url = server_url
1056
-
1057
- request = models.UpdateTaxonomyV1EntitiesTaxonomiesTaxonomyPatchRequest(
1058
- taxonomy=taxonomy,
1059
- x_namespace=x_namespace,
1060
- taxonomy_update=models.TaxonomyUpdate(
1061
- taxonomy_name=taxonomy_name,
1062
- description=description,
1063
- ),
1064
- )
1065
-
1066
- req = self._build_request_async(
1067
- method="PATCH",
1068
- path="/v1/entities/taxonomies/{taxonomy}",
1069
- base_url=base_url,
1070
- url_variables=url_variables,
1071
- request=request,
1072
- request_body_required=True,
1073
- request_has_path_params=True,
1074
- request_has_query_params=True,
1075
- user_agent_header="user-agent",
1076
- accept_header_value="application/json",
1077
- http_headers=http_headers,
1078
- security=self.sdk_configuration.security,
1079
- get_serialized_body=lambda: utils.serialize_request_body(
1080
- request.taxonomy_update, False, False, "json", models.TaxonomyUpdate
1081
- ),
1082
- timeout_ms=timeout_ms,
1083
- )
1084
-
1085
- if retries == UNSET:
1086
- if self.sdk_configuration.retry_config is not UNSET:
1087
- retries = self.sdk_configuration.retry_config
1088
-
1089
- retry_config = None
1090
- if isinstance(retries, utils.RetryConfig):
1091
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1092
-
1093
- http_res = await self.do_request_async(
1094
- hook_ctx=HookContext(
1095
- operation_id="update_taxonomy_v1_entities_taxonomies__taxonomy__patch",
1096
- oauth2_scopes=[],
1097
- security_source=get_security_from_env(
1098
- self.sdk_configuration.security, models.Security
1099
- ),
1100
- ),
1101
- request=req,
1102
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
1103
- retry_config=retry_config,
1104
- )
1105
-
1106
- data: Any = None
1107
- if utils.match_response(http_res, "200", "application/json"):
1108
- return utils.unmarshal_json(http_res.text, models.TaxonomyModel)
1109
- if utils.match_response(
1110
- http_res, ["400", "401", "403", "404"], "application/json"
1111
- ):
1112
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
1113
- raise models.ErrorResponse(data=data)
1114
- if utils.match_response(http_res, "422", "application/json"):
1115
- data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
1116
- raise models.HTTPValidationError(data=data)
1117
- if utils.match_response(http_res, "500", "application/json"):
1118
- data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
1119
- raise models.ErrorResponse(data=data)
1120
- if utils.match_response(http_res, "4XX", "*"):
1121
- http_res_text = await utils.stream_to_text_async(http_res)
1122
- raise models.APIError(
1123
- "API error occurred", http_res.status_code, http_res_text, http_res
1124
- )
1125
- if utils.match_response(http_res, "5XX", "*"):
1126
- http_res_text = await utils.stream_to_text_async(http_res)
1127
- raise models.APIError(
1128
- "API error occurred", http_res.status_code, http_res_text, http_res
1129
- )
1130
-
1131
- content_type = http_res.headers.get("Content-Type")
1132
- http_res_text = await utils.stream_to_text_async(http_res)
1133
- raise models.APIError(
1134
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1135
- http_res.status_code,
1136
- http_res_text,
1137
- http_res,
1138
- )
1139
-
1140
- def get_taxonomy_node_v1_entities_taxonomies_nodes_node_get(
464
+ def get_node(
1141
465
  self,
1142
466
  *,
1143
467
  node: str,
@@ -1242,7 +566,7 @@ class TaxonomyEntities(BaseSDK):
1242
566
  http_res,
1243
567
  )
1244
568
 
1245
- async def get_taxonomy_node_v1_entities_taxonomies_nodes_node_get_async(
569
+ async def get_node_async(
1246
570
  self,
1247
571
  *,
1248
572
  node: str,
@@ -1347,7 +671,7 @@ class TaxonomyEntities(BaseSDK):
1347
671
  http_res,
1348
672
  )
1349
673
 
1350
- def update_node_v1_entities_taxonomies_nodes_node_patch(
674
+ def update_node(
1351
675
  self,
1352
676
  *,
1353
677
  node: str,
@@ -1466,7 +790,7 @@ class TaxonomyEntities(BaseSDK):
1466
790
  http_res,
1467
791
  )
1468
792
 
1469
- async def update_node_v1_entities_taxonomies_nodes_node_patch_async(
793
+ async def update_node_async(
1470
794
  self,
1471
795
  *,
1472
796
  node: str,
@@ -1585,7 +909,7 @@ class TaxonomyEntities(BaseSDK):
1585
909
  http_res,
1586
910
  )
1587
911
 
1588
- def classify_features_v1_entities_taxonomies_taxonomy_classify_post(
912
+ def classify_features(
1589
913
  self,
1590
914
  *,
1591
915
  taxonomy: str,
@@ -1717,7 +1041,7 @@ class TaxonomyEntities(BaseSDK):
1717
1041
  http_res,
1718
1042
  )
1719
1043
 
1720
- async def classify_features_v1_entities_taxonomies_taxonomy_classify_post_async(
1044
+ async def classify_features_async(
1721
1045
  self,
1722
1046
  *,
1723
1047
  taxonomy: str,
@@ -1849,7 +1173,7 @@ class TaxonomyEntities(BaseSDK):
1849
1173
  http_res,
1850
1174
  )
1851
1175
 
1852
- def list_classifications_v1_entities_taxonomies_taxonomy_classifications_post(
1176
+ def list_classifications(
1853
1177
  self,
1854
1178
  *,
1855
1179
  taxonomy: str,
@@ -1999,7 +1323,7 @@ class TaxonomyEntities(BaseSDK):
1999
1323
  http_res,
2000
1324
  )
2001
1325
 
2002
- async def list_classifications_v1_entities_taxonomies_taxonomy_classifications_post_async(
1326
+ async def list_classifications_async(
2003
1327
  self,
2004
1328
  *,
2005
1329
  taxonomy: str,
@@ -2149,7 +1473,7 @@ class TaxonomyEntities(BaseSDK):
2149
1473
  http_res,
2150
1474
  )
2151
1475
 
2152
- def delete_classifications_v1_entities_taxonomies_taxonomy_classifications_classification_id_delete(
1476
+ def delete_classification(
2153
1477
  self,
2154
1478
  *,
2155
1479
  taxonomy: str,
@@ -2258,7 +1582,7 @@ class TaxonomyEntities(BaseSDK):
2258
1582
  http_res,
2259
1583
  )
2260
1584
 
2261
- async def delete_classifications_v1_entities_taxonomies_taxonomy_classifications_classification_id_delete_async(
1585
+ async def delete_classification_async(
2262
1586
  self,
2263
1587
  *,
2264
1588
  taxonomy: str,