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,39 @@
1
+ from office365.backuprestore.service_status import ServiceStatus
2
+ from office365.directory.protection.policy.one_drive_for_business import (
3
+ OneDriveForBusinessProtectionPolicy,
4
+ )
5
+ from office365.entity import Entity
6
+ from office365.entity_collection import EntityCollection
7
+ from office365.runtime.paths.resource_path import ResourcePath
8
+
9
+
10
+ class BackupRestoreRoot(Entity):
11
+ """Represents the Microsoft 365 Backup Storage service in a tenant."""
12
+
13
+ @property
14
+ def service_status(self):
15
+ """Represents the tenant-level status of the Backup Storage service."""
16
+ return self.properties.get("serviceStatus", ServiceStatus())
17
+
18
+ @property
19
+ def one_drive_for_business_protection_policies(self):
20
+ """The list of OneDrive for Business restore sessions available in the tenant."""
21
+ return self.properties.get(
22
+ "oneDriveForBusinessProtectionPolicies",
23
+ EntityCollection(
24
+ self.context,
25
+ OneDriveForBusinessProtectionPolicy,
26
+ ResourcePath(
27
+ "oneDriveForBusinessProtectionPolicies", self.resource_path
28
+ ),
29
+ ),
30
+ )
31
+
32
+ def get_property(self, name, default_value=None):
33
+ if default_value is None:
34
+ property_mapping = {
35
+ "serviceStatus": self.service_status,
36
+ "oneDriveForBusinessProtectionPolicies": self.one_drive_for_business_protection_policies,
37
+ }
38
+ default_value = property_mapping.get(name, None)
39
+ return super(BackupRestoreRoot, self).get_property(name, default_value)
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class ServiceStatus(ClientValue):
5
+ """Represents the tenant-level service status of the backup service."""
@@ -46,6 +46,19 @@ class BookingBusiness(Entity):
46
46
  self.context.add_query(qry)
47
47
  return return_type
48
48
 
49
+ def publish(self):
50
+ """
51
+ Make the scheduling page of a business available to external customers.
52
+
53
+ Set the isPublished property to true, and the publicUrl property to the URL of the scheduling page.
54
+ """
55
+ qry = ServiceOperationQuery(
56
+ self,
57
+ "publish",
58
+ )
59
+ self.context.add_query(qry)
60
+ return self
61
+
49
62
  @property
50
63
  def address(self):
51
64
  """
@@ -1,5 +1,8 @@
1
+ from typing import Optional
2
+
1
3
  from office365.booking.business.business import BookingBusiness
2
4
  from office365.entity_collection import EntityCollection
5
+ from office365.outlook.mail.physical_address import PhysicalAddress
3
6
 
4
7
 
5
8
  class BookingBusinessCollection(EntityCollection[BookingBusiness]):
@@ -10,12 +13,13 @@ class BookingBusinessCollection(EntityCollection[BookingBusiness]):
10
13
  context, BookingBusiness, resource_path
11
14
  )
12
15
 
13
- def add(self, display_name):
16
+ def add(self, display_name, address=None, email=None):
17
+ # type: (str, Optional[PhysicalAddress], Optional[str]) -> BookingBusiness
14
18
  """
15
19
  Create a new Microsoft Bookings business in a tenant.
16
20
  :param str display_name: The business display name.
21
+ :param PhysicalAddress address: The business display name.
22
+ :param str email: The email address for the business.
17
23
  """
18
- props = {
19
- "displayName": display_name,
20
- }
24
+ props = {"displayName": display_name, "address": address, "email": email}
21
25
  return super(BookingBusinessCollection, self).add(**props)
@@ -1,3 +1,4 @@
1
+ from office365.backuprestore.root import BackupRestoreRoot
1
2
  from office365.booking.business.collection import BookingBusinessCollection
2
3
  from office365.booking.currency import BookingCurrency
3
4
  from office365.entity import Entity
@@ -6,7 +7,7 @@ from office365.runtime.paths.resource_path import ResourcePath
6
7
 
7
8
 
8
9
  class SolutionsRoot(Entity):
9
- """"""
10
+ """The entry point for Microsoft Bookings, virtual event, and business scenario APIs."""
10
11
 
11
12
  @property
12
13
  def booking_businesses(self):
@@ -31,11 +32,23 @@ class SolutionsRoot(Entity):
31
32
  ),
32
33
  )
33
34
 
35
+ @property
36
+ def backup_restore(self):
37
+ # type: () -> BackupRestoreRoot
38
+ """Get a Microsoft 365 Backup Storage service in a tenant"""
39
+ return self.properties.get(
40
+ "backupRestore",
41
+ BackupRestoreRoot(
42
+ self.context, ResourcePath("backupRestore", self.resource_path)
43
+ ),
44
+ )
45
+
34
46
  def get_property(self, name, default_value=None):
35
47
  if default_value is None:
36
48
  property_mapping = {
37
49
  "bookingBusinesses": self.booking_businesses,
38
50
  "bookingCurrencies": self.booking_currencies,
51
+ "backupRestore": self.backup_restore,
39
52
  }
40
53
  default_value = property_mapping.get(name, None)
41
54
  return super(SolutionsRoot, self).get_property(name, default_value)
@@ -0,0 +1,42 @@
1
+ from datetime import datetime, timedelta
2
+
3
+ from office365.communications.callrecords.call_record import CallRecord
4
+ from office365.communications.callrecords.direct_routing_log_row import (
5
+ DirectRoutingLogRow,
6
+ )
7
+ from office365.entity_collection import EntityCollection
8
+ from office365.runtime.client_result import ClientResult
9
+ from office365.runtime.client_value_collection import ClientValueCollection
10
+ from office365.runtime.queries.function import FunctionQuery
11
+
12
+
13
+ class CallRecordCollection(EntityCollection[CallRecord]):
14
+ def __init__(self, context, resource_path=None):
15
+ super(CallRecordCollection, self).__init__(context, CallRecord, resource_path)
16
+
17
+ def get_direct_routing_calls(self, from_datetime=None, to_datetime=None):
18
+ """
19
+ Get a log of direct routing calls as a collection of directRoutingLogRow entries.
20
+ :param datetime from_datetime: Start of time range to query.
21
+ :param datetime to_datetime: End of time range to query
22
+ """
23
+ if to_datetime is None:
24
+ to_datetime = datetime.now()
25
+
26
+ if from_datetime is None:
27
+ from_datetime = to_datetime - timedelta(days=30)
28
+
29
+ return_type = ClientResult(
30
+ self.context, ClientValueCollection(DirectRoutingLogRow)
31
+ )
32
+ payload = {
33
+ "fromDateTime": from_datetime.strftime("%Y-%m-%d"),
34
+ "toDateTime": to_datetime.strftime("%Y-%m-%d"),
35
+ }
36
+ qry = FunctionQuery(self, "getDirectRoutingCalls", payload, return_type)
37
+
38
+ def _patch_request(request):
39
+ request.url = request.url.replace("'", "")
40
+
41
+ self.context.add_query(qry).before_query_execute(_patch_request)
42
+ return return_type
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class DirectRoutingLogRow(ClientValue):
5
+ """Represents a row of data in the direct routing call log. Each row maps to one call."""
@@ -1,4 +1,4 @@
1
- from office365.communications.callrecords.call_record import CallRecord
1
+ from office365.communications.callrecords.collection import CallRecordCollection
2
2
  from office365.communications.calls.collection import CallCollection
3
3
  from office365.communications.onlinemeetings.collection import OnlineMeetingCollection
4
4
  from office365.communications.presences.presence import Presence
@@ -37,9 +37,8 @@ class CloudCommunications(Entity):
37
37
  """ " """
38
38
  return self.properties.get(
39
39
  "callRecords",
40
- EntityCollection(
40
+ CallRecordCollection(
41
41
  self.context,
42
- CallRecord,
43
42
  ResourcePath("callRecords", self.resource_path),
44
43
  ),
45
44
  )
@@ -3,7 +3,11 @@ import datetime
3
3
  from typing import Optional
4
4
 
5
5
  from office365.directory.applications.api import ApiApplication
6
+ from office365.directory.applications.optional_claims import OptionalClaims
6
7
  from office365.directory.applications.public_client import PublicClientApplication
8
+ from office365.directory.applications.required_resource_access import (
9
+ RequiredResourceAccess,
10
+ )
7
11
  from office365.directory.applications.roles.role import AppRole
8
12
  from office365.directory.applications.spa import SpaApplication
9
13
  from office365.directory.certificates.certification import Certification
@@ -52,7 +56,7 @@ class Application(DirectoryObject):
52
56
  :param datetime.datetime end_datetime: The date and time at which the credential expires. Default: now + 180days
53
57
  """
54
58
  if start_datetime is None:
55
- start_datetime = datetime.datetime.utcnow()
59
+ start_datetime = datetime.datetime.now()
56
60
  if end_datetime is None:
57
61
  end_datetime = start_datetime + datetime.timedelta(days=180)
58
62
 
@@ -227,7 +231,7 @@ class Application(DirectoryObject):
227
231
  @property
228
232
  def key_credentials(self):
229
233
  """The collection of key credentials associated with the application. Not nullable."""
230
- self._ser_property_names.append("keyCredentials")
234
+ self._properties_to_persist.append("keyCredentials")
231
235
  return self.properties.setdefault(
232
236
  "keyCredentials", ClientValueCollection(KeyCredential)
233
237
  )
@@ -250,6 +254,20 @@ class Application(DirectoryObject):
250
254
  """
251
255
  return self.properties.get("identifierUris", StringCollection())
252
256
 
257
+ @property
258
+ def optional_claims(self):
259
+ """Application developers can configure optional claims in their Microsoft Entra applications to specify
260
+ the claims that are sent to their application by the Microsoft security token service.
261
+ """
262
+ return self.properties.get("optionalClaims", OptionalClaims())
263
+
264
+ @property
265
+ def password_credentials(self):
266
+ """The collection of password credentials associated with the application"""
267
+ return self.properties.get(
268
+ "passwordCredentials", ClientValueCollection(PasswordCredential)
269
+ )
270
+
253
271
  @property
254
272
  def public_client(self):
255
273
  """Specifies settings for installed clients such as desktop or mobile devices."""
@@ -300,6 +318,16 @@ class Application(DirectoryObject):
300
318
  ),
301
319
  )
302
320
 
321
+ @property
322
+ def required_resource_access(self):
323
+ """Specifies the resources that the application needs to access. This property also specifies the set
324
+ of delegated permissions and application roles that it needs for each of those resources.
325
+ This configuration of access to the required resources drives the consent experience.
326
+ """
327
+ return self.properties.get(
328
+ "requiredResourceAccess", ClientValueCollection(RequiredResourceAccess)
329
+ )
330
+
303
331
  @property
304
332
  def token_issuance_policies(self):
305
333
  # type: () -> EntityCollection[TokenIssuancePolicy]
@@ -321,7 +349,10 @@ class Application(DirectoryObject):
321
349
  "createdOnBehalfOf": self.created_on_behalf_of,
322
350
  "extensionProperties": self.extension_properties,
323
351
  "keyCredentials": self.key_credentials,
352
+ "optionalClaims": self.optional_claims,
353
+ "passwordCredentials": self.password_credentials,
324
354
  "publicClient": self.public_client,
355
+ "requiredResourceAccess": self.required_resource_access,
325
356
  "tokenIssuancePolicies": self.token_issuance_policies,
326
357
  }
327
358
  default_value = property_mapping.get(name, None)
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class OptionalClaim(ClientValue):
5
+ """Contains an optional claim associated with an application"""
@@ -0,0 +1,16 @@
1
+ from office365.directory.applications.optional_claim import OptionalClaim
2
+ from office365.runtime.client_value import ClientValue
3
+ from office365.runtime.client_value_collection import ClientValueCollection
4
+
5
+
6
+ class OptionalClaims(ClientValue):
7
+ """An application can configure optional claims to be returned in each of three types of tokens
8
+ (ID token, access token, SAML 2 token) it can receive from the security token service.
9
+ An application can configure a different set of optional claims to be returned in each token type.
10
+ The optionalClaims property of the application is an optionalClaims object."""
11
+
12
+ def __init__(self, access_token=None, id_token=None, saml2_token=None):
13
+ """ """
14
+ self.accessToken = ClientValueCollection(OptionalClaim, access_token)
15
+ self.idToken = ClientValueCollection(OptionalClaim, id_token)
16
+ self.saml2Token = ClientValueCollection(OptionalClaim, saml2_token)
@@ -0,0 +1,23 @@
1
+ from office365.directory.applications.resource_access import ResourceAccess
2
+ from office365.runtime.client_value import ClientValue
3
+ from office365.runtime.client_value_collection import ClientValueCollection
4
+
5
+
6
+ class RequiredResourceAccess(ClientValue):
7
+ """Specifies the set of OAuth 2.0 permission scopes and app roles under the specified resource that an
8
+ application requires access to. The application may request the specified OAuth 2.0 permission scopes or app
9
+ roles through the requiredResourceAccess property, which is a collection of requiredResourceAccess objects.
10
+ """
11
+
12
+ def __init__(self, resource_access=None, resource_app_id=None):
13
+ """
14
+ :param list[ResourceAccess] resource_access: The list of OAuth2.0 permission scopes and app roles that
15
+ the application requires from the specified resource.
16
+ :param str resource_app_id: The unique identifier for the resource that the application requires access to.
17
+ This should be equal to the appId declared on the target resource application.
18
+ """
19
+ self.resourceAccess = ClientValueCollection(ResourceAccess, resource_access)
20
+ self.resourceAppId = resource_app_id
21
+
22
+ def __repr__(self):
23
+ return self.resourceAppId or self.entity_type_name
@@ -0,0 +1,26 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class ResourceAccess(ClientValue):
5
+ """Object used to specify an OAuth 2.0 permission scope or an app role that an application requires,
6
+ through the resourceAccess property of the requiredResourceAccess resource type."""
7
+
8
+ def __init__(self, id_=None, type_=None):
9
+ """
10
+ :param str id_: The unique identifier of an app role or delegated permission exposed by the resource
11
+ application. For delegated permissions, this should match the id property of one of the delegated
12
+ permissions in the oauth2PermissionScopes collection of the resource application's service principal.
13
+ For app roles (application permissions), this should match the id property of an app role in the appRoles
14
+ collection of the resource application's service principal.
15
+ :param str type_: Specifies whether the id property references a delegated permission or an app role
16
+ (application permission). The possible values are: Scope (for delegated permissions) or Role (for app roles).
17
+ """
18
+ self.id = id_
19
+ self.type = type_
20
+
21
+ def __repr__(self):
22
+ return "ResourceAccess(id={!r}, type={!r})".format(self.id, self.type)
23
+
24
+ @property
25
+ def type_name(self):
26
+ return "Delegated" if self.type == "Scope" else "Application"
@@ -0,0 +1,9 @@
1
+ from office365.entity import Entity
2
+
3
+
4
+ class AuthenticationEventListener(Entity):
5
+ """
6
+ Defines a listener to evaluate when an authentication event happens in an authentication experience.
7
+ An authenticationListener is abstract and is the base class of the various types of listeners you can evaluate
8
+ during an authentication event.
9
+ """
@@ -54,6 +54,32 @@ class UserRegistrationDetails(Entity):
54
54
  """
55
55
  return self.properties.get("isSsprEnabled", None)
56
56
 
57
+ @property
58
+ def user_display_name(self):
59
+ # type: () -> Optional[str]
60
+ """
61
+ The user display name, such as Adele Vance. Supports $filter (eq, startsWith) and $orderby.
62
+ """
63
+ return self.properties.get("userDisplayName", None)
64
+
65
+ @property
66
+ def user_preferred_method_for_secondary_authentication(self):
67
+ # type: () -> Optional[str]
68
+ """
69
+ The method the user selected as the default second-factor for performing multifactor authentication.
70
+ """
71
+ return self.properties.get(
72
+ "userPreferredMethodForSecondaryAuthentication", None
73
+ )
74
+
75
+ @property
76
+ def user_principal_name(self):
77
+ # type: () -> Optional[str]
78
+ """
79
+ The user principal name, such as AdeleV@contoso.com. Supports $filter (eq, startsWith) and $orderby.
80
+ """
81
+ return self.properties.get("userPrincipalName", None)
82
+
57
83
  @property
58
84
  def user_type(self):
59
85
  # type: () -> Optional[str]
@@ -62,3 +88,6 @@ class UserRegistrationDetails(Entity):
62
88
  The possible values are: member, guest, unknownFutureValue.
63
89
  """
64
90
  return self.properties.get("userType", None)
91
+
92
+ def __repr__(self):
93
+ return self.user_principal_name or self.id or self.entity_type_name
@@ -32,3 +32,11 @@ class AuthenticationMethodsRoot(Entity):
32
32
  ResourcePath("userRegistrationDetails", self.resource_path),
33
33
  ),
34
34
  )
35
+
36
+ def get_property(self, name, default_value=None):
37
+ if default_value is None:
38
+ property_mapping = {
39
+ "userRegistrationDetails": self.user_registration_details
40
+ }
41
+ default_value = property_mapping.get(name, None)
42
+ return super(AuthenticationMethodsRoot, self).get_property(name, default_value)
@@ -1,6 +1,27 @@
1
+ from datetime import datetime
2
+ from typing import Optional
3
+
1
4
  from office365.entity import Entity
2
5
 
3
6
 
4
7
  class DeviceLocalCredentialInfo(Entity):
5
8
  """Represents local administrator credential information for all device objects in Azure Active Directory
6
9
  that are enabled with Local Admin Password Solution (LAPS)."""
10
+
11
+ @property
12
+ def device_name(self):
13
+ # type: () -> Optional[str]
14
+ """
15
+ Display name of the device that the local credentials are associated with.
16
+ """
17
+ return self.properties.get("deviceName", None)
18
+
19
+ @property
20
+ def last_backup_datetime(self):
21
+ """When the local administrator account credential was backed up to Azure Active Directory."""
22
+ return self.properties.get("lastBackupDateTime", datetime.min)
23
+
24
+ @property
25
+ def refresh_datetime(self):
26
+ """When the local administrator account credential will be refreshed and backed up to Azure Active Directory."""
27
+ return self.properties.get("refreshDateTime", datetime.min)
@@ -1,3 +1,6 @@
1
+ from office365.directory.authentication.conditions.event_listener import (
2
+ AuthenticationEventListener,
3
+ )
1
4
  from office365.directory.identities.api_connector import IdentityApiConnector
2
5
  from office365.directory.identities.conditional_access_root import ConditionalAccessRoot
3
6
  from office365.directory.identities.providers.base_collection import (
@@ -18,6 +21,7 @@ class IdentityContainer(Entity):
18
21
 
19
22
  @property
20
23
  def api_connectors(self):
24
+ # type: () -> EntityCollection[IdentityApiConnector]
21
25
  """Represents entry point for API connectors."""
22
26
  return self.properties.get(
23
27
  "apiConnectors",
@@ -28,6 +32,19 @@ class IdentityContainer(Entity):
28
32
  ),
29
33
  )
30
34
 
35
+ @property
36
+ def authentication_event_listeners(self):
37
+ # type: () -> EntityCollection[AuthenticationEventListener]
38
+ """Get the collection of authenticationListener resources supported by the onSignupStart event."""
39
+ return self.properties.get(
40
+ "authenticationEventListeners",
41
+ EntityCollection(
42
+ self.context,
43
+ AuthenticationEventListener,
44
+ ResourcePath("authenticationEventListeners", self.resource_path),
45
+ ),
46
+ )
47
+
31
48
  @property
32
49
  def conditional_access(self):
33
50
  """The entry point for the Conditional Access (CA) object model."""
@@ -76,6 +93,7 @@ class IdentityContainer(Entity):
76
93
  if default_value is None:
77
94
  property_mapping = {
78
95
  "apiConnectors": self.api_connectors,
96
+ "authenticationEventListeners": self.authentication_event_listeners,
79
97
  "b2xUserFlows": self.b2x_user_flows,
80
98
  "conditionalAccess": self.conditional_access,
81
99
  "identityProviders": self.identity_providers,
@@ -15,8 +15,13 @@ class PermissionScope(ClientValue):
15
15
  self,
16
16
  admin_consent_display_name=None,
17
17
  admin_consent_description=None,
18
- _id=None,
18
+ id_=None,
19
19
  is_enabled=None,
20
+ origin=None,
21
+ type_=None,
22
+ user_consent_description=None,
23
+ user_consent_display_name=None,
24
+ value=None,
20
25
  ):
21
26
  """
22
27
  :param str admin_consent_display_name: The permission's title, intended to be read by an administrator granting
@@ -24,13 +29,20 @@ class PermissionScope(ClientValue):
24
29
  :param str admin_consent_description: A description of the delegated permissions, intended to be read
25
30
  by an administrator granting the permission on behalf of all users. This text appears in tenant-wide
26
31
  admin consent experiences.
27
- :param str _id: Unique delegated permission identifier inside the collection of delegated permissions defined
32
+ :param str id_: Unique delegated permission identifier inside the collection of delegated permissions defined
28
33
  for a resource application.
29
34
  :param str is_enabled: When creating or updating a permission, this property must be set to true
30
35
  (which is the default). To delete a permission, this property must first be set to false.
31
36
  At that point, in a subsequent call, the permission may be removed.
37
+
38
+ :param str value: Specifies the value to include in the scp (scope) claim in access tokens.
32
39
  """
33
40
  self.adminConsentDescription = admin_consent_description
34
41
  self.adminConsentDisplayName = admin_consent_display_name
35
- self.id = _id
42
+ self.id = id_
36
43
  self.isEnabled = is_enabled
44
+ self.origin = origin
45
+ self.type = type_
46
+ self.userConsentDescription = user_consent_description
47
+ self.userConsentDisplayName = user_consent_display_name
48
+ self.value = value
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
 
3
5
 
@@ -7,3 +9,9 @@ class AuthenticationFlowsPolicy(Entity):
7
9
  users request to sign up for approval. It contains information, such as the identifier, display name, and
8
10
  description, and indicates whether self-service sign-up is enabled for the policy.
9
11
  """
12
+
13
+ @property
14
+ def display_name(self):
15
+ # type: () -> Optional[str]
16
+ """The human-readable name of the policy."""
17
+ return self.properties.get("displayName", None)
@@ -1,9 +1,13 @@
1
1
  from office365.directory.authentication.strength_usage import (
2
2
  AuthenticationStrengthUsage,
3
3
  )
4
+ from office365.directory.policies.update_allowed_combinations_result import (
5
+ UpdateAllowedCombinationsResult,
6
+ )
4
7
  from office365.entity import Entity
5
8
  from office365.runtime.client_result import ClientResult
6
9
  from office365.runtime.queries.function import FunctionQuery
10
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
7
11
 
8
12
 
9
13
  class AuthenticationStrengthPolicy(Entity):
@@ -26,3 +30,20 @@ class AuthenticationStrengthPolicy(Entity):
26
30
  qry = FunctionQuery(self, "usage", None, return_type)
27
31
  self.context.add_query(qry)
28
32
  return return_type
33
+
34
+ def update_allowed_combinations(self, allowed_combinations=None):
35
+ """
36
+ Update the allowedCombinations property of an authenticationStrengthPolicy object.
37
+ To update other properties of an authenticationStrengthPolicy object,
38
+ use the Update authenticationStrengthPolicy method.
39
+
40
+ :param list[str] allowed_combinations: The authentication method combinations allowed by this authentication
41
+ strength policy.
42
+ """
43
+ return_type = ClientResult(self.context, UpdateAllowedCombinationsResult())
44
+ payload = {"allowedCombinations": allowed_combinations}
45
+ qry = ServiceOperationQuery(
46
+ self, "updateAllowedCombinations", None, payload, None, return_type
47
+ )
48
+ self.context.add_query(qry)
49
+ return return_type
@@ -13,6 +13,9 @@ from office365.directory.policies.cross_tenant_access import CrossTenantAccessPo
13
13
  from office365.directory.policies.device_registration import DeviceRegistrationPolicy
14
14
  from office365.directory.policies.permission_grant import PermissionGrantPolicy
15
15
  from office365.directory.policies.tenant_app_management import TenantAppManagementPolicy
16
+ from office365.directory.policies.unified_role_management import (
17
+ UnifiedRoleManagementPolicy,
18
+ )
16
19
  from office365.entity import Entity
17
20
  from office365.entity_collection import EntityCollection
18
21
  from office365.runtime.paths.resource_path import ResourcePath
@@ -162,6 +165,19 @@ class PolicyRoot(Entity):
162
165
  ),
163
166
  )
164
167
 
168
+ @property
169
+ def role_management_policies(self):
170
+ # type: () -> EntityCollection[UnifiedRoleManagementPolicy]
171
+ """Specifies the various policies associated with scopes and roles."""
172
+ return self.properties.get(
173
+ "roleManagementPolicies",
174
+ EntityCollection(
175
+ self.context,
176
+ UnifiedRoleManagementPolicy,
177
+ ResourcePath("roleManagementPolicies", self.resource_path),
178
+ ),
179
+ )
180
+
165
181
  def get_property(self, name, default_value=None):
166
182
  if default_value is None:
167
183
  property_mapping = {
@@ -176,6 +192,7 @@ class PolicyRoot(Entity):
176
192
  "defaultAppManagementPolicy": self.default_app_management_policy,
177
193
  "deviceRegistrationPolicy": self.device_registration_policy,
178
194
  "permissionGrantPolicies": self.permission_grant_policies,
195
+ "roleManagementPolicies": self.role_management_policies,
179
196
  }
180
197
  default_value = property_mapping.get(name, None)
181
198
  return super(PolicyRoot, self).get_property(name, default_value)
@@ -0,0 +1,7 @@
1
+ from office365.entity import Entity
2
+
3
+
4
+ class UnifiedRoleManagementPolicy(Entity):
5
+ """Specifies the various policies associated with scopes and roles.
6
+ For policies that apply to Azure RBAC, use the Azure REST PIM API for role management policies.
7
+ """
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class UpdateAllowedCombinationsResult(ClientValue):
5
+ """ """
File without changes
@@ -0,0 +1,24 @@
1
+ from office365.directory.permissions.identity_set import IdentitySet
2
+ from office365.entity import Entity
3
+
4
+
5
+ class ProtectionPolicyBase(Entity):
6
+ """
7
+ Contains details about protection policies applied to Microsoft 365 data in an organization.
8
+ Protection policies are defined by the Global Admin (or the SharePoint Online Admin or Exchange Online Admin)
9
+ and include what data to protect, when to protect it, and for what time period to retain the protected data
10
+ for a single Microsoft 365 service.
11
+ """
12
+
13
+ @property
14
+ def created_by(self):
15
+ """Identity of the user, device, or application which created the item."""
16
+ return self.properties.get("createdBy", IdentitySet())
17
+
18
+ def get_property(self, name, default_value=None):
19
+ if default_value is None:
20
+ property_mapping = {
21
+ "createdBy": self.created_by,
22
+ }
23
+ default_value = property_mapping.get(name, None)
24
+ return super(ProtectionPolicyBase, self).get_property(name, default_value)