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,9 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class BrandCenter(Entity):
5
+ """
6
+ The SharePoint brand center API offers a centralized branding management application
7
+ that empowers your brand managers or designated brand owners to help your organization to customize
8
+ the look and feel of their experiences.
9
+ """
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class BrandCenterConfiguration(ClientValue):
5
+ """ """
@@ -16,9 +16,7 @@ class Change(Entity):
16
16
 
17
17
  @property
18
18
  def change_token(self):
19
- """
20
- Returns an ChangeToken that represents the change.
21
- """
19
+ """Returns an ChangeToken that represents the change."""
22
20
  return self.properties.get("ChangeToken", ChangeToken())
23
21
 
24
22
  @property
@@ -22,6 +22,7 @@ class ChangeCollection(EntityCollection[Change]):
22
22
  from office365.sharepoint.changes.item import ChangeItem
23
23
  from office365.sharepoint.changes.list import ChangeList
24
24
  from office365.sharepoint.changes.user import ChangeUser
25
+ from office365.sharepoint.changes.view import ChangeView
25
26
  from office365.sharepoint.changes.web import ChangeWeb
26
27
 
27
28
  if "ItemId" in properties and "ListId" in properties:
@@ -40,3 +41,5 @@ class ChangeCollection(EntityCollection[Change]):
40
41
  self._item_type = ChangeAlert
41
42
  elif "FieldId" in properties:
42
43
  self._item_type = ChangeField
44
+ elif "ViewId" in properties:
45
+ self._item_type = ChangeView
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.changes.change import Change
2
4
 
3
5
 
@@ -6,8 +8,12 @@ class ChangeFolder(Change):
6
8
 
7
9
  @property
8
10
  def unique_id(self):
11
+ # type: () -> Optional[str]
12
+ """Identifies the folder that has changed."""
9
13
  return self.properties.get("UniqueId", None)
10
14
 
11
15
  @property
12
16
  def web_id(self):
17
+ # type: () -> Optional[str]
18
+ """Identifies the site that contains the changed folder."""
13
19
  return self.properties.get("WebId", None)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.changes.change import Change
2
4
 
3
5
 
@@ -6,5 +8,6 @@ class ChangeGroup(Change):
6
8
 
7
9
  @property
8
10
  def group_id(self):
11
+ # type: () -> Optional[int]
9
12
  """Identifies the changed group."""
10
13
  return self.properties.get("GroupId", None)
@@ -16,9 +16,22 @@ class ChangeList(Change):
16
16
 
17
17
  @property
18
18
  def base_template(self):
19
+ # type: () -> Optional[int]
19
20
  """An SP.ListTemplateType object that returns the list template type of the list."""
20
21
  return self.properties.get("BaseTemplate", None)
21
22
 
23
+ @property
24
+ def editor(self):
25
+ # type: () -> Optional[str]
26
+ """A string that returns the name of the user who modified the list."""
27
+ return self.properties.get("Editor", None)
28
+
29
+ @property
30
+ def hidden(self):
31
+ # type: () -> Optional[bool]
32
+ """Returns a Boolean value that indicates whether a list is a hidden list."""
33
+ return self.properties.get("Hidden", None)
34
+
22
35
  @property
23
36
  def list_id(self):
24
37
  # type: () -> Optional[str]
@@ -0,0 +1,25 @@
1
+ from typing import Optional
2
+
3
+ from office365.sharepoint.changes.change import Change
4
+
5
+
6
+ class ChangeView(Change):
7
+ """Specifies a change on a view."""
8
+
9
+ @property
10
+ def view_id(self):
11
+ # type: () -> Optional[str]
12
+ """Identifies the changed view."""
13
+ return self.properties.get("ViewId", None)
14
+
15
+ @property
16
+ def list_id(self):
17
+ # type: () -> Optional[str]
18
+ """Identifies the list that contains the changed view."""
19
+ return self.properties.get("ListId", None)
20
+
21
+ @property
22
+ def web_id(self):
23
+ # type: () -> Optional[str]
24
+ """Identifies the site that contains the changed view."""
25
+ return self.properties.get("WebId", None)
@@ -42,7 +42,7 @@ class ClientContext(ClientRuntimeContext):
42
42
  """SharePoint client context (SharePoint v1 API)"""
43
43
 
44
44
  def __init__(self, base_url, auth_context=None):
45
- # type: (str, AuthenticationContext) -> None
45
+ # type: (str, AuthenticationContext | None) -> None
46
46
  """
47
47
  Instantiates a SharePoint client context
48
48
 
@@ -411,6 +411,14 @@ class ClientContext(ClientRuntimeContext):
411
411
 
412
412
  return AnnouncementsController(self, ResourcePath("Announcements"))
413
413
 
414
+ @property
415
+ def brand_center(self):
416
+ """Alias to BrandCenter"""
417
+
418
+ from office365.sharepoint.brandcenter.brand_center import BrandCenter
419
+
420
+ return BrandCenter(self, ResourcePath("BrandCenter"))
421
+
414
422
  @property
415
423
  def client_people_picker(self):
416
424
  """Query principals service alias"""
@@ -702,6 +710,16 @@ class ClientContext(ClientRuntimeContext):
702
710
 
703
711
  return WorkflowServicesManager.current(self)
704
712
 
713
+ @property
714
+ def workflow_deployment_service(self):
715
+ """Alias to WorkflowServicesManager"""
716
+
717
+ from office365.sharepoint.workflowservices.deployment_service import (
718
+ WorkflowDeploymentService,
719
+ )
720
+
721
+ return WorkflowDeploymentService(self)
722
+
705
723
  @property
706
724
  def work_items(self):
707
725
  """"""
@@ -1,3 +1,5 @@
1
+ from typing_extensions import Self
2
+
1
3
  from office365.runtime.paths.service_operation import ServiceOperationPath
2
4
  from office365.runtime.queries.create_entity import CreateEntityQuery
3
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -52,6 +54,7 @@ class FieldLinkCollection(EntityCollection[FieldLink]):
52
54
  )
53
55
 
54
56
  def reorder(self, internal_names):
57
+ # type: (list[str]) -> Self
55
58
  """
56
59
  Rearranges the collection of field links in the order in which field internal names are specified.
57
60
 
File without changes
@@ -0,0 +1,27 @@
1
+ from office365.runtime.client_result import ClientResult
2
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
3
+ from office365.sharepoint.copilot.file_collection_query_result import (
4
+ CopilotFileCollectionQueryResult,
5
+ )
6
+ from office365.sharepoint.entity import Entity
7
+
8
+
9
+ class CopilotFileCollection(Entity):
10
+ """ """
11
+
12
+ @staticmethod
13
+ def get_working_set_files(context, top=None, order_by=None, skip_token=None):
14
+ """ """
15
+ payload = {"top": top, "orderBy": order_by, "skipToken": skip_token}
16
+ return_type = ClientResult(context, CopilotFileCollectionQueryResult())
17
+ qry = ServiceOperationQuery(
18
+ CopilotFileCollection(context),
19
+ "GetWorkingSetFiles",
20
+ None,
21
+ payload,
22
+ None,
23
+ return_type,
24
+ True,
25
+ )
26
+ context.add_query(qry)
27
+ return return_type
@@ -0,0 +1,10 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class CopilotFileCollectionQueryResult(ClientValue):
5
+ """ """
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ # type: () -> str
10
+ return "Microsoft.SharePoint.Copilot.CopilotFileCollectionQueryResult"
@@ -0,0 +1,5 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class CopilotListItemExtensions(Entity):
5
+ """ """
@@ -4,6 +4,11 @@ from office365.runtime.client_value import ClientValue
4
4
  class AlternateIdData(ClientValue):
5
5
  """"""
6
6
 
7
+ def __init__(self, email=None, identifying_property=None, user_principal_name=None):
8
+ self.Email = email
9
+ self.IdentifyingProperty = identifying_property
10
+ self.UserPrincipalName = user_principal_name
11
+
7
12
  @property
8
13
  def entity_type_name(self):
9
14
  return "SP.Directory.Provider.AlternateIdData"
@@ -1,4 +1,5 @@
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
 
4
5
 
@@ -10,6 +11,13 @@ class DirectoryNotification(Entity):
10
11
  resource_path = ResourcePath("SP.Directory.Provider.DirectoryNotification")
11
12
  super(DirectoryNotification, self).__init__(context, resource_path)
12
13
 
14
+ def notify_changes(self, directory_object_changes):
15
+ """ """
16
+ payload = {"directoryObjectChanges": directory_object_changes}
17
+ qry = ServiceOperationQuery(self, "NotifyChanges", None, payload, None, None)
18
+ self.context.add_query(qry)
19
+ return self
20
+
13
21
  @property
14
22
  def entity_type_name(self):
15
23
  return "SP.Directory.Provider.DirectoryNotification"
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class DirectoryObjectChanges(ClientValue):
5
+ """ """
@@ -1,13 +1,36 @@
1
1
  from office365.runtime.client_value import ClientValue
2
2
  from office365.sharepoint.directory.provider.alternate_id_data import AlternateIdData
3
+ from office365.sharepoint.directory.provider.session_data import DirectorySessionData
3
4
 
4
5
 
5
6
  class DirectoryObjectData(ClientValue):
6
7
  """"""
7
8
 
8
- def __init__(self, AlternateId=AlternateIdData(), Id=None):
9
- self.AlternateId = AlternateId
10
- self.Id = Id
9
+ def __init__(
10
+ self,
11
+ alternate_id=AlternateIdData(),
12
+ attribute_expiration_times=None,
13
+ change_marker=None,
14
+ directory_object_sub_type=None,
15
+ directory_object_type=None,
16
+ directory_session_data=DirectorySessionData(),
17
+ id_=None,
18
+ is_new=None,
19
+ last_modified_time=None,
20
+ tenant_context_id=None,
21
+ version=None,
22
+ ):
23
+ self.AlternateId = alternate_id
24
+ self.AttributeExpirationTimes = attribute_expiration_times
25
+ self.ChangeMarker = change_marker
26
+ self.DirectoryObjectSubType = directory_object_sub_type
27
+ self.DirectoryObjectType = directory_object_type
28
+ self.DirectorySessionData = directory_session_data
29
+ self.Id = id_
30
+ self.IsNew = is_new
31
+ self.LastModifiedTime = last_modified_time
32
+ self.TenantContextId = tenant_context_id
33
+ self.Version = version
11
34
 
12
35
  @property
13
36
  def entity_type_name(self):
@@ -14,6 +14,7 @@ class SharePointDirectoryProvider(Entity):
14
14
  super(SharePointDirectoryProvider, self).__init__(context, resource_path)
15
15
 
16
16
  def read_directory_object(self, data):
17
+ # type: (DirectoryObjectData) -> ClientResult[DirectoryObjectData]
17
18
  """"""
18
19
  return_type = ClientResult(self.context, DirectoryObjectData())
19
20
  payload = {"data": data}
@@ -0,0 +1,9 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class DirectorySessionData(ClientValue):
5
+
6
+ @property
7
+ def entity_type_name(self):
8
+ # type: () -> str
9
+ return "SP.Directory.Provider.DirectorySessionData"
@@ -31,22 +31,47 @@ class DocumentId(Entity):
31
31
  self.context.add_query(qry)
32
32
  return self
33
33
 
34
- def reset_docids_in_library(self, decoded_url, content_type_id):
34
+ def reset_doc_ids_in_library(self, decoded_url, content_type_id=None):
35
35
  """
36
36
  Performs the same function as ResetDocIdByServerRelativePath (section 3.1.5.10.2.1.1), but for every
37
37
  document in the specified document library.
38
38
 
39
39
  :param str decoded_url: Server relative path to the document library, for which all document identifiers
40
40
  MUST be reset to guarantee global uniqueness in the farm.
41
- :param str content_type_id: The content type identifier.
41
+ :param str or None content_type_id: The content type identifier.
42
42
  """
43
- payload = {"DecodedUrl": decoded_url, "contentTypeId": content_type_id}
43
+ payload = {"decodedUrl": decoded_url, "contentTypeId": content_type_id}
44
44
  qry = ServiceOperationQuery(
45
45
  self, "ResetDocIdsInLibrary", None, payload, None, None
46
46
  )
47
47
  self.context.add_query(qry)
48
48
  return self
49
49
 
50
+ def set_doc_id_site_prefix(
51
+ self, prefix, schedule_assignment, overwrite_existing_ids
52
+ ):
53
+ """
54
+ Allows to set or change the prefix used for Document IDs
55
+
56
+ :param str prefix:
57
+ :param bool schedule_assignment:
58
+ :param bool overwrite_existing_ids:
59
+ """
60
+ payload = {
61
+ "prefix": prefix,
62
+ "scheduleAssignment": schedule_assignment,
63
+ "overwriteExistingIds": overwrite_existing_ids,
64
+ }
65
+ qry = ServiceOperationQuery(
66
+ self, "SetDocIdSitePrefix", None, payload, None, None
67
+ )
68
+ self.context.add_query(qry)
69
+ return self
70
+
50
71
  @property
51
72
  def entity_type_name(self):
52
73
  return "SP.DocumentManagement.DocumentId"
74
+
75
+ @property
76
+ def entity_type_id(self):
77
+ return "fb7276a2-cd36-448b-8a60-a589205f5a8f"
@@ -1,5 +1,6 @@
1
1
  import datetime
2
2
  from typing import TYPE_CHECKING, AnyStr
3
+ from urllib.parse import quote
3
4
 
4
5
  import requests
5
6
 
@@ -607,8 +608,11 @@ class File(AbstractFile):
607
608
  :type server_relative_url: str
608
609
  :type content: str
609
610
  """
610
- url = r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
611
- context.service_root_url(), server_relative_url
611
+ url = quote(
612
+ r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
613
+ context.service_root_url(), server_relative_url
614
+ ),
615
+ safe=":/",
612
616
  )
613
617
  request = RequestOptions(url)
614
618
  request.method = HttpMethod.Post
@@ -626,8 +630,11 @@ class File(AbstractFile):
626
630
  :type server_relative_url: str
627
631
  :return Response
628
632
  """
629
- url = r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
630
- context.service_root_url(), server_relative_url
633
+ url = quote(
634
+ r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
635
+ context.service_root_url(), server_relative_url
636
+ ),
637
+ safe=":/",
631
638
  )
632
639
  request = RequestOptions(url)
633
640
  request.method = HttpMethod.Get
@@ -32,3 +32,12 @@ class FileVersionEvent(Entity):
32
32
  return self.properties.get(
33
33
  "SharedWithUsers", ClientValueCollection(SharedWithUser)
34
34
  )
35
+
36
+ def get_property(self, name, default_value=None):
37
+ if default_value is None:
38
+ property_mapping = {
39
+ "SharedByUser": self.shared_by_user,
40
+ "SharedWithUsers": self.shared_with_users,
41
+ }
42
+ default_value = property_mapping.get(name, None)
43
+ return super(FileVersionEvent, self).get_property(name, default_value)
@@ -0,0 +1,30 @@
1
+ from office365.runtime.client_result import ClientResult
2
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
3
+ from office365.sharepoint.entity import Entity
4
+
5
+
6
+ class FlowPermissions(Entity):
7
+
8
+ @staticmethod
9
+ def get_flow_permission_level_on_list(context, list_name):
10
+ """
11
+ :param office365.sharepoint.client_context.ClientContext context: SharePoint client context
12
+ :param str list_name: Specifies the list name.
13
+ """
14
+ return_type = ClientResult(context)
15
+ payload = {"listName": list_name}
16
+ qry = ServiceOperationQuery(
17
+ FlowPermissions(context),
18
+ "GetFlowPermissionLevelOnList",
19
+ None,
20
+ payload,
21
+ None,
22
+ return_type,
23
+ True,
24
+ )
25
+ context.add_query(qry)
26
+ return return_type
27
+
28
+ @property
29
+ def entity_type_name(self):
30
+ return "SP.Internal.FlowPermissions"
@@ -0,0 +1,9 @@
1
+ from office365.sharepoint.listhome.item import ListHomeItem
2
+
3
+
4
+ class FavoriteListHomeItem(ListHomeItem):
5
+ """ """
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.SharePoint.ListHome.FavoriteListHomeItem"
@@ -14,9 +14,11 @@ from office365.sharepoint.fields.image_value import ImageFieldValue
14
14
  from office365.sharepoint.fields.lookup_value import FieldLookupValue
15
15
  from office365.sharepoint.fields.multi_lookup_value import FieldMultiLookupValue
16
16
  from office365.sharepoint.fields.string_values import FieldStringValues
17
+ from office365.sharepoint.fields.url_value import FieldUrlValue
17
18
  from office365.sharepoint.likes.liked_by_information import LikedByInformation
18
19
  from office365.sharepoint.listitems.compliance_info import ListItemComplianceInfo
19
20
  from office365.sharepoint.listitems.form_update_value import ListItemFormUpdateValue
21
+ from office365.sharepoint.listitems.update_parameters import ListItemUpdateParameters
20
22
  from office365.sharepoint.listitems.versions.collection import ListItemVersionCollection
21
23
  from office365.sharepoint.permissions.securable_object import SecurableObject
22
24
  from office365.sharepoint.policy.dlp_policy_tip import DlpPolicyTip
@@ -275,7 +277,7 @@ class ListItem(SecurableObject):
275
277
  """Validates and sets the values of the specified collection of fields for the list item.
276
278
 
277
279
  :param dict form_values: Specifies a collection of field internal names and values for the given field
278
- :param dict new_document_update: Specifies whether the list item is a document being updated after upload.
280
+ :param bool new_document_update: Specifies whether the list item is a document being updated after upload.
279
281
  :param str checkin_comment: Check-in comment, if any. This parameter is only applicable when the list item
280
282
  is checked out.
281
283
  :param bool or None dates_in_utc:
@@ -310,10 +312,59 @@ class ListItem(SecurableObject):
310
312
  super(ListItem, self).update()
311
313
  return self
312
314
 
315
+ def update_ex(self, bypass_quota_check=None, bypass_shared_lock=None):
316
+ """
317
+
318
+ :param bool bypass_quota_check:
319
+ :param bool bypass_shared_lock:
320
+ """
321
+ payload = {
322
+ "parameters": ListItemUpdateParameters(
323
+ bypass_quota_check, bypass_shared_lock
324
+ )
325
+ }
326
+ qry = ServiceOperationQuery(self, "UpdateEx", None, payload)
327
+ self.context.add_query(qry)
328
+ return self
329
+
313
330
  def system_update(self):
314
331
  """Update the list item."""
315
- qry = ServiceOperationQuery(self, "SystemUpdate")
316
- self.context.add_query(qry)
332
+
333
+ sys_metadata = ["EditorId", "Modified"]
334
+
335
+ def _after_system_update(result):
336
+ # type: (ClientResult[ClientValueCollection[ListItemFormUpdateValue]]) -> None
337
+ has_any_error = any([item.HasException for item in result.value])
338
+ if has_any_error:
339
+ raise ValueError("Update ListItem failed")
340
+
341
+ def _system_update():
342
+ from office365.sharepoint.fields.user_value import FieldUserValue
343
+
344
+ form_values = self.persistable_properties
345
+ for n in sys_metadata:
346
+ if n == "Id":
347
+ pass
348
+ elif n.endswith("Id"):
349
+ user = self.context.web.site_users.get_by_id(self.get_property(n))
350
+ form_values[n[:-2]] = FieldUserValue.from_user(user)
351
+ else:
352
+ form_values[n] = self.get_property(n)
353
+
354
+ self.validate_update_list_item(
355
+ form_values=form_values,
356
+ dates_in_utc=True,
357
+ new_document_update=True,
358
+ ).after_execute(_after_system_update)
359
+
360
+ def _list_loaded():
361
+ if self.parent_list.base_template == 101:
362
+ self.ensure_properties(sys_metadata, _system_update)
363
+ else:
364
+ next_qry = ServiceOperationQuery(self, "SystemUpdate")
365
+ self.context.add_query(next_qry)
366
+
367
+ self.parent_list.ensure_properties(["BaseTemplate"], _list_loaded)
317
368
  return self
318
369
 
319
370
  def update_overwrite_version(self):
@@ -332,6 +383,17 @@ class ListItem(SecurableObject):
332
383
  self.context.add_query(qry)
333
384
  return self
334
385
 
386
+ def set_compliance_tag_with_hold(self, compliance_tag):
387
+ """
388
+ Sets a compliance tag with a hold
389
+
390
+ :param str compliance_tag: The applying label (tag) to the list item
391
+ """
392
+ payload = {"complianceTag": compliance_tag}
393
+ qry = ServiceOperationQuery(self, "SetComplianceTagWithHold", None, payload)
394
+ self.context.add_query(qry)
395
+ return self
396
+
335
397
  def get_comments(self):
336
398
  """Retrieve ListItem comments"""
337
399
  return_type = CommentCollection(self.context)
@@ -377,7 +439,7 @@ class ListItem(SecurableObject):
377
439
  """Get parent List"""
378
440
  from office365.sharepoint.lists.list import List
379
441
 
380
- return self.properties.get(
442
+ return self.properties.setdefault(
381
443
  "ParentList",
382
444
  List(self.context, ResourcePath("ParentList", self.resource_path)),
383
445
  )
@@ -507,12 +569,25 @@ class ListItem(SecurableObject):
507
569
  ),
508
570
  )
509
571
 
572
+ @property
573
+ def doc_id(self):
574
+ # type: () -> Optional[str]
575
+ """Document ID fora document"""
576
+ return self.properties.get("OData__dlc_DocId", None)
577
+
578
+ @property
579
+ def doc_id_url(self):
580
+ # type: () -> Optional[FieldUrlValue]
581
+ """Document ID fora document"""
582
+ return self.properties.get("OData__dlc_DocIdUrl", FieldUrlValue())
583
+
510
584
  def get_property(self, name, default_value=None):
511
585
  if default_value is None:
512
586
  property_mapping = {
513
587
  "AttachmentFiles": self.attachment_files,
514
588
  "ContentType": self.content_type,
515
589
  "ComplianceInfo": self.compliance_info,
590
+ "OData__dlc_DocIdUrl": self.doc_id_url,
516
591
  "EffectiveBasePermissions": self.effective_base_permissions,
517
592
  "GetDlpPolicyTip": self.get_dlp_policy_tip,
518
593
  "FieldValuesAsHtml": self.field_values_as_html,
@@ -2,4 +2,7 @@ from office365.runtime.client_value import ClientValue
2
2
 
3
3
 
4
4
  class ListItemUpdateParameters(ClientValue):
5
- pass
5
+
6
+ def __init__(self, bypass_quota_check=None, bypass_shared_lock=None):
7
+ self.BypassQuotaCheck = bypass_quota_check
8
+ self.BypassSharedLock = bypass_shared_lock
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class RenderListFilterDataParameters(ClientValue):
5
+ """Specifies the parameters that are used to retrieve filter data."""