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.
- {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/METADATA +5 -5
- {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/RECORD +147 -96
- office365/communications/onlinemeetings/online_meeting.py +30 -3
- office365/communications/onlinemeetings/recordings/__init__.py +0 -0
- office365/communications/onlinemeetings/recordings/call.py +5 -0
- office365/communications/onlinemeetings/transcripts/__init__.py +0 -0
- office365/directory/administrative_unit.py +9 -2
- office365/directory/applications/roles/collection.py +5 -1
- office365/directory/applications/roles/role.py +1 -1
- office365/directory/audit/provisioning/object_summary.py +30 -1
- office365/directory/authentication/methods/fido.py +8 -0
- office365/directory/authentication/methods/password.py +23 -0
- office365/directory/custom_security_attribute_definition.py +7 -0
- office365/directory/device_local_credential_info.py +6 -0
- office365/directory/directory.py +40 -12
- office365/directory/identitygovernance/appconsent/request_collection.py +1 -1
- office365/directory/identitygovernance/entitlementmanagement/entitlement_management.py +7 -0
- office365/directory/identitygovernance/governance.py +16 -0
- office365/directory/identitygovernance/termsofuse/agreement_acceptance.py +8 -0
- office365/directory/identitygovernance/userconsent/request_collection.py +1 -1
- office365/directory/insights/resource_reference.py +1 -1
- office365/directory/policies/device_registration.py +6 -0
- office365/directory/policies/root.py +13 -0
- office365/directory/security/threatintelligence/article_indicator.py +7 -0
- office365/directory/serviceprincipals/service_principal.py +109 -25
- office365/directory/synchronization/schema.py +16 -0
- office365/directory/users/user.py +23 -0
- office365/graph_client.py +8 -0
- office365/onedrive/driveitems/driveItem.py +86 -6
- office365/onedrive/driveitems/retention_label.py +25 -0
- office365/onedrive/lists/list.py +1 -1
- office365/onedrive/sitepages/__init__.py +0 -0
- office365/onedrive/sitepages/base.py +29 -0
- office365/onedrive/sitepages/canvas_layout.py +43 -0
- office365/onedrive/sitepages/collection.py +32 -0
- office365/onedrive/sitepages/horizontal_section.py +23 -0
- office365/onedrive/sitepages/horizontal_section_column.py +27 -0
- office365/onedrive/sitepages/site_page.py +116 -0
- office365/onedrive/sitepages/title_area.py +13 -0
- office365/onedrive/sitepages/vertical_section.py +27 -0
- office365/onedrive/sitepages/web_part.py +5 -0
- office365/onedrive/sites/site.py +10 -0
- office365/onedrive/workbooks/charts/chart.py +13 -0
- office365/onedrive/workbooks/charts/data_labels.py +13 -1
- office365/onedrive/workbooks/icon.py +5 -0
- office365/onedrive/workbooks/names/named_item.py +6 -0
- office365/onedrive/workbooks/ranges/font.py +5 -0
- office365/onedrive/workbooks/ranges/format.py +60 -0
- office365/onedrive/workbooks/ranges/range.py +12 -0
- office365/onedrive/workbooks/ranges/reference.py +6 -0
- office365/onedrive/workbooks/sort_field.py +26 -0
- office365/onedrive/workbooks/tables/pivot_table_collection.py +16 -0
- office365/onedrive/workbooks/tables/sort.py +5 -0
- office365/onedrive/workbooks/tables/table.py +57 -0
- office365/onedrive/workbooks/worksheets/protection.py +20 -1
- office365/onedrive/workbooks/worksheets/protection_options.py +10 -0
- office365/onedrive/workbooks/worksheets/worksheet.py +5 -4
- office365/outlook/calendar/calendar.py +1 -3
- office365/outlook/calendar/events/event.py +45 -0
- office365/outlook/calendar/response_status.py +11 -0
- office365/outlook/calendar/rooms/room.py +14 -0
- office365/outlook/mail/automatic_replies_mailtips.py +5 -0
- office365/outlook/mail/conversation.py +1 -3
- office365/outlook/mail/folders/folder.py +1 -3
- office365/outlook/mail/tips.py +17 -0
- office365/planner/plans/plan.py +11 -1
- office365/reports/root.py +33 -0
- office365/runtime/auth/authentication_context.py +12 -2
- office365/runtime/odata/json_format.py +3 -2
- office365/runtime/odata/request.py +12 -2
- office365/runtime/queries/upload_session.py +5 -0
- office365/sharepoint/activities/action_facet.py +17 -0
- office365/sharepoint/activities/client_request.py +4 -0
- office365/sharepoint/activities/client_response.py +8 -0
- office365/sharepoint/activities/entity.py +10 -0
- office365/sharepoint/activities/facets/delete.py +1 -0
- office365/sharepoint/activities/facets/get_mention.py +10 -0
- office365/sharepoint/activities/facets/in_doc.py +4 -0
- office365/sharepoint/activities/facets/move.py +14 -0
- office365/sharepoint/activities/facets/point_in_time_restore.py +9 -0
- office365/sharepoint/activities/facets/revision_set.py +9 -0
- office365/sharepoint/activities/facets/task_completed.py +9 -0
- office365/sharepoint/activities/facets/version.py +12 -0
- office365/sharepoint/activities/identity_item.py +16 -1
- office365/sharepoint/alerts/collection.py +2 -1
- office365/sharepoint/attachments/attachment.py +6 -9
- office365/sharepoint/attachments/collection.py +25 -3
- office365/sharepoint/client_context.py +33 -2
- office365/sharepoint/comments/collection.py +1 -1
- office365/sharepoint/compliance/store_proxy.py +43 -0
- office365/sharepoint/contenttypes/content_type.py +13 -1
- office365/sharepoint/contenttypes/fieldlinks/collection.py +1 -1
- office365/sharepoint/directory/helper.py +2 -0
- office365/sharepoint/directory/provider/alternate_id_data.py +9 -0
- office365/sharepoint/directory/provider/notification.py +15 -0
- office365/sharepoint/directory/provider/object_data.py +14 -0
- office365/sharepoint/directory/provider/provider.py +13 -0
- office365/sharepoint/entity.py +15 -0
- office365/sharepoint/features/collection.py +2 -0
- office365/sharepoint/fields/collection.py +4 -3
- office365/sharepoint/fields/user_value.py +1 -1
- office365/sharepoint/folders/folder.py +3 -5
- office365/sharepoint/migrationcenter/deploy_status.py +5 -0
- office365/sharepoint/migrationcenter/service/performance/__init__.py +0 -0
- office365/sharepoint/migrationcenter/service/performance/dashboard_data.py +9 -0
- office365/sharepoint/migrationcenter/service/performance/data.py +7 -0
- office365/sharepoint/migrationcenter/service/performance/entity_data.py +5 -0
- office365/sharepoint/multigeo/move_job_entity_data.py +9 -0
- office365/sharepoint/multigeo/site_move_job_entity_data.py +9 -0
- office365/sharepoint/multigeo/user_personal_site_location.py +9 -0
- office365/sharepoint/permissions/securable_object.py +2 -0
- office365/sharepoint/principal/principal.py +2 -4
- office365/sharepoint/recyclebin/item.py +107 -7
- office365/sharepoint/sharing/information.py +9 -0
- office365/sharepoint/sharing/link_info.py +6 -0
- office365/sharepoint/sharing/object_sharing_information.py +2 -0
- office365/sharepoint/sharing/permission_collection.py +18 -0
- office365/sharepoint/sharing/shared_document_info.py +9 -0
- office365/sharepoint/sites/script_safe_domain.py +5 -0
- office365/sharepoint/sites/site.py +10 -4
- office365/sharepoint/sites/version_policy_manager.py +7 -0
- office365/sharepoint/taxonomy/field_value.py +1 -1
- office365/sharepoint/tenant/administration/powerapps/__init__.py +0 -0
- office365/sharepoint/tenant/administration/powerapps/environment_context.py +8 -0
- office365/sharepoint/tenant/administration/secondary_administrators_info.py +5 -0
- office365/sharepoint/tenant/administration/tenant.py +14 -0
- office365/sharepoint/tenant/cdn_api.py +16 -0
- office365/sharepoint/tenant/management/externalusers/results/get.py +4 -0
- office365/sharepoint/tenant/management/office365_tenant.py +14 -0
- office365/sharepoint/ui/applicationpages/peoplepicker/web_service_interface.py +39 -33
- office365/sharepoint/userprofiles/cross_geo_sync.py +37 -0
- office365/sharepoint/userprofiles/cross_geo_sync_user_data_batch.py +5 -0
- office365/sharepoint/userprofiles/followed_content.py +15 -0
- office365/sharepoint/userprofiles/people_manager.py +23 -10
- office365/sharepoint/userprofiles/person_properties.py +7 -0
- office365/sharepoint/userprofiles/user_profile.py +4 -6
- office365/sharepoint/views/view.py +2 -0
- office365/sharepoint/webs/information_collection.py +1 -1
- office365/sharepoint/webs/regional_settings.py +71 -0
- office365/sharepoint/webs/web.py +53 -5
- office365/sharepoint/workflowservices/deployment_service.py +9 -0
- office365/teams/apps/catalog.py +1 -0
- office365/teams/chats/chat.py +4 -0
- office365/teams/schedule/schedule.py +6 -2
- {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.6.dist-info → Office365_REST_Python_Client-2.5.8.dist-info}/top_level.txt +0 -0
|
@@ -2,8 +2,13 @@ from datetime import datetime
|
|
|
2
2
|
from typing import AnyStr, Optional
|
|
3
3
|
|
|
4
4
|
from office365.communications.onlinemeetings.participants import MeetingParticipants
|
|
5
|
+
from office365.communications.onlinemeetings.recordings.call import CallRecording
|
|
5
6
|
from office365.entity import Entity
|
|
7
|
+
from office365.entity_collection import EntityCollection
|
|
6
8
|
from office365.outlook.mail.item_body import ItemBody
|
|
9
|
+
from office365.runtime.client_result import ClientResult
|
|
10
|
+
from office365.runtime.paths.resource_path import ResourcePath
|
|
11
|
+
from office365.runtime.queries.function import FunctionQuery
|
|
7
12
|
from office365.runtime.types.collections import StringCollection
|
|
8
13
|
|
|
9
14
|
|
|
@@ -13,6 +18,17 @@ class OnlineMeeting(Entity):
|
|
|
13
18
|
the attendees list, and the description.
|
|
14
19
|
"""
|
|
15
20
|
|
|
21
|
+
def get_virtual_appointment_join_web_url(self):
|
|
22
|
+
"""Get a join web URL for a Microsoft Virtual Appointment. This web URL includes enhanced
|
|
23
|
+
business-to-customer experiences such as mobile browser join and virtual lobby rooms.
|
|
24
|
+
With Teams Premium, you can configure a custom lobby room experience for attendees by adding your company
|
|
25
|
+
logo and access the Virtual Appointments usage report for organizational analytics.
|
|
26
|
+
"""
|
|
27
|
+
return_type = ClientResult(self.context, str())
|
|
28
|
+
qry = FunctionQuery(self, "getVirtualAppointmentJoinWebUrl", None, return_type)
|
|
29
|
+
self.context.add_query(qry)
|
|
30
|
+
return return_type
|
|
31
|
+
|
|
16
32
|
@property
|
|
17
33
|
def allow_attendee_to_enable_camera(self):
|
|
18
34
|
# type: () -> Optional[bool]
|
|
@@ -74,9 +90,7 @@ class OnlineMeeting(Entity):
|
|
|
74
90
|
@start_datetime.setter
|
|
75
91
|
def start_datetime(self, value):
|
|
76
92
|
# type: (datetime) -> None
|
|
77
|
-
"""
|
|
78
|
-
Sets the meeting start time in UTC.
|
|
79
|
-
"""
|
|
93
|
+
"""Sets the meeting start time in UTC."""
|
|
80
94
|
self.set_property("startDateTime", value.isoformat())
|
|
81
95
|
|
|
82
96
|
@property
|
|
@@ -107,6 +121,19 @@ class OnlineMeeting(Entity):
|
|
|
107
121
|
"""The video teleconferencing ID."""
|
|
108
122
|
return self.properties.get("videoTeleconferenceId", None)
|
|
109
123
|
|
|
124
|
+
@property
|
|
125
|
+
def recordings(self):
|
|
126
|
+
# type: () -> EntityCollection[CallRecording]
|
|
127
|
+
"""he recordings of an online meeting"""
|
|
128
|
+
return self.properties.get(
|
|
129
|
+
"recordings",
|
|
130
|
+
EntityCollection(
|
|
131
|
+
self.context,
|
|
132
|
+
CallRecording,
|
|
133
|
+
ResourcePath("recordings", self.resource_path),
|
|
134
|
+
),
|
|
135
|
+
)
|
|
136
|
+
|
|
110
137
|
def get_property(self, name, default_value=None):
|
|
111
138
|
if default_value is None:
|
|
112
139
|
property_mapping = {
|
|
File without changes
|
|
File without changes
|
|
@@ -21,10 +21,17 @@ class AdministrativeUnit(DirectoryObject):
|
|
|
21
21
|
return self.properties.get("displayName", None)
|
|
22
22
|
|
|
23
23
|
@property
|
|
24
|
-
def
|
|
24
|
+
def visibility(self):
|
|
25
25
|
"""
|
|
26
|
-
|
|
26
|
+
Controls whether the administrative unit and its members are hidden or public. Can be set to HiddenMembership.
|
|
27
|
+
If not set (value is null), the default behavior is public. When set to HiddenMembership, only members of
|
|
28
|
+
the administrative unit can list other members of the administrative unit.
|
|
27
29
|
"""
|
|
30
|
+
return self.properties.get("visibility", None)
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def members(self):
|
|
34
|
+
"""Users and groups that are members of this administrative unit"""
|
|
28
35
|
from office365.directory.object_collection import DirectoryObjectCollection
|
|
29
36
|
|
|
30
37
|
return self.properties.get(
|
|
@@ -10,4 +10,8 @@ class AppRoleCollection(ClientValueCollection[AppRole]):
|
|
|
10
10
|
|
|
11
11
|
def __getitem__(self, key):
|
|
12
12
|
# type: (str) -> AppRole
|
|
13
|
-
return
|
|
13
|
+
return self.get_by_value(key)
|
|
14
|
+
|
|
15
|
+
def get_by_value(self, value):
|
|
16
|
+
# type: (str) -> AppRole
|
|
17
|
+
return next(iter([item for item in self._data if item.value == value]), None)
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
1
4
|
from office365.directory.audit.provisioning.service_principal import (
|
|
2
5
|
ProvisioningServicePrincipal,
|
|
3
6
|
)
|
|
@@ -7,6 +10,29 @@ from office365.entity import Entity
|
|
|
7
10
|
class ProvisioningObjectSummary(Entity):
|
|
8
11
|
"""Represents an action performed by the Azure AD Provisioning service and its associated properties."""
|
|
9
12
|
|
|
13
|
+
@property
|
|
14
|
+
def activity_datetime(self):
|
|
15
|
+
"""Represents date and time information using ISO 8601 format and is always in UTC time."""
|
|
16
|
+
return self.properties.get("activityDateTime", datetime.min)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def change_id(self):
|
|
20
|
+
# type: () -> Optional[str]
|
|
21
|
+
"""Unique ID of this change in this cycle. Supports $filter (eq, contains)."""
|
|
22
|
+
return self.properties.get("changeId", None)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def cycle_id(self):
|
|
26
|
+
# type: () -> Optional[str]
|
|
27
|
+
"""Unique ID per job iteration. Supports $filter (eq, contains)."""
|
|
28
|
+
return self.properties.get("cycleId", None)
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def duration_in_milliseconds(self):
|
|
32
|
+
# type: () -> Optional[int]
|
|
33
|
+
"""Indicates how long this provisioning action took to finish. Measured in milliseconds."""
|
|
34
|
+
return self.properties.get("durationInMilliseconds", None)
|
|
35
|
+
|
|
10
36
|
@property
|
|
11
37
|
def service_principal(self):
|
|
12
38
|
"""Represents the service principal used for provisioning."""
|
|
@@ -14,6 +40,9 @@ class ProvisioningObjectSummary(Entity):
|
|
|
14
40
|
|
|
15
41
|
def get_property(self, name, default_value=None):
|
|
16
42
|
if default_value is None:
|
|
17
|
-
property_mapping = {
|
|
43
|
+
property_mapping = {
|
|
44
|
+
"activityDateTime": self.activity_datetime,
|
|
45
|
+
"servicePrincipal": self.service_principal,
|
|
46
|
+
}
|
|
18
47
|
default_value = property_mapping.get(name, None)
|
|
19
48
|
return super(ProvisioningObjectSummary, self).get_property(name, default_value)
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.directory.authentication.methods.method import AuthenticationMethod
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
class Fido2AuthenticationMethod(AuthenticationMethod):
|
|
5
7
|
"""Representation of a FIDO2 security key registered to a user. FIDO2 is a sign-in authentication method."""
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def model(self):
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
"""The manufacturer-assigned model of the FIDO2 security key."""
|
|
13
|
+
return self.properties.get("model", None)
|
|
@@ -1,6 +1,29 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
1
4
|
from office365.directory.authentication.methods.method import AuthenticationMethod
|
|
2
5
|
|
|
3
6
|
|
|
4
7
|
class PasswordAuthenticationMethod(AuthenticationMethod):
|
|
5
8
|
"""A representation of a user's password. For security, the password itself will never be returned in the object,
|
|
6
9
|
but action can be taken to reset a password."""
|
|
10
|
+
|
|
11
|
+
@property
|
|
12
|
+
def created_datetime(self):
|
|
13
|
+
# type: () -> datetime
|
|
14
|
+
"""The date and time when this password was last updated. This property is currently not populated."""
|
|
15
|
+
return self.properties.get("createdDateTime", datetime.min)
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def password(self):
|
|
19
|
+
# type: () -> Optional[str]
|
|
20
|
+
"""For security, the password is always returned as null from a LIST or GET operation."""
|
|
21
|
+
return self.properties.get("password", None)
|
|
22
|
+
|
|
23
|
+
def get_property(self, name, default_value=None):
|
|
24
|
+
if default_value is None:
|
|
25
|
+
property_mapping = {"createdDateTime": self.created_datetime}
|
|
26
|
+
default_value = property_mapping.get(name, None)
|
|
27
|
+
return super(PasswordAuthenticationMethod, self).get_property(
|
|
28
|
+
name, default_value
|
|
29
|
+
)
|
office365/directory/directory.py
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
from office365.directory.administrative_unit import AdministrativeUnit
|
|
2
|
+
from office365.directory.custom_security_attribute_definition import (
|
|
3
|
+
CustomSecurityAttributeDefinition,
|
|
4
|
+
)
|
|
5
|
+
from office365.directory.device_local_credential_info import DeviceLocalCredentialInfo
|
|
2
6
|
from office365.directory.object_collection import DirectoryObjectCollection
|
|
3
7
|
from office365.entity import Entity
|
|
4
8
|
from office365.entity_collection import EntityCollection
|
|
@@ -10,6 +14,42 @@ class Directory(Entity):
|
|
|
10
14
|
"container". Deleted items will remain available to restore for up to 30 days. After 30 days, the items are
|
|
11
15
|
permanently deleted."""
|
|
12
16
|
|
|
17
|
+
@property
|
|
18
|
+
def device_local_credentials(self):
|
|
19
|
+
"""Conceptual container for user and group directory objects."""
|
|
20
|
+
return self.properties.get(
|
|
21
|
+
"deviceLocalCredentials",
|
|
22
|
+
EntityCollection(
|
|
23
|
+
self.context,
|
|
24
|
+
DeviceLocalCredentialInfo,
|
|
25
|
+
ResourcePath("deviceLocalCredentials", self.resource_path),
|
|
26
|
+
),
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def administrative_units(self):
|
|
31
|
+
"""Conceptual container for user and group directory objects."""
|
|
32
|
+
return self.properties.get(
|
|
33
|
+
"administrativeUnits",
|
|
34
|
+
EntityCollection(
|
|
35
|
+
self.context,
|
|
36
|
+
AdministrativeUnit,
|
|
37
|
+
ResourcePath("administrativeUnits", self.resource_path),
|
|
38
|
+
),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
@property
|
|
42
|
+
def custom_security_attribute_definitions(self):
|
|
43
|
+
"""Conceptual container for customSecurityAttributeDefinition objects and their properties."""
|
|
44
|
+
return self.properties.get(
|
|
45
|
+
"customSecurityAttributeDefinitions",
|
|
46
|
+
EntityCollection(
|
|
47
|
+
self.context,
|
|
48
|
+
CustomSecurityAttributeDefinition,
|
|
49
|
+
ResourcePath("customSecurityAttributeDefinitions", self.resource_path),
|
|
50
|
+
),
|
|
51
|
+
)
|
|
52
|
+
|
|
13
53
|
def deleted_items(self, entity_type=None):
|
|
14
54
|
"""Recently deleted items. Read-only. Nullable."""
|
|
15
55
|
if entity_type:
|
|
@@ -27,18 +67,6 @@ class Directory(Entity):
|
|
|
27
67
|
),
|
|
28
68
|
)
|
|
29
69
|
|
|
30
|
-
@property
|
|
31
|
-
def administrative_units(self):
|
|
32
|
-
"""Conceptual container for user and group directory objects."""
|
|
33
|
-
return self.properties.get(
|
|
34
|
-
"administrativeUnits",
|
|
35
|
-
EntityCollection(
|
|
36
|
-
self.context,
|
|
37
|
-
AdministrativeUnit,
|
|
38
|
-
ResourcePath("administrativeUnits", self.resource_path),
|
|
39
|
-
),
|
|
40
|
-
)
|
|
41
|
-
|
|
42
70
|
@property
|
|
43
71
|
def deleted_groups(self):
|
|
44
72
|
"""Recently deleted groups"""
|
|
@@ -3,7 +3,7 @@ from office365.entity_collection import EntityCollection
|
|
|
3
3
|
from office365.runtime.queries.function import FunctionQuery
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
class AppConsentRequestCollection(EntityCollection):
|
|
6
|
+
class AppConsentRequestCollection(EntityCollection[AppConsentRequest]):
|
|
7
7
|
"""AppConsentRequest's collection"""
|
|
8
8
|
|
|
9
9
|
def __init__(self, context, resource_path=None):
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
from office365.entity import Entity
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class EntitlementManagement(Entity):
|
|
5
|
+
"""The entitlement management singleton is the container for entitlement management resources,
|
|
6
|
+
including accessPackageCatalog, connectedOrganization, and entitlementManagementSettings.
|
|
7
|
+
"""
|
|
@@ -2,6 +2,9 @@ from office365.directory.identitygovernance.accessreview.set import AccessReview
|
|
|
2
2
|
from office365.directory.identitygovernance.appconsent.approval_route import (
|
|
3
3
|
AppConsentApprovalRoute,
|
|
4
4
|
)
|
|
5
|
+
from office365.directory.identitygovernance.entitlementmanagement.entitlement_management import (
|
|
6
|
+
EntitlementManagement,
|
|
7
|
+
)
|
|
5
8
|
from office365.directory.identitygovernance.privilegedaccess.root import (
|
|
6
9
|
PrivilegedAccessRoot,
|
|
7
10
|
)
|
|
@@ -68,3 +71,16 @@ class IdentityGovernance(Entity):
|
|
|
68
71
|
self.context, ResourcePath("termsOfUse", self.resource_path)
|
|
69
72
|
),
|
|
70
73
|
)
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def entitlement_management(self):
|
|
77
|
+
"""
|
|
78
|
+
Container for entitlement management resources, including accessPackageCatalog, connectedOrganization,
|
|
79
|
+
and entitlementManagementSettings.
|
|
80
|
+
"""
|
|
81
|
+
return self.properties.get(
|
|
82
|
+
"entitlementManagement",
|
|
83
|
+
EntitlementManagement(
|
|
84
|
+
self.context, ResourcePath("entitlementManagement", self.resource_path)
|
|
85
|
+
),
|
|
86
|
+
)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,3 +8,9 @@ class AgreementAcceptance(Entity):
|
|
|
6
8
|
Represents the current status of a user's response to a company's customizable terms of use agreement powered by
|
|
7
9
|
Azure Active Directory (Azure AD).
|
|
8
10
|
"""
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def user_principal_name(self):
|
|
14
|
+
# type: () -> Optional[str]
|
|
15
|
+
"""UPN of the user when the acceptance was recorded."""
|
|
16
|
+
return self.properties.get("userPrincipalName", None)
|
|
@@ -4,7 +4,7 @@ from office365.directory.identitygovernance.userconsent.request import (
|
|
|
4
4
|
from office365.entity_collection import EntityCollection
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class UserConsentRequestCollection(EntityCollection):
|
|
7
|
+
class UserConsentRequestCollection(EntityCollection[UserConsentRequest]):
|
|
8
8
|
"""AppConsentRequest's collection"""
|
|
9
9
|
|
|
10
10
|
def __init__(self, context, resource_path=None):
|
|
@@ -9,6 +9,7 @@ from office365.directory.policies.authentication_strength import (
|
|
|
9
9
|
from office365.directory.policies.authorization import AuthorizationPolicy
|
|
10
10
|
from office365.directory.policies.conditional_access import ConditionalAccessPolicy
|
|
11
11
|
from office365.directory.policies.cross_tenant_access import CrossTenantAccessPolicy
|
|
12
|
+
from office365.directory.policies.device_registration import DeviceRegistrationPolicy
|
|
12
13
|
from office365.directory.policies.permission_grant import PermissionGrantPolicy
|
|
13
14
|
from office365.directory.policies.tenant_app_management import TenantAppManagementPolicy
|
|
14
15
|
from office365.entity import Entity
|
|
@@ -33,6 +34,17 @@ class PolicyRoot(Entity):
|
|
|
33
34
|
),
|
|
34
35
|
)
|
|
35
36
|
|
|
37
|
+
@property
|
|
38
|
+
def device_registration_policy(self):
|
|
39
|
+
""" """
|
|
40
|
+
return self.properties.get(
|
|
41
|
+
"deviceRegistrationPolicy",
|
|
42
|
+
DeviceRegistrationPolicy(
|
|
43
|
+
self.context,
|
|
44
|
+
ResourcePath("deviceRegistrationPolicy", self.resource_path),
|
|
45
|
+
),
|
|
46
|
+
)
|
|
47
|
+
|
|
36
48
|
def authentication_strength_policies(self):
|
|
37
49
|
# type: () -> EntityCollection[AuthenticationStrengthPolicy]
|
|
38
50
|
"""
|
|
@@ -147,6 +159,7 @@ class PolicyRoot(Entity):
|
|
|
147
159
|
"conditional_access_policies": self.conditional_access_policies,
|
|
148
160
|
"crossTenantAccessPolicy": self.cross_tenant_access_policy,
|
|
149
161
|
"defaultAppManagementPolicy": self.default_app_management_policy,
|
|
162
|
+
"deviceRegistrationPolicy": self.device_registration_policy,
|
|
150
163
|
"permissionGrantPolicies": self.permission_grant_policies,
|
|
151
164
|
}
|
|
152
165
|
default_value = property_mapping.get(name, None)
|
|
@@ -17,6 +17,7 @@ from office365.directory.password_credential import PasswordCredential
|
|
|
17
17
|
from office365.directory.permissions.grants.oauth2 import OAuth2PermissionGrant
|
|
18
18
|
from office365.directory.permissions.scope import PermissionScope
|
|
19
19
|
from office365.directory.synchronization.synchronization import Synchronization
|
|
20
|
+
from office365.directory.users.user import User
|
|
20
21
|
from office365.runtime.client_result import ClientResult
|
|
21
22
|
from office365.runtime.client_value_collection import ClientValueCollection
|
|
22
23
|
from office365.runtime.paths.appid import AppIdPath
|
|
@@ -101,7 +102,82 @@ class ServicePrincipal(DirectoryObject):
|
|
|
101
102
|
self.context.add_query(qry)
|
|
102
103
|
return return_type
|
|
103
104
|
|
|
104
|
-
def
|
|
105
|
+
def _ensure_client_service_principal(self, app, action):
|
|
106
|
+
if isinstance(app, Application):
|
|
107
|
+
|
|
108
|
+
def _after():
|
|
109
|
+
action(app)
|
|
110
|
+
|
|
111
|
+
app.ensure_property("id", _after)
|
|
112
|
+
else:
|
|
113
|
+
self.context.service_principals.get_by_app(app).get().after_execute(action)
|
|
114
|
+
|
|
115
|
+
def grant_delegated(self, app, principal, scope):
|
|
116
|
+
# type: (Application|str, User|str, AppRole|str) -> Self
|
|
117
|
+
"""Grants a delegated permission to the client service principal on behalf of a user"""
|
|
118
|
+
|
|
119
|
+
def _grant_delegated(principal_id, client_id):
|
|
120
|
+
# type: (str, str) -> None
|
|
121
|
+
self.context.oauth2_permission_grants.add(
|
|
122
|
+
clientId=client_id,
|
|
123
|
+
consentType="Principal",
|
|
124
|
+
resourceId=self.id,
|
|
125
|
+
principalId=principal_id,
|
|
126
|
+
scope=scope,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
def _ensure_app(principal_id):
|
|
130
|
+
def _after(return_type):
|
|
131
|
+
_grant_delegated(principal_id, return_type.id)
|
|
132
|
+
|
|
133
|
+
self._ensure_client_service_principal(app, _after)
|
|
134
|
+
|
|
135
|
+
def _ensure_principal():
|
|
136
|
+
if isinstance(principal, User):
|
|
137
|
+
|
|
138
|
+
def _after():
|
|
139
|
+
_ensure_app(principal.id)
|
|
140
|
+
|
|
141
|
+
principal.ensure_property("id", _after)
|
|
142
|
+
else:
|
|
143
|
+
_ensure_app(principal)
|
|
144
|
+
|
|
145
|
+
self.ensure_property("id", _ensure_principal)
|
|
146
|
+
return self
|
|
147
|
+
|
|
148
|
+
def revoke_delegated(self, app, principal, scope):
|
|
149
|
+
# type: (Application|str, User|str, AppRole|str) -> Self
|
|
150
|
+
""""""
|
|
151
|
+
|
|
152
|
+
def _revoke(app_id, principal_id):
|
|
153
|
+
# type: (str, str) -> None
|
|
154
|
+
|
|
155
|
+
def _after(return_type):
|
|
156
|
+
pass
|
|
157
|
+
|
|
158
|
+
query_text = "clientId eq '{0}' and principalId eq '{1}'".format(
|
|
159
|
+
app_id, principal_id
|
|
160
|
+
)
|
|
161
|
+
# query_text = "clientId eq '{0}'".format(app_id)
|
|
162
|
+
self.context.oauth2_permission_grants.filter(
|
|
163
|
+
query_text
|
|
164
|
+
).get().after_execute(_after)
|
|
165
|
+
|
|
166
|
+
def _ensure_principal(return_type):
|
|
167
|
+
if isinstance(principal, User):
|
|
168
|
+
|
|
169
|
+
def _after():
|
|
170
|
+
_revoke(principal.id, return_type.id)
|
|
171
|
+
|
|
172
|
+
principal.ensure_property("id", _after)
|
|
173
|
+
else:
|
|
174
|
+
_revoke(principal, return_type.id)
|
|
175
|
+
|
|
176
|
+
self._ensure_client_service_principal(app, _ensure_principal)
|
|
177
|
+
# self.ensure_property("id", _ensure_principal)
|
|
178
|
+
return self
|
|
179
|
+
|
|
180
|
+
def grant_application(self, app, app_role):
|
|
105
181
|
# type: (Application|str, AppRole|str) -> Self
|
|
106
182
|
"""
|
|
107
183
|
Grants an app role assignment to a client service principal
|
|
@@ -109,46 +185,54 @@ class ServicePrincipal(DirectoryObject):
|
|
|
109
185
|
:param AppRole or str app_role: AppRole object or name
|
|
110
186
|
"""
|
|
111
187
|
|
|
112
|
-
def _grant(
|
|
113
|
-
# type: (
|
|
114
|
-
app_role_id = repr(app_role)
|
|
115
|
-
principal_id = principal.id
|
|
188
|
+
def _grant(principal_id, app_role_id):
|
|
189
|
+
# type: (str, str) -> None
|
|
116
190
|
self.app_role_assigned_to.add(
|
|
117
191
|
principalId=principal_id, resourceId=self.id, appRoleId=app_role_id
|
|
118
192
|
)
|
|
119
193
|
|
|
120
|
-
def
|
|
121
|
-
|
|
194
|
+
def _ensure_resource():
|
|
195
|
+
def _after(return_type):
|
|
196
|
+
if isinstance(app_role, AppRole):
|
|
197
|
+
_grant(return_type.id, app_role.id)
|
|
198
|
+
else:
|
|
199
|
+
_grant(return_type.id, self.app_roles[app_role].id)
|
|
122
200
|
|
|
123
|
-
|
|
201
|
+
self.context.service_principals.get_by_app(app).get().after_execute(_after)
|
|
202
|
+
|
|
203
|
+
self.ensure_properties(["id", "appRoles"], _ensure_resource)
|
|
124
204
|
return self
|
|
125
205
|
|
|
126
|
-
def
|
|
206
|
+
def revoke_application(self, app, app_role):
|
|
127
207
|
# type: (Application|str, AppRole|str) -> Self
|
|
128
208
|
"""Revokes an app role assignment from a client service principal"""
|
|
129
209
|
|
|
130
|
-
def _revoke(
|
|
131
|
-
# type (
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
app_role_assigned_to_ids = [
|
|
135
|
-
item.id
|
|
210
|
+
def _revoke(principal_id, app_role_id):
|
|
211
|
+
# type: (str, str) -> None
|
|
212
|
+
app_role_to_revoke = [
|
|
213
|
+
item
|
|
136
214
|
for item in self.app_role_assigned_to
|
|
137
|
-
if item.principal_id == principal_id and item.app_role_id == app_role_id
|
|
215
|
+
# if item.principal_id == principal_id and item.app_role_id == app_role_id
|
|
216
|
+
if item.principal_id == principal_id
|
|
138
217
|
]
|
|
139
|
-
if len(
|
|
140
|
-
self.app_role_assigned_to[
|
|
218
|
+
if len(app_role_to_revoke) > 0:
|
|
219
|
+
self.app_role_assigned_to[app_role_to_revoke[0].id].delete_object()
|
|
141
220
|
|
|
142
|
-
def
|
|
143
|
-
|
|
144
|
-
|
|
221
|
+
def _ensure_app_role(principal):
|
|
222
|
+
# type: ("ServicePrincipal") -> None
|
|
223
|
+
if isinstance(app_role, AppRole):
|
|
224
|
+
_revoke(principal.id, app_role.id)
|
|
225
|
+
else:
|
|
226
|
+
_revoke(principal.id, self.app_roles[app_role].id)
|
|
145
227
|
|
|
146
228
|
def _ensure_principal():
|
|
147
|
-
self.context.service_principals.get_by_app(app).
|
|
148
|
-
|
|
149
|
-
)
|
|
229
|
+
self.context.service_principals.get_by_app(app).select(
|
|
230
|
+
["id"]
|
|
231
|
+
).get().after_execute(_ensure_app_role)
|
|
150
232
|
|
|
151
|
-
self.
|
|
233
|
+
self.ensure_properties(
|
|
234
|
+
["id", "appId", "appRoles", "appRoleAssignedTo"], _ensure_principal
|
|
235
|
+
)
|
|
152
236
|
return self
|
|
153
237
|
|
|
154
238
|
def remove_password(self, key_id):
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
from office365.directory.synchronization.directory_definition import DirectoryDefinition
|
|
1
2
|
from office365.entity import Entity
|
|
3
|
+
from office365.entity_collection import EntityCollection
|
|
4
|
+
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
5
|
|
|
3
6
|
|
|
4
7
|
class SynchronizationSchema(Entity):
|
|
@@ -9,3 +12,16 @@ class SynchronizationSchema(Entity):
|
|
|
9
12
|
|
|
10
13
|
The following sections describe the high-level components of the synchronization schema.
|
|
11
14
|
"""
|
|
15
|
+
|
|
16
|
+
@property
|
|
17
|
+
def directories(self):
|
|
18
|
+
# type: () -> EntityCollection[DirectoryDefinition]
|
|
19
|
+
"""Contains the collection of directories and all of their objects."""
|
|
20
|
+
return self.properties.get(
|
|
21
|
+
"directories",
|
|
22
|
+
EntityCollection(
|
|
23
|
+
self.context,
|
|
24
|
+
DirectoryDefinition,
|
|
25
|
+
ResourcePath("directories", self.resource_path),
|
|
26
|
+
),
|
|
27
|
+
)
|
|
@@ -50,6 +50,7 @@ from office365.outlook.mail.mailbox_settings import MailboxSettings
|
|
|
50
50
|
from office365.outlook.mail.messages.collection import MessageCollection
|
|
51
51
|
from office365.outlook.mail.messages.message import Message
|
|
52
52
|
from office365.outlook.mail.recipient import Recipient
|
|
53
|
+
from office365.outlook.mail.tips import MailTips
|
|
53
54
|
from office365.outlook.user import OutlookUser
|
|
54
55
|
from office365.planner.user import PlannerUser
|
|
55
56
|
from office365.runtime.client_result import ClientResult
|
|
@@ -169,6 +170,28 @@ class User(DirectoryObject):
|
|
|
169
170
|
self.context.add_query(qry)
|
|
170
171
|
return self
|
|
171
172
|
|
|
173
|
+
def get_mail_tips(self, email_addresses, mail_tips_options=None):
|
|
174
|
+
"""Get the MailTips of one or more recipients as available to the signed-in user.
|
|
175
|
+
:param list[str] email_addresses: A collection of SMTP addresses of recipients to get MailTips for.
|
|
176
|
+
:param str mail_tips_options: A enumeration of flags that represents the requested mailtips.
|
|
177
|
+
Possible values are: automaticReplies, customMailTip, deliveryRestriction, externalMemberCount,
|
|
178
|
+
mailboxFullStatus, maxMessageSize, moderationStatus, recipientScope, recipientSuggestions,
|
|
179
|
+
and totalMemberCount.
|
|
180
|
+
"""
|
|
181
|
+
return_type = ClientResult(self.context, ClientValueCollection(MailTips))
|
|
182
|
+
payload = {
|
|
183
|
+
"EmailAddresses": StringCollection(email_addresses),
|
|
184
|
+
"MailTipsOptions": mail_tips_options,
|
|
185
|
+
}
|
|
186
|
+
qry = ServiceOperationQuery(
|
|
187
|
+
self,
|
|
188
|
+
"getMailTips",
|
|
189
|
+
None,
|
|
190
|
+
payload,
|
|
191
|
+
)
|
|
192
|
+
self.context.add_query(qry)
|
|
193
|
+
return return_type
|
|
194
|
+
|
|
172
195
|
def send_mail(
|
|
173
196
|
self,
|
|
174
197
|
subject,
|