Office365-REST-Python-Client 2.5.4__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.4.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/METADATA +2 -2
- {Office365_REST_Python_Client-2.5.4.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/RECORD +224 -204
- office365/booking/business/business.py +5 -3
- 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/extensions/extended_property.py +4 -4
- office365/directory/extensions/open_type.py +4 -4
- 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/base.py +7 -5
- office365/directory/identities/providers/builtin_identity.py +3 -2
- office365/directory/identities/providers/saml_or_wsfed.py +4 -5
- office365/directory/identities/providers/social_identity.py +5 -3
- office365/directory/identities/userflows/b2x/user_flow.py +6 -5
- office365/directory/identities/userflows/language_configuration.py +10 -7
- 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 +8 -6
- 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 +9 -10
- 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/comments/comment.py +7 -6
- 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/onedrive/workbooks/worksheets/worksheet.py +30 -2
- office365/onenote/notebooks/collection.py +0 -1
- office365/outlook/calendar/events/event.py +24 -46
- 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/attachments/file.py +9 -16
- office365/outlook/mail/messages/message.py +1 -1
- office365/planner/user.py +3 -7
- 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 +21 -17
- office365/runtime/client_object_collection.py +9 -24
- office365/runtime/client_request_exception.py +1 -3
- office365/runtime/client_result.py +11 -14
- office365/runtime/client_runtime_context.py +20 -32
- office365/runtime/odata/json_format.py +4 -7
- office365/runtime/odata/request.py +3 -3
- office365/runtime/odata/v3/batch_request.py +17 -31
- office365/runtime/odata/v4/batch_request.py +13 -21
- office365/runtime/queries/batch.py +5 -11
- office365/runtime/queries/function.py +5 -6
- 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/alerts/alert.py +8 -12
- 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/client_context.py +20 -20
- 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 +3 -6
- 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/checked_out_file.py +4 -3
- office365/sharepoint/files/collection.py +17 -15
- office365/sharepoint/files/file.py +33 -27
- 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 +26 -30
- 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 +9 -11
- office365/sharepoint/lists/bloom_filter.py +5 -7
- office365/sharepoint/lists/creatables_info.py +5 -6
- office365/sharepoint/lists/list.py +25 -10
- 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/portal/sites/manager.py +4 -3
- 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 +18 -18
- office365/sharepoint/webs/theme_info.py +6 -6
- office365/sharepoint/webs/web.py +16 -23
- office365/teams/members/aad_user_conversation.py +4 -4
- office365/teams/operations/async_operation.py +5 -7
- office365/runtime/paths/item.py +0 -8
- {Office365_REST_Python_Client-2.5.4.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.4.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.4.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/top_level.txt +0 -0
|
@@ -81,7 +81,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
81
81
|
thumbprint,
|
|
82
82
|
cert_path=None,
|
|
83
83
|
private_key=None,
|
|
84
|
-
scopes=None
|
|
84
|
+
scopes=None,
|
|
85
85
|
):
|
|
86
86
|
# type: (str, str, str, Optional[str], Optional[str], Optional[List[str]]) -> Self
|
|
87
87
|
"""
|
|
@@ -136,7 +136,12 @@ class ClientContext(ClientRuntimeContext):
|
|
|
136
136
|
return self
|
|
137
137
|
|
|
138
138
|
def with_user_credentials(
|
|
139
|
-
self,
|
|
139
|
+
self,
|
|
140
|
+
username,
|
|
141
|
+
password,
|
|
142
|
+
allow_ntlm=False,
|
|
143
|
+
browser_mode=False,
|
|
144
|
+
environment="commercial",
|
|
140
145
|
):
|
|
141
146
|
# type: (str, str, bool, bool, Optional[str]) -> Self
|
|
142
147
|
"""
|
|
@@ -152,11 +157,13 @@ class ClientContext(ClientRuntimeContext):
|
|
|
152
157
|
UserCredential(username, password),
|
|
153
158
|
allow_ntlm=allow_ntlm,
|
|
154
159
|
browser_mode=browser_mode,
|
|
155
|
-
environment=environment
|
|
160
|
+
environment=environment,
|
|
156
161
|
)
|
|
157
162
|
return self
|
|
158
163
|
|
|
159
|
-
def with_client_credentials(
|
|
164
|
+
def with_client_credentials(
|
|
165
|
+
self, client_id, client_secret, environment="commercial"
|
|
166
|
+
):
|
|
160
167
|
# type: (str, str, Optional[str]) -> Self
|
|
161
168
|
"""
|
|
162
169
|
Initializes a client to acquire a token via client credentials (SharePoint App-Only)
|
|
@@ -170,12 +177,11 @@ class ClientContext(ClientRuntimeContext):
|
|
|
170
177
|
defaults to 'commercial'.
|
|
171
178
|
"""
|
|
172
179
|
self.authentication_context.with_credentials(
|
|
173
|
-
ClientCredential(client_id, client_secret),
|
|
174
|
-
environment=environment
|
|
180
|
+
ClientCredential(client_id, client_secret), environment=environment
|
|
175
181
|
)
|
|
176
182
|
return self
|
|
177
183
|
|
|
178
|
-
def with_credentials(self, credentials, environment=
|
|
184
|
+
def with_credentials(self, credentials, environment="commercial"):
|
|
179
185
|
# type: (UserCredential|ClientCredential, Optional[str]) -> Self
|
|
180
186
|
"""
|
|
181
187
|
Initializes a client to acquire a token via user or client credentials
|
|
@@ -183,7 +189,9 @@ class ClientContext(ClientRuntimeContext):
|
|
|
183
189
|
:param str environment: The Office 365 Cloud Environment endpoint used for authentication
|
|
184
190
|
defaults to 'commercial'.
|
|
185
191
|
"""
|
|
186
|
-
self.authentication_context.with_credentials(
|
|
192
|
+
self.authentication_context.with_credentials(
|
|
193
|
+
credentials, environment=environment
|
|
194
|
+
)
|
|
187
195
|
return self
|
|
188
196
|
|
|
189
197
|
def execute_batch(self, items_per_batch=100, success_callback=None):
|
|
@@ -204,9 +212,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
204
212
|
return self
|
|
205
213
|
|
|
206
214
|
def pending_request(self):
|
|
207
|
-
"""
|
|
208
|
-
Provides access to underlying request instance
|
|
209
|
-
"""
|
|
215
|
+
"""Provides access to underlying request instance"""
|
|
210
216
|
if self._pending_request is None:
|
|
211
217
|
self._pending_request = ODataRequest(JsonLightFormat())
|
|
212
218
|
self._pending_request.beforeExecute += self._authenticate_request
|
|
@@ -220,9 +226,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
220
226
|
request.set_header("X-RequestDigest", self._ctx_web_info.FormDigestValue)
|
|
221
227
|
|
|
222
228
|
def _get_context_web_information(self):
|
|
223
|
-
"""
|
|
224
|
-
Returns an ContextWebInformation object that specifies metadata about the site
|
|
225
|
-
"""
|
|
229
|
+
"""Returns an ContextWebInformation object that specifies metadata about the site"""
|
|
226
230
|
client = ODataRequest(JsonLightFormat())
|
|
227
231
|
client.beforeExecute += self._authenticate_request
|
|
228
232
|
for e in self.pending_request().beforeExecute:
|
|
@@ -278,9 +282,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
278
282
|
|
|
279
283
|
def _build_modification_query(self, request):
|
|
280
284
|
# type: (RequestOptions) -> None
|
|
281
|
-
"""
|
|
282
|
-
Constructs SharePoint specific modification OData request
|
|
283
|
-
"""
|
|
285
|
+
"""Constructs SharePoint specific modification OData request"""
|
|
284
286
|
if request.method == HttpMethod.Post:
|
|
285
287
|
self._ensure_form_digest(request)
|
|
286
288
|
# set custom SharePoint control headers
|
|
@@ -366,9 +368,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
366
368
|
|
|
367
369
|
@property
|
|
368
370
|
def context_info(self):
|
|
369
|
-
"""
|
|
370
|
-
Returns an ContextWebInformation object that specifies metadata about the site
|
|
371
|
-
"""
|
|
371
|
+
"""Returns an ContextWebInformation object that specifies metadata about the site"""
|
|
372
372
|
if self._ctx_web_info is None:
|
|
373
373
|
self._ctx_web_info = ContextWebInformation()
|
|
374
374
|
return self._ctx_web_info
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,9 +8,8 @@ class ComponentContextInfo(Entity):
|
|
|
6
8
|
|
|
7
9
|
@property
|
|
8
10
|
def serialized_data(self):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"""
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
""""""
|
|
12
13
|
return self.properties.get("SerializedData", None)
|
|
13
14
|
|
|
14
15
|
@property
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
class SPMachineLearningEnabled(Entity):
|
|
5
7
|
@property
|
|
6
8
|
def is_syntex_payg_enabled(self):
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"""
|
|
9
|
+
# type: () -> Optional[bool]
|
|
10
|
+
""" """
|
|
10
11
|
return self.properties.get("IsSyntexPAYGEnabled", None)
|
|
11
12
|
|
|
12
13
|
@property
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.client_result import ClientResult
|
|
2
4
|
from office365.runtime.client_value_collection import ClientValueCollection
|
|
3
5
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
@@ -73,16 +75,14 @@ class SPMachineLearningHub(Entity):
|
|
|
73
75
|
|
|
74
76
|
@property
|
|
75
77
|
def is_default_content_center(self):
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
"""
|
|
78
|
+
# type: () -> Optional[bool]
|
|
79
|
+
""" """
|
|
79
80
|
return self.properties.get("IsDefaultContentCenter", None)
|
|
80
81
|
|
|
81
82
|
@property
|
|
82
83
|
def machine_learning_capture_enabled(self):
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
"""
|
|
84
|
+
# type: () -> Optional[bool]
|
|
85
|
+
""" """
|
|
86
86
|
return self.properties.get("MachineLearningCaptureEnabled", None)
|
|
87
87
|
|
|
88
88
|
@property
|
|
@@ -5,7 +5,7 @@ from office365.sharepoint.contentcenter.machinelearning.models.model import (
|
|
|
5
5
|
from office365.sharepoint.entity_collection import EntityCollection
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
class SPMachineLearningModelCollection(EntityCollection):
|
|
8
|
+
class SPMachineLearningModelCollection(EntityCollection[SPMachineLearningModel]):
|
|
9
9
|
def __init__(self, context, resource_path=None):
|
|
10
10
|
super(SPMachineLearningModelCollection, self).__init__(
|
|
11
11
|
context, SPMachineLearningModel, resource_path
|
|
@@ -21,10 +21,8 @@ class FieldLinkCollection(EntityCollection):
|
|
|
21
21
|
:param str or office365.sharepoint.fields.field.Field field: Specifies the internal name of the field or type
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
-
def
|
|
25
|
-
|
|
26
|
-
:type field_internal_name: str
|
|
27
|
-
"""
|
|
24
|
+
def _add(field_internal_name):
|
|
25
|
+
# type: (str) -> None
|
|
28
26
|
return_type.set_property("FieldInternalName", field_internal_name)
|
|
29
27
|
qry = CreateEntityQuery(self, return_type, return_type)
|
|
30
28
|
self.context.add_query(qry)
|
|
@@ -34,11 +32,11 @@ class FieldLinkCollection(EntityCollection):
|
|
|
34
32
|
if isinstance(field, Field):
|
|
35
33
|
|
|
36
34
|
def _field_loaded():
|
|
37
|
-
|
|
35
|
+
_add(field.internal_name)
|
|
38
36
|
|
|
39
37
|
field.ensure_property("InternalName", _field_loaded)
|
|
40
38
|
else:
|
|
41
|
-
|
|
39
|
+
_add(field)
|
|
42
40
|
return return_type
|
|
43
41
|
|
|
44
42
|
def get_by_id(self, _id):
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,46 +8,36 @@ class FieldLink(Entity):
|
|
|
6
8
|
|
|
7
9
|
@property
|
|
8
10
|
def id(self):
|
|
9
|
-
|
|
10
|
-
Gets a value that specifies the GUID of the FieldLink.
|
|
11
|
-
:rtype: str or None
|
|
12
|
-
"""
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
"""Gets a value that specifies the GUID of the FieldLink."""
|
|
13
13
|
return self.properties.get("Id", None)
|
|
14
14
|
|
|
15
15
|
@property
|
|
16
16
|
def field_internal_name(self):
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"""
|
|
17
|
+
# type: () -> Optional[str]
|
|
18
|
+
"""Gets a value that specifies field internal name"""
|
|
20
19
|
return self.properties.get("FieldInternalName", None)
|
|
21
20
|
|
|
22
21
|
@property
|
|
23
22
|
def read_only(self):
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"""
|
|
23
|
+
# type: () -> Optional[bool]
|
|
24
|
+
""" """
|
|
27
25
|
return self.properties.get("ReadOnly", None)
|
|
28
26
|
|
|
29
27
|
@property
|
|
30
28
|
def hidden(self):
|
|
31
|
-
|
|
32
|
-
Gets a value that specifies whether the field is displayed in forms that can be edited.
|
|
33
|
-
:rtype: bool or None
|
|
34
|
-
"""
|
|
29
|
+
# type: () -> Optional[bool]
|
|
30
|
+
"""Gets a value that specifies whether the field is displayed in forms that can be edited."""
|
|
35
31
|
return self.properties.get("Hidden", None)
|
|
36
32
|
|
|
37
33
|
@property
|
|
38
34
|
def required(self):
|
|
39
|
-
|
|
40
|
-
Gets a value that specifies whether the field (2) requires a value.
|
|
41
|
-
:rtype: bool or None
|
|
42
|
-
"""
|
|
35
|
+
# type: () -> Optional[bool]
|
|
36
|
+
"""Gets a value that specifies whether the field (2) requires a value."""
|
|
43
37
|
return self.properties.get("Required", None)
|
|
44
38
|
|
|
45
39
|
@property
|
|
46
40
|
def show_in_display_form(self):
|
|
47
|
-
|
|
48
|
-
A Boolean value that indicates whether this field is shown in the display form.
|
|
49
|
-
:rtype: bool or None
|
|
50
|
-
"""
|
|
41
|
+
# type: () -> Optional[bool]
|
|
42
|
+
"""A Boolean value that indicates whether this field is shown in the display form."""
|
|
51
43
|
return self.properties.get("ShowInDisplayForm", None)
|
office365/sharepoint/entity.py
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING
|
|
1
|
+
from typing import TYPE_CHECKING, Callable
|
|
2
2
|
|
|
3
|
+
from typing_extensions import Self
|
|
4
|
+
|
|
5
|
+
from office365.runtime.auth.client_credential import ClientCredential
|
|
6
|
+
from office365.runtime.auth.user_credential import UserCredential
|
|
3
7
|
from office365.runtime.client_object import ClientObject
|
|
4
8
|
from office365.runtime.queries.delete_entity import DeleteEntityQuery
|
|
5
9
|
from office365.runtime.queries.update_entity import UpdateEntityQuery
|
|
@@ -11,11 +15,14 @@ if TYPE_CHECKING:
|
|
|
11
15
|
class Entity(ClientObject):
|
|
12
16
|
"""SharePoint specific entity"""
|
|
13
17
|
|
|
18
|
+
def execute_batch(self, items_per_batch=100, success_callback=None):
|
|
19
|
+
# type: (int, Callable[[int], None]) -> Self
|
|
20
|
+
"""Construct and submit to a server a batch request"""
|
|
21
|
+
return self.context.execute_batch(items_per_batch, success_callback)
|
|
22
|
+
|
|
14
23
|
def with_credentials(self, credentials):
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
:type credentials: UserCredential or ClientCredential
|
|
18
|
-
"""
|
|
24
|
+
# type: (UserCredential|ClientCredential) -> Self
|
|
25
|
+
""" """
|
|
19
26
|
self.context.with_credentials(credentials)
|
|
20
27
|
return self
|
|
21
28
|
|
|
@@ -12,9 +12,7 @@ T = TypeVar("T")
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
class EntityCollection(ClientObjectCollection[T]):
|
|
15
|
-
"""
|
|
16
|
-
SharePoint's entity set
|
|
17
|
-
"""
|
|
15
|
+
"""SharePoint's entity set"""
|
|
18
16
|
|
|
19
17
|
def __init__(self, context, item_type, resource_path=None, parent=None):
|
|
20
18
|
# type: (ClientContext, Type[T], Optional[ResourcePath], Optional[Entity]) -> None
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -7,24 +9,18 @@ class EventReceiverDefinition(Entity):
|
|
|
7
9
|
|
|
8
10
|
@property
|
|
9
11
|
def receiver_assembly(self):
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:rtype: str or None
|
|
13
|
-
"""
|
|
12
|
+
# type: () -> Optional[str]
|
|
13
|
+
"""Specifies the strong name of the assembly that is used for the event receiver."""
|
|
14
14
|
return self.properties.get("ReceiverAssembly", None)
|
|
15
15
|
|
|
16
16
|
@property
|
|
17
17
|
def receiver_class(self):
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
:rtype: str or None
|
|
21
|
-
"""
|
|
18
|
+
# type: () -> Optional[str]
|
|
19
|
+
"""Specifies the strong name of the assembly that is used for the event receiver."""
|
|
22
20
|
return self.properties.get("ReceiverClass", None)
|
|
23
21
|
|
|
24
22
|
@property
|
|
25
23
|
def receiver_url(self):
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
:rtype: str or None
|
|
29
|
-
"""
|
|
24
|
+
# type: () -> Optional[str]
|
|
25
|
+
"""Gets the URL of the receiver for the event."""
|
|
30
26
|
return self.properties.get("ReceiverUrl", None)
|
|
@@ -4,7 +4,7 @@ from office365.sharepoint.entity_collection import EntityCollection
|
|
|
4
4
|
from office365.sharepoint.features.feature import Feature
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
class FeatureCollection(EntityCollection):
|
|
7
|
+
class FeatureCollection(EntityCollection[Feature]):
|
|
8
8
|
"""Represents a collection of Feature resources."""
|
|
9
9
|
|
|
10
10
|
def __init__(self, context, resource_path=None, parent=None):
|
|
@@ -31,15 +31,12 @@ class FeatureCollection(EntityCollection):
|
|
|
31
31
|
return ServiceOperationQuery(self, "Add", None, payload, None, return_type)
|
|
32
32
|
|
|
33
33
|
def _create_if_not_activated(f):
|
|
34
|
-
|
|
35
|
-
:type f: Feature
|
|
36
|
-
"""
|
|
34
|
+
# type: (Feature) -> None
|
|
37
35
|
if not f.properties:
|
|
38
36
|
self.context.add_query(_create_query())
|
|
39
37
|
|
|
40
38
|
if verify_if_activated:
|
|
41
|
-
|
|
42
|
-
self.context.load(feature, after_loaded=_create_if_not_activated)
|
|
39
|
+
self.get_by_id(feature_id).get().after_execute(_create_if_not_activated)
|
|
43
40
|
else:
|
|
44
41
|
self.context.add_query(_create_query())
|
|
45
42
|
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
class FeatureDefinition(Entity):
|
|
5
7
|
"""Contains the base definition of a feature, including its name, ID, scope, and version."""
|
|
6
8
|
|
|
9
|
+
def __str__(self):
|
|
10
|
+
return self.display_name or self.entity_type_name
|
|
11
|
+
|
|
7
12
|
@property
|
|
8
13
|
def display_name(self):
|
|
9
|
-
|
|
10
|
-
:rtype: str or None
|
|
11
|
-
"""
|
|
14
|
+
# type: () -> Optional[str]
|
|
12
15
|
return self.properties.get("DisplayName", None)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.fields.field import Field
|
|
2
4
|
|
|
3
5
|
|
|
@@ -11,26 +13,18 @@ class FieldCalculated(Field):
|
|
|
11
13
|
|
|
12
14
|
@property
|
|
13
15
|
def currency_locale_id(self):
|
|
14
|
-
|
|
15
|
-
Gets the locale ID that is used for currency on the Web site.
|
|
16
|
-
|
|
17
|
-
:rtype: int or None
|
|
18
|
-
"""
|
|
16
|
+
# type: () -> Optional[int]
|
|
17
|
+
"""Gets the locale ID that is used for currency on the Web site."""
|
|
19
18
|
return self.properties.get("CurrencyLocaleId", None)
|
|
20
19
|
|
|
21
20
|
@property
|
|
22
21
|
def formula(self):
|
|
23
|
-
|
|
24
|
-
Specifies the formula for the field
|
|
25
|
-
|
|
26
|
-
:rtype: str or None
|
|
27
|
-
"""
|
|
22
|
+
# type: () -> Optional[str]
|
|
23
|
+
"""Specifies the formula for the field"""
|
|
28
24
|
return self.properties.get("Formula", None)
|
|
29
25
|
|
|
30
26
|
@formula.setter
|
|
31
27
|
def formula(self, val):
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
:type val: str
|
|
35
|
-
"""
|
|
28
|
+
# type: (str) -> None
|
|
29
|
+
"""Sets a value that specifies the Formula."""
|
|
36
30
|
self.set_property("Formula", val)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.paths.service_operation import ServiceOperationPath
|
|
2
4
|
from office365.runtime.queries.create_entity import CreateEntityQuery
|
|
3
5
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
@@ -7,12 +9,20 @@ from office365.sharepoint.fields.creation_information import FieldCreationInform
|
|
|
7
9
|
from office365.sharepoint.fields.date_time import FieldDateTime
|
|
8
10
|
from office365.sharepoint.fields.field import Field
|
|
9
11
|
from office365.sharepoint.fields.geolocation import FieldGeolocation
|
|
12
|
+
from office365.sharepoint.fields.number import FieldNumber
|
|
13
|
+
from office365.sharepoint.fields.text import FieldText
|
|
10
14
|
from office365.sharepoint.fields.type import FieldType
|
|
15
|
+
from office365.sharepoint.fields.url import FieldUrl
|
|
11
16
|
from office365.sharepoint.fields.xmlSchemaFieldCreationInformation import (
|
|
12
17
|
XmlSchemaFieldCreationInformation,
|
|
13
18
|
)
|
|
14
19
|
from office365.sharepoint.taxonomy.field import TaxonomyField
|
|
15
20
|
from office365.sharepoint.taxonomy.sets.set import TermSet
|
|
21
|
+
from office365.sharepoint.taxonomy.stores.store import TermStore
|
|
22
|
+
|
|
23
|
+
if TYPE_CHECKING:
|
|
24
|
+
from office365.sharepoint.lists.list import List
|
|
25
|
+
from office365.sharepoint.webs.web import Web
|
|
16
26
|
|
|
17
27
|
|
|
18
28
|
class FieldCollection(EntityCollection[Field]):
|
|
@@ -39,6 +49,7 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
39
49
|
return return_type
|
|
40
50
|
|
|
41
51
|
def add_datetime(self, title, description=None):
|
|
52
|
+
# type: (str, Optional[str]) -> FieldDateTime
|
|
42
53
|
"""
|
|
43
54
|
Creates DateTime field
|
|
44
55
|
:param str title: Specifies the display name of the field
|
|
@@ -50,10 +61,11 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
50
61
|
description=description,
|
|
51
62
|
field_type_kind=FieldType.DateTime,
|
|
52
63
|
)
|
|
53
|
-
)
|
|
64
|
+
)
|
|
54
65
|
return return_type
|
|
55
66
|
|
|
56
67
|
def add_geolocation_field(self, title, description=None):
|
|
68
|
+
# type: (str, Optional[str]) -> FieldGeolocation
|
|
57
69
|
"""
|
|
58
70
|
Creates Geolocation field
|
|
59
71
|
|
|
@@ -66,13 +78,29 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
66
78
|
description=description,
|
|
67
79
|
field_type_kind=FieldType.Geolocation,
|
|
68
80
|
)
|
|
69
|
-
)
|
|
81
|
+
)
|
|
82
|
+
return return_type
|
|
83
|
+
|
|
84
|
+
def add_number(self, title, description=None):
|
|
85
|
+
# type: (str, Optional[str]) -> FieldNumber
|
|
86
|
+
"""
|
|
87
|
+
Creates Number field
|
|
88
|
+
:param str title: Specifies the display name of the field
|
|
89
|
+
:param str or None description: Specifies the description of the field
|
|
90
|
+
"""
|
|
91
|
+
return_type = self.add(
|
|
92
|
+
FieldCreationInformation(
|
|
93
|
+
title=title,
|
|
94
|
+
description=description,
|
|
95
|
+
field_type_kind=FieldType.Number,
|
|
96
|
+
)
|
|
97
|
+
)
|
|
70
98
|
return return_type
|
|
71
99
|
|
|
72
100
|
def add_url_field(self, title, description=None):
|
|
101
|
+
# type: (str, Optional[str]) -> FieldUrl
|
|
73
102
|
"""
|
|
74
103
|
Creates Url field
|
|
75
|
-
|
|
76
104
|
:param str title: Specifies the display name of the field
|
|
77
105
|
:param str or None description:
|
|
78
106
|
"""
|
|
@@ -124,8 +152,6 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
124
152
|
return_type=return_type,
|
|
125
153
|
)
|
|
126
154
|
|
|
127
|
-
from office365.sharepoint.lists.list import List
|
|
128
|
-
|
|
129
155
|
if isinstance(lookup_list, List):
|
|
130
156
|
|
|
131
157
|
def _lookup_list_loaded():
|
|
@@ -158,11 +184,10 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
158
184
|
return self.add_field(FieldCreationInformation(title, FieldType.User))
|
|
159
185
|
|
|
160
186
|
def add_text_field(self, title):
|
|
187
|
+
# type: (str) -> FieldText
|
|
161
188
|
"""
|
|
162
189
|
Creates a Text field
|
|
163
|
-
|
|
164
190
|
:param str title: specifies the display name of the field
|
|
165
|
-
:rtype: office365.sharepoint.fields.text.FieldText
|
|
166
191
|
"""
|
|
167
192
|
return self.add_field(FieldCreationInformation(title, FieldType.Text))
|
|
168
193
|
|
|
@@ -245,6 +270,7 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
245
270
|
else:
|
|
246
271
|
|
|
247
272
|
def _term_store_loaded(term_store):
|
|
273
|
+
# type: (TermStore) -> None
|
|
248
274
|
TaxonomyField.create(
|
|
249
275
|
self,
|
|
250
276
|
name,
|
|
@@ -254,9 +280,10 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
254
280
|
return_type=return_type,
|
|
255
281
|
)
|
|
256
282
|
|
|
257
|
-
self.context.load(
|
|
258
|
-
|
|
283
|
+
self.context.load(self.context.taxonomy.term_store).after_query_execute(
|
|
284
|
+
_term_store_loaded
|
|
259
285
|
)
|
|
286
|
+
|
|
260
287
|
return return_type
|
|
261
288
|
|
|
262
289
|
def create_field_as_xml(self, schema_xml, return_type=None):
|
|
@@ -287,7 +314,7 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
287
314
|
)
|
|
288
315
|
|
|
289
316
|
def get_by_internal_name_or_title(self, value):
|
|
290
|
-
"""Returns the first field
|
|
317
|
+
"""Returns the first field in the collection based on the internal name or the title specified
|
|
291
318
|
by the parameter.
|
|
292
319
|
|
|
293
320
|
:param str value: The title or internal name to look up the field (2) by.
|
|
@@ -309,3 +336,8 @@ class FieldCollection(EntityCollection[Field]):
|
|
|
309
336
|
self.context,
|
|
310
337
|
ServiceOperationPath("getByTitle", [title], self.resource_path),
|
|
311
338
|
)
|
|
339
|
+
|
|
340
|
+
@property
|
|
341
|
+
def parent(self):
|
|
342
|
+
# type: () -> Web|List
|
|
343
|
+
return self._parent
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.fields.field import Field
|
|
2
4
|
|
|
3
5
|
|
|
@@ -10,9 +12,6 @@ class FieldComputed(Field):
|
|
|
10
12
|
|
|
11
13
|
@property
|
|
12
14
|
def enable_lookup(self):
|
|
13
|
-
|
|
14
|
-
Specifies whether a lookup field can reference the field
|
|
15
|
-
|
|
16
|
-
:rtype: bool or None
|
|
17
|
-
"""
|
|
15
|
+
# type: () -> Optional[bool]
|
|
16
|
+
"""Specifies whether a lookup field can reference the field."""
|
|
18
17
|
return self.properties.get("EnableLookup", None)
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.fields.number import FieldNumber
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
class FieldCurrency(FieldNumber):
|
|
5
|
-
"""Specifies a field
|
|
7
|
+
"""Specifies a field that contains currency values. To set properties, call the Update method
|
|
6
8
|
(section 3.2.5.43.2.1.5)."""
|
|
7
9
|
|
|
8
10
|
@property
|
|
9
11
|
def currency_locale_id(self):
|
|
10
|
-
|
|
11
|
-
Gets the language code identifier (LCID) used to format the value of the field.
|
|
12
|
-
|
|
13
|
-
:rtype: int or None
|
|
14
|
-
"""
|
|
12
|
+
# type: () -> Optional[int]
|
|
13
|
+
"""Gets the language code identifier (LCID) used to format the value of the field."""
|
|
15
14
|
return self.properties.get("CurrencyLocaleId", None)
|
|
16
15
|
|
|
17
16
|
@currency_locale_id.setter
|
|
18
17
|
def currency_locale_id(self, value):
|
|
19
|
-
|
|
20
|
-
Sets the language code identifier (LCID) used to format the value of the field.
|
|
21
|
-
|
|
22
|
-
:type value: int
|
|
23
|
-
"""
|
|
18
|
+
# type: (int) -> None
|
|
19
|
+
"""Sets the language code identifier (LCID) used to format the value of the field."""
|
|
24
20
|
self.set_property("CurrencyLocaleId", value)
|
|
@@ -9,18 +9,14 @@ class FieldDateTime(Field):
|
|
|
9
9
|
|
|
10
10
|
@property
|
|
11
11
|
def datetime_calendar_type(self):
|
|
12
|
-
|
|
13
|
-
Gets the calendar type of the field
|
|
14
|
-
:rtype: int or None
|
|
15
|
-
"""
|
|
12
|
+
# type: () -> Optional[int]
|
|
13
|
+
"""Gets the calendar type of the field"""
|
|
16
14
|
return self.properties.get("DateTimeCalendarType", None)
|
|
17
15
|
|
|
18
16
|
@datetime_calendar_type.setter
|
|
19
17
|
def datetime_calendar_type(self, value):
|
|
20
|
-
|
|
21
|
-
Sets Gets the calendar type of the field
|
|
22
|
-
:type value: int
|
|
23
|
-
"""
|
|
18
|
+
# type: (int) -> None
|
|
19
|
+
"""Sets Gets the calendar type of the field"""
|
|
24
20
|
self.set_property("DateTimeCalendarType", value)
|
|
25
21
|
|
|
26
22
|
@property
|