Office365-REST-Python-Client 2.5.6__py3-none-any.whl → 2.5.8__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 (147) hide show
  1. {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/METADATA +5 -5
  2. {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/RECORD +147 -96
  3. office365/communications/onlinemeetings/online_meeting.py +30 -3
  4. office365/communications/onlinemeetings/recordings/__init__.py +0 -0
  5. office365/communications/onlinemeetings/recordings/call.py +5 -0
  6. office365/communications/onlinemeetings/transcripts/__init__.py +0 -0
  7. office365/directory/administrative_unit.py +9 -2
  8. office365/directory/applications/roles/collection.py +5 -1
  9. office365/directory/applications/roles/role.py +1 -1
  10. office365/directory/audit/provisioning/object_summary.py +30 -1
  11. office365/directory/authentication/methods/fido.py +8 -0
  12. office365/directory/authentication/methods/password.py +23 -0
  13. office365/directory/custom_security_attribute_definition.py +7 -0
  14. office365/directory/device_local_credential_info.py +6 -0
  15. office365/directory/directory.py +40 -12
  16. office365/directory/identitygovernance/appconsent/request_collection.py +1 -1
  17. office365/directory/identitygovernance/entitlementmanagement/entitlement_management.py +7 -0
  18. office365/directory/identitygovernance/governance.py +16 -0
  19. office365/directory/identitygovernance/termsofuse/agreement_acceptance.py +8 -0
  20. office365/directory/identitygovernance/userconsent/request_collection.py +1 -1
  21. office365/directory/insights/resource_reference.py +1 -1
  22. office365/directory/policies/device_registration.py +6 -0
  23. office365/directory/policies/root.py +13 -0
  24. office365/directory/security/threatintelligence/article_indicator.py +7 -0
  25. office365/directory/serviceprincipals/service_principal.py +109 -25
  26. office365/directory/synchronization/schema.py +16 -0
  27. office365/directory/users/user.py +23 -0
  28. office365/graph_client.py +8 -0
  29. office365/onedrive/driveitems/driveItem.py +86 -6
  30. office365/onedrive/driveitems/retention_label.py +25 -0
  31. office365/onedrive/lists/list.py +1 -1
  32. office365/onedrive/sitepages/__init__.py +0 -0
  33. office365/onedrive/sitepages/base.py +29 -0
  34. office365/onedrive/sitepages/canvas_layout.py +43 -0
  35. office365/onedrive/sitepages/collection.py +32 -0
  36. office365/onedrive/sitepages/horizontal_section.py +23 -0
  37. office365/onedrive/sitepages/horizontal_section_column.py +27 -0
  38. office365/onedrive/sitepages/site_page.py +116 -0
  39. office365/onedrive/sitepages/title_area.py +13 -0
  40. office365/onedrive/sitepages/vertical_section.py +27 -0
  41. office365/onedrive/sitepages/web_part.py +5 -0
  42. office365/onedrive/sites/site.py +10 -0
  43. office365/onedrive/workbooks/charts/chart.py +13 -0
  44. office365/onedrive/workbooks/charts/data_labels.py +13 -1
  45. office365/onedrive/workbooks/icon.py +5 -0
  46. office365/onedrive/workbooks/names/named_item.py +6 -0
  47. office365/onedrive/workbooks/ranges/font.py +5 -0
  48. office365/onedrive/workbooks/ranges/format.py +60 -0
  49. office365/onedrive/workbooks/ranges/range.py +12 -0
  50. office365/onedrive/workbooks/ranges/reference.py +6 -0
  51. office365/onedrive/workbooks/sort_field.py +26 -0
  52. office365/onedrive/workbooks/tables/pivot_table_collection.py +16 -0
  53. office365/onedrive/workbooks/tables/sort.py +5 -0
  54. office365/onedrive/workbooks/tables/table.py +57 -0
  55. office365/onedrive/workbooks/worksheets/protection.py +20 -1
  56. office365/onedrive/workbooks/worksheets/protection_options.py +10 -0
  57. office365/onedrive/workbooks/worksheets/worksheet.py +5 -4
  58. office365/outlook/calendar/calendar.py +1 -3
  59. office365/outlook/calendar/events/event.py +45 -0
  60. office365/outlook/calendar/response_status.py +11 -0
  61. office365/outlook/calendar/rooms/room.py +14 -0
  62. office365/outlook/mail/automatic_replies_mailtips.py +5 -0
  63. office365/outlook/mail/conversation.py +1 -3
  64. office365/outlook/mail/folders/folder.py +1 -3
  65. office365/outlook/mail/tips.py +17 -0
  66. office365/planner/plans/plan.py +11 -1
  67. office365/reports/root.py +33 -0
  68. office365/runtime/auth/authentication_context.py +12 -2
  69. office365/runtime/odata/json_format.py +3 -2
  70. office365/runtime/odata/request.py +12 -2
  71. office365/runtime/queries/upload_session.py +5 -0
  72. office365/sharepoint/activities/action_facet.py +17 -0
  73. office365/sharepoint/activities/client_request.py +4 -0
  74. office365/sharepoint/activities/client_response.py +8 -0
  75. office365/sharepoint/activities/entity.py +10 -0
  76. office365/sharepoint/activities/facets/delete.py +1 -0
  77. office365/sharepoint/activities/facets/get_mention.py +10 -0
  78. office365/sharepoint/activities/facets/in_doc.py +4 -0
  79. office365/sharepoint/activities/facets/move.py +14 -0
  80. office365/sharepoint/activities/facets/point_in_time_restore.py +9 -0
  81. office365/sharepoint/activities/facets/revision_set.py +9 -0
  82. office365/sharepoint/activities/facets/task_completed.py +9 -0
  83. office365/sharepoint/activities/facets/version.py +12 -0
  84. office365/sharepoint/activities/identity_item.py +16 -1
  85. office365/sharepoint/alerts/collection.py +2 -1
  86. office365/sharepoint/attachments/attachment.py +6 -9
  87. office365/sharepoint/attachments/collection.py +25 -3
  88. office365/sharepoint/client_context.py +33 -2
  89. office365/sharepoint/comments/collection.py +1 -1
  90. office365/sharepoint/compliance/store_proxy.py +43 -0
  91. office365/sharepoint/contenttypes/content_type.py +13 -1
  92. office365/sharepoint/contenttypes/fieldlinks/collection.py +1 -1
  93. office365/sharepoint/directory/helper.py +2 -0
  94. office365/sharepoint/directory/provider/alternate_id_data.py +9 -0
  95. office365/sharepoint/directory/provider/notification.py +15 -0
  96. office365/sharepoint/directory/provider/object_data.py +14 -0
  97. office365/sharepoint/directory/provider/provider.py +13 -0
  98. office365/sharepoint/entity.py +15 -0
  99. office365/sharepoint/features/collection.py +2 -0
  100. office365/sharepoint/fields/collection.py +4 -3
  101. office365/sharepoint/fields/user_value.py +1 -1
  102. office365/sharepoint/folders/folder.py +3 -5
  103. office365/sharepoint/migrationcenter/deploy_status.py +5 -0
  104. office365/sharepoint/migrationcenter/service/performance/__init__.py +0 -0
  105. office365/sharepoint/migrationcenter/service/performance/dashboard_data.py +9 -0
  106. office365/sharepoint/migrationcenter/service/performance/data.py +7 -0
  107. office365/sharepoint/migrationcenter/service/performance/entity_data.py +5 -0
  108. office365/sharepoint/multigeo/move_job_entity_data.py +9 -0
  109. office365/sharepoint/multigeo/site_move_job_entity_data.py +9 -0
  110. office365/sharepoint/multigeo/user_personal_site_location.py +9 -0
  111. office365/sharepoint/permissions/securable_object.py +2 -0
  112. office365/sharepoint/principal/principal.py +2 -4
  113. office365/sharepoint/recyclebin/item.py +107 -7
  114. office365/sharepoint/sharing/information.py +9 -0
  115. office365/sharepoint/sharing/link_info.py +6 -0
  116. office365/sharepoint/sharing/object_sharing_information.py +2 -0
  117. office365/sharepoint/sharing/permission_collection.py +18 -0
  118. office365/sharepoint/sharing/shared_document_info.py +9 -0
  119. office365/sharepoint/sites/script_safe_domain.py +5 -0
  120. office365/sharepoint/sites/site.py +10 -4
  121. office365/sharepoint/sites/version_policy_manager.py +7 -0
  122. office365/sharepoint/taxonomy/field_value.py +1 -1
  123. office365/sharepoint/tenant/administration/powerapps/__init__.py +0 -0
  124. office365/sharepoint/tenant/administration/powerapps/environment_context.py +8 -0
  125. office365/sharepoint/tenant/administration/secondary_administrators_info.py +5 -0
  126. office365/sharepoint/tenant/administration/tenant.py +14 -0
  127. office365/sharepoint/tenant/cdn_api.py +16 -0
  128. office365/sharepoint/tenant/management/externalusers/results/get.py +4 -0
  129. office365/sharepoint/tenant/management/office365_tenant.py +14 -0
  130. office365/sharepoint/ui/applicationpages/peoplepicker/web_service_interface.py +39 -33
  131. office365/sharepoint/userprofiles/cross_geo_sync.py +37 -0
  132. office365/sharepoint/userprofiles/cross_geo_sync_user_data_batch.py +5 -0
  133. office365/sharepoint/userprofiles/followed_content.py +15 -0
  134. office365/sharepoint/userprofiles/people_manager.py +23 -10
  135. office365/sharepoint/userprofiles/person_properties.py +7 -0
  136. office365/sharepoint/userprofiles/user_profile.py +4 -6
  137. office365/sharepoint/views/view.py +2 -0
  138. office365/sharepoint/webs/information_collection.py +1 -1
  139. office365/sharepoint/webs/regional_settings.py +71 -0
  140. office365/sharepoint/webs/web.py +53 -5
  141. office365/sharepoint/workflowservices/deployment_service.py +9 -0
  142. office365/teams/apps/catalog.py +1 -0
  143. office365/teams/chats/chat.py +4 -0
  144. office365/teams/schedule/schedule.py +6 -2
  145. {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/LICENSE +0 -0
  146. {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/WHEEL +0 -0
  147. {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/top_level.txt +0 -0
@@ -7,8 +7,15 @@ from office365.sharepoint.activities.facets.delete import DeleteFacet
7
7
  from office365.sharepoint.activities.facets.discard_checkout import DiscardCheckoutFacet
8
8
  from office365.sharepoint.activities.facets.edit import EditFacet
9
9
  from office365.sharepoint.activities.facets.get_comment import GetCommentFacet
10
+ from office365.sharepoint.activities.facets.get_mention import GetMentionFacet
11
+ from office365.sharepoint.activities.facets.move import MoveFacet
12
+ from office365.sharepoint.activities.facets.point_in_time_restore import (
13
+ PointInTimeRestoreFacet,
14
+ )
10
15
  from office365.sharepoint.activities.facets.rename import RenameFacet
11
16
  from office365.sharepoint.activities.facets.sharing import SharingFacet
17
+ from office365.sharepoint.activities.facets.task_completed import TaskCompletedFacet
18
+ from office365.sharepoint.activities.facets.version import VersionFacet
12
19
 
13
20
 
14
21
  class ActionFacet(ClientValue):
@@ -22,8 +29,13 @@ class ActionFacet(ClientValue):
22
29
  delete=DeleteFacet(),
23
30
  discard_checkout=DiscardCheckoutFacet(),
24
31
  edit=EditFacet(),
32
+ mention=GetMentionFacet(),
33
+ move=MoveFacet(),
34
+ pointInTimeRestore=PointInTimeRestoreFacet(),
25
35
  rename=RenameFacet(),
26
36
  share=SharingFacet(),
37
+ taskCompleted=TaskCompletedFacet(),
38
+ version=VersionFacet(),
27
39
  ):
28
40
  """
29
41
  :param AddToOneDriveFacet add_to_one_drive:
@@ -42,8 +54,13 @@ class ActionFacet(ClientValue):
42
54
  self.delete = delete
43
55
  self.discardCheckout = discard_checkout
44
56
  self.edit = edit
57
+ self.mention = mention
58
+ self.move = move
59
+ self.pointInTimeRestore = pointInTimeRestore
45
60
  self.rename = rename
46
61
  self.share = share
62
+ self.taskCompleted = taskCompleted
63
+ self.version = version
47
64
 
48
65
  def __repr__(self):
49
66
  return self.facet_type
@@ -1,7 +1,11 @@
1
1
  from office365.runtime.client_value import ClientValue
2
+ from office365.sharepoint.activities.facets.revision_set import RevisionSetFacet
2
3
 
3
4
 
4
5
  class ActivityClientRequest(ClientValue):
6
+ def __init__(self, revisionSet=RevisionSetFacet()):
7
+ self.revisionSet = revisionSet
8
+
5
9
  @property
6
10
  def entity_type_name(self):
7
11
  return "Microsoft.SharePoint.Activities.ActivityClientRequest"
@@ -4,6 +4,14 @@ from office365.runtime.client_value import ClientValue
4
4
  class ActivityClientResponse(ClientValue):
5
5
  """"""
6
6
 
7
+ def __init__(self, id_, message=None, serverId=None, status=None):
8
+ # type: (str, str, str, int) -> None
9
+ """ """
10
+ self.id = id_
11
+ self.message = message
12
+ self.serverId = serverId
13
+ self.status = status
14
+
7
15
  @property
8
16
  def entity_type_name(self):
9
17
  return "Microsoft.SharePoint.Activities.ActivityClientResponse"
@@ -34,6 +34,16 @@ class SPActivityEntity(Entity):
34
34
  def times(self):
35
35
  return self.properties.get("times", ActivityTimeFacet())
36
36
 
37
+ @property
38
+ def property_ref_name(self):
39
+ return "id"
40
+
37
41
  @property
38
42
  def entity_type_name(self):
39
43
  return "Microsoft.SharePoint.Activities.SPActivityEntity"
44
+
45
+ def set_property(self, name, value, persist_changes=True):
46
+ super(SPActivityEntity, self).set_property(name, value, persist_changes)
47
+ if name == self.property_ref_name:
48
+ self._resource_path.patch(value)
49
+ return self
@@ -5,6 +5,7 @@ class DeleteFacet(ClientValue):
5
5
  """"""
6
6
 
7
7
  def __init__(self, name=None):
8
+ # type: (str) -> None
8
9
  self.name = name
9
10
 
10
11
  @property
@@ -0,0 +1,10 @@
1
+ from office365.runtime.client_value import ClientValue
2
+ from office365.runtime.client_value_collection import ClientValueCollection
3
+ from office365.sharepoint.activities.identity import ActivityIdentity
4
+
5
+
6
+ class GetMentionFacet(ClientValue):
7
+ """"""
8
+
9
+ def __init__(self, mentionees=None):
10
+ self.mentionees = ClientValueCollection(ActivityIdentity, mentionees)
@@ -4,6 +4,10 @@ from office365.runtime.client_value import ClientValue
4
4
  class InDocFacet(ClientValue):
5
5
  """"""
6
6
 
7
+ def __init__(self, contentId=None, navigationId=None):
8
+ self.contentId = contentId
9
+ self.navigationId = navigationId
10
+
7
11
  @property
8
12
  def entity_type_name(self):
9
13
  return "Microsoft.SharePoint.Activities.InDocFacet"
@@ -0,0 +1,14 @@
1
+ from office365.runtime.client_value import ClientValue
2
+ from office365.sharepoint.types.resource_path import ResourcePath as SPResPath
3
+
4
+
5
+ class MoveFacet(ClientValue):
6
+ """"""
7
+
8
+ def __init__(self, from_=SPResPath(), to=SPResPath()):
9
+ self.from_ = from_
10
+ self.to = to
11
+
12
+ @property
13
+ def entity_type_name(self):
14
+ return "Microsoft.SharePoint.Activities.MoveFacet"
@@ -0,0 +1,9 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class PointInTimeRestoreFacet(ClientValue):
5
+ """"""
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.SharePoint.Activities.PointInTimeRestoreFacet"
@@ -0,0 +1,9 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class RevisionSetFacet(ClientValue):
5
+ """ """
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.SharePoint.Activities.RevisionSetFacet"
@@ -0,0 +1,9 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class TaskCompletedFacet(ClientValue):
5
+ """ """
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.SharePoint.Activities.TaskCompletedFacet"
@@ -0,0 +1,12 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class VersionFacet(ClientValue):
5
+ """"""
6
+
7
+ def __init__(self, fromVersion=None):
8
+ self.fromVersion = fromVersion
9
+
10
+ @property
11
+ def entity_type_name(self):
12
+ return "Microsoft.SharePoint.Activities.VersionFacet"
@@ -2,11 +2,26 @@ from office365.runtime.client_value import ClientValue
2
2
 
3
3
 
4
4
  class ActivityIdentityItem(ClientValue):
5
- def __init__(self, client_id=None):
5
+ def __init__(
6
+ self,
7
+ client_id=None,
8
+ clientIdProvider=None,
9
+ displayName=None,
10
+ email=None,
11
+ userPrincipalName=None,
12
+ ):
6
13
  """
7
14
  :param str client_id:
15
+ :param str clientIdProvider:
16
+ :param str displayName:
17
+ :param str email:
18
+ :param str userPrincipalName:
8
19
  """
9
20
  self.clientId = client_id
21
+ self.clientIdProvider = clientIdProvider
22
+ self.displayName = displayName
23
+ self.email = email
24
+ self.userPrincipalName = userPrincipalName
10
25
 
11
26
  @property
12
27
  def entity_type_name(self):
@@ -5,7 +5,7 @@ from office365.sharepoint.alerts.alert import Alert
5
5
  from office365.sharepoint.entity_collection import EntityCollection
6
6
 
7
7
 
8
- class AlertCollection(EntityCollection):
8
+ class AlertCollection(EntityCollection[Alert]):
9
9
  """Content Type resource collection"""
10
10
 
11
11
  def __init__(self, context, resource_path=None):
@@ -26,6 +26,7 @@ class AlertCollection(EntityCollection):
26
26
  return return_type
27
27
 
28
28
  def contains(self, id_alert):
29
+ # type: (str) -> ClientResult[bool]
29
30
  """
30
31
  Returns true if the given alert exists in the alert collection. False otherwise.
31
32
 
@@ -10,6 +10,9 @@ from office365.sharepoint.types.resource_path import ResourcePath as SPResPath
10
10
  class Attachment(Entity):
11
11
  """Represents an attachment file in a SharePoint List Item."""
12
12
 
13
+ def __repr__(self):
14
+ return self.server_relative_url or self.entity_type_name
15
+
13
16
  def download(self, file_object, use_path=True):
14
17
  """Download attachment file
15
18
 
@@ -76,16 +79,12 @@ class Attachment(Entity):
76
79
  @property
77
80
  def file_name(self):
78
81
  # type: () -> Optional[str]
79
- """
80
- Specifies the file name of the list item attachment.
81
- """
82
+ """Specifies the file name of the list item attachment."""
82
83
  return self.properties.get("FileName", None)
83
84
 
84
85
  @property
85
86
  def file_name_as_path(self):
86
- """
87
- The file name of the attachment as a SP.ResourcePath.
88
- """
87
+ """The file name of the attachment as a SP.ResourcePath."""
89
88
  return self.properties.get("FileNameAsPath", SPResPath())
90
89
 
91
90
  @property
@@ -96,9 +95,7 @@ class Attachment(Entity):
96
95
 
97
96
  @property
98
97
  def server_relative_path(self):
99
- """
100
- The server-relative-path of the attachment.
101
- """
98
+ """The server-relative-path of the attachment."""
102
99
  return self.properties.get("ServerRelativePath", SPResPath())
103
100
 
104
101
  @property
@@ -1,4 +1,5 @@
1
- from typing import AnyStr
1
+ import os
2
+ from typing import IO, AnyStr
2
3
 
3
4
  from office365.runtime.paths.service_operation import ServiceOperationPath
4
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -55,14 +56,35 @@ class AttachmentCollection(EntityCollection[Attachment]):
55
56
  :param str content_stream: Stream containing the content of the attachment.
56
57
  """
57
58
  return_type = Attachment(self.context)
58
- payload = {"DecodedUrl": decoded_url, "contentStream": content_stream}
59
+ params = {"DecodedUrl": decoded_url}
59
60
  qry = ServiceOperationQuery(
60
- self, "AddUsingPath", None, payload, None, return_type
61
+ self, "AddUsingPath", params, content_stream, None, return_type
61
62
  )
62
63
  self.context.add_query(qry)
63
64
  self.add_child(return_type)
64
65
  return return_type
65
66
 
67
+ def delete_all(self):
68
+ """Deletes all attachments"""
69
+
70
+ def _delete_all(return_type):
71
+ # type: ("AttachmentCollection") -> None
72
+ [a.delete_object() for a in return_type]
73
+
74
+ self.get().after_execute(_delete_all)
75
+ return self
76
+
77
+ def upload(self, file, use_path=True):
78
+ # type: (IO, bool) -> Attachment
79
+ """
80
+ Uploads the attachment
81
+ """
82
+ info = AttachmentCreationInformation(os.path.basename(file.name), file.read())
83
+ if use_path:
84
+ return self.add_using_path(info.filename, info.content)
85
+ else:
86
+ return self.add(info)
87
+
66
88
  def get_by_filename(self, filename):
67
89
  """Retrieve Attachment file object by filename
68
90
 
@@ -82,8 +82,9 @@ class ClientContext(ClientRuntimeContext):
82
82
  cert_path=None,
83
83
  private_key=None,
84
84
  scopes=None,
85
+ passphrase=None,
85
86
  ):
86
- # type: (str, str, str, Optional[str], Optional[str], Optional[List[str]]) -> Self
87
+ # type: (str, str, str, Optional[str], Optional[str], Optional[List[str]], Optional[str]) -> Self
87
88
  """
88
89
  Creates authenticated SharePoint context via certificate credentials
89
90
 
@@ -93,9 +94,10 @@ class ClientContext(ClientRuntimeContext):
93
94
  :param str thumbprint: Hex encoded thumbprint of the certificate.
94
95
  :param str client_id: The OAuth client id of the calling application.
95
96
  :param list[str] or None scopes: Scopes requested to access a protected API (a resource)
97
+ :param str passphrase: Passphrase if the private_key is encrypted
96
98
  """
97
99
  self.authentication_context.with_client_certificate(
98
- tenant, client_id, thumbprint, cert_path, private_key, scopes
100
+ tenant, client_id, thumbprint, cert_path, private_key, scopes, passphrase
99
101
  )
100
102
  return self
101
103
 
@@ -408,6 +410,16 @@ class ClientContext(ClientRuntimeContext):
408
410
 
409
411
  return AnnouncementsController(self, ResourcePath("Announcements"))
410
412
 
413
+ @property
414
+ def client_people_picker(self):
415
+ """Query principals service alias"""
416
+
417
+ from office365.sharepoint.ui.applicationpages.peoplepicker.web_service_interface import (
418
+ ClientPeoplePickerWebServiceInterface,
419
+ )
420
+
421
+ return ClientPeoplePickerWebServiceInterface(self)
422
+
411
423
  @property
412
424
  def consumer_permissions(self):
413
425
  """Consumer permissions alias"""
@@ -429,6 +441,15 @@ class ClientContext(ClientRuntimeContext):
429
441
 
430
442
  return EmployeeEngagement(self)
431
443
 
444
+ @property
445
+ def directory_provider(self):
446
+ """Alias to SharePointDirectoryProvider"""
447
+ from office365.sharepoint.directory.provider.provider import (
448
+ SharePointDirectoryProvider,
449
+ )
450
+
451
+ return SharePointDirectoryProvider(self)
452
+
432
453
  @property
433
454
  def employee_experience(self):
434
455
  """Alias to EmployeeExperience"""
@@ -610,6 +631,16 @@ class ClientContext(ClientRuntimeContext):
610
631
 
611
632
  return SPHSite(self, ResourcePath("SPHSite"))
612
633
 
634
+ @property
635
+ def people_picker(self):
636
+ """Query principals service alias"""
637
+
638
+ from office365.sharepoint.ui.applicationpages.peoplepicker.web_service_interface import (
639
+ PeoplePickerWebServiceInterface,
640
+ )
641
+
642
+ return PeoplePickerWebServiceInterface(self)
643
+
613
644
  @property
614
645
  def publications(self):
615
646
  from office365.sharepoint.contentcenter.machinelearning.publications.publication import (
@@ -4,7 +4,7 @@ from office365.sharepoint.comments.comment import Comment
4
4
  from office365.sharepoint.entity_collection import EntityCollection
5
5
 
6
6
 
7
- class CommentCollection(EntityCollection):
7
+ class CommentCollection(EntityCollection[Comment]):
8
8
  def __init__(self, context, resource_path=None):
9
9
  super(CommentCollection, self).__init__(context, Comment, resource_path)
10
10
 
@@ -1,3 +1,5 @@
1
+ from typing import TYPE_CHECKING, Optional
2
+
1
3
  from office365.runtime.client_result import ClientResult
2
4
  from office365.runtime.client_value_collection import ClientValueCollection
3
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -5,8 +7,49 @@ from office365.runtime.types.collections import StringCollection
5
7
  from office365.sharepoint.compliance.tag import ComplianceTag
6
8
  from office365.sharepoint.entity import Entity
7
9
 
10
+ if TYPE_CHECKING:
11
+ from office365.sharepoint.client_context import ClientContext
12
+
8
13
 
9
14
  class SPPolicyStoreProxy(Entity):
15
+ @staticmethod
16
+ def check_site_is_deletable_by_id(context, site_id, return_type=None):
17
+ # type: (ClientContext, str, Optional[ClientResult[bool]]) -> ClientResult[bool]
18
+ """ """
19
+ if return_type is None:
20
+ return_type = ClientResult(context, bool())
21
+ payload = {"siteId": site_id}
22
+ qry = ServiceOperationQuery(
23
+ SPPolicyStoreProxy(context),
24
+ "CheckSiteIsDeletableById",
25
+ None,
26
+ payload,
27
+ None,
28
+ return_type,
29
+ True,
30
+ )
31
+ context.add_query(qry)
32
+ return return_type
33
+
34
+ @staticmethod
35
+ def is_site_deletable(context, site_url, return_type=None):
36
+ # type: (ClientContext, str, Optional[ClientResult[bool]]) -> ClientResult[bool]
37
+ """ """
38
+ if return_type is None:
39
+ return_type = ClientResult(context, bool())
40
+ payload = {"siteUrl": site_url}
41
+ qry = ServiceOperationQuery(
42
+ SPPolicyStoreProxy(context),
43
+ "IsSiteDeletable",
44
+ None,
45
+ payload,
46
+ None,
47
+ return_type,
48
+ True,
49
+ )
50
+ context.add_query(qry)
51
+ return return_type
52
+
10
53
  @staticmethod
11
54
  def get_available_tags_for_site(context, site_url, return_type=None):
12
55
  """
@@ -20,7 +20,7 @@ class ContentType(Entity):
20
20
  """
21
21
 
22
22
  def __str__(self):
23
- return self.name
23
+ return self.name or self.entity_type_name
24
24
 
25
25
  def __repr__(self):
26
26
  return self.string_id or str(self.id) or self.entity_type_name
@@ -111,6 +111,12 @@ class ContentType(Entity):
111
111
  """
112
112
  return self.properties.get("Id", ContentTypeId())
113
113
 
114
+ @property
115
+ def scope(self):
116
+ # type: () -> Optional[str]
117
+ """Specifies a server-relative path to the content type scope of the content type."""
118
+ return self.properties.get("Scope", None)
119
+
114
120
  @property
115
121
  def sealed(self):
116
122
  # type: () -> Optional[bool]
@@ -142,6 +148,12 @@ class ContentType(Entity):
142
148
  item forms"""
143
149
  return self.properties.get("NewFormClientSideComponentProperties", None)
144
150
 
151
+ @property
152
+ def new_form_url(self):
153
+ # type: () -> Optional[str]
154
+ """Specifies the URL of a custom new form to use for list items that have been assigned the content type."""
155
+ return self.properties.get("NewFormUrl", None)
156
+
145
157
  @property
146
158
  def description(self):
147
159
  # type: () -> Optional[str]
@@ -7,7 +7,7 @@ from office365.sharepoint.entity_collection import EntityCollection
7
7
  from office365.sharepoint.fields.field import Field
8
8
 
9
9
 
10
- class FieldLinkCollection(EntityCollection):
10
+ class FieldLinkCollection(EntityCollection[FieldLink]):
11
11
  """Specifies a Collection for field links."""
12
12
 
13
13
  def __init__(self, context, resource_path=None):
@@ -1,6 +1,7 @@
1
1
  from office365.runtime.client_result import ClientResult
2
2
  from office365.runtime.paths.resource_path import ResourcePath
3
3
  from office365.runtime.queries.service_operation import ServiceOperationQuery
4
+ from office365.sharepoint.client_context import ClientContext
4
5
  from office365.sharepoint.directory.members_info import MembersInfo
5
6
  from office365.sharepoint.directory.membership_result import MembershipResult
6
7
  from office365.sharepoint.directory.my_groups_result import MyGroupsResult
@@ -32,6 +33,7 @@ class SPHelper(Entity):
32
33
 
33
34
  @staticmethod
34
35
  def check_site_availability(context, site_url):
36
+ # type: (ClientContext, str) -> ClientResult[bool]
35
37
  """
36
38
  :param str site_url: Site Url
37
39
  :param office365.sharepoint.client_context.ClientContext context: SharePoint context
@@ -0,0 +1,9 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class AlternateIdData(ClientValue):
5
+ """"""
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "SP.Directory.Provider.AlternateIdData"
@@ -0,0 +1,15 @@
1
+ from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.sharepoint.entity import Entity
3
+
4
+
5
+ class DirectoryNotification(Entity):
6
+ """"""
7
+
8
+ def __init__(self, context, resource_path=None):
9
+ if resource_path is None:
10
+ resource_path = ResourcePath("SP.Directory.Provider.DirectoryNotification")
11
+ super(DirectoryNotification, self).__init__(context, resource_path)
12
+
13
+ @property
14
+ def entity_type_name(self):
15
+ return "SP.Directory.Provider.DirectoryNotification"
@@ -0,0 +1,14 @@
1
+ from office365.runtime.client_value import ClientValue
2
+ from office365.sharepoint.directory.provider.alternate_id_data import AlternateIdData
3
+
4
+
5
+ class DirectoryObjectData(ClientValue):
6
+ """"""
7
+
8
+ def __init__(self, AlternateId=AlternateIdData(), Id=None):
9
+ self.AlternateId = AlternateId
10
+ self.Id = Id
11
+
12
+ @property
13
+ def entity_type_name(self):
14
+ return "SP.Directory.Provider.DirectoryObjectData"
@@ -1,4 +1,7 @@
1
+ from office365.runtime.client_result import ClientResult
1
2
  from office365.runtime.paths.resource_path import ResourcePath
3
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
4
+ from office365.sharepoint.directory.provider.object_data import DirectoryObjectData
2
5
  from office365.sharepoint.entity import Entity
3
6
 
4
7
 
@@ -10,6 +13,16 @@ class SharePointDirectoryProvider(Entity):
10
13
  )
11
14
  super(SharePointDirectoryProvider, self).__init__(context, resource_path)
12
15
 
16
+ def read_directory_object(self, data):
17
+ """"""
18
+ return_type = ClientResult(self.context, DirectoryObjectData())
19
+ payload = {"data": data}
20
+ qry = ServiceOperationQuery(
21
+ self, "ReadDirectoryObject", None, payload, None, return_type
22
+ )
23
+ self.context.add_query(qry)
24
+ return return_type
25
+
13
26
  @property
14
27
  def entity_type_name(self):
15
28
  return "SP.Directory.Provider.SharePointDirectoryProvider"
@@ -5,6 +5,7 @@ from typing_extensions import Self
5
5
  from office365.runtime.auth.client_credential import ClientCredential
6
6
  from office365.runtime.auth.user_credential import UserCredential
7
7
  from office365.runtime.client_object import ClientObject
8
+ from office365.runtime.paths.v3.entity import EntityPath
8
9
  from office365.runtime.queries.delete_entity import DeleteEntityQuery
9
10
  from office365.runtime.queries.update_entity import UpdateEntityQuery
10
11
 
@@ -53,3 +54,17 @@ class Entity(ClientObject):
53
54
  @property
54
55
  def property_ref_name(self):
55
56
  return "Id"
57
+
58
+ def set_property(self, name, value, persist_changes=True):
59
+ super(Entity, self).set_property(name, value, persist_changes)
60
+ if name == self.property_ref_name:
61
+ if self.resource_path is None:
62
+ if self.parent_collection:
63
+ self._resource_path = EntityPath(
64
+ value, self.parent_collection.resource_path
65
+ )
66
+ else:
67
+ pass
68
+ else:
69
+ self._resource_path.patch(value)
70
+ return self
@@ -11,6 +11,7 @@ class FeatureCollection(EntityCollection[Feature]):
11
11
  super(FeatureCollection, self).__init__(context, Feature, resource_path, parent)
12
12
 
13
13
  def add(self, feature_id, force, featdef_scope, verify_if_activated=False):
14
+ # type: (str, bool, int, bool) -> Feature
14
15
  """
15
16
  Adds the feature to the collection of activated features and returns the added feature.
16
17
 
@@ -43,6 +44,7 @@ class FeatureCollection(EntityCollection[Feature]):
43
44
  return return_type
44
45
 
45
46
  def get_by_id(self, feature_id):
47
+ # type: (str) -> Feature
46
48
  """Returns the feature for the given feature identifier. Returns NULL if no feature is available for the given
47
49
  feature identifier.
48
50
 
@@ -13,6 +13,7 @@ from office365.sharepoint.fields.number import FieldNumber
13
13
  from office365.sharepoint.fields.text import FieldText
14
14
  from office365.sharepoint.fields.type import FieldType
15
15
  from office365.sharepoint.fields.url import FieldUrl
16
+ from office365.sharepoint.fields.user import FieldUser
16
17
  from office365.sharepoint.fields.xmlSchemaFieldCreationInformation import (
17
18
  XmlSchemaFieldCreationInformation,
18
19
  )
@@ -123,13 +124,12 @@ class FieldCollection(EntityCollection[Field]):
123
124
  :param str title: Specifies the display name of the field.
124
125
  """
125
126
  from office365.sharepoint.fields.lookup import FieldLookup
127
+ from office365.sharepoint.lists.list import List # noqa
126
128
 
127
129
  return_type = FieldLookup(self.context)
128
130
 
129
131
  def _add_lookup_field(lookup_list_id):
130
- """
131
- :type lookup_list_id: str
132
- """
132
+ # type: (str) -> None
133
133
  if allow_multiple_values:
134
134
  field_schema = """
135
135
  <Field Type="LookupMulti" Mult="TRUE" DisplayName="{title}" Required="FALSE" Hidden="TRUE" \
@@ -176,6 +176,7 @@ class FieldCollection(EntityCollection[Field]):
176
176
  return self.add_field(create_field_info)
177
177
 
178
178
  def add_user_field(self, title):
179
+ # type: (str) -> FieldUser
179
180
  """
180
181
  Creates a User field
181
182