Office365-REST-Python-Client 2.5.5__py3-none-any.whl → 2.5.6__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.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/METADATA +2 -2
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/RECORD +202 -182
- office365/booking/virtualevents/__init__.py +0 -0
- office365/booking/virtualevents/root.py +5 -0
- office365/communications/calls/participant.py +4 -5
- office365/directory/applications/application.py +3 -3
- office365/directory/applications/roles/assignment_collection.py +1 -1
- office365/directory/applications/roles/collection.py +2 -2
- office365/directory/authentication/method_configuration.py +9 -0
- office365/directory/authentication/method_mode_detail.py +8 -0
- office365/directory/authentication/method_target.py +5 -0
- office365/directory/authentication/strength_root.py +5 -0
- office365/directory/certificates/auth_configuration.py +1 -3
- office365/directory/groups/group.py +2 -6
- office365/directory/identities/conditional_access_root.py +10 -1
- office365/directory/identities/container.py +3 -9
- office365/directory/identities/providers/builtin_identity.py +3 -2
- office365/directory/identities/providers/saml_or_wsfed.py +4 -5
- office365/directory/identitygovernance/governance.py +14 -3
- office365/directory/identitygovernance/privilegedaccess/__init__.py +0 -0
- office365/directory/identitygovernance/privilegedaccess/root.py +5 -0
- office365/directory/key_credential.py +3 -0
- office365/directory/licenses/assignment_state.py +26 -2
- office365/directory/licenses/details.py +4 -3
- office365/directory/licenses/subscribed_sku.py +8 -10
- office365/directory/object_collection.py +40 -25
- office365/directory/password_credential.py +3 -0
- office365/directory/permissions/default_user_role.py +5 -0
- office365/directory/permissions/grants/condition_set.py +4 -2
- office365/directory/permissions/grants/oauth2.py +7 -10
- office365/directory/policies/authorization.py +50 -3
- office365/directory/policies/permission_grant.py +2 -0
- office365/directory/profile_photo.py +6 -6
- office365/directory/protection/riskyusers/risky_user.py +4 -4
- office365/directory/rolemanagement/resource_action.py +10 -0
- office365/directory/rolemanagement/role_permission.py +10 -0
- office365/directory/security/alerts/alert.py +5 -7
- office365/directory/security/attacksimulations/landing_page.py +5 -0
- office365/directory/security/attacksimulations/operation.py +5 -0
- office365/directory/security/attacksimulations/report.py +8 -1
- office365/directory/security/attacksimulations/root.py +33 -0
- office365/directory/security/attacksimulations/users/__init__.py +0 -0
- office365/directory/security/attacksimulations/users/details.py +5 -0
- office365/directory/security/hunting_query_results.py +5 -0
- office365/directory/security/incidents/incident.py +8 -13
- office365/directory/security/security.py +20 -3
- office365/directory/serviceprincipals/service_principal.py +3 -4
- office365/directory/synchronization/synchronization.py +2 -0
- office365/directory/users/activities/history_item.py +3 -2
- office365/directory/users/user.py +37 -10
- office365/entity_collection.py +3 -2
- office365/graph_client.py +58 -30
- office365/intune/audit/event.py +1 -3
- office365/intune/audit/event_collection.py +1 -1
- office365/intune/devices/alternative_security_id.py +4 -0
- office365/intune/devices/collection.py +57 -0
- office365/intune/devices/device.py +38 -10
- office365/intune/devices/management/management.py +12 -0
- office365/intune/organizations/organization.py +1 -0
- office365/onedrive/analytics/item_activity_stat.py +9 -0
- office365/onedrive/analytics/item_analytics.py +1 -0
- office365/onedrive/contenttypes/content_type.py +4 -12
- office365/onedrive/driveitems/driveItem.py +2 -1
- office365/onedrive/files/hashes.py +5 -0
- office365/onedrive/lists/collection.py +2 -2
- office365/onedrive/operations/long_running.py +6 -6
- office365/onedrive/operations/rich_long_running.py +4 -3
- office365/onedrive/permissions/collection.py +1 -14
- office365/onedrive/sharepoint_settings.py +6 -6
- office365/onedrive/sites/sites_with_root.py +1 -3
- office365/onedrive/termstore/store.py +2 -4
- office365/onedrive/termstore/terms/collection.py +1 -2
- office365/onedrive/workbooks/filter.py +9 -0
- office365/onedrive/workbooks/filter_criteria.py +5 -0
- office365/onedrive/workbooks/functions/functions.py +6 -3
- office365/onedrive/workbooks/functions/result.py +2 -0
- office365/onedrive/workbooks/operations/workbook.py +7 -10
- office365/onedrive/workbooks/tables/pivot_table.py +9 -9
- office365/onedrive/workbooks/worksheets/collection.py +0 -6
- office365/onedrive/workbooks/worksheets/protection.py +2 -0
- office365/outlook/calendar/permissions/permission.py +7 -7
- office365/outlook/calendar/place.py +5 -3
- office365/outlook/mail/attachments/collection.py +6 -1
- office365/outlook/mail/messages/message.py +1 -1
- office365/reports/root.py +50 -4
- office365/runtime/auth/providers/acs_token_provider.py +10 -7
- office365/runtime/auth/sts_profile.py +0 -1
- office365/runtime/client_object.py +18 -14
- office365/runtime/client_object_collection.py +8 -23
- office365/runtime/client_request_exception.py +1 -3
- office365/runtime/client_result.py +11 -14
- office365/runtime/client_runtime_context.py +11 -21
- office365/runtime/odata/json_format.py +4 -7
- office365/runtime/odata/v3/batch_request.py +7 -15
- office365/runtime/odata/v4/batch_request.py +13 -21
- office365/runtime/types/event_handler.py +1 -1
- office365/search/entity.py +3 -2
- office365/sharepoint/activities/facets/delete.py +1 -1
- office365/sharepoint/activities/tracked_item_service.py +2 -3
- office365/sharepoint/administration/web_application.py +8 -7
- office365/sharepoint/audit/audit.py +3 -2
- office365/sharepoint/changes/alert.py +4 -3
- office365/sharepoint/changes/collection.py +7 -10
- office365/sharepoint/changes/content_type.py +4 -4
- office365/sharepoint/changes/field.py +4 -5
- office365/sharepoint/changes/item.py +34 -7
- office365/sharepoint/changes/list.py +4 -4
- office365/sharepoint/changes/user.py +5 -6
- office365/sharepoint/clientsidecomponent/component_context_info.py +4 -3
- office365/sharepoint/contentcenter/machinelearning/enabled.py +4 -3
- office365/sharepoint/contentcenter/machinelearning/hub.py +6 -6
- office365/sharepoint/contentcenter/machinelearning/models/collection.py +1 -1
- office365/sharepoint/contenttypes/fieldlinks/collection.py +4 -6
- office365/sharepoint/contenttypes/fieldlinks/field_link.py +14 -22
- office365/sharepoint/entity.py +12 -5
- office365/sharepoint/entity_collection.py +1 -3
- office365/sharepoint/eventreceivers/definition.py +8 -12
- office365/sharepoint/features/collection.py +1 -2
- office365/sharepoint/features/definitions/definition.py +6 -3
- office365/sharepoint/fields/calculated.py +8 -14
- office365/sharepoint/fields/collection.py +42 -10
- office365/sharepoint/fields/computed.py +4 -5
- office365/sharepoint/fields/currency.py +7 -11
- office365/sharepoint/fields/date_time.py +4 -8
- office365/sharepoint/fields/field.py +6 -16
- office365/sharepoint/fields/lookup.py +11 -9
- office365/sharepoint/fields/multi_choice.py +8 -12
- office365/sharepoint/fields/multi_line_text.py +10 -14
- office365/sharepoint/fields/number.py +13 -26
- office365/sharepoint/fields/rating_scale.py +6 -10
- office365/sharepoint/fields/related_field.py +10 -17
- office365/sharepoint/fields/url.py +4 -5
- office365/sharepoint/fields/user.py +10 -9
- office365/sharepoint/files/collection.py +17 -15
- office365/sharepoint/files/file.py +30 -23
- office365/sharepoint/folders/collection.py +22 -5
- office365/sharepoint/folders/coloring.py +11 -9
- office365/sharepoint/folders/coloring_information.py +38 -0
- office365/sharepoint/folders/folder.py +22 -22
- office365/sharepoint/likes/liked_by_information.py +7 -10
- office365/sharepoint/likes/user_entity.py +6 -8
- office365/sharepoint/listitems/form_update_value.py +17 -1
- office365/sharepoint/listitems/listitem.py +2 -2
- office365/sharepoint/lists/bloom_filter.py +5 -7
- office365/sharepoint/lists/creatables_info.py +5 -6
- office365/sharepoint/lists/list.py +24 -9
- office365/sharepoint/lists/template.py +7 -4
- office365/sharepoint/lists/template_collection.py +2 -4
- office365/sharepoint/marketplace/app_metadata.py +14 -23
- office365/sharepoint/marketplace/sitecollection/appcatalog/allowed_item.py +6 -8
- office365/sharepoint/navigation/node.py +5 -8
- office365/sharepoint/permissions/irm/effective_settings.py +6 -8
- office365/sharepoint/permissions/irm/file_settings.py +8 -6
- office365/sharepoint/permissions/irm/settings.py +25 -43
- office365/sharepoint/portal/groups/site_manager.py +6 -7
- office365/sharepoint/publishing/embed_data_v1.py +8 -15
- office365/sharepoint/publishing/pages/campaign_publication.py +4 -3
- office365/sharepoint/publishing/primary_city_time.py +8 -9
- office365/sharepoint/publishing/video/service_discoverer.py +4 -3
- office365/sharepoint/pushnotifications/subscriber.py +11 -15
- office365/sharepoint/sharing/object_sharing_settings.py +24 -46
- office365/sharepoint/sharing/permission_information.py +5 -5
- office365/sharepoint/sharing/result.py +1 -0
- office365/sharepoint/sitedesigns/run.py +4 -3
- office365/sharepoint/sites/site.py +7 -16
- office365/sharepoint/taxonomy/field.py +32 -21
- office365/sharepoint/taxonomy/groups/group.py +12 -1
- office365/sharepoint/taxonomy/sets/set.py +6 -0
- office365/sharepoint/taxonomy/stores/store.py +4 -2
- office365/sharepoint/teams/channel.py +6 -6
- office365/sharepoint/tenant/administration/endpoints.py +4 -3
- office365/sharepoint/tenant/administration/hubsites/properties.py +4 -5
- office365/sharepoint/tenant/administration/sites/properties.py +0 -1
- office365/sharepoint/tenant/administration/spo_operation.py +4 -4
- office365/sharepoint/tenant/administration/tenant.py +1 -0
- office365/sharepoint/tenant/insights/report.py +11 -0
- office365/sharepoint/tenant/insights/report_manager.py +5 -0
- office365/sharepoint/tenant/insights/report_metadata.py +5 -0
- office365/sharepoint/tenant/settings.py +4 -3
- office365/sharepoint/translation/sync_translator.py +3 -2
- office365/sharepoint/ui/applicationpages/peoplepicker/entity_information.py +4 -4
- office365/sharepoint/usercustomactions/action.py +12 -20
- office365/sharepoint/userprofiles/followed_content.py +6 -10
- office365/sharepoint/userprofiles/people_manager.py +0 -1
- office365/sharepoint/userprofiles/person_properties.py +14 -30
- office365/sharepoint/userprofiles/personal_cache.py +4 -3
- office365/sharepoint/userprofiles/properties_for_user.py +4 -5
- office365/sharepoint/userprofiles/sharedwithme/document.py +12 -21
- office365/sharepoint/utilities/move_copy_util.py +19 -19
- office365/sharepoint/utilities/upload_status.py +7 -10
- office365/sharepoint/views/field_collection.py +9 -14
- office365/sharepoint/views/view.py +43 -64
- office365/sharepoint/webhooks/subscription.py +11 -19
- office365/sharepoint/webparts/webpart.py +3 -1
- office365/sharepoint/webs/modernize_homepage_result.py +4 -3
- office365/sharepoint/webs/regional_settings.py +9 -17
- office365/sharepoint/webs/template.py +3 -5
- office365/sharepoint/webs/web.py +14 -20
- office365/teams/operations/async_operation.py +5 -7
- office365/runtime/paths/item.py +0 -8
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from office365.directory.permissions.default_user_role import DefaultUserRolePermissions
|
|
1
4
|
from office365.directory.policies.base import PolicyBase
|
|
2
5
|
|
|
3
6
|
|
|
@@ -8,8 +11,52 @@ class AuthorizationPolicy(PolicyBase):
|
|
|
8
11
|
|
|
9
12
|
@property
|
|
10
13
|
def allowed_to_sign_up_email_based_subscriptions(self):
|
|
14
|
+
# type: () -> Optional[bool]
|
|
15
|
+
"""Indicates whether a user can join the tenant by email validation."""
|
|
16
|
+
return self.properties.get("allowedToSignUpEmailBasedSubscriptions", None)
|
|
17
|
+
|
|
18
|
+
@property
|
|
19
|
+
def allowed_to_use_sspr(self):
|
|
20
|
+
# type: () -> Optional[bool]
|
|
21
|
+
"""Indicates whether users can use the Self-Service Password Reset feature on the tenant."""
|
|
22
|
+
return self.properties.get("allowedToUseSSPR", None)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def allow_email_verified_users_to_join_organization(self):
|
|
26
|
+
# type: () -> Optional[bool]
|
|
27
|
+
"""Indicates whether a user can join the tenant by email validation."""
|
|
28
|
+
return self.properties.get("allowEmailVerifiedUsersToJoinOrganization", None)
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def allow_invites_from(self):
|
|
32
|
+
# type: () -> Optional[str]
|
|
33
|
+
"""Indicates who can invite external users to the organization.
|
|
34
|
+
Possible values are: none, adminsAndGuestInviters, adminsGuestInvitersAndAllMembers, everyone.
|
|
35
|
+
everyone is the default setting for all cloud environments except US Government.
|
|
11
36
|
"""
|
|
12
|
-
|
|
13
|
-
|
|
37
|
+
return self.properties.get("allowInvitesFrom", None)
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def allow_user_consent_for_risky_apps(self):
|
|
41
|
+
# type: () -> Optional[bool]
|
|
42
|
+
"""Indicates whether user consent for risky apps is allowed.
|
|
43
|
+
We recommend keeping allowUserConsentForRiskyApps as false. Default value is false.
|
|
14
44
|
"""
|
|
15
|
-
return self.properties.get("
|
|
45
|
+
return self.properties.get("allowUserConsentForRiskyApps", None)
|
|
46
|
+
|
|
47
|
+
@property
|
|
48
|
+
def block_msol_powershell(self):
|
|
49
|
+
# type: () -> Optional[bool]
|
|
50
|
+
"""To disable the use of MSOL PowerShell, set this property to true. This also disables user-based access to
|
|
51
|
+
the legacy service endpoint used by MSOL PowerShell. This doesn't affect Microsoft Entra Connect
|
|
52
|
+
or Microsoft Graph.
|
|
53
|
+
"""
|
|
54
|
+
return self.properties.get("blockMsolPowerShell", None)
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def default_user_role_permissions(self):
|
|
58
|
+
# type: () -> Optional[DefaultUserRolePermissions]
|
|
59
|
+
"""Specifies certain customizable permissions for default user role."""
|
|
60
|
+
return self.properties.get(
|
|
61
|
+
"defaultUserRolePermissions", DefaultUserRolePermissions()
|
|
62
|
+
)
|
|
@@ -17,6 +17,7 @@ class PermissionGrantPolicy(PolicyBase):
|
|
|
17
17
|
|
|
18
18
|
@property
|
|
19
19
|
def excludes(self):
|
|
20
|
+
# type: () -> EntityCollection[PermissionGrantConditionSet]
|
|
20
21
|
"""
|
|
21
22
|
Condition sets which are excluded in this permission grant policy.
|
|
22
23
|
This navigation is automatically expanded on GET.
|
|
@@ -32,6 +33,7 @@ class PermissionGrantPolicy(PolicyBase):
|
|
|
32
33
|
|
|
33
34
|
@property
|
|
34
35
|
def includes(self):
|
|
36
|
+
# type: () -> EntityCollection[PermissionGrantConditionSet]
|
|
35
37
|
"""
|
|
36
38
|
Condition sets which are included in this permission grant policy.
|
|
37
39
|
This navigation is automatically expanded on GET.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -12,14 +14,12 @@ class ProfilePhoto(Entity):
|
|
|
12
14
|
|
|
13
15
|
@property
|
|
14
16
|
def height(self):
|
|
15
|
-
|
|
16
|
-
The height of the photo.
|
|
17
|
-
"""
|
|
17
|
+
# type: () -> Optional[int]
|
|
18
|
+
"""The height of the photo."""
|
|
18
19
|
return self.properties.get("height", None)
|
|
19
20
|
|
|
20
21
|
@property
|
|
21
22
|
def width(self):
|
|
22
|
-
|
|
23
|
-
The width of the photo.
|
|
24
|
-
"""
|
|
23
|
+
# type: () -> Optional[int]
|
|
24
|
+
"""The width of the photo."""
|
|
25
25
|
return self.properties.get("width", None)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.entity import Entity
|
|
2
4
|
from office365.entity_collection import EntityCollection
|
|
3
5
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
@@ -27,8 +29,6 @@ class RiskyUser(Entity):
|
|
|
27
29
|
|
|
28
30
|
@property
|
|
29
31
|
def user_principal_name(self):
|
|
30
|
-
|
|
31
|
-
Risky user principal name.
|
|
32
|
-
:rtype: str or None
|
|
33
|
-
"""
|
|
32
|
+
# type: () -> Optional[str]
|
|
33
|
+
"""Risky user principal name."""
|
|
34
34
|
return self.properties.get("userPrincipalName", None)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from office365.runtime.client_value import ClientValue
|
|
2
|
+
from office365.runtime.types.collections import StringCollection
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class ResourceAction(ClientValue):
|
|
6
|
+
""" """
|
|
7
|
+
|
|
8
|
+
def __init__(self):
|
|
9
|
+
self.allowedResourceActions = StringCollection()
|
|
10
|
+
self.notAllowedResourceActions = StringCollection()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from office365.directory.rolemanagement.resource_action import ResourceAction
|
|
2
|
+
from office365.runtime.client_value import ClientValue
|
|
3
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class RolePermission(ClientValue):
|
|
7
|
+
""" """
|
|
8
|
+
|
|
9
|
+
def __init__(self, resourceActions=None):
|
|
10
|
+
self.resourceActions = ClientValueCollection(ResourceAction, resourceActions)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.directory.security.alerts.evidence import AlertEvidence
|
|
2
4
|
from office365.directory.security.alerts.history_state import AlertHistoryState
|
|
3
5
|
from office365.entity import Entity
|
|
@@ -11,17 +13,13 @@ class Alert(Entity):
|
|
|
11
13
|
|
|
12
14
|
@property
|
|
13
15
|
def actor_display_name(self):
|
|
14
|
-
|
|
15
|
-
The adversary or activity group that is associated with this alert.
|
|
16
|
-
:rtype: str
|
|
17
|
-
"""
|
|
16
|
+
# type: () -> Optional[str]
|
|
17
|
+
"""The adversary or activity group that is associated with this alert."""
|
|
18
18
|
return self.properties.get("actorDisplayName", None)
|
|
19
19
|
|
|
20
20
|
@property
|
|
21
21
|
def alert_policy_id(self):
|
|
22
|
-
|
|
23
|
-
:rtype: str
|
|
24
|
-
"""
|
|
22
|
+
# type: () -> Optional[str]
|
|
25
23
|
return self.properties.get("alertPolicyId", None)
|
|
26
24
|
|
|
27
25
|
@property
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
from office365.directory.security.attacksimulations.report_overview import (
|
|
2
2
|
SimulationReportOverview,
|
|
3
3
|
)
|
|
4
|
+
from office365.directory.security.attacksimulations.users.details import (
|
|
5
|
+
UserSimulationDetails,
|
|
6
|
+
)
|
|
4
7
|
from office365.runtime.client_value import ClientValue
|
|
8
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
class SimulationReport(ClientValue):
|
|
@@ -10,8 +14,11 @@ class SimulationReport(ClientValue):
|
|
|
10
14
|
participated in the campaign.
|
|
11
15
|
"""
|
|
12
16
|
|
|
13
|
-
def __init__(self, overview=SimulationReportOverview()):
|
|
17
|
+
def __init__(self, overview=SimulationReportOverview(), simulationUsers=None):
|
|
14
18
|
"""
|
|
15
19
|
:param SimulationReportOverview overview: Overview of an attack simulation and training campaign.
|
|
16
20
|
"""
|
|
17
21
|
self.overview = overview
|
|
22
|
+
self.simulationUsers = ClientValueCollection(
|
|
23
|
+
UserSimulationDetails, simulationUsers
|
|
24
|
+
)
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
from office365.directory.security.attacksimulations.automation import (
|
|
2
2
|
SimulationAutomation,
|
|
3
3
|
)
|
|
4
|
+
from office365.directory.security.attacksimulations.landing_page import LandingPage
|
|
5
|
+
from office365.directory.security.attacksimulations.operation import (
|
|
6
|
+
AttackSimulationOperation,
|
|
7
|
+
)
|
|
4
8
|
from office365.directory.security.attacksimulations.simulation import Simulation
|
|
5
9
|
from office365.entity import Entity
|
|
6
10
|
from office365.entity_collection import EntityCollection
|
|
@@ -11,8 +15,35 @@ class AttackSimulationRoot(Entity):
|
|
|
11
15
|
"""Represents an abstract type that provides the ability to launch a realistic phishing attack that organizations
|
|
12
16
|
can learn from."""
|
|
13
17
|
|
|
18
|
+
@property
|
|
19
|
+
def landing_pages(self):
|
|
20
|
+
# type: () -> EntityCollection[LandingPage]
|
|
21
|
+
"""Represents an attack simulation training landing page."""
|
|
22
|
+
return self.properties.get(
|
|
23
|
+
"landingPages",
|
|
24
|
+
EntityCollection(
|
|
25
|
+
self.context,
|
|
26
|
+
LandingPage,
|
|
27
|
+
ResourcePath("landingPages", self.resource_path),
|
|
28
|
+
),
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def operations(self):
|
|
33
|
+
# type: () -> EntityCollection[AttackSimulationOperation]
|
|
34
|
+
"""Represents an attack simulation training operation."""
|
|
35
|
+
return self.properties.get(
|
|
36
|
+
"operations",
|
|
37
|
+
EntityCollection(
|
|
38
|
+
self.context,
|
|
39
|
+
AttackSimulationOperation,
|
|
40
|
+
ResourcePath("operations", self.resource_path),
|
|
41
|
+
),
|
|
42
|
+
)
|
|
43
|
+
|
|
14
44
|
@property
|
|
15
45
|
def simulations(self):
|
|
46
|
+
# type: () -> EntityCollection[Simulation]
|
|
16
47
|
"""Represents an attack simulation training campaign in a tenant."""
|
|
17
48
|
return self.properties.get(
|
|
18
49
|
"simulations",
|
|
@@ -25,6 +56,7 @@ class AttackSimulationRoot(Entity):
|
|
|
25
56
|
|
|
26
57
|
@property
|
|
27
58
|
def simulation_automations(self):
|
|
59
|
+
# type: () -> EntityCollection[SimulationAutomation]
|
|
28
60
|
"""Represents simulation automation created to run on a tenant."""
|
|
29
61
|
return self.properties.get(
|
|
30
62
|
"simulationAutomations",
|
|
@@ -38,6 +70,7 @@ class AttackSimulationRoot(Entity):
|
|
|
38
70
|
def get_property(self, name, default_value=None):
|
|
39
71
|
if default_value is None:
|
|
40
72
|
property_mapping = {
|
|
73
|
+
"landingPages": self.landing_pages,
|
|
41
74
|
"simulationAutomations": self.simulation_automations,
|
|
42
75
|
}
|
|
43
76
|
default_value = property_mapping.get(name, None)
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from datetime import datetime
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from office365.directory.security.alerts.alert import Alert
|
|
4
5
|
from office365.directory.security.alerts.comment import AlertComment
|
|
@@ -23,37 +24,31 @@ class Incident(Entity):
|
|
|
23
24
|
|
|
24
25
|
@property
|
|
25
26
|
def assigned_to(self):
|
|
26
|
-
|
|
27
|
-
Owner of the incident, or null if no owner is assigned. Free editable text.
|
|
28
|
-
:rtype: str or None
|
|
29
|
-
"""
|
|
27
|
+
# type: () -> Optional[str]
|
|
28
|
+
"""Owner of the incident, or null if no owner is assigned. Free editable text."""
|
|
30
29
|
return self.properties.get("assignedTo", None)
|
|
31
30
|
|
|
32
31
|
@property
|
|
33
32
|
def classification(self):
|
|
34
|
-
|
|
35
|
-
The specification for the incident.
|
|
33
|
+
# type: () -> Optional[str]
|
|
34
|
+
"""The specification for the incident.
|
|
36
35
|
Possible values are: unknown, falsePositive, truePositive, informationalExpectedActivity, unknownFutureValue.
|
|
37
|
-
:rtype: str or None
|
|
38
36
|
"""
|
|
39
37
|
return self.properties.get("classification", None)
|
|
40
38
|
|
|
41
39
|
@property
|
|
42
40
|
def comments(self):
|
|
43
|
-
"""
|
|
44
|
-
Array of comments created by the Security Operations (SecOps) team when the incident is managed.
|
|
45
|
-
"""
|
|
41
|
+
"""Array of comments created by the Security Operations (SecOps) team when the incident is managed."""
|
|
46
42
|
return self.properties.get("comments", ClientValueCollection(AlertComment))
|
|
47
43
|
|
|
48
44
|
@property
|
|
49
45
|
def created_datetime(self):
|
|
50
|
-
"""
|
|
51
|
-
Time when the incident was first created.
|
|
52
|
-
"""
|
|
46
|
+
"""Time when the incident was first created."""
|
|
53
47
|
return self.properties("createdDateTime", datetime.min)
|
|
54
48
|
|
|
55
49
|
@property
|
|
56
50
|
def alerts(self):
|
|
51
|
+
# type: () -> EntityCollection[Alert]
|
|
57
52
|
"""The list of related alerts. Supports $expand."""
|
|
58
53
|
return self.properties.get(
|
|
59
54
|
"alerts",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
from office365.directory.security.alerts.alert import Alert
|
|
2
2
|
from office365.directory.security.attacksimulations.root import AttackSimulationRoot
|
|
3
3
|
from office365.directory.security.cases.root import CasesRoot
|
|
4
|
+
from office365.directory.security.hunting_query_results import HuntingQueryResults
|
|
4
5
|
from office365.directory.security.incidents.incident import Incident
|
|
5
6
|
from office365.directory.security.threatintelligence.threat_intelligence import (
|
|
6
7
|
ThreatIntelligence,
|
|
@@ -8,13 +9,30 @@ from office365.directory.security.threatintelligence.threat_intelligence import
|
|
|
8
9
|
from office365.directory.security.triggers.root import TriggersRoot
|
|
9
10
|
from office365.entity import Entity
|
|
10
11
|
from office365.entity_collection import EntityCollection
|
|
12
|
+
from office365.runtime.client_result import ClientResult
|
|
11
13
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
14
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
12
15
|
|
|
13
16
|
|
|
14
17
|
class Security(Entity):
|
|
15
18
|
"""The security resource is the entry point for the Security object model. It returns a singleton security resource.
|
|
16
19
|
It doesn't contain any usable properties."""
|
|
17
20
|
|
|
21
|
+
def run_hunting_query(self, query):
|
|
22
|
+
"""
|
|
23
|
+
Queries a specified set of event, activity, or entity data supported by Microsoft 365 Defender
|
|
24
|
+
to proactively look for specific threats in your environment.
|
|
25
|
+
:param str query: The hunting query in Kusto Query Language (KQL). For more information on KQL syntax,see KQL
|
|
26
|
+
quick reference: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/kql-quick-reference
|
|
27
|
+
"""
|
|
28
|
+
return_type = ClientResult(self.context, HuntingQueryResults())
|
|
29
|
+
payload = {"Query": query}
|
|
30
|
+
qry = ServiceOperationQuery(
|
|
31
|
+
self, "runHuntingQuery", None, payload, None, return_type
|
|
32
|
+
)
|
|
33
|
+
self.context.add_query(qry)
|
|
34
|
+
return return_type
|
|
35
|
+
|
|
18
36
|
@property
|
|
19
37
|
def alerts(self):
|
|
20
38
|
# type: () -> EntityCollection[Alert]
|
|
@@ -28,9 +46,7 @@ class Security(Entity):
|
|
|
28
46
|
@property
|
|
29
47
|
def alerts_v2(self):
|
|
30
48
|
# type: () -> EntityCollection[Alert]
|
|
31
|
-
"""
|
|
32
|
-
A collection of alerts in Microsoft 365 Defender.
|
|
33
|
-
"""
|
|
49
|
+
"""A collection of alerts in Microsoft 365 Defender."""
|
|
34
50
|
return self.properties.get(
|
|
35
51
|
"alerts_v2",
|
|
36
52
|
EntityCollection(
|
|
@@ -69,6 +85,7 @@ class Security(Entity):
|
|
|
69
85
|
|
|
70
86
|
@property
|
|
71
87
|
def triggers(self):
|
|
88
|
+
""""""
|
|
72
89
|
return self.properties.get(
|
|
73
90
|
"triggers",
|
|
74
91
|
TriggersRoot(self.context, ResourcePath("triggers", self.resource_path)),
|
|
@@ -104,7 +104,7 @@ class ServicePrincipal(DirectoryObject):
|
|
|
104
104
|
def grant(self, app, app_role):
|
|
105
105
|
# type: (Application|str, AppRole|str) -> Self
|
|
106
106
|
"""
|
|
107
|
-
|
|
107
|
+
Grants an app role assignment to a client service principal
|
|
108
108
|
:param Application or str app: Application object or app identifier
|
|
109
109
|
:param AppRole or str app_role: AppRole object or name
|
|
110
110
|
"""
|
|
@@ -205,9 +205,7 @@ class ServicePrincipal(DirectoryObject):
|
|
|
205
205
|
|
|
206
206
|
@property
|
|
207
207
|
def app_roles(self):
|
|
208
|
-
"""
|
|
209
|
-
The roles exposed by the application which this service principal represents.
|
|
210
|
-
"""
|
|
208
|
+
"""The roles exposed by the application which this service principal represents."""
|
|
211
209
|
return self.properties.get("appRoles", AppRoleCollection())
|
|
212
210
|
|
|
213
211
|
@property
|
|
@@ -299,6 +297,7 @@ class ServicePrincipal(DirectoryObject):
|
|
|
299
297
|
|
|
300
298
|
@property
|
|
301
299
|
def oauth2_permission_scopes(self):
|
|
300
|
+
# type: () -> ClientValueCollection[PermissionScope]
|
|
302
301
|
"""
|
|
303
302
|
The delegated permissions exposed by the application. For more information see the oauth2PermissionScopes
|
|
304
303
|
property on the application entity's api property.
|
|
@@ -16,6 +16,7 @@ class Synchronization(Entity):
|
|
|
16
16
|
|
|
17
17
|
@property
|
|
18
18
|
def jobs(self):
|
|
19
|
+
# type: () -> EntityCollection[SynchronizationJob]
|
|
19
20
|
"""
|
|
20
21
|
Performs synchronization by periodically running in the background, polling for changes in one directory,
|
|
21
22
|
and pushing them to another directory.
|
|
@@ -31,6 +32,7 @@ class Synchronization(Entity):
|
|
|
31
32
|
|
|
32
33
|
@property
|
|
33
34
|
def templates(self):
|
|
35
|
+
# type: () -> EntityCollection[SynchronizationTemplate]
|
|
34
36
|
"""
|
|
35
37
|
Performs synchronization by periodically running in the background, polling for changes in one directory,
|
|
36
38
|
and pushing them to another directory.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import datetime
|
|
2
|
+
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from office365.directory.users.activities.activity import UserActivity
|
|
4
5
|
from office365.entity import Entity
|
|
@@ -16,10 +17,10 @@ class ActivityHistoryItem(Entity):
|
|
|
16
17
|
|
|
17
18
|
@property
|
|
18
19
|
def active_duration_seconds(self):
|
|
20
|
+
# type: () -> Optional[int]
|
|
19
21
|
"""
|
|
20
|
-
|
|
22
|
+
The duration of active user engagement. if not supplied, this is calculated from the startedDateTime
|
|
21
23
|
and lastActiveDateTime.
|
|
22
|
-
:rtype: int or None
|
|
23
24
|
"""
|
|
24
25
|
return self.properties.get("activeDurationSeconds", None)
|
|
25
26
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import json
|
|
2
|
+
from datetime import datetime
|
|
2
3
|
from typing import Optional
|
|
3
4
|
|
|
4
5
|
from office365.communications.onlinemeetings.collection import OnlineMeetingCollection
|
|
@@ -445,9 +446,29 @@ class User(DirectoryObject):
|
|
|
445
446
|
self.context.add_query(qry)
|
|
446
447
|
return return_type
|
|
447
448
|
|
|
449
|
+
@property
|
|
450
|
+
def created_datetime(self):
|
|
451
|
+
# type: () -> Optional[datetime]
|
|
452
|
+
"""
|
|
453
|
+
The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.
|
|
454
|
+
For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z
|
|
455
|
+
"""
|
|
456
|
+
return self.properties.get("createdDateTime", datetime.min)
|
|
457
|
+
|
|
458
|
+
@property
|
|
459
|
+
def created_objects(self):
|
|
460
|
+
"""Directory objects created by this user."""
|
|
461
|
+
return self.properties.get(
|
|
462
|
+
"createdObjects",
|
|
463
|
+
DirectoryObjectCollection(
|
|
464
|
+
self.context, ResourcePath("createdObjects", self.resource_path)
|
|
465
|
+
),
|
|
466
|
+
)
|
|
467
|
+
|
|
448
468
|
@property
|
|
449
469
|
def device_enrollment_limit(self):
|
|
450
470
|
# type: () -> Optional[str]
|
|
471
|
+
""" """
|
|
451
472
|
return self.properties.get("deviceEnrollmentLimit", None)
|
|
452
473
|
|
|
453
474
|
@property
|
|
@@ -630,6 +651,16 @@ class User(DirectoryObject):
|
|
|
630
651
|
ProfilePhoto(self.context, ResourcePath("photo", self.resource_path)),
|
|
631
652
|
)
|
|
632
653
|
|
|
654
|
+
@property
|
|
655
|
+
def photos(self):
|
|
656
|
+
"""The collection of the user's profile photos in different sizes"""
|
|
657
|
+
return self.properties.get(
|
|
658
|
+
"photos",
|
|
659
|
+
EntityCollection(
|
|
660
|
+
self.context, ProfilePhoto, ResourcePath("photos", self.resource_path)
|
|
661
|
+
),
|
|
662
|
+
)
|
|
663
|
+
|
|
633
664
|
@property
|
|
634
665
|
def manager(self):
|
|
635
666
|
"""The user or contact that is this user's manager"""
|
|
@@ -770,7 +801,7 @@ class User(DirectoryObject):
|
|
|
770
801
|
@property
|
|
771
802
|
def managed_devices(self):
|
|
772
803
|
# type: () -> EntityCollection[ManagedDevice]
|
|
773
|
-
""""""
|
|
804
|
+
"""Devices that are managed or pre-enrolled through Intune"""
|
|
774
805
|
return self.properties.get(
|
|
775
806
|
"managedDevices",
|
|
776
807
|
EntityCollection(
|
|
@@ -936,9 +967,7 @@ class User(DirectoryObject):
|
|
|
936
967
|
|
|
937
968
|
@property
|
|
938
969
|
def online_meetings(self):
|
|
939
|
-
"""
|
|
940
|
-
Get a user's online meetings.
|
|
941
|
-
"""
|
|
970
|
+
"""Get a user's online meetings."""
|
|
942
971
|
return self.properties.get(
|
|
943
972
|
"onlineMeetings",
|
|
944
973
|
OnlineMeetingCollection(
|
|
@@ -987,21 +1016,18 @@ class User(DirectoryObject):
|
|
|
987
1016
|
@property
|
|
988
1017
|
def street_address(self):
|
|
989
1018
|
# type: () -> Optional[str]
|
|
990
|
-
"""
|
|
991
|
-
The street address of the user's place of business. Maximum length is 1024 characters.
|
|
992
|
-
"""
|
|
1019
|
+
"""The street address of the user's place of business. Maximum length is 1024 characters."""
|
|
993
1020
|
return self.properties.get("streetAddress", None)
|
|
994
1021
|
|
|
995
1022
|
@property
|
|
996
1023
|
def security_identifier(self):
|
|
997
1024
|
# type: () -> Optional[str]
|
|
998
|
-
"""
|
|
999
|
-
Security identifier (SID) of the user, used in Windows scenarios.
|
|
1000
|
-
"""
|
|
1025
|
+
"""Security identifier (SID) of the user, used in Windows scenarios."""
|
|
1001
1026
|
return self.properties.get("securityIdentifier", None)
|
|
1002
1027
|
|
|
1003
1028
|
@property
|
|
1004
1029
|
def teamwork(self):
|
|
1030
|
+
# type: () -> UserTeamwork
|
|
1005
1031
|
"""A container for the range of Microsoft Teams functionalities that are available per user in the tenant."""
|
|
1006
1032
|
return self.properties.get(
|
|
1007
1033
|
"teamwork",
|
|
@@ -1042,6 +1068,7 @@ class User(DirectoryObject):
|
|
|
1042
1068
|
"businessPhones": self.business_phones,
|
|
1043
1069
|
"calendarGroups": self.calendar_groups,
|
|
1044
1070
|
"contactFolders": self.contact_folders,
|
|
1071
|
+
"createdObjects": self.created_objects,
|
|
1045
1072
|
"employeeExperience": self.employee_experience,
|
|
1046
1073
|
"followedSites": self.followed_sites,
|
|
1047
1074
|
"licenseDetails": self.license_details,
|
office365/entity_collection.py
CHANGED
|
@@ -3,7 +3,6 @@ from typing import TYPE_CHECKING, Any, Optional, Type, TypeVar
|
|
|
3
3
|
from office365.entity import Entity
|
|
4
4
|
from office365.runtime.client_object_collection import ClientObjectCollection
|
|
5
5
|
from office365.runtime.compat import is_string_type
|
|
6
|
-
from office365.runtime.paths.item import ItemPath
|
|
7
6
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
8
7
|
from office365.runtime.paths.v4.entity import EntityPath
|
|
9
8
|
from office365.runtime.queries.create_entity import CreateEntityQuery
|
|
@@ -43,7 +42,9 @@ class EntityCollection(ClientObjectCollection[T]):
|
|
|
43
42
|
def add(self, **kwargs):
|
|
44
43
|
# type: (Any) -> T
|
|
45
44
|
"""Creates an entity and prepares the query"""
|
|
46
|
-
return_type = self.create_typed_object(
|
|
45
|
+
return_type = self.create_typed_object(
|
|
46
|
+
kwargs, EntityPath(None, self.resource_path)
|
|
47
|
+
)
|
|
47
48
|
self.add_child(return_type)
|
|
48
49
|
qry = CreateEntityQuery(self, return_type, return_type)
|
|
49
50
|
self.context.add_query(qry)
|