Skip to content

Commit eea6b94

Browse files
committed
SharePoint API: web namespace updates
1 parent 8d8b27a commit eea6b94

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

office365/sharepoint/sitescripts/utility.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,20 @@ def __init__(self, context):
2121
path = ResourcePath("Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility")
2222
super(SiteScriptUtility, self).__init__(context, path)
2323

24+
@staticmethod
25+
def create_list_design(context, info):
26+
"""
27+
Creates a new list design available to users when they create a new list from the SharePoint start page.
28+
29+
:param office365.sharepoint.client_context.ClientContext context: SharePoint context
30+
:param office365.sharepoint.sitedesigns.creation_info.SiteDesignCreationInfo info:
31+
"""
32+
return_type = ClientResult(context, SiteDesignMetadata())
33+
utility = SiteScriptUtility(context)
34+
qry = ServiceOperationQuery(utility, "CreateListDesign", None, info, "info", return_type, True)
35+
context.add_query(qry)
36+
return return_type
37+
2438
@staticmethod
2539
def add_site_design_task(context, web_url, site_design_id):
2640
"""
@@ -165,8 +179,7 @@ def create_site_design(context, info):
165179
"""
166180
return_type = ClientResult(context, SiteDesignMetadata())
167181
utility = SiteScriptUtility(context)
168-
qry = ServiceOperationQuery(utility, "CreateSiteDesign", None, info, "info", return_type)
169-
qry.static = True
182+
qry = ServiceOperationQuery(utility, "CreateSiteDesign", None, info, "info", return_type, True)
170183
context.add_query(qry)
171184
return return_type
172185

office365/sharepoint/webs/web.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,18 @@ def get_group_based_environment(self):
285285
self.context.add_query(qry)
286286
return return_type
287287

288-
def list_acs_service_principals(self):
288+
def get_acs_service_principals(self, app_ids=None):
289289
"""
290290
List service principals
291+
:para, list[str] appIds:
291292
"""
293+
payload = {"appIds": app_ids}
292294
return_type = ClientResult(self.context, ClientValueCollection(SPACSServicePrincipalInfo))
293-
qry = ServiceOperationQuery(self, "ListACSServicePrincipals", None, None, None, return_type)
295+
qry = ServiceOperationQuery(self, "GetACSServicePrincipals", None, payload, None, return_type)
294296
self.context.add_query(qry)
295297
return return_type
296298

299+
297300
def sync_flow_instances(self, target_web_url):
298301
"""
299302
:param str target_web_url:
@@ -315,10 +318,10 @@ def sync_flow_templates(self, category):
315318
return return_type
316319

317320
def get_all_client_side_components(self):
318-
result = ClientResult(self.context, str())
319-
qry = ServiceOperationQuery(self, "GetAllClientSideComponents", None, None, None, result)
321+
return_type = ClientResult(self.context, str())
322+
qry = ServiceOperationQuery(self, "GetAllClientSideComponents", None, None, None, return_type)
320323
self.context.add_query(qry)
321-
return result
324+
return return_type
322325

323326
def get_app_bdc_catalog(self):
324327
"""

tests/sharepoint/test_web.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def test_25_parse_datetime(self):
149149
self.assertIsNotNone(result.value)
150150

151151
def test_26_list_acs_service_principals(self):
152-
result = self.client.web.list_acs_service_principals().execute_query()
152+
result = self.client.web.get_acs_service_principals().execute_query()
153153
self.assertIsNotNone(result.value)
154154

155155
def test_27_ensure_tenant_app_catalog(self):

0 commit comments

Comments
 (0)