Skip to content

Commit 3b73287

Browse files
authored
Merge pull request #307 from ynput/enhancement/support-project-bundle-name-in-bundles
Bundles: Allow to pass project bundle name to bundle methods
2 parents 372436a + 73fd84a commit 3b73287

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

ayon_api/_api.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2889,6 +2889,7 @@ def get_addon_site_settings(
28892889
def get_bundle_settings(
28902890
bundle_name: Optional[str] = None,
28912891
project_name: Optional[str] = None,
2892+
project_bundle_name: Optional[str] = None,
28922893
variant: Optional[str] = None,
28932894
site_id: Optional[str] = None,
28942895
use_site: bool = True,
@@ -2928,6 +2929,7 @@ def get_bundle_settings(
29282929
return con.get_bundle_settings(
29292930
bundle_name=bundle_name,
29302931
project_name=project_name,
2932+
project_bundle_name=project_bundle_name,
29312933
variant=variant,
29322934
site_id=site_id,
29332935
use_site=use_site,
@@ -2936,6 +2938,7 @@ def get_bundle_settings(
29362938

29372939
def get_addons_studio_settings(
29382940
bundle_name: Optional[str] = None,
2941+
project_bundle_name: Optional[str] = None,
29392942
variant: Optional[str] = None,
29402943
site_id: Optional[str] = None,
29412944
use_site: bool = True,
@@ -2951,6 +2954,8 @@ def get_addons_studio_settings(
29512954
Args:
29522955
bundle_name (Optional[str]): Name of bundle for which should be
29532956
settings received.
2957+
project_bundle_name (Optional[str]): Project bundle name for
2958+
which should be settings received.
29542959
variant (Optional[Literal['production', 'staging']]): Name of
29552960
settings variant. Used 'default_settings_variant' by default.
29562961
site_id (Optional[str]): Site id for which want to receive
@@ -2968,6 +2973,7 @@ def get_addons_studio_settings(
29682973
con = get_server_api_connection()
29692974
return con.get_addons_studio_settings(
29702975
bundle_name=bundle_name,
2976+
project_bundle_name=project_bundle_name,
29712977
variant=variant,
29722978
site_id=site_id,
29732979
use_site=use_site,
@@ -2978,6 +2984,7 @@ def get_addons_studio_settings(
29782984
def get_addons_project_settings(
29792985
project_name: str,
29802986
bundle_name: Optional[str] = None,
2987+
project_bundle_name: Optional[str] = None,
29812988
variant: Optional[str] = None,
29822989
site_id: Optional[str] = None,
29832990
use_site: bool = True,
@@ -3009,6 +3016,8 @@ def get_addons_project_settings(
30093016
received.
30103017
bundle_name (Optional[str]): Name of bundle for which should be
30113018
settings received.
3019+
project_bundle_name (Optional[str]): Project bundle name for which
3020+
should be settings received.
30123021
variant (Optional[Literal['production', 'staging']]): Name of
30133022
settings variant. Used 'default_settings_variant' by default.
30143023
site_id (Optional[str]): Site id for which want to receive
@@ -3028,6 +3037,7 @@ def get_addons_project_settings(
30283037
return con.get_addons_project_settings(
30293038
project_name=project_name,
30303039
bundle_name=bundle_name,
3040+
project_bundle_name=project_bundle_name,
30313041
variant=variant,
30323042
site_id=site_id,
30333043
use_site=use_site,
@@ -3037,6 +3047,7 @@ def get_addons_project_settings(
30373047

30383048
def get_addons_settings(
30393049
bundle_name: Optional[str] = None,
3050+
project_bundle_name: Optional[str] = None,
30403051
project_name: Optional[str] = None,
30413052
variant: Optional[str] = None,
30423053
site_id: Optional[str] = None,
@@ -3056,6 +3067,8 @@ def get_addons_settings(
30563067
Args:
30573068
bundle_name (Optional[str]): Name of bundle for which should be
30583069
settings received.
3070+
project_bundle_name (Optional[str]): Name of project bundle
3071+
for which should be settings received.
30593072
project_name (Optional[str]): Name of project for which should be
30603073
settings received.
30613074
variant (Optional[Literal['production', 'staging']]): Name of
@@ -3072,6 +3085,7 @@ def get_addons_settings(
30723085
con = get_server_api_connection()
30733086
return con.get_addons_settings(
30743087
bundle_name=bundle_name,
3088+
project_bundle_name=project_bundle_name,
30753089
project_name=project_name,
30763090
variant=variant,
30773091
site_id=site_id,

ayon_api/_api_helpers/bundles_addons.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,7 @@ def get_bundle_settings(
671671
self,
672672
bundle_name: Optional[str] = None,
673673
project_name: Optional[str] = None,
674+
project_bundle_name: Optional[str] = None,
674675
variant: Optional[str] = None,
675676
site_id: Optional[str] = None,
676677
use_site: bool = True,
@@ -714,6 +715,7 @@ def get_bundle_settings(
714715
query = prepare_query_string({
715716
"project_name": project_name or None,
716717
"bundle_name": bundle_name or None,
718+
"project_bundle_name": project_bundle_name or None,
717719
"variant": variant or self.get_default_settings_variant() or None,
718720
"site_id": site_id,
719721
})
@@ -724,6 +726,7 @@ def get_bundle_settings(
724726
def get_addons_studio_settings(
725727
self,
726728
bundle_name: Optional[str] = None,
729+
project_bundle_name: Optional[str] = None,
727730
variant: Optional[str] = None,
728731
site_id: Optional[str] = None,
729732
use_site: bool = True,
@@ -739,6 +742,8 @@ def get_addons_studio_settings(
739742
Args:
740743
bundle_name (Optional[str]): Name of bundle for which should be
741744
settings received.
745+
project_bundle_name (Optional[str]): Project bundle name for
746+
which should be settings received.
742747
variant (Optional[Literal['production', 'staging']]): Name of
743748
settings variant. Used 'default_settings_variant' by default.
744749
site_id (Optional[str]): Site id for which want to receive
@@ -755,6 +760,7 @@ def get_addons_studio_settings(
755760
"""
756761
output = self.get_bundle_settings(
757762
bundle_name=bundle_name,
763+
project_bundle_name=project_bundle_name,
758764
variant=variant,
759765
site_id=site_id,
760766
use_site=use_site
@@ -770,6 +776,7 @@ def get_addons_project_settings(
770776
self,
771777
project_name: str,
772778
bundle_name: Optional[str] = None,
779+
project_bundle_name: Optional[str] = None,
773780
variant: Optional[str] = None,
774781
site_id: Optional[str] = None,
775782
use_site: bool = True,
@@ -801,6 +808,8 @@ def get_addons_project_settings(
801808
received.
802809
bundle_name (Optional[str]): Name of bundle for which should be
803810
settings received.
811+
project_bundle_name (Optional[str]): Project bundle name for which
812+
should be settings received.
804813
variant (Optional[Literal['production', 'staging']]): Name of
805814
settings variant. Used 'default_settings_variant' by default.
806815
site_id (Optional[str]): Site id for which want to receive
@@ -822,6 +831,7 @@ def get_addons_project_settings(
822831
output = self.get_bundle_settings(
823832
project_name=project_name,
824833
bundle_name=bundle_name,
834+
project_bundle_name=project_bundle_name,
825835
variant=variant,
826836
site_id=site_id,
827837
use_site=use_site
@@ -836,6 +846,7 @@ def get_addons_project_settings(
836846
def get_addons_settings(
837847
self,
838848
bundle_name: Optional[str] = None,
849+
project_bundle_name: Optional[str] = None,
839850
project_name: Optional[str] = None,
840851
variant: Optional[str] = None,
841852
site_id: Optional[str] = None,
@@ -855,6 +866,8 @@ def get_addons_settings(
855866
Args:
856867
bundle_name (Optional[str]): Name of bundle for which should be
857868
settings received.
869+
project_bundle_name (Optional[str]): Name of project bundle
870+
for which should be settings received.
858871
project_name (Optional[str]): Name of project for which should be
859872
settings received.
860873
variant (Optional[Literal['production', 'staging']]): Name of
@@ -871,6 +884,7 @@ def get_addons_settings(
871884
if project_name is None:
872885
return self.get_addons_studio_settings(
873886
bundle_name=bundle_name,
887+
project_bundle_name=project_bundle_name,
874888
variant=variant,
875889
site_id=site_id,
876890
use_site=use_site,
@@ -880,6 +894,7 @@ def get_addons_settings(
880894
return self.get_addons_project_settings(
881895
project_name=project_name,
882896
bundle_name=bundle_name,
897+
project_bundle_name=project_bundle_name,
883898
variant=variant,
884899
site_id=site_id,
885900
use_site=use_site,

0 commit comments

Comments
 (0)