Office365-REST-Python-Client 2.5.12__py3-none-any.whl → 2.5.14__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.
Files changed (201) hide show
  1. {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/METADATA +1 -1
  2. {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/RECORD +199 -107
  3. office365/backuprestore/root.py +39 -0
  4. office365/backuprestore/service_status.py +5 -0
  5. office365/booking/business/business.py +13 -0
  6. office365/booking/business/collection.py +8 -4
  7. office365/booking/solutions/root.py +14 -1
  8. office365/communications/callrecords/collection.py +42 -0
  9. office365/communications/callrecords/direct_routing_log_row.py +5 -0
  10. office365/communications/cloud_communications.py +2 -3
  11. office365/directory/applications/application.py +33 -2
  12. office365/directory/applications/optional_claim.py +5 -0
  13. office365/directory/applications/optional_claims.py +16 -0
  14. office365/directory/applications/required_resource_access.py +23 -0
  15. office365/directory/applications/resource_access.py +26 -0
  16. office365/directory/authentication/conditions/event_listener.py +9 -0
  17. office365/directory/authentication/methods/details.py +29 -0
  18. office365/directory/authentication/methods/root.py +8 -0
  19. office365/directory/device_local_credential_info.py +21 -0
  20. office365/directory/identities/container.py +18 -0
  21. office365/directory/permissions/scope.py +15 -3
  22. office365/directory/policies/authentication_flows.py +8 -0
  23. office365/directory/policies/authentication_strength.py +21 -0
  24. office365/directory/policies/root.py +17 -0
  25. office365/directory/policies/unified_role_management.py +7 -0
  26. office365/directory/policies/update_allowed_combinations_result.py +5 -0
  27. office365/directory/protection/policy/__init__.py +0 -0
  28. office365/directory/protection/policy/base.py +24 -0
  29. office365/directory/protection/policy/one_drive_for_business.py +10 -0
  30. office365/directory/security/alerts/evidence.py +2 -1
  31. office365/directory/security/alerts/malware_evidence.py +5 -0
  32. office365/directory/security/alerts/process_evidence.py +5 -0
  33. office365/directory/security/attacksimulations/user.py +5 -0
  34. office365/directory/security/attacksimulations/user_coverage.py +3 -0
  35. office365/directory/security/attacksimulations/users/details.py +12 -0
  36. office365/directory/serviceprincipals/service_principal.py +118 -18
  37. office365/directory/users/user.py +23 -3
  38. office365/graph_client.py +3 -1
  39. office365/intune/devices/management/management.py +26 -0
  40. office365/intune/devices/management/terms_and_conditions.py +10 -0
  41. office365/intune/devices/management/virtual_endpoint.py +8 -0
  42. office365/onedrive/driveitems/driveItem.py +1 -1
  43. office365/onedrive/driveitems/retention_label.py +33 -0
  44. office365/onedrive/driveitems/retention_label_settings.py +7 -0
  45. office365/onedrive/sitepages/base.py +3 -0
  46. office365/onedrive/sitepages/collection.py +12 -0
  47. office365/onedrive/sitepages/site_page.py +9 -9
  48. office365/onedrive/sites/archival_details.py +5 -0
  49. office365/onedrive/sites/site_collection.py +10 -1
  50. office365/onedrive/workbooks/functions/functions.py +23 -0
  51. office365/partners/__init__.py +0 -0
  52. office365/partners/billing/__init__.py +0 -0
  53. office365/planner/tasks/check_list_item.py +5 -1
  54. office365/runtime/client_object.py +24 -8
  55. office365/runtime/client_object_collection.py +4 -4
  56. office365/runtime/client_result.py +21 -2
  57. office365/runtime/client_value.py +1 -1
  58. office365/runtime/csom/request.py +11 -0
  59. office365/runtime/odata/v4/batch_request.py +12 -15
  60. office365/runtime/types/exceptions.py +18 -0
  61. office365/search/acronym.py +10 -0
  62. office365/search/aggregation_option.py +6 -0
  63. office365/search/answer.py +9 -0
  64. office365/search/entity.py +67 -14
  65. office365/search/entity_type.py +28 -0
  66. office365/search/request.py +32 -3
  67. office365/sharepoint/apps/access_requests.py +5 -0
  68. office365/sharepoint/apps/context_site.py +41 -0
  69. office365/sharepoint/apps/management/__init__.py +0 -0
  70. office365/sharepoint/apps/management/principal_info.py +9 -0
  71. office365/sharepoint/authpolicy/events/collection.py +39 -0
  72. office365/sharepoint/authpolicy/events/{auth_event.py → event.py} +1 -0
  73. office365/sharepoint/authpolicy/events/role_assignment_resource_payload.py +9 -0
  74. office365/sharepoint/brandcenter/__init__.py +0 -0
  75. office365/sharepoint/brandcenter/brand_center.py +9 -0
  76. office365/sharepoint/brandcenter/configuration.py +5 -0
  77. office365/sharepoint/changes/change.py +1 -3
  78. office365/sharepoint/changes/collection.py +3 -0
  79. office365/sharepoint/changes/folder.py +6 -0
  80. office365/sharepoint/changes/group.py +3 -0
  81. office365/sharepoint/changes/list.py +13 -0
  82. office365/sharepoint/changes/view.py +25 -0
  83. office365/sharepoint/client_context.py +19 -1
  84. office365/sharepoint/contenttypes/fieldlinks/collection.py +3 -0
  85. office365/sharepoint/copilot/__init__.py +0 -0
  86. office365/sharepoint/copilot/file_collection.py +27 -0
  87. office365/sharepoint/copilot/file_collection_query_result.py +10 -0
  88. office365/sharepoint/copilot/list_item_extensions.py +5 -0
  89. office365/sharepoint/directory/provider/alternate_id_data.py +5 -0
  90. office365/sharepoint/directory/provider/notification.py +8 -0
  91. office365/sharepoint/directory/provider/object_changes.py +5 -0
  92. office365/sharepoint/directory/provider/object_data.py +26 -3
  93. office365/sharepoint/directory/provider/provider.py +1 -0
  94. office365/sharepoint/directory/provider/session_data.py +9 -0
  95. office365/sharepoint/documentmanagement/document_id.py +28 -3
  96. office365/sharepoint/files/file.py +11 -4
  97. office365/sharepoint/files/versions/event.py +9 -0
  98. office365/sharepoint/flows/permissions.py +30 -0
  99. office365/sharepoint/listhome/favorite_item.py +9 -0
  100. office365/sharepoint/listitems/listitem.py +79 -4
  101. office365/sharepoint/listitems/update_parameters.py +4 -1
  102. office365/sharepoint/lists/data_parameters.py +5 -0
  103. office365/sharepoint/lists/exporter.py +73 -0
  104. office365/sharepoint/lists/list.py +157 -7
  105. office365/sharepoint/lists/render_data_parameters.py +31 -0
  106. office365/sharepoint/lists/version_policy_manager.py +5 -0
  107. office365/sharepoint/logger/log_export.py +2 -0
  108. office365/sharepoint/migration/copy_migration_options.py +5 -0
  109. office365/sharepoint/migrationcenter/service/performance/data.py +5 -5
  110. office365/sharepoint/multigeo/services.py +24 -0
  111. office365/sharepoint/navigation/menu_node.py +43 -1
  112. office365/sharepoint/navigation/node_collection.py +1 -1
  113. office365/sharepoint/oauth/token.py +22 -0
  114. office365/sharepoint/oauth/token_response.py +5 -0
  115. office365/sharepoint/portal/groups/site_manager.py +32 -0
  116. office365/sharepoint/portal/project/__init__.py +9 -0
  117. office365/sharepoint/portal/userprofiles/documentsshared/__init__.py +0 -0
  118. office365/sharepoint/portal/userprofiles/documentsshared/with_group.py +38 -0
  119. office365/sharepoint/portal/userprofiles/documentsshared/with_person.py +9 -0
  120. office365/sharepoint/portal/userprofiles/sharedwithme/__init__.py +0 -0
  121. office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/document.py +1 -1
  122. office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/items.py +3 -1
  123. office365/sharepoint/publishing/pages/campaign_publication.py +10 -0
  124. office365/sharepoint/publishing/pages/coauth_state.py +8 -0
  125. office365/sharepoint/publishing/pages/page.py +11 -0
  126. office365/sharepoint/publishing/pages/stream_content.py +9 -0
  127. office365/sharepoint/publishing/pages/stream_data.py +8 -0
  128. office365/sharepoint/quotamanagement/consumer/non_quota_backfill_api.py +8 -0
  129. office365/sharepoint/request.py +3 -0
  130. office365/sharepoint/search/administration/site_content_processing_info_provider.py +11 -0
  131. office365/sharepoint/search/ranking_labeling.py +1 -0
  132. office365/sharepoint/search/reports/abandonedqueries/__init__.py +0 -0
  133. office365/sharepoint/search/reports/abandonedqueries/data.py +0 -0
  134. office365/sharepoint/search/reports/abandonedqueries/item.py +5 -0
  135. office365/sharepoint/search/reports/noresult/__init__.py +0 -0
  136. office365/sharepoint/search/reports/numberofqueries/__init__.py +0 -0
  137. office365/sharepoint/search/reports/top_queries.py +7 -0
  138. office365/sharepoint/search/reports/topqueries/__init__.py +0 -0
  139. office365/sharepoint/search/reports/topqueries/data.py +9 -0
  140. office365/sharepoint/search/reports/topqueries/item.py +15 -0
  141. office365/sharepoint/search/scs_endpoint.py +9 -0
  142. office365/sharepoint/securestore/target_application.py +10 -0
  143. office365/sharepoint/sharing/document_manager.py +3 -3
  144. office365/sharepoint/sharing/inherited_from.py +5 -0
  145. office365/sharepoint/sharing/internal/__init__.py +0 -0
  146. office365/sharepoint/sharing/internal/sharing_restrictions.py +22 -0
  147. office365/sharepoint/sharing/internal/types.py +17 -0
  148. office365/sharepoint/sharing/link_info.py +24 -0
  149. office365/sharepoint/sharing/result.py +21 -0
  150. office365/sharepoint/sites/html_field_security_setting.py +5 -0
  151. office365/sharepoint/sites/site.py +39 -1
  152. office365/sharepoint/sites/version_policy_manager.py +33 -0
  153. office365/sharepoint/sitescripts/metadata.py +28 -3
  154. office365/sharepoint/sitescripts/utility.py +17 -0
  155. office365/sharepoint/smartcache/__init__.py +0 -0
  156. office365/sharepoint/smartcache/item.py +9 -0
  157. office365/sharepoint/tenant/administration/app_billing_properties.py +21 -0
  158. office365/sharepoint/tenant/administration/insights/summary_response.py +8 -0
  159. office365/sharepoint/tenant/administration/internal/aad/__init__.py +0 -0
  160. office365/sharepoint/tenant/administration/internal/aad/permission_grant.py +32 -0
  161. office365/sharepoint/tenant/administration/internal/appservice/__init__.py +0 -0
  162. office365/sharepoint/tenant/administration/internal/appservice/permission_grant.py +5 -0
  163. office365/sharepoint/tenant/administration/internal/{permission_grant.py → appservice/permission_request.py} +4 -2
  164. office365/sharepoint/tenant/administration/internal/appservice/principal.py +104 -0
  165. office365/sharepoint/tenant/administration/policies/__init__.py +0 -0
  166. office365/sharepoint/tenant/administration/policies/definition.py +5 -0
  167. office365/sharepoint/tenant/administration/settings_service.py +12 -1
  168. office365/sharepoint/tenant/administration/sites/creation_source.py +8 -8
  169. office365/sharepoint/tenant/administration/sites/properties.py +45 -0
  170. office365/sharepoint/tenant/administration/tenant.py +124 -4
  171. office365/sharepoint/tenant/administration/types.py +29 -1
  172. office365/sharepoint/tenant/cdn_api.py +3 -1
  173. office365/sharepoint/tenant/management/office365_tenant.py +2 -0
  174. office365/sharepoint/tenant/settings.py +10 -0
  175. office365/sharepoint/utilities/utility.py +6 -0
  176. office365/sharepoint/utilities/wopi_host.py +45 -0
  177. office365/sharepoint/viva/connections_page.py +8 -0
  178. office365/sharepoint/viva/dashboard_configuration.py +8 -0
  179. office365/sharepoint/viva/employee_engagement.py +39 -1
  180. office365/sharepoint/viva/resource_get_endpoint.py +8 -0
  181. office365/sharepoint/viva/resource_link.py +8 -0
  182. office365/sharepoint/webs/information.py +66 -1
  183. office365/sharepoint/webs/regional_settings.py +38 -0
  184. office365/sharepoint/webs/templates/__init__.py +0 -0
  185. office365/sharepoint/webs/time_zone.py +1 -1
  186. office365/sharepoint/webs/web.py +114 -0
  187. office365/sharepoint/workflow/definition.py +5 -0
  188. office365/sharepoint/workflow/task.py +5 -0
  189. office365/sharepoint/workflowservices/deployment_service.py +23 -0
  190. office365/subscriptions/collection.py +16 -0
  191. office365/teams/members/settings.py +2 -2
  192. office365/sharepoint/portal/userprofiles/documents_shared_with_group.py +0 -11
  193. office365/sharepoint/tenant/administration/internal/web_appservice_principal.py +0 -23
  194. {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/LICENSE +0 -0
  195. {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/WHEEL +0 -0
  196. {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/top_level.txt +0 -0
  197. /office365/{sharepoint/userprofiles/sharedwithme → backuprestore}/__init__.py +0 -0
  198. /office365/sharepoint/portal/userprofiles/{documents_shared_with_me.py → documentsshared/with_me.py} +0 -0
  199. /office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/document_user.py +0 -0
  200. /office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/item_collection.py +0 -0
  201. /office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/view_item_removal_result.py +0 -0
@@ -0,0 +1,73 @@
1
+ import json
2
+ from typing import IO, AnyStr, Callable
3
+
4
+ from typing_extensions import Self
5
+
6
+ from office365.runtime.client_result import ClientResult
7
+ from office365.sharepoint.files.system_object_type import FileSystemObjectType
8
+ from office365.sharepoint.listitems.collection import ListItemCollection
9
+ from office365.sharepoint.listitems.listitem import ListItem
10
+ from office365.sharepoint.lists.list import List
11
+
12
+
13
+ class ListExporter(object):
14
+
15
+ @staticmethod
16
+ def export(
17
+ source_list, destination_file, include_content=False, item_exported=None
18
+ ):
19
+ # type: (List, IO, bool, Callable[[ListItem], None]) -> Self
20
+ """Exports SharePoint List"""
21
+ import zipfile
22
+
23
+ def _append_file(name, data):
24
+ with zipfile.ZipFile(
25
+ destination_file.name, "a", zipfile.ZIP_DEFLATED
26
+ ) as zf:
27
+ zf.writestr(name, data)
28
+
29
+ def _download_content(list_item):
30
+ # type: (ListItem) -> None
31
+ def _after_downloaded(result):
32
+ # type: (ClientResult[AnyStr]) -> None
33
+ item_path = list_item.properties["FileRef"].replace(
34
+ source_list.root_folder.serverRelativeUrl, ""
35
+ )
36
+ _append_file(item_path, result.value)
37
+
38
+ list_item.file.get_content().after_execute(_after_downloaded)
39
+
40
+ def _export_items(items):
41
+ # type: (ListItemCollection) -> None
42
+
43
+ for item in items:
44
+ item_path = str(item.id) + ".json"
45
+
46
+ if item.file_system_object_type == FileSystemObjectType.File:
47
+ _append_file(item_path, json.dumps(item.to_json()))
48
+
49
+ if include_content:
50
+ _download_content(item)
51
+
52
+ if callable(item_exported):
53
+ item_exported(item)
54
+
55
+ def _get_items():
56
+ (
57
+ source_list.items.select(
58
+ [
59
+ "*",
60
+ "Id",
61
+ "FileRef",
62
+ "FileDirRef",
63
+ "FileLeafRef",
64
+ "FileSystemObjectType",
65
+ ]
66
+ )
67
+ .get()
68
+ .paged(page_loaded=_export_items)
69
+ )
70
+
71
+ source_list.ensure_properties(["SchemaXml", "RootFolder"], _get_items)
72
+
73
+ return source_list
@@ -1,6 +1,8 @@
1
1
  import os
2
2
  from datetime import datetime
3
- from typing import TYPE_CHECKING, AnyStr, Dict, Optional
3
+ from typing import IO, TYPE_CHECKING, AnyStr, Callable, Dict, Optional
4
+
5
+ from typing_extensions import Self
4
6
 
5
7
  from office365.runtime.client_result import ClientResult
6
8
  from office365.runtime.client_value_collection import ClientValueCollection
@@ -19,6 +21,7 @@ from office365.sharepoint.eventreceivers.definition_collection import (
19
21
  EventReceiverDefinitionCollection,
20
22
  )
21
23
  from office365.sharepoint.fields.collection import FieldCollection
24
+ from office365.sharepoint.fields.field import Field
22
25
  from office365.sharepoint.fields.related_field_collection import RelatedFieldCollection
23
26
  from office365.sharepoint.files.checked_out_file_collection import (
24
27
  CheckedOutFileCollection,
@@ -40,7 +43,9 @@ from office365.sharepoint.listitems.listitem import ListItem
40
43
  from office365.sharepoint.lists.bloom_filter import ListBloomFilter
41
44
  from office365.sharepoint.lists.creatables_info import CreatablesInfo
42
45
  from office365.sharepoint.lists.data_source import ListDataSource
46
+ from office365.sharepoint.lists.render_data_parameters import RenderListDataParameters
43
47
  from office365.sharepoint.lists.rule import SPListRule
48
+ from office365.sharepoint.lists.version_policy_manager import VersionPolicyManager
44
49
  from office365.sharepoint.navigation.configured_metadata_items import (
45
50
  ConfiguredMetadataNavigationItemCollection,
46
51
  )
@@ -77,6 +82,13 @@ class List(SecurableObject):
77
82
  def __repr__(self):
78
83
  return self.id or self.title or self.entity_type_name
79
84
 
85
+ def export(self, local_file, include_content=False, item_exported=None):
86
+ # type: (IO, bool, Callable[[ListItem|File|Folder], None]) -> Self
87
+ """Exports SharePoint List"""
88
+ from office365.sharepoint.lists.exporter import ListExporter
89
+
90
+ return ListExporter.export(self, local_file, include_content, item_exported)
91
+
80
92
  def clear(self):
81
93
  """Clears the list."""
82
94
 
@@ -125,6 +137,7 @@ class List(SecurableObject):
125
137
  return self
126
138
 
127
139
  def get_async_action_config(self):
140
+ """ """
128
141
  return_type = ClientResult(self.context)
129
142
  qry = ServiceOperationQuery(
130
143
  self, "GetAsyncActionConfig", return_type=return_type
@@ -200,6 +213,16 @@ class List(SecurableObject):
200
213
  self.ensure_property("RootFolder", _list_loaded)
201
214
  return return_type
202
215
 
216
+ def ensure_signoff_status_field(self):
217
+ """"""
218
+ return_type = Field(self.context)
219
+ self.fields.add_child(return_type)
220
+ qry = ServiceOperationQuery(
221
+ self, "EnsureSignoffStatusField", None, None, None, return_type
222
+ )
223
+ self.context.add_query(qry)
224
+ return return_type
225
+
203
226
  def get_all_rules(self):
204
227
  """Retrieves rules of a List"""
205
228
  return_type = ClientResult(self.context, ClientValueCollection(SPListRule))
@@ -329,25 +352,72 @@ class List(SecurableObject):
329
352
  return return_type
330
353
 
331
354
  @staticmethod
332
- def get_list_data_as_stream(context, list_full_url, parameters=None):
355
+ def get_list_data_as_stream(
356
+ context,
357
+ list_full_url,
358
+ parameters=None,
359
+ casc_del_warn_message=None,
360
+ custom_action=None,
361
+ drill_down=None,
362
+ field=None,
363
+ field_internal_name=None,
364
+ return_type=None,
365
+ ):
333
366
  """
334
367
  Returns list data from the specified list url and for the specified query parameters.
335
368
 
336
369
  :param office365.sharepoint.client_context.ClientContext context: Client context
337
370
  :param str list_full_url: The absolute URL of the list.
338
371
  :param RenderListDataParameters parameters: The parameters to be used.
339
- """
340
- result = ClientResult(context)
372
+ :param str casc_del_warn_message:
373
+ :param str custom_action:
374
+ :param str drill_down:
375
+ :param str field:
376
+ :param str field_internal_name:
377
+ :param ClientResult[dict] return_type: The return type.
378
+ """
379
+ if return_type is None:
380
+ return_type = ClientResult(context, dict())
341
381
  payload = {
342
382
  "listFullUrl": list_full_url,
343
383
  "parameters": parameters,
384
+ "CascDelWarnMessage": casc_del_warn_message,
385
+ "CustomAction": custom_action,
386
+ "DrillDown": drill_down,
387
+ "Field": field,
388
+ "FieldInternalName": field_internal_name,
389
+ }
390
+ qry = ServiceOperationQuery(
391
+ List(context), "GetListDataAsStream", None, payload, None, return_type, True
392
+ )
393
+ context.add_query(qry)
394
+ return return_type
395
+
396
+ @staticmethod
397
+ def get_onedrive_list_data_as_stream(context, parameters=None, return_type=None):
398
+ """
399
+ Returns list data from the specified list url and for the specified query parameters.
400
+
401
+ :param office365.sharepoint.client_context.ClientContext context: Client context
402
+ :param RenderListDataParameters parameters: The parameters to be used.
403
+ :param ClientResult[dict] return_type: The return type.
404
+ """
405
+ if return_type is None:
406
+ return_type = ClientResult(context, dict())
407
+ payload = {
408
+ "parameters": parameters,
344
409
  }
345
- target_list = context.web.get_list(list_full_url)
346
410
  qry = ServiceOperationQuery(
347
- target_list, "GetListDataAsStream", None, payload, None, result
411
+ List(context),
412
+ "GetOneDriveListDataAsStream",
413
+ None,
414
+ payload,
415
+ None,
416
+ return_type,
417
+ True,
348
418
  )
349
419
  context.add_query(qry)
350
- return result
420
+ return return_type
351
421
 
352
422
  def bulk_validate_update_list_items(
353
423
  self,
@@ -387,6 +457,7 @@ class List(SecurableObject):
387
457
 
388
458
  def get_lookup_field_choices(self, target_field_name, paging_info=None):
389
459
  """
460
+ Retrieves the possible choices or values for a lookup field in a SharePoint list
390
461
  :param str target_field_name:
391
462
  :param str paging_info:
392
463
  """
@@ -648,6 +719,31 @@ class List(SecurableObject):
648
719
  self.context.add_query(qry)
649
720
  return return_type
650
721
 
722
+ def render_list_data_as_stream(
723
+ self, view_xml=None, render_options=None, expand_groups=None
724
+ ):
725
+ """Returns the data for the specified query view.
726
+
727
+ :param str view_xml: Specifies the CAML view XML.
728
+ :param int render_options: Specifies the type of output to return.
729
+ :param bool expand_groups: Specifies whether to expand the grouping or not.
730
+ """
731
+ return_type = ClientResult(self.context, dict())
732
+ if view_xml is None:
733
+ view_xml = "<View/>"
734
+ payload = {
735
+ "parameters": RenderListDataParameters(
736
+ view_xml=view_xml,
737
+ render_options=render_options,
738
+ expand_groups=expand_groups,
739
+ ),
740
+ }
741
+ qry = ServiceOperationQuery(
742
+ self, "RenderListDataAsStream", None, payload, None, return_type
743
+ )
744
+ self.context.add_query(qry)
745
+ return return_type
746
+
651
747
  def reserve_list_item_id(self):
652
748
  # type: () -> ClientResult[int]
653
749
  """Reserves the returned list item identifier for the idempotent creation of a list item."""
@@ -688,6 +784,17 @@ class List(SecurableObject):
688
784
  self.context.add_query(qry)
689
785
  return return_type
690
786
 
787
+ def reset_doc_id(self):
788
+ """"""
789
+ from office365.sharepoint.documentmanagement.document_id import DocumentId
790
+
791
+ def _loaded():
792
+ doc_mng = DocumentId(self.context)
793
+ doc_mng.reset_doc_ids_in_library(self.root_folder.serverRelativeUrl)
794
+
795
+ self.ensure_property("RootFolder", _loaded)
796
+ return self
797
+
691
798
  @property
692
799
  def id(self):
693
800
  # type: () -> Optional[str]
@@ -953,6 +1060,34 @@ class List(SecurableObject):
953
1060
  """ """
954
1061
  return self.properties.get("HasContentAssemblyTemplates", None)
955
1062
 
1063
+ @property
1064
+ def has_external_data_source(self):
1065
+ # type: () -> Optional[bool]
1066
+ """
1067
+ Specifies whether the list is an external list.
1068
+ """
1069
+ return self.properties.get("HasExternalDataSource", None)
1070
+
1071
+ @property
1072
+ def has_folder_coloring_fields(self):
1073
+ # type: () -> Optional[bool]
1074
+ """ """
1075
+ return self.properties.get("HasFolderColoringFields", None)
1076
+
1077
+ @property
1078
+ def irm_enabled(self):
1079
+ # type: () -> Optional[bool]
1080
+ """Gets a Boolean value that specifies whether Information Rights Management (IRM) is enabled for the list."""
1081
+ return self.properties.get("IrmEnabled", None)
1082
+
1083
+ @property
1084
+ def irm_expire(self):
1085
+ # type: () -> Optional[bool]
1086
+ """Gets a Boolean value that specifies whether Information Rights Management (IRM) expiration is enabled
1087
+ for the list
1088
+ """
1089
+ return self.properties.get("IrmExpire", None)
1090
+
956
1091
  @property
957
1092
  def items(self):
958
1093
  # type: () -> ListItemCollection
@@ -1065,6 +1200,16 @@ class List(SecurableObject):
1065
1200
  ),
1066
1201
  )
1067
1202
 
1203
+ @property
1204
+ def version_policies(self):
1205
+ """ """
1206
+ return self.properties.get(
1207
+ "VersionPolicies",
1208
+ VersionPolicyManager(
1209
+ self.context, ResourcePath("VersionPolicies", self.resource_path)
1210
+ ),
1211
+ )
1212
+
1068
1213
  @property
1069
1214
  def custom_action_elements(self):
1070
1215
  return self.properties.get(
@@ -1345,6 +1490,7 @@ class List(SecurableObject):
1345
1490
  "RootFolder": self.root_folder,
1346
1491
  "TitleResource": self.title_resource,
1347
1492
  "UserCustomActions": self.user_custom_actions,
1493
+ "VersionPolicies": self.version_policies,
1348
1494
  }
1349
1495
  default_value = property_mapping.get(name, None)
1350
1496
  return super(List, self).get_property(name, default_value)
@@ -1357,4 +1503,8 @@ class List(SecurableObject):
1357
1503
  self._resource_path = self.parent_collection.get_by_id(
1358
1504
  value
1359
1505
  ).resource_path
1506
+ elif name == "Url":
1507
+ self._resource_path = ServiceOperationPath(
1508
+ "getList", [value], self.context.web.resource_path
1509
+ )
1360
1510
  return self
@@ -1,6 +1,25 @@
1
1
  from office365.runtime.client_value import ClientValue
2
2
 
3
3
 
4
+ class RenderListDataOptions:
5
+ """The type of data to return when rendering a list view as JSON."""
6
+
7
+ """Default render type."""
8
+ None_ = 0
9
+
10
+ """ Returns the list data context information. """
11
+ ContextInfo = 1
12
+
13
+ """ Returns the list data. """
14
+ ListData = 2
15
+
16
+ """ Returns the list schema. """
17
+ ListSchema = 4
18
+
19
+ """ Returns the menu view of the list. """
20
+ MenuView = 8
21
+
22
+
4
23
  class RenderListDataParameters(ClientValue):
5
24
  """Specifies the parameters to be used to render list data as a JSON string"""
6
25
 
@@ -16,6 +35,10 @@ class RenderListDataParameters(ClientValue):
16
35
  expand_groups=None,
17
36
  expand_user_field=None,
18
37
  filter_out_channel_folders_in_default_doc_lib=None,
38
+ render_options=None,
39
+ require_folder_coloring_fields=None,
40
+ show_stub_file=None,
41
+ view_xml=None,
19
42
  ):
20
43
  """
21
44
  :param bool add_all_fields:
@@ -29,6 +52,10 @@ class RenderListDataParameters(ClientValue):
29
52
  :param bool expand_groups: Specifies whether to expand the grouping or not.
30
53
  :param bool expand_user_field:
31
54
  :param bool filter_out_channel_folders_in_default_doc_lib:
55
+ :param int render_options: Specifies the type of output to return.
56
+ :param bool require_folder_coloring_fields:
57
+ :param bool show_stub_file:
58
+ :param str view_xml: Specifies the CAML view XML.
32
59
  """
33
60
  self.AddAllFields = add_all_fields
34
61
  self.AddAllViewFields = add_all_view_fields
@@ -44,6 +71,10 @@ class RenderListDataParameters(ClientValue):
44
71
  self.FilterOutChannelFoldersInDefaultDocLib = (
45
72
  filter_out_channel_folders_in_default_doc_lib
46
73
  )
74
+ self.RenderOptions = render_options
75
+ self.RequireFolderColoringFields = require_folder_coloring_fields
76
+ self.ShowStubFile = show_stub_file
77
+ self.ViewXml = view_xml
47
78
 
48
79
  @property
49
80
  def entity_type_name(self):
@@ -0,0 +1,5 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class VersionPolicyManager(Entity):
5
+ """ """
@@ -14,12 +14,14 @@ class LogExport(Entity):
14
14
  )
15
15
 
16
16
  def get_files(self):
17
+ """ """
17
18
  return_type = LogFileInfoCollection(self.context)
18
19
  qry = ServiceOperationQuery(self, "GetFiles", None, None, None, return_type)
19
20
  self.context.add_query(qry)
20
21
  return return_type
21
22
 
22
23
  def get_log_types(self):
24
+ """ """
23
25
  return_type = ClientResult(self.context)
24
26
  qry = ServiceOperationQuery(self, "GetLogTypes", None, None, None, return_type)
25
27
  self.context.add_query(qry)
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class CopyMigrationOptions(ClientValue):
5
+ """ """
@@ -31,14 +31,14 @@ class PerformanceDataCollection(EntityCollection[PerformanceData]):
31
31
  context, PerformanceData, resource_path
32
32
  )
33
33
 
34
- def get_data(self, StartTime=None, EndTime=None, AgentId=None, TimeUnit=None):
34
+ def get_data(self, start_time=None, end_time=None, agent_id=None, time_unit=None):
35
35
  """ """
36
36
  return_type = ClientResult(self.context, PerformanceDashboardData())
37
37
  payload = {
38
- "StartTime": StartTime,
39
- "EndTime": EndTime,
40
- "AgentId": AgentId,
41
- "TimeUnit": TimeUnit,
38
+ "StartTime": start_time,
39
+ "EndTime": end_time,
40
+ "AgentId": agent_id,
41
+ "TimeUnit": time_unit,
42
42
  }
43
43
  qry = ServiceOperationQuery(self, "GetData", None, payload, None, return_type)
44
44
  self.context.add_query(qry)
@@ -1,7 +1,11 @@
1
1
  from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
2
3
  from office365.sharepoint.entity import Entity
3
4
  from office365.sharepoint.entity_collection import EntityCollection
4
5
  from office365.sharepoint.multigeo.unified_group import UnifiedGroup
6
+ from office365.sharepoint.multigeo.user_personal_site_location import (
7
+ UserPersonalSiteLocation,
8
+ )
5
9
 
6
10
 
7
11
  class MultiGeoServices(Entity):
@@ -15,6 +19,26 @@ class MultiGeoServices(Entity):
15
19
  data residency requirements.
16
20
  """
17
21
 
22
+ def __init__(self, context):
23
+ static_path = ResourcePath(
24
+ "Microsoft.Online.SharePoint.MultiGeo.Service.MultiGeoServicesBeta"
25
+ )
26
+ super(MultiGeoServices, self).__init__(context, static_path)
27
+
28
+ def user_personal_site_location(self, user_principal_name):
29
+ # type: (str) -> UserPersonalSiteLocation
30
+ return_type = UserPersonalSiteLocation(self.context)
31
+ qry = ServiceOperationQuery(
32
+ self,
33
+ "UserPersonalSiteLocation",
34
+ [user_principal_name],
35
+ None,
36
+ None,
37
+ return_type,
38
+ )
39
+ self.context.add_query(qry)
40
+ return return_type
41
+
18
42
  @property
19
43
  def unified_groups(self):
20
44
  # type: () -> EntityCollection[UnifiedGroup]
@@ -1,15 +1,57 @@
1
1
  from office365.runtime.client_value import ClientValue
2
+ from office365.runtime.client_value_collection import ClientValueCollection
3
+ from office365.sharepoint.translation.resource_entry import SPResourceEntry
2
4
 
3
5
 
4
6
  class MenuNode(ClientValue):
5
7
  """Represents a navigation node in the navigation hierarchy. A navigation hierarchy is a tree structure of
6
8
  navigation nodes."""
7
9
 
8
- def __init__(self, current_lcid=None, title=None):
10
+ def __init__(
11
+ self,
12
+ audience_ids=None,
13
+ current_lcid=None,
14
+ title=None,
15
+ is_deleted=None,
16
+ is_hidden=None,
17
+ key=None,
18
+ nodes=None,
19
+ node_type=None,
20
+ open_in_new_window=None,
21
+ simple_url=None,
22
+ translations=None,
23
+ ):
9
24
  """
25
+ :param list[str] audience_ids:
10
26
  :param int current_lcid:
11
27
  :param str title: Specifies the title of the navigation node. The value is in the preferred language of the
12
28
  user, if available, or is in the default language of the site (2) as a fallback.
29
+ :param int node_type: Specifies the type of the navigation node.
30
+ :param bool is_deleted: A client MUST use this property set to TRUE to indicate that this node MUST be
31
+ deleted by the server. When set to TRUE the server MUST delete the node including all the child nodes
32
+ when present. When set to FALSE the server SHOULD NOT delete this node.
33
+ :param bool is_hidden: Specifies whether the node will be hidden in the navigation menu. During editing,
34
+ all nodes temporarily become visible so that they can be edited.
35
+ :param str key: Specifies the identifier for the navigation node in the menu tree. If the navigation node does
36
+ not exist on the protocol server, this value MUST be an empty string.
37
+ :param list[MenuNode] nodes:
38
+ :param bool open_in_new_window:
39
+ :param str simple_url: If the NodeType (section 3.2.5.244.1.1.7) property is set to "SimpleLink",
40
+ this property represents the URL of the navigation node. The URL can be relative or absolute.
41
+ If the value is a relative URL, it can begin with URL tokens "~site" and "~sitecollection".
42
+ These tokens indicate that the URL is either relative to the site (2) or to the site collection
43
+ respectively. If the NodeType (section 3.2.5.244.1.1.7) property is not set to "SimpleLink",
44
+ the value MUST be an empty string.
45
+ :param list[SPResourceEntry] translations:
13
46
  """
47
+ self.AudienceIds = audience_ids
14
48
  self.CurrentLCID = current_lcid
49
+ self.IsDeleted = is_deleted
50
+ self.IsHidden = is_hidden
51
+ self.Key = key
52
+ self.Nodes = ClientValueCollection(MenuNode, nodes)
53
+ self.NodeType = node_type
54
+ self.OpenInNewWindow = open_in_new_window
55
+ self.SimpleUrl = simple_url
15
56
  self.Title = title
57
+ self.Translations = ClientValueCollection(SPResourceEntry, translations)
@@ -39,7 +39,7 @@ class NavigationNodeCollection(EntityCollection[NavigationNode]):
39
39
  :param int previous_node_id: Identifier of the navigation node after which the node identified by nodeId moves to
40
40
  """
41
41
  params = {"nodeId": node_id, "previousNodeId": previous_node_id}
42
- qry = ServiceOperationQuery(self, "GetByIndex", params)
42
+ qry = ServiceOperationQuery(self, "MoveAfter", params)
43
43
  self.context.add_query(qry)
44
44
  return self
45
45
 
@@ -0,0 +1,22 @@
1
+ from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
3
+ from office365.sharepoint.entity import Entity
4
+ from office365.sharepoint.oauth.token_response import TokenResponse
5
+
6
+
7
+ class Token(Entity):
8
+ """"""
9
+
10
+ def __init__(self, context):
11
+ super(Token, self).__init__(context, ResourcePath("SP.OAuth.Token"))
12
+
13
+ def acquire(self):
14
+ """ """
15
+ return_type = TokenResponse(self.context)
16
+ qry = ServiceOperationQuery(self, "Acquire", return_type=return_type)
17
+ self.context.add_query(qry)
18
+ return return_type
19
+
20
+ @property
21
+ def entity_type_name(self):
22
+ return "SP.OAuth.Token"
@@ -0,0 +1,5 @@
1
+ from office365.entity import Entity
2
+
3
+
4
+ class TokenResponse(Entity):
5
+ """ """
@@ -4,6 +4,7 @@ from office365.runtime.http.http_method import HttpMethod
4
4
  from office365.runtime.http.request_options import RequestOptions
5
5
  from office365.runtime.paths.resource_path import ResourcePath
6
6
  from office365.runtime.queries.service_operation import ServiceOperationQuery
7
+ from office365.sharepoint.portal.channels.info_collection import ChannelInfoCollection
7
8
  from office365.sharepoint.portal.groups.creation_context import GroupCreationContext
8
9
  from office365.sharepoint.portal.groups.creation_information import (
9
10
  GroupCreationInformation,
@@ -15,12 +16,17 @@ from office365.sharepoint.portal.teams.recent_and_joined_response import (
15
16
 
16
17
 
17
18
  class GroupSiteManager(ClientObject):
19
+ """Management of Group Sites in SharePoint. Group Sites, also known as Microsoft 365 Groups,
20
+ provide collaboration spaces that integrate with various Microsoft 365 services like Teams, Outlook, and Planner.
21
+ """
22
+
18
23
  def __init__(self, context, resource_path=None):
19
24
  if resource_path is None:
20
25
  resource_path = ResourcePath("GroupSiteManager")
21
26
  super(GroupSiteManager, self).__init__(context, resource_path)
22
27
 
23
28
  def can_user_create_group(self):
29
+ """Determines if the current user can create group site"""
24
30
  return_type = ClientResult(self.context, bool())
25
31
  qry = ServiceOperationQuery(
26
32
  self, "CanUserCreateGroup", None, None, None, return_type
@@ -83,6 +89,7 @@ class GroupSiteManager(ClientObject):
83
89
  return self
84
90
 
85
91
  def ensure_team_for_group(self):
92
+ """ """
86
93
  return_type = ClientResult(self.context)
87
94
  qry = ServiceOperationQuery(
88
95
  self, "EnsureTeamForGroup", None, None, None, return_type
@@ -91,6 +98,7 @@ class GroupSiteManager(ClientObject):
91
98
  return return_type
92
99
 
93
100
  def get_group_creation_context(self):
101
+ """ """
94
102
  return_type = ClientResult(self.context, GroupCreationContext())
95
103
  qry = ServiceOperationQuery(
96
104
  self, "GetGroupCreationContext", None, None, None, return_type
@@ -131,6 +139,7 @@ class GroupSiteManager(ClientObject):
131
139
  return result
132
140
 
133
141
  def get_current_user_shared_channel_member_groups(self):
142
+ """ """
134
143
  return_type = ClientResult(self.context)
135
144
  qry = ServiceOperationQuery(
136
145
  self,
@@ -145,6 +154,8 @@ class GroupSiteManager(ClientObject):
145
154
 
146
155
  def get_team_channels(self, team_id, use_staging_endpoint=False):
147
156
  """
157
+ Retrieves the channels associated with a specific Microsoft 365 Group (or Team)
158
+
148
159
  :param str team_id:
149
160
  :param bool use_staging_endpoint:
150
161
  """
@@ -170,6 +181,21 @@ class GroupSiteManager(ClientObject):
170
181
  self.context.add_query(qry)
171
182
  return return_type
172
183
 
184
+ def get_team_channels_with_site_url(self, site_url):
185
+ """
186
+ Returns a list of team channels associated with a Microsoft 365 Group.
187
+ :param str site_url:
188
+ """
189
+ return_type = ClientResult(self.context, ChannelInfoCollection())
190
+ payload = {
191
+ "siteUrl": site_url,
192
+ }
193
+ qry = ServiceOperationQuery(
194
+ self, "GetTeamChannelsWithSiteUrl", None, payload, None, return_type
195
+ )
196
+ self.context.add_query(qry)
197
+ return return_type
198
+
173
199
  def notebook(self, group_id):
174
200
  """
175
201
  :param str group_id:
@@ -188,6 +214,8 @@ class GroupSiteManager(ClientObject):
188
214
  existing_joined_teams_data=None,
189
215
  ):
190
216
  """
217
+ Retrieves a list of teams that a user has recently accessed or joined
218
+
191
219
  :param bool include_recent:
192
220
  :param bool include_teams:
193
221
  :param bool include_pinned:
@@ -205,3 +233,7 @@ class GroupSiteManager(ClientObject):
205
233
  )
206
234
  self.context.add_query(qry)
207
235
  return return_type
236
+
237
+ @property
238
+ def entity_type_name(self):
239
+ return "Microsoft.SharePoint.Portal.GroupSiteManager"