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.
- {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/METADATA +1 -1
- {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/RECORD +199 -107
- office365/backuprestore/root.py +39 -0
- office365/backuprestore/service_status.py +5 -0
- office365/booking/business/business.py +13 -0
- office365/booking/business/collection.py +8 -4
- office365/booking/solutions/root.py +14 -1
- office365/communications/callrecords/collection.py +42 -0
- office365/communications/callrecords/direct_routing_log_row.py +5 -0
- office365/communications/cloud_communications.py +2 -3
- office365/directory/applications/application.py +33 -2
- office365/directory/applications/optional_claim.py +5 -0
- office365/directory/applications/optional_claims.py +16 -0
- office365/directory/applications/required_resource_access.py +23 -0
- office365/directory/applications/resource_access.py +26 -0
- office365/directory/authentication/conditions/event_listener.py +9 -0
- office365/directory/authentication/methods/details.py +29 -0
- office365/directory/authentication/methods/root.py +8 -0
- office365/directory/device_local_credential_info.py +21 -0
- office365/directory/identities/container.py +18 -0
- office365/directory/permissions/scope.py +15 -3
- office365/directory/policies/authentication_flows.py +8 -0
- office365/directory/policies/authentication_strength.py +21 -0
- office365/directory/policies/root.py +17 -0
- office365/directory/policies/unified_role_management.py +7 -0
- office365/directory/policies/update_allowed_combinations_result.py +5 -0
- office365/directory/protection/policy/__init__.py +0 -0
- office365/directory/protection/policy/base.py +24 -0
- office365/directory/protection/policy/one_drive_for_business.py +10 -0
- office365/directory/security/alerts/evidence.py +2 -1
- office365/directory/security/alerts/malware_evidence.py +5 -0
- office365/directory/security/alerts/process_evidence.py +5 -0
- office365/directory/security/attacksimulations/user.py +5 -0
- office365/directory/security/attacksimulations/user_coverage.py +3 -0
- office365/directory/security/attacksimulations/users/details.py +12 -0
- office365/directory/serviceprincipals/service_principal.py +118 -18
- office365/directory/users/user.py +23 -3
- office365/graph_client.py +3 -1
- office365/intune/devices/management/management.py +26 -0
- office365/intune/devices/management/terms_and_conditions.py +10 -0
- office365/intune/devices/management/virtual_endpoint.py +8 -0
- office365/onedrive/driveitems/driveItem.py +1 -1
- office365/onedrive/driveitems/retention_label.py +33 -0
- office365/onedrive/driveitems/retention_label_settings.py +7 -0
- office365/onedrive/sitepages/base.py +3 -0
- office365/onedrive/sitepages/collection.py +12 -0
- office365/onedrive/sitepages/site_page.py +9 -9
- office365/onedrive/sites/archival_details.py +5 -0
- office365/onedrive/sites/site_collection.py +10 -1
- office365/onedrive/workbooks/functions/functions.py +23 -0
- office365/partners/__init__.py +0 -0
- office365/partners/billing/__init__.py +0 -0
- office365/planner/tasks/check_list_item.py +5 -1
- office365/runtime/client_object.py +24 -8
- office365/runtime/client_object_collection.py +4 -4
- office365/runtime/client_result.py +21 -2
- office365/runtime/client_value.py +1 -1
- office365/runtime/csom/request.py +11 -0
- office365/runtime/odata/v4/batch_request.py +12 -15
- office365/runtime/types/exceptions.py +18 -0
- office365/search/acronym.py +10 -0
- office365/search/aggregation_option.py +6 -0
- office365/search/answer.py +9 -0
- office365/search/entity.py +67 -14
- office365/search/entity_type.py +28 -0
- office365/search/request.py +32 -3
- office365/sharepoint/apps/access_requests.py +5 -0
- office365/sharepoint/apps/context_site.py +41 -0
- office365/sharepoint/apps/management/__init__.py +0 -0
- office365/sharepoint/apps/management/principal_info.py +9 -0
- office365/sharepoint/authpolicy/events/collection.py +39 -0
- office365/sharepoint/authpolicy/events/{auth_event.py → event.py} +1 -0
- office365/sharepoint/authpolicy/events/role_assignment_resource_payload.py +9 -0
- office365/sharepoint/brandcenter/__init__.py +0 -0
- office365/sharepoint/brandcenter/brand_center.py +9 -0
- office365/sharepoint/brandcenter/configuration.py +5 -0
- office365/sharepoint/changes/change.py +1 -3
- office365/sharepoint/changes/collection.py +3 -0
- office365/sharepoint/changes/folder.py +6 -0
- office365/sharepoint/changes/group.py +3 -0
- office365/sharepoint/changes/list.py +13 -0
- office365/sharepoint/changes/view.py +25 -0
- office365/sharepoint/client_context.py +19 -1
- office365/sharepoint/contenttypes/fieldlinks/collection.py +3 -0
- office365/sharepoint/copilot/__init__.py +0 -0
- office365/sharepoint/copilot/file_collection.py +27 -0
- office365/sharepoint/copilot/file_collection_query_result.py +10 -0
- office365/sharepoint/copilot/list_item_extensions.py +5 -0
- office365/sharepoint/directory/provider/alternate_id_data.py +5 -0
- office365/sharepoint/directory/provider/notification.py +8 -0
- office365/sharepoint/directory/provider/object_changes.py +5 -0
- office365/sharepoint/directory/provider/object_data.py +26 -3
- office365/sharepoint/directory/provider/provider.py +1 -0
- office365/sharepoint/directory/provider/session_data.py +9 -0
- office365/sharepoint/documentmanagement/document_id.py +28 -3
- office365/sharepoint/files/file.py +11 -4
- office365/sharepoint/files/versions/event.py +9 -0
- office365/sharepoint/flows/permissions.py +30 -0
- office365/sharepoint/listhome/favorite_item.py +9 -0
- office365/sharepoint/listitems/listitem.py +79 -4
- office365/sharepoint/listitems/update_parameters.py +4 -1
- office365/sharepoint/lists/data_parameters.py +5 -0
- office365/sharepoint/lists/exporter.py +73 -0
- office365/sharepoint/lists/list.py +157 -7
- office365/sharepoint/lists/render_data_parameters.py +31 -0
- office365/sharepoint/lists/version_policy_manager.py +5 -0
- office365/sharepoint/logger/log_export.py +2 -0
- office365/sharepoint/migration/copy_migration_options.py +5 -0
- office365/sharepoint/migrationcenter/service/performance/data.py +5 -5
- office365/sharepoint/multigeo/services.py +24 -0
- office365/sharepoint/navigation/menu_node.py +43 -1
- office365/sharepoint/navigation/node_collection.py +1 -1
- office365/sharepoint/oauth/token.py +22 -0
- office365/sharepoint/oauth/token_response.py +5 -0
- office365/sharepoint/portal/groups/site_manager.py +32 -0
- office365/sharepoint/portal/project/__init__.py +9 -0
- office365/sharepoint/portal/userprofiles/documentsshared/__init__.py +0 -0
- office365/sharepoint/portal/userprofiles/documentsshared/with_group.py +38 -0
- office365/sharepoint/portal/userprofiles/documentsshared/with_person.py +9 -0
- office365/sharepoint/portal/userprofiles/sharedwithme/__init__.py +0 -0
- office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/document.py +1 -1
- office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/items.py +3 -1
- office365/sharepoint/publishing/pages/campaign_publication.py +10 -0
- office365/sharepoint/publishing/pages/coauth_state.py +8 -0
- office365/sharepoint/publishing/pages/page.py +11 -0
- office365/sharepoint/publishing/pages/stream_content.py +9 -0
- office365/sharepoint/publishing/pages/stream_data.py +8 -0
- office365/sharepoint/quotamanagement/consumer/non_quota_backfill_api.py +8 -0
- office365/sharepoint/request.py +3 -0
- office365/sharepoint/search/administration/site_content_processing_info_provider.py +11 -0
- office365/sharepoint/search/ranking_labeling.py +1 -0
- office365/sharepoint/search/reports/abandonedqueries/__init__.py +0 -0
- office365/sharepoint/search/reports/abandonedqueries/data.py +0 -0
- office365/sharepoint/search/reports/abandonedqueries/item.py +5 -0
- office365/sharepoint/search/reports/noresult/__init__.py +0 -0
- office365/sharepoint/search/reports/numberofqueries/__init__.py +0 -0
- office365/sharepoint/search/reports/top_queries.py +7 -0
- office365/sharepoint/search/reports/topqueries/__init__.py +0 -0
- office365/sharepoint/search/reports/topqueries/data.py +9 -0
- office365/sharepoint/search/reports/topqueries/item.py +15 -0
- office365/sharepoint/search/scs_endpoint.py +9 -0
- office365/sharepoint/securestore/target_application.py +10 -0
- office365/sharepoint/sharing/document_manager.py +3 -3
- office365/sharepoint/sharing/inherited_from.py +5 -0
- office365/sharepoint/sharing/internal/__init__.py +0 -0
- office365/sharepoint/sharing/internal/sharing_restrictions.py +22 -0
- office365/sharepoint/sharing/internal/types.py +17 -0
- office365/sharepoint/sharing/link_info.py +24 -0
- office365/sharepoint/sharing/result.py +21 -0
- office365/sharepoint/sites/html_field_security_setting.py +5 -0
- office365/sharepoint/sites/site.py +39 -1
- office365/sharepoint/sites/version_policy_manager.py +33 -0
- office365/sharepoint/sitescripts/metadata.py +28 -3
- office365/sharepoint/sitescripts/utility.py +17 -0
- office365/sharepoint/smartcache/__init__.py +0 -0
- office365/sharepoint/smartcache/item.py +9 -0
- office365/sharepoint/tenant/administration/app_billing_properties.py +21 -0
- office365/sharepoint/tenant/administration/insights/summary_response.py +8 -0
- office365/sharepoint/tenant/administration/internal/aad/__init__.py +0 -0
- office365/sharepoint/tenant/administration/internal/aad/permission_grant.py +32 -0
- office365/sharepoint/tenant/administration/internal/appservice/__init__.py +0 -0
- office365/sharepoint/tenant/administration/internal/appservice/permission_grant.py +5 -0
- office365/sharepoint/tenant/administration/internal/{permission_grant.py → appservice/permission_request.py} +4 -2
- office365/sharepoint/tenant/administration/internal/appservice/principal.py +104 -0
- office365/sharepoint/tenant/administration/policies/__init__.py +0 -0
- office365/sharepoint/tenant/administration/policies/definition.py +5 -0
- office365/sharepoint/tenant/administration/settings_service.py +12 -1
- office365/sharepoint/tenant/administration/sites/creation_source.py +8 -8
- office365/sharepoint/tenant/administration/sites/properties.py +45 -0
- office365/sharepoint/tenant/administration/tenant.py +124 -4
- office365/sharepoint/tenant/administration/types.py +29 -1
- office365/sharepoint/tenant/cdn_api.py +3 -1
- office365/sharepoint/tenant/management/office365_tenant.py +2 -0
- office365/sharepoint/tenant/settings.py +10 -0
- office365/sharepoint/utilities/utility.py +6 -0
- office365/sharepoint/utilities/wopi_host.py +45 -0
- office365/sharepoint/viva/connections_page.py +8 -0
- office365/sharepoint/viva/dashboard_configuration.py +8 -0
- office365/sharepoint/viva/employee_engagement.py +39 -1
- office365/sharepoint/viva/resource_get_endpoint.py +8 -0
- office365/sharepoint/viva/resource_link.py +8 -0
- office365/sharepoint/webs/information.py +66 -1
- office365/sharepoint/webs/regional_settings.py +38 -0
- office365/sharepoint/webs/templates/__init__.py +0 -0
- office365/sharepoint/webs/time_zone.py +1 -1
- office365/sharepoint/webs/web.py +114 -0
- office365/sharepoint/workflow/definition.py +5 -0
- office365/sharepoint/workflow/task.py +5 -0
- office365/sharepoint/workflowservices/deployment_service.py +23 -0
- office365/subscriptions/collection.py +16 -0
- office365/teams/members/settings.py +2 -2
- office365/sharepoint/portal/userprofiles/documents_shared_with_group.py +0 -11
- office365/sharepoint/tenant/administration/internal/web_appservice_principal.py +0 -23
- {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.12.dist-info → Office365_REST_Python_Client-2.5.14.dist-info}/top_level.txt +0 -0
- /office365/{sharepoint/userprofiles/sharedwithme → backuprestore}/__init__.py +0 -0
- /office365/sharepoint/portal/userprofiles/{documents_shared_with_me.py → documentsshared/with_me.py} +0 -0
- /office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/document_user.py +0 -0
- /office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/item_collection.py +0 -0
- /office365/sharepoint/{userprofiles → portal/userprofiles}/sharedwithme/view_item_removal_result.py +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from office365.directory.protection.policy.base import ProtectionPolicyBase
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class OneDriveForBusinessProtectionPolicy(ProtectionPolicyBase):
|
|
5
|
+
"""
|
|
6
|
+
Contains details about protection policies applied to Microsoft 365 data in an organization.
|
|
7
|
+
Protection policies are defined by the Global Admin (or the SharePoint Online Admin or Exchange Online Admin)
|
|
8
|
+
and include what data to protect, when to protect it, and for what time period to retain the protected data
|
|
9
|
+
for a single Microsoft 365 service.
|
|
10
|
+
"""
|
|
@@ -3,7 +3,8 @@ from office365.runtime.types.collections import StringCollection
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
class AlertEvidence(ClientValue):
|
|
6
|
-
"""
|
|
6
|
+
"""The alertEvidence base type and its derived evidence types provide a means to organize and track rich data
|
|
7
|
+
about each artifact involved in an alert."""
|
|
7
8
|
|
|
8
9
|
def __init__(self, created_datetime=None, detailed_roles=None):
|
|
9
10
|
"""
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
+
from office365.directory.security.attacksimulations.user import AttackSimulationUser
|
|
1
2
|
from office365.runtime.client_value import ClientValue
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class UserSimulationDetails(ClientValue):
|
|
5
6
|
"""Represents a user of a tenant and their online actions in an attack simulation and training campaign."""
|
|
7
|
+
|
|
8
|
+
def __init__(
|
|
9
|
+
self, assigned_trainings_count=None, simulation_user=AttackSimulationUser()
|
|
10
|
+
):
|
|
11
|
+
"""
|
|
12
|
+
:param int assigned_trainings_count: Number of trainings assigned to a user in an attack simulation
|
|
13
|
+
and training campaign.
|
|
14
|
+
:param AttackSimulationUser simulation_user:
|
|
15
|
+
"""
|
|
16
|
+
self.assignedTrainingsCount = assigned_trainings_count
|
|
17
|
+
self.simulationUser = simulation_user
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from collections.abc import Callable
|
|
1
2
|
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from typing_extensions import Self
|
|
@@ -102,7 +103,8 @@ class ServicePrincipal(DirectoryObject):
|
|
|
102
103
|
self.context.add_query(qry)
|
|
103
104
|
return return_type
|
|
104
105
|
|
|
105
|
-
def
|
|
106
|
+
def _get_service_principal_by_app(self, app, action):
|
|
107
|
+
# type: (Application|str, Callable[[Application], None]) -> None
|
|
106
108
|
if isinstance(app, Application):
|
|
107
109
|
|
|
108
110
|
def _after():
|
|
@@ -112,7 +114,63 @@ class ServicePrincipal(DirectoryObject):
|
|
|
112
114
|
else:
|
|
113
115
|
self.context.service_principals.get_by_app(app).get().after_execute(action)
|
|
114
116
|
|
|
115
|
-
def
|
|
117
|
+
def get_delegated_permissions(self, app, principal=None):
|
|
118
|
+
# type: (Application|str, User|str) -> ClientResult[StringCollection]
|
|
119
|
+
"""Gets a delegated API permission"""
|
|
120
|
+
|
|
121
|
+
return_type = ClientResult(self.context, StringCollection())
|
|
122
|
+
|
|
123
|
+
def _get_delegated_permissions(client_id, principal_id=None):
|
|
124
|
+
# type: (str, str) -> None
|
|
125
|
+
|
|
126
|
+
if principal_id is None:
|
|
127
|
+
query_text = (
|
|
128
|
+
"clientId eq '{0}' and consentType eq 'AllPrincipals'".format(
|
|
129
|
+
client_id
|
|
130
|
+
)
|
|
131
|
+
)
|
|
132
|
+
else:
|
|
133
|
+
query_text = "principalId eq '{0}' and clientId eq '{1}'".format(
|
|
134
|
+
principal_id, client_id
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
def _loaded(col):
|
|
138
|
+
scope_val = next(
|
|
139
|
+
iter([g.scope for g in col if g.resource_id == self.id]), None
|
|
140
|
+
)
|
|
141
|
+
if scope_val is not None:
|
|
142
|
+
[return_type.value.add(name) for name in scope_val.split(" ")]
|
|
143
|
+
|
|
144
|
+
(
|
|
145
|
+
self.context.oauth2_permission_grants.get()
|
|
146
|
+
.filter(query_text)
|
|
147
|
+
.after_execute(_loaded)
|
|
148
|
+
)
|
|
149
|
+
|
|
150
|
+
def _resolve_application():
|
|
151
|
+
# type: () -> None
|
|
152
|
+
def _after(service_principal):
|
|
153
|
+
if principal is None:
|
|
154
|
+
_get_delegated_permissions(service_principal.id)
|
|
155
|
+
else:
|
|
156
|
+
_resolve_principal(service_principal.id)
|
|
157
|
+
|
|
158
|
+
self.context.service_principals.get_by_app(app).get().after_execute(_after)
|
|
159
|
+
|
|
160
|
+
def _resolve_principal(app_id):
|
|
161
|
+
if isinstance(principal, User):
|
|
162
|
+
|
|
163
|
+
def _after():
|
|
164
|
+
_get_delegated_permissions(app_id, principal.id)
|
|
165
|
+
|
|
166
|
+
principal.ensure_property("id", _after)
|
|
167
|
+
else:
|
|
168
|
+
_get_delegated_permissions(app_id, principal)
|
|
169
|
+
|
|
170
|
+
self.ensure_property("id", _resolve_application)
|
|
171
|
+
return return_type
|
|
172
|
+
|
|
173
|
+
def grant_delegated_permissions(self, app, principal, scope):
|
|
116
174
|
# type: (Application|str, User|str, AppRole|str) -> Self
|
|
117
175
|
"""Grants a delegated permission to the client service principal on behalf of a user"""
|
|
118
176
|
|
|
@@ -126,30 +184,33 @@ class ServicePrincipal(DirectoryObject):
|
|
|
126
184
|
scope=scope,
|
|
127
185
|
)
|
|
128
186
|
|
|
129
|
-
def
|
|
130
|
-
|
|
187
|
+
def _principal_resolved(principal_id):
|
|
188
|
+
# type: (str) -> None
|
|
189
|
+
def _client_loaded(return_type):
|
|
131
190
|
_grant_delegated(principal_id, return_type.id)
|
|
132
191
|
|
|
133
|
-
self.
|
|
192
|
+
self.context.service_principals.get_by_app(app).get().after_execute(
|
|
193
|
+
_client_loaded
|
|
194
|
+
)
|
|
134
195
|
|
|
135
|
-
def
|
|
196
|
+
def _resource_resolved():
|
|
136
197
|
if isinstance(principal, User):
|
|
137
198
|
|
|
138
199
|
def _after():
|
|
139
|
-
|
|
200
|
+
_principal_resolved(principal.id)
|
|
140
201
|
|
|
141
202
|
principal.ensure_property("id", _after)
|
|
142
203
|
else:
|
|
143
|
-
|
|
204
|
+
_principal_resolved(principal)
|
|
144
205
|
|
|
145
|
-
self.ensure_property("id",
|
|
206
|
+
self.ensure_property("id", _resource_resolved)
|
|
146
207
|
return self
|
|
147
208
|
|
|
148
|
-
def
|
|
209
|
+
def revoke_delegated_permissions(self, app, principal, scope):
|
|
149
210
|
# type: (Application|str, User|str, AppRole|str) -> Self
|
|
150
211
|
""""""
|
|
151
212
|
|
|
152
|
-
def
|
|
213
|
+
def _revoke_delegated_permissions(app_id, principal_id):
|
|
153
214
|
# type: (str, str) -> None
|
|
154
215
|
|
|
155
216
|
def _after(return_type):
|
|
@@ -158,7 +219,6 @@ class ServicePrincipal(DirectoryObject):
|
|
|
158
219
|
query_text = "clientId eq '{0}' and principalId eq '{1}'".format(
|
|
159
220
|
app_id, principal_id
|
|
160
221
|
)
|
|
161
|
-
# query_text = "clientId eq '{0}'".format(app_id)
|
|
162
222
|
self.context.oauth2_permission_grants.filter(
|
|
163
223
|
query_text
|
|
164
224
|
).get().after_execute(_after)
|
|
@@ -167,17 +227,40 @@ class ServicePrincipal(DirectoryObject):
|
|
|
167
227
|
if isinstance(principal, User):
|
|
168
228
|
|
|
169
229
|
def _after():
|
|
170
|
-
|
|
230
|
+
_revoke_delegated_permissions(principal.id, return_type.id)
|
|
171
231
|
|
|
172
232
|
principal.ensure_property("id", _after)
|
|
173
233
|
else:
|
|
174
|
-
|
|
234
|
+
_revoke_delegated_permissions(principal, return_type.id)
|
|
175
235
|
|
|
176
|
-
self.
|
|
177
|
-
# self.ensure_property("id", _ensure_principal)
|
|
236
|
+
self._get_service_principal_by_app(app, _ensure_principal)
|
|
178
237
|
return self
|
|
179
238
|
|
|
180
|
-
def
|
|
239
|
+
def get_application_permissions(self, app):
|
|
240
|
+
# type: (Application|str) -> ClientResult[AppRoleCollection]
|
|
241
|
+
return_type = ClientResult(self.context, AppRoleCollection())
|
|
242
|
+
|
|
243
|
+
def _get_application_permissions(app_id):
|
|
244
|
+
app_role_ids = [
|
|
245
|
+
app_role.app_role_id
|
|
246
|
+
for app_role in self.app_role_assigned_to
|
|
247
|
+
if app_role.principal_id == app_id
|
|
248
|
+
]
|
|
249
|
+
for app_role in self.app_roles:
|
|
250
|
+
if app_role.id in app_role_ids:
|
|
251
|
+
return_type.value.add(app_role)
|
|
252
|
+
|
|
253
|
+
def _resolve_app():
|
|
254
|
+
|
|
255
|
+
def _after(service_principal):
|
|
256
|
+
_get_application_permissions(service_principal.id)
|
|
257
|
+
|
|
258
|
+
self.context.service_principals.get_by_app(app).get().after_execute(_after)
|
|
259
|
+
|
|
260
|
+
self.ensure_properties(["id", "appRoles", "appRoleAssignedTo"], _resolve_app)
|
|
261
|
+
return return_type
|
|
262
|
+
|
|
263
|
+
def grant_application_permissions(self, app, app_role):
|
|
181
264
|
# type: (Application|str, AppRole|str) -> Self
|
|
182
265
|
"""
|
|
183
266
|
Grants an app role assignment to a client service principal
|
|
@@ -203,7 +286,7 @@ class ServicePrincipal(DirectoryObject):
|
|
|
203
286
|
self.ensure_properties(["id", "appRoles"], _ensure_resource)
|
|
204
287
|
return self
|
|
205
288
|
|
|
206
|
-
def
|
|
289
|
+
def revoke_application_permissions(self, app, app_role):
|
|
207
290
|
# type: (Application|str, AppRole|str) -> Self
|
|
208
291
|
"""Revokes an app role assignment from a client service principal"""
|
|
209
292
|
|
|
@@ -275,6 +358,12 @@ class ServicePrincipal(DirectoryObject):
|
|
|
275
358
|
"""The display name exposed by the associated application."""
|
|
276
359
|
return self.properties.get("appDisplayName", None)
|
|
277
360
|
|
|
361
|
+
@property
|
|
362
|
+
def app_id(self):
|
|
363
|
+
# type: () -> Optional[str]
|
|
364
|
+
"""The unique identifier for the associated application (its appId property)."""
|
|
365
|
+
return self.properties.get("appId", None)
|
|
366
|
+
|
|
278
367
|
@property
|
|
279
368
|
def app_role_assigned_to(self):
|
|
280
369
|
"""
|
|
@@ -287,6 +376,16 @@ class ServicePrincipal(DirectoryObject):
|
|
|
287
376
|
),
|
|
288
377
|
)
|
|
289
378
|
|
|
379
|
+
@property
|
|
380
|
+
def app_role_assignments(self):
|
|
381
|
+
"""Get an event collection or an appRoleAssignments."""
|
|
382
|
+
return self.properties.get(
|
|
383
|
+
"appRoleAssignments",
|
|
384
|
+
AppRoleAssignmentCollection(
|
|
385
|
+
self.context, ResourcePath("appRoleAssignments", self.resource_path)
|
|
386
|
+
),
|
|
387
|
+
)
|
|
388
|
+
|
|
290
389
|
@property
|
|
291
390
|
def app_roles(self):
|
|
292
391
|
"""The roles exposed by the application which this service principal represents."""
|
|
@@ -452,6 +551,7 @@ class ServicePrincipal(DirectoryObject):
|
|
|
452
551
|
property_mapping = {
|
|
453
552
|
"appRoles": self.app_roles,
|
|
454
553
|
"appRoleAssignedTo": self.app_role_assigned_to,
|
|
554
|
+
"appRoleAssignments": self.app_role_assignments,
|
|
455
555
|
"created_objects": self.created_objects,
|
|
456
556
|
"keyCredentials": self.key_credentials,
|
|
457
557
|
"oauth2PermissionScopes": self.oauth2_permission_scopes,
|
|
@@ -193,6 +193,16 @@ class User(DirectoryObject):
|
|
|
193
193
|
self.context.add_query(qry)
|
|
194
194
|
return return_type
|
|
195
195
|
|
|
196
|
+
def get_my_site(self):
|
|
197
|
+
"""Gets user's site"""
|
|
198
|
+
return_type = Site(self.context)
|
|
199
|
+
|
|
200
|
+
def _loaded():
|
|
201
|
+
return_type.set_property("webUrl", self.my_site)
|
|
202
|
+
|
|
203
|
+
self.ensure_property("mySite", _loaded)
|
|
204
|
+
return return_type
|
|
205
|
+
|
|
196
206
|
def send_mail(
|
|
197
207
|
self,
|
|
198
208
|
subject,
|
|
@@ -535,11 +545,21 @@ class User(DirectoryObject):
|
|
|
535
545
|
@property
|
|
536
546
|
def given_name(self):
|
|
537
547
|
# type: () -> Optional[str]
|
|
538
|
-
"""
|
|
539
|
-
The given name (first name) of the user. Maximum length is 64 characters.
|
|
540
|
-
"""
|
|
548
|
+
"""The given name (first name) of the user. Maximum length is 64 characters"""
|
|
541
549
|
return self.properties.get("givenName", None)
|
|
542
550
|
|
|
551
|
+
@property
|
|
552
|
+
def my_site(self):
|
|
553
|
+
# type: () -> Optional[str]
|
|
554
|
+
"""The URL for the user's site."""
|
|
555
|
+
return self.properties.get("mySite", None)
|
|
556
|
+
|
|
557
|
+
@property
|
|
558
|
+
def office_location(self):
|
|
559
|
+
# type: () -> Optional[str]
|
|
560
|
+
"""The office location in the user's place of business."""
|
|
561
|
+
return self.properties.get("officeLocation", None)
|
|
562
|
+
|
|
543
563
|
@property
|
|
544
564
|
def user_principal_name(self):
|
|
545
565
|
# type: () -> Optional[str]
|
office365/graph_client.py
CHANGED
|
@@ -229,9 +229,11 @@ class GraphClient(ClientRuntimeContext):
|
|
|
229
229
|
|
|
230
230
|
return GraphClient(_acquire_token)
|
|
231
231
|
|
|
232
|
-
def execute_batch(self, items_per_batch=
|
|
232
|
+
def execute_batch(self, items_per_batch=20, success_callback=None):
|
|
233
233
|
"""Constructs and submit a batch request
|
|
234
234
|
|
|
235
|
+
Per Batch size limitations: JSON batch requests are currently limited to 20 individual requests.
|
|
236
|
+
|
|
235
237
|
:param int items_per_batch: Maximum to be selected for bulk operation
|
|
236
238
|
:param (List[ClientObject|ClientResult])-> None success_callback: A success callback
|
|
237
239
|
"""
|
|
@@ -9,6 +9,8 @@ from office365.intune.devices.enrollment.configuration import (
|
|
|
9
9
|
)
|
|
10
10
|
from office365.intune.devices.managed import ManagedDevice
|
|
11
11
|
from office365.intune.devices.management.reports.reports import DeviceManagementReports
|
|
12
|
+
from office365.intune.devices.management.terms_and_conditions import TermsAndConditions
|
|
13
|
+
from office365.intune.devices.management.virtual_endpoint import VirtualEndpoint
|
|
12
14
|
from office365.runtime.client_result import ClientResult
|
|
13
15
|
from office365.runtime.client_value_collection import ClientValueCollection
|
|
14
16
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
@@ -40,6 +42,28 @@ class DeviceManagement(Entity):
|
|
|
40
42
|
),
|
|
41
43
|
)
|
|
42
44
|
|
|
45
|
+
@property
|
|
46
|
+
def virtual_endpoint(self):
|
|
47
|
+
""""""
|
|
48
|
+
return self.properties.get(
|
|
49
|
+
"virtualEndpoint",
|
|
50
|
+
VirtualEndpoint(
|
|
51
|
+
self.context, ResourcePath("virtualEndpoint", self.resource_path)
|
|
52
|
+
),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def terms_and_conditions(self):
|
|
57
|
+
""""""
|
|
58
|
+
return self.properties.get(
|
|
59
|
+
"termsAndConditions",
|
|
60
|
+
EntityCollection(
|
|
61
|
+
self.context,
|
|
62
|
+
TermsAndConditions,
|
|
63
|
+
ResourcePath("termsAndConditions", self.resource_path),
|
|
64
|
+
),
|
|
65
|
+
)
|
|
66
|
+
|
|
43
67
|
@property
|
|
44
68
|
def device_categories(self):
|
|
45
69
|
""""""
|
|
@@ -98,6 +122,8 @@ class DeviceManagement(Entity):
|
|
|
98
122
|
"deviceEnrollmentConfigurations": self.device_enrollment_configurations,
|
|
99
123
|
"intuneBrand": self.intune_brand,
|
|
100
124
|
"managedDevices": self.managed_devices,
|
|
125
|
+
"termsAndConditions": self.terms_and_conditions,
|
|
126
|
+
"virtualEndpoint": self.virtual_endpoint,
|
|
101
127
|
}
|
|
102
128
|
default_value = property_mapping.get(name, None)
|
|
103
129
|
return super(DeviceManagement, self).get_property(name, default_value)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from office365.entity import Entity
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class TermsAndConditions(Entity):
|
|
5
|
+
"""
|
|
6
|
+
A termsAndConditions entity represents the metadata and contents of a given Terms and Conditions (T&C) policy.
|
|
7
|
+
T&C policies’ contents are presented to users upon their first attempt to enroll into Intune and subsequently
|
|
8
|
+
upon edits where an administrator has required re-acceptance. They enable administrators to communicate
|
|
9
|
+
the provisions to which a user must agree in order to have devices enrolled into Intune.
|
|
10
|
+
"""
|
|
@@ -366,7 +366,7 @@ class DriveItem(BaseItem):
|
|
|
366
366
|
def download_folder(
|
|
367
367
|
self, download_file, after_file_downloaded=None, recursive=True
|
|
368
368
|
):
|
|
369
|
-
# type: (IO, Callable[[
|
|
369
|
+
# type: (IO, Callable[["DriveItem"], None], bool) -> "DriveItem"
|
|
370
370
|
"""
|
|
371
371
|
Download the folder content
|
|
372
372
|
"""
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
from datetime import datetime
|
|
1
2
|
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from office365.directory.permissions.identity_set import IdentitySet
|
|
4
5
|
from office365.entity import Entity
|
|
6
|
+
from office365.onedrive.driveitems.retention_label_settings import (
|
|
7
|
+
RetentionLabelSettings,
|
|
8
|
+
)
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
class ItemRetentionLabel(Entity):
|
|
@@ -23,3 +27,32 @@ class ItemRetentionLabel(Entity):
|
|
|
23
27
|
# type: () -> Optional[IdentitySet]
|
|
24
28
|
"""Identity of the user who applied the label. Read-only."""
|
|
25
29
|
return self.properties.get("labelAppliedBy", IdentitySet())
|
|
30
|
+
|
|
31
|
+
@property
|
|
32
|
+
def label_applied_datetime(self):
|
|
33
|
+
# type: () -> Optional[datetime]
|
|
34
|
+
"""The date and time when the label was applied on the item.
|
|
35
|
+
The timestamp type represents date and time information using ISO 8601 format and is always in UTC.
|
|
36
|
+
"""
|
|
37
|
+
return self.properties.get("labelAppliedDateTime", datetime.min)
|
|
38
|
+
|
|
39
|
+
@property
|
|
40
|
+
def name(self):
|
|
41
|
+
# type: () -> Optional[str]
|
|
42
|
+
"""The retention label on the document. Read-write."""
|
|
43
|
+
return self.properties.get("name", None)
|
|
44
|
+
|
|
45
|
+
@property
|
|
46
|
+
def retention_settings(self):
|
|
47
|
+
# type: () -> RetentionLabelSettings
|
|
48
|
+
"""The retention settings enforced on the item. Read-write."""
|
|
49
|
+
return self.properties.get("retentionSettings", RetentionLabelSettings())
|
|
50
|
+
|
|
51
|
+
def get_property(self, name, default_value=None):
|
|
52
|
+
if default_value is None:
|
|
53
|
+
property_mapping = {
|
|
54
|
+
"labelAppliedBy": self.label_applied_by,
|
|
55
|
+
"retentionSettings": self.retention_settings,
|
|
56
|
+
}
|
|
57
|
+
default_value = property_mapping.get(name, None)
|
|
58
|
+
return super(ItemRetentionLabel, self).get_property(name, default_value)
|
|
@@ -7,6 +7,9 @@ from office365.onedrive.driveitems.publication_facet import PublicationFacet
|
|
|
7
7
|
class BaseSitePage(BaseItem):
|
|
8
8
|
"""An abstract type that represents a page in the site page library."""
|
|
9
9
|
|
|
10
|
+
def __repr__(self):
|
|
11
|
+
return self.name or self.entity_type_name
|
|
12
|
+
|
|
10
13
|
@property
|
|
11
14
|
def publishing_state(self):
|
|
12
15
|
# type: () -> Optional[str]
|
|
@@ -10,10 +10,22 @@ class SitePageCollection(EntityCollection[SitePage]):
|
|
|
10
10
|
def __init__(self, context, resource_path=None):
|
|
11
11
|
super(SitePageCollection, self).__init__(context, SitePage, resource_path)
|
|
12
12
|
|
|
13
|
+
def get(self):
|
|
14
|
+
def _construct_request(request):
|
|
15
|
+
# type: (RequestOptions) -> None
|
|
16
|
+
# request.url += "/microsoft.graph.sitePage"
|
|
17
|
+
pass
|
|
18
|
+
|
|
19
|
+
return super(SitePageCollection, self).get().before_execute(_construct_request)
|
|
20
|
+
|
|
21
|
+
def get_by_name(self, name):
|
|
22
|
+
return self.single("name eq '{0}'".format(name))
|
|
23
|
+
|
|
13
24
|
def add(self, title):
|
|
14
25
|
"""
|
|
15
26
|
Create a new sitePage in the site pages list in a site.
|
|
16
27
|
|
|
28
|
+
:param str title:
|
|
17
29
|
"""
|
|
18
30
|
|
|
19
31
|
def _construct_request(request):
|
|
@@ -15,23 +15,23 @@ class SitePage(BaseSitePage):
|
|
|
15
15
|
webParts."""
|
|
16
16
|
|
|
17
17
|
def get_web_parts_by_position(
|
|
18
|
-
self,
|
|
18
|
+
self, web_part_index, horizontal_section_id, is_in_vertical_section, column_id
|
|
19
19
|
):
|
|
20
20
|
"""
|
|
21
21
|
Get a collection of webPart by providing webPartPosition information.
|
|
22
22
|
|
|
23
|
-
:param float
|
|
23
|
+
:param float web_part_index: Index of the current WebPart. Represents the order of WebPart in this column or
|
|
24
24
|
section. Only works if either columnId or isInVerticalSection is provided.
|
|
25
|
-
:param float
|
|
26
|
-
:param bool
|
|
27
|
-
:param float
|
|
25
|
+
:param float horizontal_section_id: Indicate the horizontal section where the WebPart located in.
|
|
26
|
+
:param bool is_in_vertical_section: Indicate whether the WebPart located in the vertical section.
|
|
27
|
+
:param float column_id: Indicate the identifier of the column where the WebPart located in. Only works
|
|
28
28
|
if horizontalSectionId is provided.
|
|
29
29
|
"""
|
|
30
30
|
params = {
|
|
31
|
-
"webPartIndex":
|
|
32
|
-
"horizontalSectionId":
|
|
33
|
-
"isInverticalSection":
|
|
34
|
-
"columnId":
|
|
31
|
+
"webPartIndex": web_part_index,
|
|
32
|
+
"horizontalSectionId": horizontal_section_id,
|
|
33
|
+
"isInverticalSection": is_in_vertical_section,
|
|
34
|
+
"columnId": column_id,
|
|
35
35
|
}
|
|
36
36
|
return_type = EntityCollection(
|
|
37
37
|
self.context, WebPart, ResourcePath("webParts", self.resource_path)
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
+
from office365.onedrive.sites.archival_details import SiteArchivalDetails
|
|
1
2
|
from office365.runtime.client_value import ClientValue
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class SiteCollection(ClientValue):
|
|
5
6
|
"""The siteCollection resource provides more information about a site collection."""
|
|
6
7
|
|
|
7
|
-
def __init__(
|
|
8
|
+
def __init__(
|
|
9
|
+
self,
|
|
10
|
+
root=None,
|
|
11
|
+
hostname=None,
|
|
12
|
+
data_location_code=None,
|
|
13
|
+
archival_details=SiteArchivalDetails(),
|
|
14
|
+
):
|
|
8
15
|
"""
|
|
9
16
|
|
|
10
17
|
:param office365.onedrive.root.Root root: The hostname for the site collection.
|
|
11
18
|
:param str hostname: The hostname for the site collection.
|
|
12
19
|
:param str data_location_code: The geographic region code for where this site collection resides
|
|
20
|
+
:param str archival_details: Represents the archival details of a siteCollection.
|
|
13
21
|
"""
|
|
14
22
|
super(SiteCollection, self).__init__()
|
|
15
23
|
self.root = root
|
|
16
24
|
self.hostname = hostname
|
|
17
25
|
self.dataLocationCode = data_location_code
|
|
26
|
+
self.archivalDetails = archival_details
|
|
@@ -45,6 +45,29 @@ class WorkbookFunctions(Entity):
|
|
|
45
45
|
self.context.add_query(qry)
|
|
46
46
|
return return_type
|
|
47
47
|
|
|
48
|
+
def accr_int_m(self, issue, settlement, rate, par, basis):
|
|
49
|
+
"""
|
|
50
|
+
Returns the accrued interest for a security that pays periodic interest.
|
|
51
|
+
|
|
52
|
+
:param any issue: The real number of which you want the absolute value.
|
|
53
|
+
:param any settlement: The security's settlement date. The security settlement date is the date after
|
|
54
|
+
the issue date when the security is traded to the buyer.
|
|
55
|
+
:param any rate: The security's annual coupon rate.
|
|
56
|
+
:param any par: The security's par value. If you omit par, ACCRINT uses $1,000.
|
|
57
|
+
:param any basis:
|
|
58
|
+
"""
|
|
59
|
+
return_type = WorkbookFunctionResult(self.context)
|
|
60
|
+
payload = {
|
|
61
|
+
"issue": issue,
|
|
62
|
+
"settlement": settlement,
|
|
63
|
+
"rate": rate,
|
|
64
|
+
"par": par,
|
|
65
|
+
"basis": basis,
|
|
66
|
+
}
|
|
67
|
+
qry = ServiceOperationQuery(self, "accrIntM", None, payload, None, return_type)
|
|
68
|
+
self.context.add_query(qry)
|
|
69
|
+
return return_type
|
|
70
|
+
|
|
48
71
|
def days(self, start_date, end_date):
|
|
49
72
|
"""Returns the number of days between two dates.
|
|
50
73
|
|
|
File without changes
|
|
File without changes
|