Office365-REST-Python-Client 2.5.5__py3-none-any.whl → 2.5.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/METADATA +2 -2
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/RECORD +202 -182
- office365/booking/virtualevents/__init__.py +0 -0
- office365/booking/virtualevents/root.py +5 -0
- office365/communications/calls/participant.py +4 -5
- office365/directory/applications/application.py +3 -3
- office365/directory/applications/roles/assignment_collection.py +1 -1
- office365/directory/applications/roles/collection.py +2 -2
- office365/directory/authentication/method_configuration.py +9 -0
- office365/directory/authentication/method_mode_detail.py +8 -0
- office365/directory/authentication/method_target.py +5 -0
- office365/directory/authentication/strength_root.py +5 -0
- office365/directory/certificates/auth_configuration.py +1 -3
- office365/directory/groups/group.py +2 -6
- office365/directory/identities/conditional_access_root.py +10 -1
- office365/directory/identities/container.py +3 -9
- office365/directory/identities/providers/builtin_identity.py +3 -2
- office365/directory/identities/providers/saml_or_wsfed.py +4 -5
- office365/directory/identitygovernance/governance.py +14 -3
- office365/directory/identitygovernance/privilegedaccess/__init__.py +0 -0
- office365/directory/identitygovernance/privilegedaccess/root.py +5 -0
- office365/directory/key_credential.py +3 -0
- office365/directory/licenses/assignment_state.py +26 -2
- office365/directory/licenses/details.py +4 -3
- office365/directory/licenses/subscribed_sku.py +8 -10
- office365/directory/object_collection.py +40 -25
- office365/directory/password_credential.py +3 -0
- office365/directory/permissions/default_user_role.py +5 -0
- office365/directory/permissions/grants/condition_set.py +4 -2
- office365/directory/permissions/grants/oauth2.py +7 -10
- office365/directory/policies/authorization.py +50 -3
- office365/directory/policies/permission_grant.py +2 -0
- office365/directory/profile_photo.py +6 -6
- office365/directory/protection/riskyusers/risky_user.py +4 -4
- office365/directory/rolemanagement/resource_action.py +10 -0
- office365/directory/rolemanagement/role_permission.py +10 -0
- office365/directory/security/alerts/alert.py +5 -7
- office365/directory/security/attacksimulations/landing_page.py +5 -0
- office365/directory/security/attacksimulations/operation.py +5 -0
- office365/directory/security/attacksimulations/report.py +8 -1
- office365/directory/security/attacksimulations/root.py +33 -0
- office365/directory/security/attacksimulations/users/__init__.py +0 -0
- office365/directory/security/attacksimulations/users/details.py +5 -0
- office365/directory/security/hunting_query_results.py +5 -0
- office365/directory/security/incidents/incident.py +8 -13
- office365/directory/security/security.py +20 -3
- office365/directory/serviceprincipals/service_principal.py +3 -4
- office365/directory/synchronization/synchronization.py +2 -0
- office365/directory/users/activities/history_item.py +3 -2
- office365/directory/users/user.py +37 -10
- office365/entity_collection.py +3 -2
- office365/graph_client.py +58 -30
- office365/intune/audit/event.py +1 -3
- office365/intune/audit/event_collection.py +1 -1
- office365/intune/devices/alternative_security_id.py +4 -0
- office365/intune/devices/collection.py +57 -0
- office365/intune/devices/device.py +38 -10
- office365/intune/devices/management/management.py +12 -0
- office365/intune/organizations/organization.py +1 -0
- office365/onedrive/analytics/item_activity_stat.py +9 -0
- office365/onedrive/analytics/item_analytics.py +1 -0
- office365/onedrive/contenttypes/content_type.py +4 -12
- office365/onedrive/driveitems/driveItem.py +2 -1
- office365/onedrive/files/hashes.py +5 -0
- office365/onedrive/lists/collection.py +2 -2
- office365/onedrive/operations/long_running.py +6 -6
- office365/onedrive/operations/rich_long_running.py +4 -3
- office365/onedrive/permissions/collection.py +1 -14
- office365/onedrive/sharepoint_settings.py +6 -6
- office365/onedrive/sites/sites_with_root.py +1 -3
- office365/onedrive/termstore/store.py +2 -4
- office365/onedrive/termstore/terms/collection.py +1 -2
- office365/onedrive/workbooks/filter.py +9 -0
- office365/onedrive/workbooks/filter_criteria.py +5 -0
- office365/onedrive/workbooks/functions/functions.py +6 -3
- office365/onedrive/workbooks/functions/result.py +2 -0
- office365/onedrive/workbooks/operations/workbook.py +7 -10
- office365/onedrive/workbooks/tables/pivot_table.py +9 -9
- office365/onedrive/workbooks/worksheets/collection.py +0 -6
- office365/onedrive/workbooks/worksheets/protection.py +2 -0
- office365/outlook/calendar/permissions/permission.py +7 -7
- office365/outlook/calendar/place.py +5 -3
- office365/outlook/mail/attachments/collection.py +6 -1
- office365/outlook/mail/messages/message.py +1 -1
- office365/reports/root.py +50 -4
- office365/runtime/auth/providers/acs_token_provider.py +10 -7
- office365/runtime/auth/sts_profile.py +0 -1
- office365/runtime/client_object.py +18 -14
- office365/runtime/client_object_collection.py +8 -23
- office365/runtime/client_request_exception.py +1 -3
- office365/runtime/client_result.py +11 -14
- office365/runtime/client_runtime_context.py +11 -21
- office365/runtime/odata/json_format.py +4 -7
- office365/runtime/odata/v3/batch_request.py +7 -15
- office365/runtime/odata/v4/batch_request.py +13 -21
- office365/runtime/types/event_handler.py +1 -1
- office365/search/entity.py +3 -2
- office365/sharepoint/activities/facets/delete.py +1 -1
- office365/sharepoint/activities/tracked_item_service.py +2 -3
- office365/sharepoint/administration/web_application.py +8 -7
- office365/sharepoint/audit/audit.py +3 -2
- office365/sharepoint/changes/alert.py +4 -3
- office365/sharepoint/changes/collection.py +7 -10
- office365/sharepoint/changes/content_type.py +4 -4
- office365/sharepoint/changes/field.py +4 -5
- office365/sharepoint/changes/item.py +34 -7
- office365/sharepoint/changes/list.py +4 -4
- office365/sharepoint/changes/user.py +5 -6
- office365/sharepoint/clientsidecomponent/component_context_info.py +4 -3
- office365/sharepoint/contentcenter/machinelearning/enabled.py +4 -3
- office365/sharepoint/contentcenter/machinelearning/hub.py +6 -6
- office365/sharepoint/contentcenter/machinelearning/models/collection.py +1 -1
- office365/sharepoint/contenttypes/fieldlinks/collection.py +4 -6
- office365/sharepoint/contenttypes/fieldlinks/field_link.py +14 -22
- office365/sharepoint/entity.py +12 -5
- office365/sharepoint/entity_collection.py +1 -3
- office365/sharepoint/eventreceivers/definition.py +8 -12
- office365/sharepoint/features/collection.py +1 -2
- office365/sharepoint/features/definitions/definition.py +6 -3
- office365/sharepoint/fields/calculated.py +8 -14
- office365/sharepoint/fields/collection.py +42 -10
- office365/sharepoint/fields/computed.py +4 -5
- office365/sharepoint/fields/currency.py +7 -11
- office365/sharepoint/fields/date_time.py +4 -8
- office365/sharepoint/fields/field.py +6 -16
- office365/sharepoint/fields/lookup.py +11 -9
- office365/sharepoint/fields/multi_choice.py +8 -12
- office365/sharepoint/fields/multi_line_text.py +10 -14
- office365/sharepoint/fields/number.py +13 -26
- office365/sharepoint/fields/rating_scale.py +6 -10
- office365/sharepoint/fields/related_field.py +10 -17
- office365/sharepoint/fields/url.py +4 -5
- office365/sharepoint/fields/user.py +10 -9
- office365/sharepoint/files/collection.py +17 -15
- office365/sharepoint/files/file.py +30 -23
- office365/sharepoint/folders/collection.py +22 -5
- office365/sharepoint/folders/coloring.py +11 -9
- office365/sharepoint/folders/coloring_information.py +38 -0
- office365/sharepoint/folders/folder.py +22 -22
- office365/sharepoint/likes/liked_by_information.py +7 -10
- office365/sharepoint/likes/user_entity.py +6 -8
- office365/sharepoint/listitems/form_update_value.py +17 -1
- office365/sharepoint/listitems/listitem.py +2 -2
- office365/sharepoint/lists/bloom_filter.py +5 -7
- office365/sharepoint/lists/creatables_info.py +5 -6
- office365/sharepoint/lists/list.py +24 -9
- office365/sharepoint/lists/template.py +7 -4
- office365/sharepoint/lists/template_collection.py +2 -4
- office365/sharepoint/marketplace/app_metadata.py +14 -23
- office365/sharepoint/marketplace/sitecollection/appcatalog/allowed_item.py +6 -8
- office365/sharepoint/navigation/node.py +5 -8
- office365/sharepoint/permissions/irm/effective_settings.py +6 -8
- office365/sharepoint/permissions/irm/file_settings.py +8 -6
- office365/sharepoint/permissions/irm/settings.py +25 -43
- office365/sharepoint/portal/groups/site_manager.py +6 -7
- office365/sharepoint/publishing/embed_data_v1.py +8 -15
- office365/sharepoint/publishing/pages/campaign_publication.py +4 -3
- office365/sharepoint/publishing/primary_city_time.py +8 -9
- office365/sharepoint/publishing/video/service_discoverer.py +4 -3
- office365/sharepoint/pushnotifications/subscriber.py +11 -15
- office365/sharepoint/sharing/object_sharing_settings.py +24 -46
- office365/sharepoint/sharing/permission_information.py +5 -5
- office365/sharepoint/sharing/result.py +1 -0
- office365/sharepoint/sitedesigns/run.py +4 -3
- office365/sharepoint/sites/site.py +7 -16
- office365/sharepoint/taxonomy/field.py +32 -21
- office365/sharepoint/taxonomy/groups/group.py +12 -1
- office365/sharepoint/taxonomy/sets/set.py +6 -0
- office365/sharepoint/taxonomy/stores/store.py +4 -2
- office365/sharepoint/teams/channel.py +6 -6
- office365/sharepoint/tenant/administration/endpoints.py +4 -3
- office365/sharepoint/tenant/administration/hubsites/properties.py +4 -5
- office365/sharepoint/tenant/administration/sites/properties.py +0 -1
- office365/sharepoint/tenant/administration/spo_operation.py +4 -4
- office365/sharepoint/tenant/administration/tenant.py +1 -0
- office365/sharepoint/tenant/insights/report.py +11 -0
- office365/sharepoint/tenant/insights/report_manager.py +5 -0
- office365/sharepoint/tenant/insights/report_metadata.py +5 -0
- office365/sharepoint/tenant/settings.py +4 -3
- office365/sharepoint/translation/sync_translator.py +3 -2
- office365/sharepoint/ui/applicationpages/peoplepicker/entity_information.py +4 -4
- office365/sharepoint/usercustomactions/action.py +12 -20
- office365/sharepoint/userprofiles/followed_content.py +6 -10
- office365/sharepoint/userprofiles/people_manager.py +0 -1
- office365/sharepoint/userprofiles/person_properties.py +14 -30
- office365/sharepoint/userprofiles/personal_cache.py +4 -3
- office365/sharepoint/userprofiles/properties_for_user.py +4 -5
- office365/sharepoint/userprofiles/sharedwithme/document.py +12 -21
- office365/sharepoint/utilities/move_copy_util.py +19 -19
- office365/sharepoint/utilities/upload_status.py +7 -10
- office365/sharepoint/views/field_collection.py +9 -14
- office365/sharepoint/views/view.py +43 -64
- office365/sharepoint/webhooks/subscription.py +11 -19
- office365/sharepoint/webparts/webpart.py +3 -1
- office365/sharepoint/webs/modernize_homepage_result.py +4 -3
- office365/sharepoint/webs/regional_settings.py +9 -17
- office365/sharepoint/webs/template.py +3 -5
- office365/sharepoint/webs/web.py +14 -20
- office365/teams/operations/async_operation.py +5 -7
- office365/runtime/paths/item.py +0 -8
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.6.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import re
|
|
3
3
|
from email.message import Message
|
|
4
|
-
from typing import Iterator, Tuple
|
|
4
|
+
from typing import AnyStr, Iterator, List, Tuple
|
|
5
5
|
|
|
6
6
|
import requests
|
|
7
7
|
from requests import Response
|
|
@@ -40,12 +40,8 @@ class ODataBatchV3Request(ODataRequest):
|
|
|
40
40
|
super(ODataBatchV3Request, self).process_response(sub_resp, sub_qry)
|
|
41
41
|
|
|
42
42
|
def _extract_response(self, response, query):
|
|
43
|
-
# type: (
|
|
44
|
-
"""Parses a multipart/mixed response body from the position defined by the context.
|
|
45
|
-
|
|
46
|
-
:type response: requests.Response
|
|
47
|
-
:type query: office365.runtime.queries.batch.BatchQuery
|
|
48
|
-
"""
|
|
43
|
+
# type: (Response, BatchQuery) -> Iterator[Tuple[ClientQuery, Response]]
|
|
44
|
+
"""Parses a multipart/mixed response body from the position defined by the context."""
|
|
49
45
|
content_type = response.headers["Content-Type"].encode("ascii")
|
|
50
46
|
http_body = b"Content-Type: " + content_type + b"\r\n\r\n" + response.content
|
|
51
47
|
|
|
@@ -59,11 +55,8 @@ class ODataBatchV3Request(ODataRequest):
|
|
|
59
55
|
yield qry, self._deserialize_response(raw_response)
|
|
60
56
|
|
|
61
57
|
def _prepare_payload(self, query):
|
|
62
|
-
|
|
63
|
-
Serializes a batch request body.
|
|
64
|
-
|
|
65
|
-
:type query: office365.runtime.queries.batch.BatchQuery
|
|
66
|
-
"""
|
|
58
|
+
# type: (BatchQuery) -> AnyStr
|
|
59
|
+
"""Serializes a batch request body."""
|
|
67
60
|
main_message = Message()
|
|
68
61
|
main_message.add_header("Content-Type", "multipart/mixed")
|
|
69
62
|
main_message.set_boundary(query.current_boundary)
|
|
@@ -89,9 +82,8 @@ class ODataBatchV3Request(ODataRequest):
|
|
|
89
82
|
|
|
90
83
|
@staticmethod
|
|
91
84
|
def _normalize_headers(headers_raw):
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"""
|
|
85
|
+
# type: (List[str]) -> CaseInsensitiveDict
|
|
86
|
+
""" """
|
|
95
87
|
headers = {}
|
|
96
88
|
for header_line in headers_raw:
|
|
97
89
|
k, v = header_line.split(":", 1)
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import json
|
|
2
|
+
from typing import Any, Dict, Iterator, List, Optional, Tuple
|
|
2
3
|
|
|
3
|
-
import
|
|
4
|
+
from requests import Response
|
|
4
5
|
from requests.structures import CaseInsensitiveDict
|
|
5
6
|
|
|
6
7
|
from office365.runtime.http.http_method import HttpMethod
|
|
7
8
|
from office365.runtime.http.request_options import RequestOptions
|
|
8
9
|
from office365.runtime.odata.request import ODataRequest
|
|
10
|
+
from office365.runtime.queries.batch import BatchQuery
|
|
11
|
+
from office365.runtime.queries.client_query import ClientQuery
|
|
9
12
|
|
|
10
13
|
|
|
11
14
|
class ODataV4BatchRequest(ODataRequest):
|
|
12
15
|
"""JSON batch request"""
|
|
13
16
|
|
|
14
17
|
def build_request(self, query):
|
|
15
|
-
|
|
16
|
-
Builds a batch request
|
|
17
|
-
|
|
18
|
-
:type query: office365.runtime.queries.batch.BatchQuery
|
|
19
|
-
"""
|
|
18
|
+
# type: (BatchQuery) -> RequestOptions
|
|
19
|
+
"""Builds a batch request"""
|
|
20
20
|
request = RequestOptions(query.url)
|
|
21
21
|
request.method = HttpMethod.Post
|
|
22
22
|
request.ensure_header("Content-Type", "application/json")
|
|
@@ -25,24 +25,19 @@ class ODataV4BatchRequest(ODataRequest):
|
|
|
25
25
|
return request
|
|
26
26
|
|
|
27
27
|
def process_response(self, response, query):
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
:type response: requests.Response
|
|
31
|
-
:type query: office365.runtime.queries.batch.BatchQuery
|
|
32
|
-
"""
|
|
28
|
+
# type: (Response, BatchQuery) -> None
|
|
29
|
+
"""Parses an HTTP response."""
|
|
33
30
|
for sub_qry, sub_resp in self._extract_response(response, query):
|
|
34
31
|
sub_resp.raise_for_status()
|
|
35
32
|
super(ODataV4BatchRequest, self).process_response(sub_resp, sub_qry)
|
|
36
33
|
|
|
37
34
|
@staticmethod
|
|
38
35
|
def _extract_response(response, query):
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
:type query: office365.runtime.queries.batch.BatchQuery
|
|
42
|
-
"""
|
|
36
|
+
# type: (Response, BatchQuery) -> Iterator[Tuple[ClientQuery, Response]]
|
|
37
|
+
""" """
|
|
43
38
|
json_responses = response.json()
|
|
44
39
|
for json_resp in json_responses["responses"]:
|
|
45
|
-
resp =
|
|
40
|
+
resp = Response()
|
|
46
41
|
resp.status_code = int(json_resp["status"])
|
|
47
42
|
resp.headers = CaseInsensitiveDict(json_resp["headers"])
|
|
48
43
|
resp._content = json.dumps(json_resp["body"]).encode("utf-8")
|
|
@@ -65,11 +60,8 @@ class ODataV4BatchRequest(ODataRequest):
|
|
|
65
60
|
|
|
66
61
|
@staticmethod
|
|
67
62
|
def _normalize_request(query, query_id, depends_on=None):
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
:type query_id: str
|
|
71
|
-
:type depends_on: list[str] or None
|
|
72
|
-
"""
|
|
63
|
+
# type: (ClientQuery, str, Optional[List[str]]) -> Dict[str, Any]
|
|
64
|
+
""" """
|
|
73
65
|
request = query.build_request()
|
|
74
66
|
allowed_props = ["id", "method", "headers", "url", "body"]
|
|
75
67
|
request_json = dict(
|
office365/search/entity.py
CHANGED
|
@@ -38,8 +38,9 @@ class SearchEntity(Entity):
|
|
|
38
38
|
# self.context.pending_request().map_json(search_hit.resource, resource)
|
|
39
39
|
# search_hit.set_property("resource", resource)
|
|
40
40
|
|
|
41
|
-
def _process_response():
|
|
42
|
-
|
|
41
|
+
def _process_response(result):
|
|
42
|
+
# type: (ClientResult[ClientValueCollection[SearchResponse]]) -> None
|
|
43
|
+
for item in result.value:
|
|
43
44
|
for hcs in item.hitsContainers:
|
|
44
45
|
[_patch_hit(hit) for hit in hcs.hits]
|
|
45
46
|
|
|
@@ -3,15 +3,14 @@ from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
|
3
3
|
from office365.sharepoint.activities.tracked_item_updates_request import (
|
|
4
4
|
TrackedItemUpdatesRequest,
|
|
5
5
|
)
|
|
6
|
+
from office365.sharepoint.client_context import ClientContext
|
|
6
7
|
from office365.sharepoint.entity import Entity
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
class TrackedItemService(Entity):
|
|
10
11
|
@staticmethod
|
|
11
12
|
def get_tracked_item_updates_for_user(context):
|
|
12
|
-
|
|
13
|
-
:type context: office365.sharepoint.client_context.ClientContext
|
|
14
|
-
"""
|
|
13
|
+
# type: (ClientContext) -> ClientResult[str]
|
|
15
14
|
return_type = ClientResult(context)
|
|
16
15
|
payload = {"request": TrackedItemUpdatesRequest()}
|
|
17
16
|
qry = ServiceOperationQuery(
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
4
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
5
|
+
from office365.sharepoint.client_context import ClientContext
|
|
3
6
|
from office365.sharepoint.entity import Entity
|
|
4
7
|
from office365.sharepoint.entity_collection import EntityCollection
|
|
5
8
|
from office365.sharepoint.sites.site import Site
|
|
@@ -8,10 +11,8 @@ from office365.sharepoint.sites.site import Site
|
|
|
8
11
|
class WebApplication(Entity):
|
|
9
12
|
@staticmethod
|
|
10
13
|
def lookup(context, request_uri):
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
:type request_uri str
|
|
14
|
-
"""
|
|
14
|
+
# type: (ClientContext, str) -> WebApplication
|
|
15
|
+
""" """
|
|
15
16
|
return_type = WebApplication(context)
|
|
16
17
|
payload = {"requestUri": request_uri}
|
|
17
18
|
qry = ServiceOperationQuery(
|
|
@@ -22,13 +23,13 @@ class WebApplication(Entity):
|
|
|
22
23
|
|
|
23
24
|
@property
|
|
24
25
|
def outbound_mail_sender_address(self):
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"""
|
|
26
|
+
# type: () -> Optional[str]
|
|
27
|
+
""" """
|
|
28
28
|
return self.properties.get("OutboundMailSenderAddress", None)
|
|
29
29
|
|
|
30
30
|
@property
|
|
31
31
|
def sites(self):
|
|
32
|
+
# type: () -> EntityCollection[Site]
|
|
32
33
|
return self.properties.get(
|
|
33
34
|
"Sites",
|
|
34
35
|
EntityCollection(
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -8,11 +10,10 @@ class Audit(Entity):
|
|
|
8
10
|
|
|
9
11
|
@property
|
|
10
12
|
def allow_designer(self):
|
|
13
|
+
# type: () -> Optional[bool]
|
|
11
14
|
"""
|
|
12
15
|
Specifies whether a designer can be used on this site collection.
|
|
13
16
|
See Microsoft.SharePoint.Client.Web.AllowDesignerForCurrentUser, which is the scalar property used
|
|
14
17
|
to determine the behavior for the current user. The default, if not disabled on the Web application, is "true".
|
|
15
|
-
|
|
16
|
-
:rtype: bool or None
|
|
17
18
|
"""
|
|
18
19
|
return self.properties.get("AllowDesigner", None)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.changes.change import Change
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,7 +8,6 @@ class ChangeAlert(Change):
|
|
|
6
8
|
|
|
7
9
|
@property
|
|
8
10
|
def alert_id(self):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"""
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
"""Identifies the changed alert."""
|
|
12
13
|
return self.properties.get("AlertId", None)
|
|
@@ -9,15 +9,12 @@ class ChangeCollection(EntityCollection[Change]):
|
|
|
9
9
|
super(ChangeCollection, self).__init__(context, Change, resource_path)
|
|
10
10
|
|
|
11
11
|
def set_property(self, key, value, persist_changes=False):
|
|
12
|
-
self.
|
|
12
|
+
self._resolve_change_type(value)
|
|
13
13
|
super(ChangeCollection, self).set_property(key, value)
|
|
14
14
|
|
|
15
|
-
def
|
|
16
|
-
|
|
17
|
-
Resolves a change type
|
|
18
|
-
|
|
19
|
-
:type properties: dict
|
|
20
|
-
"""
|
|
15
|
+
def _resolve_change_type(self, properties):
|
|
16
|
+
# type: (dict) -> None
|
|
17
|
+
"""Resolves a change type"""
|
|
21
18
|
from office365.sharepoint.changes.alert import ChangeAlert
|
|
22
19
|
from office365.sharepoint.changes.content_type import ChangeContentType
|
|
23
20
|
from office365.sharepoint.changes.field import ChangeField
|
|
@@ -27,10 +24,10 @@ class ChangeCollection(EntityCollection[Change]):
|
|
|
27
24
|
from office365.sharepoint.changes.user import ChangeUser
|
|
28
25
|
from office365.sharepoint.changes.web import ChangeWeb
|
|
29
26
|
|
|
30
|
-
if "
|
|
31
|
-
self._item_type = ChangeList
|
|
32
|
-
elif "ItemId" in properties and "ListId" in properties:
|
|
27
|
+
if "ItemId" in properties and "ListId" in properties:
|
|
33
28
|
self._item_type = ChangeItem
|
|
29
|
+
elif "ListId" in properties and "WebId" in properties:
|
|
30
|
+
self._item_type = ChangeList
|
|
34
31
|
elif "WebId" in properties:
|
|
35
32
|
self._item_type = ChangeWeb
|
|
36
33
|
elif "UserId" in properties:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.changes.change import Change
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,8 +8,6 @@ class ChangeContentType(Change):
|
|
|
6
8
|
|
|
7
9
|
@property
|
|
8
10
|
def content_type_id(self):
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:rtype: str or None
|
|
12
|
-
"""
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
"""Identifies the content type that has changed."""
|
|
13
13
|
return self.properties.get("ContentTypeId", None)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.changes.change import Change
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,9 +8,6 @@ class ChangeField(Change):
|
|
|
6
8
|
|
|
7
9
|
@property
|
|
8
10
|
def field_id(self):
|
|
9
|
-
|
|
10
|
-
Identifies the changed field
|
|
11
|
-
|
|
12
|
-
:rtype: str or None
|
|
13
|
-
"""
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
"""Identifies the changed field"""
|
|
14
13
|
return self.properties.get("FieldId", None)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.client_value_collection import ClientValueCollection
|
|
2
4
|
from office365.sharepoint.changes.change import Change
|
|
3
5
|
from office365.sharepoint.contenttypes.content_type_id import ContentTypeId
|
|
@@ -9,19 +11,38 @@ class ChangeItem(Change):
|
|
|
9
11
|
|
|
10
12
|
@property
|
|
11
13
|
def activity_type(self):
|
|
12
|
-
|
|
13
|
-
Returns activity type defined in ChangeActivityType
|
|
14
|
-
:rtype: str or None
|
|
15
|
-
"""
|
|
14
|
+
# type: () -> Optional[str]
|
|
15
|
+
"""Returns activity type defined in ChangeActivityType"""
|
|
16
16
|
return self.properties.get("ActivityType", None)
|
|
17
17
|
|
|
18
18
|
@property
|
|
19
19
|
def content_type_id(self):
|
|
20
|
-
"""
|
|
21
|
-
Specifies an identifier for the content type
|
|
22
|
-
"""
|
|
20
|
+
"""Specifies an identifier for the content type"""
|
|
23
21
|
return self.properties.get("ContentTypeId", ContentTypeId())
|
|
24
22
|
|
|
23
|
+
@property
|
|
24
|
+
def file_type(self):
|
|
25
|
+
# type: () -> Optional[str]
|
|
26
|
+
"""Returns the list item’s file type."""
|
|
27
|
+
return self.properties.get("FileType", None)
|
|
28
|
+
|
|
29
|
+
@property
|
|
30
|
+
def item_id(self):
|
|
31
|
+
# type: () -> Optional[int]
|
|
32
|
+
"""Identifies the changed item."""
|
|
33
|
+
return self.properties.get("ItemId", None)
|
|
34
|
+
|
|
35
|
+
@property
|
|
36
|
+
def is_recycle_bin_operation(self):
|
|
37
|
+
# type: () -> Optional[bool]
|
|
38
|
+
return self.properties.get("IsRecycleBinOperation", None)
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
def server_relative_url(self):
|
|
42
|
+
# type: () -> Optional[str]
|
|
43
|
+
"""Specifies the server-relative URL of the item."""
|
|
44
|
+
return self.properties.get("ServerRelativeUrl", None)
|
|
45
|
+
|
|
25
46
|
@property
|
|
26
47
|
def shared_by_user(self):
|
|
27
48
|
"""Return the sharedBy User Information in sharing action for change log."""
|
|
@@ -34,6 +55,12 @@ class ChangeItem(Change):
|
|
|
34
55
|
"SharedWithUsers", ClientValueCollection(SharedWithUser)
|
|
35
56
|
)
|
|
36
57
|
|
|
58
|
+
@property
|
|
59
|
+
def unique_id(self):
|
|
60
|
+
# type: () -> Optional[str]
|
|
61
|
+
"""The Document identifier of the item."""
|
|
62
|
+
return self.properties.get("UniqueId", None)
|
|
63
|
+
|
|
37
64
|
def get_property(self, name, default_value=None):
|
|
38
65
|
if default_value is None:
|
|
39
66
|
property_mapping = {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
4
|
from office365.sharepoint.changes.change import Change
|
|
3
5
|
|
|
@@ -19,10 +21,8 @@ class ChangeList(Change):
|
|
|
19
21
|
|
|
20
22
|
@property
|
|
21
23
|
def list_id(self):
|
|
22
|
-
|
|
23
|
-
Identifies the changed list
|
|
24
|
-
:rtype: str or None
|
|
25
|
-
"""
|
|
24
|
+
# type: () -> Optional[str]
|
|
25
|
+
"""Identifies the changed list"""
|
|
26
26
|
return self.properties.get("ListId", None)
|
|
27
27
|
|
|
28
28
|
@property
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.sharepoint.changes.change import Change
|
|
2
4
|
|
|
3
5
|
|
|
@@ -6,21 +8,18 @@ class ChangeUser(Change):
|
|
|
6
8
|
|
|
7
9
|
@property
|
|
8
10
|
def activate(self):
|
|
11
|
+
# type: () -> Optional[bool]
|
|
9
12
|
"""
|
|
10
13
|
Specifies whether a user has changed from an inactive state to an active state.
|
|
11
14
|
|
|
12
15
|
When a user is added to a site and only has browse permissions, the user is in an inactive state.
|
|
13
16
|
However, once the user can author list items, add documents, be assigned tasks, or make any contribution
|
|
14
17
|
to the site, the user is in an active state.
|
|
15
|
-
|
|
16
|
-
:rtype: bool or None
|
|
17
18
|
"""
|
|
18
19
|
return self.properties.get("Activate", None)
|
|
19
20
|
|
|
20
21
|
@property
|
|
21
22
|
def user_id(self):
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
:rtype: str or None
|
|
25
|
-
"""
|
|
23
|
+
# type: () -> Optional[str]
|
|
24
|
+
"""Uniquely identifies the changed user."""
|
|
26
25
|
return self.properties.get("UserId", None)
|
|
@@ -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
|