@@ -70,9 +70,43 @@ def rename(
7070 return server_context .make_request (url , json = payload )
7171
7272
73+ def get_containers (
74+ server_context : ServerContext ,
75+ container_path : str = None ,
76+ include_effective_permissions : bool = True ,
77+ include_subfolders : bool = False ,
78+ depth : int = 50 ,
79+ include_standard_properties : bool = True ,
80+ ):
81+ """
82+ Gets the containers for a given container_path
83+ :param server_context: a ServerContext object
84+ :param container_path: The container path to query against, defaults to the container path of the ServerContext
85+ :param include_effective_permissions: If set to false, the effective permissions for this container resource will
86+ not be included (defaults to True)
87+ :param include_subfolders: If set to true, the entire branch of containers will be returned. If false, only the
88+ immediate children of the starting container will be returned (defaults to False).
89+ :param depth: May be used to control the depth of recursion if includeSubfolders is set to true
90+ :param include_standard_properties: Includes the standard properties for containers, if f False returns a limited
91+ subset of properties: ['path', 'children', 'name', 'id'] (defaults to True)
92+ :return:
93+ """
94+ url = server_context .build_url ("project" , "getContainers.view" , container_path = container_path )
95+ payload = {
96+ "includeSubfolders" : include_subfolders ,
97+ "includeEffectivePermissions" : include_effective_permissions ,
98+ "includeStandardProperties" : include_standard_properties ,
99+ }
100+
101+ if include_subfolders :
102+ payload ["depth" ] = depth
103+
104+ return server_context .make_request (url , json = payload )
105+
106+
73107class ContainerWrapper :
74108 """
75- Wrapper for all of the API methods exposed in the container module. Used by the APIWrapper class.
109+ Wrapper for all the API methods exposed in the container module. Used by the APIWrapper class.
76110 """
77111
78112 def __init__ (self , server_context : ServerContext ):
@@ -95,6 +129,27 @@ def delete(self, container_path: str = None):
95129 return delete (self .server_context , container_path )
96130
97131 def rename (
98- self , name : str = None , title : str = None , add_alias : bool = True , container_path : str = None
132+ self ,
133+ name : str = None ,
134+ title : str = None ,
135+ add_alias : bool = True ,
136+ container_path : str = None ,
99137 ):
100138 return rename (self .server_context , name , title , add_alias , container_path )
139+
140+ def get_containers (
141+ self ,
142+ container_path : str = None ,
143+ include_effective_permissions : bool = True ,
144+ include_subfolders : bool = True ,
145+ depth : int = 50 ,
146+ include_standard_properties : bool = True ,
147+ ):
148+ return get_containers (
149+ self .server_context ,
150+ container_path ,
151+ include_effective_permissions ,
152+ include_subfolders ,
153+ depth ,
154+ include_standard_properties ,
155+ )
0 commit comments