Office365-REST-Python-Client 2.5.7__py3-none-any.whl → 2.5.9__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.7.dist-info → Office365_REST_Python_Client-2.5.9.dist-info}/METADATA +1 -1
- {Office365_REST_Python_Client-2.5.7.dist-info → Office365_REST_Python_Client-2.5.9.dist-info}/RECORD +109 -71
- 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/identitygovernance/entitlementmanagement/entitlement_management.py +7 -0
- office365/directory/identitygovernance/governance.py +16 -0
- office365/directory/serviceprincipals/service_principal.py +110 -21
- office365/graph_client.py +8 -0
- office365/onedrive/driveitems/driveItem.py +51 -5
- office365/onedrive/driveitems/retention_label.py +25 -0
- office365/onedrive/workbooks/charts/chart.py +13 -0
- 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/worksheets/protection_options.py +3 -0
- office365/onedrive/workbooks/worksheets/worksheet.py +5 -4
- 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 +12 -0
- office365/sharepoint/attachments/attachment.py +3 -0
- office365/sharepoint/attachments/collection.py +26 -4
- office365/sharepoint/client_context.py +29 -0
- office365/sharepoint/comments/collection.py +1 -1
- office365/sharepoint/compliance/store_proxy.py +43 -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/date_time.py +18 -0
- office365/sharepoint/fields/lookup.py +20 -0
- office365/sharepoint/fields/multi_line_text.py +25 -0
- office365/sharepoint/fields/rating_scale.py +2 -5
- office365/sharepoint/fields/user_value.py +1 -1
- office365/sharepoint/files/collection.py +6 -5
- office365/sharepoint/files/versions/version.py +7 -0
- office365/sharepoint/folders/folder.py +2 -2
- office365/sharepoint/migrationcenter/service/performance/dashboard_data.py +12 -0
- office365/sharepoint/migrationcenter/service/performance/data.py +38 -0
- office365/sharepoint/migrationcenter/service/performance/throughput_data.py +9 -0
- office365/sharepoint/migrationcenter/service/services.py +22 -0
- office365/sharepoint/multigeo/api_versions.py +28 -0
- office365/sharepoint/multigeo/move_job_entity_data.py +9 -0
- office365/sharepoint/multigeo/services.py +39 -0
- office365/sharepoint/multigeo/site_move_job_entity_data.py +9 -0
- office365/sharepoint/multigeo/tenant_information.py +9 -0
- office365/sharepoint/multigeo/user_personal_site_location.py +9 -0
- office365/sharepoint/permissions/securable_object.py +2 -0
- office365/sharepoint/publishing/portal_health_details.py +10 -0
- office365/sharepoint/publishing/portal_health_status.py +8 -1
- office365/sharepoint/sharing/object_sharing_information.py +2 -0
- office365/sharepoint/sharing/permission_collection.py +8 -1
- office365/sharepoint/sharing/shared_document_info.py +28 -0
- office365/sharepoint/sitehealth/summary.py +20 -0
- office365/sharepoint/sites/site.py +12 -0
- office365/sharepoint/sites/version_policy_manager.py +7 -0
- office365/sharepoint/tenant/administration/container_properties.py +17 -0
- office365/sharepoint/tenant/administration/group.py +17 -0
- office365/sharepoint/tenant/administration/powerapps/environment.py +31 -0
- office365/sharepoint/tenant/administration/recent_admin_action_report.py +14 -0
- office365/sharepoint/tenant/administration/recent_admin_action_report_payload.py +10 -0
- office365/sharepoint/tenant/administration/secondary_administrators_info.py +5 -0
- office365/sharepoint/tenant/administration/siteinfo_for_site_picker.py +5 -1
- office365/sharepoint/tenant/administration/sites/creation_default_storage_quota.py +5 -0
- office365/sharepoint/tenant/administration/sites/creation_source.py +16 -1
- office365/sharepoint/tenant/administration/sites/properties_collection.py +2 -0
- office365/sharepoint/tenant/administration/sites/state_properties.py +14 -0
- office365/sharepoint/tenant/administration/tenant.py +56 -1
- 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/types/resource_path.py +1 -1
- 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 +3 -1
- office365/sharepoint/views/visualization/__init__.py +0 -0
- office365/sharepoint/views/visualization/field.py +14 -0
- office365/sharepoint/views/visualization/style_set.py +5 -0
- office365/sharepoint/webs/web.py +43 -0
- office365/sharepoint/workflow/manager.py +5 -0
- office365/sharepoint/workflowservices/deployment_service.py +9 -0
- {Office365_REST_Python_Client-2.5.7.dist-info → Office365_REST_Python_Client-2.5.9.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.7.dist-info → Office365_REST_Python_Client-2.5.9.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.7.dist-info → Office365_REST_Python_Client-2.5.9.dist-info}/top_level.txt +0 -0
- /office365/sharepoint/views/{visualization.py → visualization/visualization.py} +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
|
|
@@ -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
|
+
)
|
|
@@ -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,41 +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: (
|
|
188
|
+
def _grant(principal_id, app_role_id):
|
|
189
|
+
# type: (str, str) -> None
|
|
114
190
|
self.app_role_assigned_to.add(
|
|
115
|
-
principalId=
|
|
191
|
+
principalId=principal_id, resourceId=self.id, appRoleId=app_role_id
|
|
116
192
|
)
|
|
117
193
|
|
|
118
|
-
def
|
|
119
|
-
|
|
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)
|
|
120
200
|
|
|
121
|
-
|
|
201
|
+
self.context.service_principals.get_by_app(app).get().after_execute(_after)
|
|
202
|
+
|
|
203
|
+
self.ensure_properties(["id", "appRoles"], _ensure_resource)
|
|
122
204
|
return self
|
|
123
205
|
|
|
124
|
-
def
|
|
206
|
+
def revoke_application(self, app, app_role):
|
|
125
207
|
# type: (Application|str, AppRole|str) -> Self
|
|
126
208
|
"""Revokes an app role assignment from a client service principal"""
|
|
127
209
|
|
|
128
|
-
def _revoke(
|
|
129
|
-
# type: (
|
|
130
|
-
|
|
131
|
-
item
|
|
210
|
+
def _revoke(principal_id, app_role_id):
|
|
211
|
+
# type: (str, str) -> None
|
|
212
|
+
app_role_to_revoke = [
|
|
213
|
+
item
|
|
132
214
|
for item in self.app_role_assigned_to
|
|
133
|
-
if item.principal_id ==
|
|
215
|
+
# if item.principal_id == principal_id and item.app_role_id == app_role_id
|
|
216
|
+
if item.principal_id == principal_id
|
|
134
217
|
]
|
|
135
|
-
if len(
|
|
136
|
-
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()
|
|
137
220
|
|
|
138
|
-
def
|
|
139
|
-
|
|
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)
|
|
140
227
|
|
|
141
228
|
def _ensure_principal():
|
|
142
|
-
self.context.service_principals.get_by_app(app).
|
|
143
|
-
|
|
144
|
-
)
|
|
229
|
+
self.context.service_principals.get_by_app(app).select(
|
|
230
|
+
["id"]
|
|
231
|
+
).get().after_execute(_ensure_app_role)
|
|
145
232
|
|
|
146
|
-
self.
|
|
233
|
+
self.ensure_properties(
|
|
234
|
+
["id", "appId", "appRoles", "appRoleAssignedTo"], _ensure_principal
|
|
235
|
+
)
|
|
147
236
|
return self
|
|
148
237
|
|
|
149
238
|
def remove_password(self, key_id):
|
office365/graph_client.py
CHANGED
|
@@ -25,6 +25,7 @@ from office365.directory.internal.paths.me import MePath
|
|
|
25
25
|
from office365.directory.invitations.collection import InvitationCollection
|
|
26
26
|
from office365.directory.licenses.subscribed_sku import SubscribedSku
|
|
27
27
|
from office365.directory.object_collection import DirectoryObjectCollection
|
|
28
|
+
from office365.directory.permissions.grants.oauth2 import OAuth2PermissionGrant
|
|
28
29
|
from office365.directory.permissions.grants.resource_specific import (
|
|
29
30
|
ResourceSpecificPermissionGrant,
|
|
30
31
|
)
|
|
@@ -516,6 +517,13 @@ class GraphClient(ClientRuntimeContext):
|
|
|
516
517
|
"""Gets all places in a tenant"""
|
|
517
518
|
return EntityCollection(self, Place, ResourcePath("places"))
|
|
518
519
|
|
|
520
|
+
@property
|
|
521
|
+
def oauth2_permission_grants(self):
|
|
522
|
+
"""Permission grants container"""
|
|
523
|
+
return DeltaCollection(
|
|
524
|
+
self, OAuth2PermissionGrant, ResourcePath("oauth2PermissionGrants")
|
|
525
|
+
)
|
|
526
|
+
|
|
519
527
|
@property
|
|
520
528
|
def room_lists(self):
|
|
521
529
|
"""Gets all the room lists in a tenant"""
|
|
@@ -22,6 +22,7 @@ from office365.onedrive.driveitems.item_preview_info import ItemPreviewInfo
|
|
|
22
22
|
from office365.onedrive.driveitems.photo import Photo
|
|
23
23
|
from office365.onedrive.driveitems.publication_facet import PublicationFacet
|
|
24
24
|
from office365.onedrive.driveitems.remote_item import RemoteItem
|
|
25
|
+
from office365.onedrive.driveitems.retention_label import ItemRetentionLabel
|
|
25
26
|
from office365.onedrive.driveitems.special_folder import SpecialFolder
|
|
26
27
|
from office365.onedrive.driveitems.thumbnail_set import ThumbnailSet
|
|
27
28
|
from office365.onedrive.driveitems.uploadable_properties import (
|
|
@@ -64,27 +65,61 @@ class DriveItem(BaseItem):
|
|
|
64
65
|
"""The driveItem resource represents a file, folder, or other item stored in a drive. All file system objects in
|
|
65
66
|
OneDrive and SharePoint are returned as driveItem resources"""
|
|
66
67
|
|
|
67
|
-
def get_files(self, recursive=False):
|
|
68
|
+
def get_files(self, recursive=False, page_size=None):
|
|
68
69
|
"""Retrieves files
|
|
69
70
|
:param bool recursive: Determines whether to enumerate folders recursively
|
|
71
|
+
:param int page_size: Page size
|
|
70
72
|
"""
|
|
71
73
|
return_type = EntityCollection(self.context, DriveItem, self.resource_path)
|
|
72
74
|
|
|
73
75
|
def _get_files(parent_drive_item):
|
|
74
76
|
# type: (DriveItem) -> None
|
|
75
|
-
def _after_loaded():
|
|
76
|
-
|
|
77
|
+
def _after_loaded(col):
|
|
78
|
+
# type: (EntityCollection[DriveItem]) -> None
|
|
79
|
+
if col.has_next:
|
|
80
|
+
return
|
|
81
|
+
|
|
82
|
+
for drive_item in col:
|
|
77
83
|
if drive_item.is_folder:
|
|
78
|
-
if recursive:
|
|
84
|
+
if recursive and drive_item.folder.childCount > 0:
|
|
79
85
|
_get_files(drive_item)
|
|
80
86
|
else:
|
|
81
87
|
return_type.add_child(drive_item)
|
|
82
88
|
|
|
83
|
-
parent_drive_item.
|
|
89
|
+
parent_drive_item.children.get_all(
|
|
90
|
+
page_size=page_size, page_loaded=_after_loaded
|
|
91
|
+
)
|
|
84
92
|
|
|
85
93
|
_get_files(self)
|
|
86
94
|
return return_type
|
|
87
95
|
|
|
96
|
+
def get_folders(self, recursive=False, page_size=None):
|
|
97
|
+
"""Retrieves folders
|
|
98
|
+
:param bool recursive: Determines whether to enumerate folders recursively
|
|
99
|
+
:param int page_size: Page size
|
|
100
|
+
"""
|
|
101
|
+
return_type = EntityCollection(self.context, DriveItem, self.resource_path)
|
|
102
|
+
|
|
103
|
+
def _get_folders(parent):
|
|
104
|
+
# type: (DriveItem) -> None
|
|
105
|
+
|
|
106
|
+
def _after_loaded(col):
|
|
107
|
+
# type: (EntityCollection[DriveItem]) -> None
|
|
108
|
+
if col.has_next:
|
|
109
|
+
return
|
|
110
|
+
|
|
111
|
+
for drive_item in col:
|
|
112
|
+
if recursive and drive_item.folder.childCount > 0:
|
|
113
|
+
_get_folders(drive_item)
|
|
114
|
+
return_type.add_child(drive_item)
|
|
115
|
+
|
|
116
|
+
parent.children.filter("folder ne null").get_all(
|
|
117
|
+
page_size=page_size, page_loaded=_after_loaded
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
_get_folders(self)
|
|
121
|
+
return return_type
|
|
122
|
+
|
|
88
123
|
def get_by_path(self, url_path):
|
|
89
124
|
# type: (str) -> "DriveItem"
|
|
90
125
|
"""Retrieve DriveItem by server relative path"""
|
|
@@ -785,6 +820,17 @@ class DriveItem(BaseItem):
|
|
|
785
820
|
),
|
|
786
821
|
)
|
|
787
822
|
|
|
823
|
+
@property
|
|
824
|
+
def retention_label(self):
|
|
825
|
+
# type: () -> ItemRetentionLabel
|
|
826
|
+
"""Information about retention label and settings enforced on the driveItem."""
|
|
827
|
+
return self.properties.get(
|
|
828
|
+
"retentionLabel",
|
|
829
|
+
ItemRetentionLabel(
|
|
830
|
+
self.context, ResourcePath("retentionLabel", self.resource_path)
|
|
831
|
+
),
|
|
832
|
+
)
|
|
833
|
+
|
|
788
834
|
@property
|
|
789
835
|
def publication(self):
|
|
790
836
|
# type: () -> PublicationFacet
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from office365.directory.permissions.identity_set import IdentitySet
|
|
4
|
+
from office365.entity import Entity
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ItemRetentionLabel(Entity):
|
|
8
|
+
"""
|
|
9
|
+
Groups retention and compliance-related properties on an item into a single structure.
|
|
10
|
+
Currently, supported only for driveItem.
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
@property
|
|
14
|
+
def is_label_applied_explicitly(self):
|
|
15
|
+
# type: () -> Optional[bool]
|
|
16
|
+
"""Specifies whether the label is applied explicitly on the item.
|
|
17
|
+
True indicates that the label is applied explicitly; otherwise, the label is inherited from its parent.
|
|
18
|
+
Read-only."""
|
|
19
|
+
return self.properties.get("isLabelAppliedExplicitly", None)
|
|
20
|
+
|
|
21
|
+
@property
|
|
22
|
+
def label_applied_by(self):
|
|
23
|
+
# type: () -> Optional[IdentitySet]
|
|
24
|
+
"""Identity of the user who applied the label. Read-only."""
|
|
25
|
+
return self.properties.get("labelAppliedBy", IdentitySet())
|
|
@@ -2,11 +2,24 @@ from office365.entity import Entity
|
|
|
2
2
|
from office365.onedrive.workbooks.charts.axes import WorkbookChartAxes
|
|
3
3
|
from office365.onedrive.workbooks.charts.data_labels import WorkbookChartDataLabels
|
|
4
4
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
5
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class WorkbookChart(Entity):
|
|
8
9
|
"""Represents a chart object in a workbook."""
|
|
9
10
|
|
|
11
|
+
def set_position(self, startCell, endCell):
|
|
12
|
+
"""Positions the chart relative to cells on the worksheet.
|
|
13
|
+
:param str startCell: The start cell. It is where the chart is moved to. The start cell is the top-left or
|
|
14
|
+
top-right cell, depending on the user's right-to-left display settings.
|
|
15
|
+
:param str endCell: The end cell. If specified, the chart's width and height is set to fully cover up
|
|
16
|
+
this cell/range.
|
|
17
|
+
"""
|
|
18
|
+
payload = {"startCell": startCell, "endCell": endCell}
|
|
19
|
+
qry = ServiceOperationQuery(self, "setPosition", None, payload)
|
|
20
|
+
self.context.add_query(qry)
|
|
21
|
+
return self
|
|
22
|
+
|
|
10
23
|
@property
|
|
11
24
|
def axes(self):
|
|
12
25
|
"""Represents chart axes."""
|
|
@@ -33,6 +33,12 @@ class WorkbookNamedItem(Entity):
|
|
|
33
33
|
"""Represents the comment associated with this name."""
|
|
34
34
|
return self.properties.get("comment", None)
|
|
35
35
|
|
|
36
|
+
@property
|
|
37
|
+
def scope(self):
|
|
38
|
+
# type: () -> Optional[str]
|
|
39
|
+
"""Indicates whether the name is scoped to the workbook or to a specific worksheet."""
|
|
40
|
+
return self.properties.get("scope", None)
|
|
41
|
+
|
|
36
42
|
@property
|
|
37
43
|
def worksheet(self):
|
|
38
44
|
"""Returns the worksheet on which the named item is scoped to. Available only if the item is scoped
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.entity import Entity
|
|
4
|
+
from office365.entity_collection import EntityCollection
|
|
5
|
+
from office365.onedrive.workbooks.ranges.border import WorkbookRangeBorder
|
|
2
6
|
from office365.onedrive.workbooks.ranges.fill import WorkbookRangeFill
|
|
7
|
+
from office365.onedrive.workbooks.ranges.font import WorkbookRangeFont
|
|
3
8
|
from office365.onedrive.workbooks.ranges.format_protection import (
|
|
4
9
|
WorkbookFormatProtection,
|
|
5
10
|
)
|
|
@@ -9,6 +14,53 @@ from office365.runtime.paths.resource_path import ResourcePath
|
|
|
9
14
|
class WorkbookRangeFormat(Entity):
|
|
10
15
|
"""A format object encapsulating the range's font, fill, borders, alignment, and other properties."""
|
|
11
16
|
|
|
17
|
+
@property
|
|
18
|
+
def column_width(self):
|
|
19
|
+
# type: () -> Optional[float]
|
|
20
|
+
"""Gets or sets the width of all columns within the range. If the column widths aren't uniform,
|
|
21
|
+
null will be returned."""
|
|
22
|
+
return self.properties.get("columnWidth", None)
|
|
23
|
+
|
|
24
|
+
@property
|
|
25
|
+
def horizontal_alignment(self):
|
|
26
|
+
# type: () -> Optional[str]
|
|
27
|
+
"""Represents the horizontal alignment for the specified object"""
|
|
28
|
+
return self.properties.get("horizontalAlignment", None)
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def row_height(self):
|
|
32
|
+
# type: () -> Optional[float]
|
|
33
|
+
"""Gets or sets the height of all rows in the range. If the row heights aren't uniform null will be returned."""
|
|
34
|
+
return self.properties.get("rowHeight", None)
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
def vertical_alignment(self):
|
|
38
|
+
# type: () -> Optional[str]
|
|
39
|
+
"""Represents the vertical alignment for the specified object.
|
|
40
|
+
Possible values are: Top, Center, Bottom, Justify, Distributed."""
|
|
41
|
+
return self.properties.get("verticalAlignment", None)
|
|
42
|
+
|
|
43
|
+
@property
|
|
44
|
+
def wrap_text(self):
|
|
45
|
+
# type: () -> Optional[bool]
|
|
46
|
+
"""Indicates if Excel wraps the text in the object.
|
|
47
|
+
A null value indicates that the entire range doesn't have uniform wrap setting
|
|
48
|
+
"""
|
|
49
|
+
return self.properties.get("wrapText", None)
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def borders(self):
|
|
53
|
+
# type: () -> EntityCollection[WorkbookRangeBorder]
|
|
54
|
+
"""Collection of border objects that apply to the overall range selected."""
|
|
55
|
+
return self.properties.get(
|
|
56
|
+
"borders",
|
|
57
|
+
EntityCollection(
|
|
58
|
+
self.context,
|
|
59
|
+
WorkbookRangeBorder,
|
|
60
|
+
ResourcePath("borders", self.resource_path),
|
|
61
|
+
),
|
|
62
|
+
)
|
|
63
|
+
|
|
12
64
|
@property
|
|
13
65
|
def fill(self):
|
|
14
66
|
"""Returns the fill object defined on the overall range"""
|
|
@@ -17,6 +69,14 @@ class WorkbookRangeFormat(Entity):
|
|
|
17
69
|
WorkbookRangeFill(self.context, ResourcePath("fill", self.resource_path)),
|
|
18
70
|
)
|
|
19
71
|
|
|
72
|
+
@property
|
|
73
|
+
def font(self):
|
|
74
|
+
"""Returns the font object defined on the overall range selected"""
|
|
75
|
+
return self.properties.get(
|
|
76
|
+
"font",
|
|
77
|
+
WorkbookRangeFont(self.context, ResourcePath("font", self.resource_path)),
|
|
78
|
+
)
|
|
79
|
+
|
|
20
80
|
@property
|
|
21
81
|
def protection(self):
|
|
22
82
|
"""Returns the format protection object for a range"""
|
|
@@ -82,6 +82,18 @@ class WorkbookRange(Entity):
|
|
|
82
82
|
"""Represents the total number of columns in the range. Read-only."""
|
|
83
83
|
return self.properties.get("columnCount", None)
|
|
84
84
|
|
|
85
|
+
@property
|
|
86
|
+
def column_hidden(self):
|
|
87
|
+
# type: () -> Optional[bool]
|
|
88
|
+
"""Represents if all columns of the current range are hidden."""
|
|
89
|
+
return self.properties.get("columnHidden", None)
|
|
90
|
+
|
|
91
|
+
@property
|
|
92
|
+
def column_index(self):
|
|
93
|
+
# type: () -> Optional[int]
|
|
94
|
+
"""Represents the column number of the first cell in the range. Zero-indexed. Read-only."""
|
|
95
|
+
return self.properties.get("columnIndex", None)
|
|
96
|
+
|
|
85
97
|
@property
|
|
86
98
|
def format(self):
|
|
87
99
|
"""Returns a format object, encapsulating the range's font, fill, borders, alignment, and other properties"""
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from office365.onedrive.workbooks.icon import WorkbookIcon
|
|
2
|
+
from office365.runtime.client_value import ClientValue
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class WorkbookSortField(ClientValue):
|
|
6
|
+
"""Represents a condition in a sorting operation."""
|
|
7
|
+
|
|
8
|
+
def __init__(
|
|
9
|
+
self, ascending=None, color=None, dataOption=None, icon=WorkbookIcon(), key=None
|
|
10
|
+
):
|
|
11
|
+
"""
|
|
12
|
+
:param bool ascending: Represents whether the sorting is done in an ascending fashion.
|
|
13
|
+
:param str color: Represents the color that is the target of the condition if the sorting is on font
|
|
14
|
+
or cell color.
|
|
15
|
+
:param str dataOption: Represents additional sorting options for this field.
|
|
16
|
+
Possible values are: Normal, TextAsNumber.
|
|
17
|
+
:param WorkbookIcon icon: Represents the icon that is the target of the condition if the sorting
|
|
18
|
+
is on the cell's icon.
|
|
19
|
+
:param str key: Represents the column (or row, depending on the sort orientation) that the condition is on.
|
|
20
|
+
Represented as an offset from the first column (or row).
|
|
21
|
+
"""
|
|
22
|
+
self.ascending = ascending
|
|
23
|
+
self.color = color
|
|
24
|
+
self.dataOption = dataOption
|
|
25
|
+
self.icon = icon
|
|
26
|
+
self.key = key
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from office365.entity_collection import EntityCollection
|
|
2
|
+
from office365.onedrive.workbooks.tables.pivot_table import WorkbookPivotTable
|
|
3
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class WorkbookPivotTableCollection(EntityCollection[WorkbookPivotTable]):
|
|
7
|
+
def __init__(self, context, resource_path=None):
|
|
8
|
+
super(WorkbookPivotTableCollection, self).__init__(
|
|
9
|
+
context, WorkbookPivotTable, resource_path
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
def refresh_all(self):
|
|
13
|
+
"""Refreshes the PivotTable."""
|
|
14
|
+
qry = ServiceOperationQuery(self, "refreshAll")
|
|
15
|
+
self.context.add_query(qry)
|
|
16
|
+
return self
|
|
@@ -7,6 +7,9 @@ class WorkbookWorksheetProtectionOptions(ClientValue):
|
|
|
7
7
|
def __init__(
|
|
8
8
|
self, allowAutoFilter=None, allowDeleteColumns=None, allowDeleteRows=None
|
|
9
9
|
):
|
|
10
|
+
"""
|
|
11
|
+
:param bool allowAutoFilter:
|
|
12
|
+
"""
|
|
10
13
|
self.allowAutoFilter = allowAutoFilter
|
|
11
14
|
self.allowDeleteColumns = allowDeleteColumns
|
|
12
15
|
self.allowDeleteRows = allowDeleteRows
|
|
@@ -6,7 +6,9 @@ from office365.onedrive.workbooks.charts.chart import WorkbookChart
|
|
|
6
6
|
from office365.onedrive.workbooks.names.named_item import WorkbookNamedItem
|
|
7
7
|
from office365.onedrive.workbooks.ranges.range import WorkbookRange
|
|
8
8
|
from office365.onedrive.workbooks.tables.collection import WorkbookTableCollection
|
|
9
|
-
from office365.onedrive.workbooks.tables.
|
|
9
|
+
from office365.onedrive.workbooks.tables.pivot_table_collection import (
|
|
10
|
+
WorkbookPivotTableCollection,
|
|
11
|
+
)
|
|
10
12
|
from office365.onedrive.workbooks.worksheets.protection import (
|
|
11
13
|
WorkbookWorksheetProtection,
|
|
12
14
|
)
|
|
@@ -94,13 +96,12 @@ class WorkbookWorksheet(Entity):
|
|
|
94
96
|
|
|
95
97
|
@property
|
|
96
98
|
def pivot_tables(self):
|
|
97
|
-
# type: () ->
|
|
99
|
+
# type: () -> WorkbookPivotTableCollection
|
|
98
100
|
"""Collection of PivotTables that are part of the worksheet."""
|
|
99
101
|
return self.properties.get(
|
|
100
102
|
"pivotTables",
|
|
101
|
-
|
|
103
|
+
WorkbookPivotTableCollection(
|
|
102
104
|
self.context,
|
|
103
|
-
WorkbookPivotTable,
|
|
104
105
|
ResourcePath("pivotTables", self.resource_path),
|
|
105
106
|
),
|
|
106
107
|
)
|