Office365-REST-Python-Client 2.5.11__py3-none-any.whl → 2.5.13__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.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/METADATA +6 -1
- {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/RECORD +108 -66
- office365/backuprestore/__init__.py +0 -0
- office365/backuprestore/root.py +39 -0
- office365/backuprestore/service_status.py +5 -0
- office365/booking/solutions/root.py +14 -1
- office365/directory/applications/application.py +17 -0
- office365/directory/applications/optional_claim.py +5 -0
- office365/directory/applications/optional_claims.py +16 -0
- office365/directory/authentication/conditions/__init__.py +0 -0
- office365/directory/authentication/conditions/application.py +5 -0
- office365/directory/authentication/conditions/applications.py +5 -0
- office365/directory/authentication/conditions/conditions.py +11 -0
- office365/directory/authentication/conditions/event_listener.py +9 -0
- office365/directory/device_local_credential_info.py +21 -0
- office365/directory/identities/container.py +18 -0
- office365/directory/policies/authentication_flows.py +8 -0
- office365/directory/policies/root.py +17 -0
- office365/directory/policies/unified_role_management.py +7 -0
- office365/directory/protection/policy/__init__.py +0 -0
- office365/directory/protection/policy/base.py +24 -0
- office365/directory/protection/policy/one_drive_for_business.py +10 -0
- office365/directory/security/attacksimulations/users/details.py +7 -0
- office365/directory/serviceprincipals/service_principal.py +65 -14
- office365/directory/users/user.py +23 -3
- office365/graph_client.py +6 -1
- office365/intune/devices/management/management.py +26 -0
- office365/intune/devices/management/terms_and_conditions.py +10 -0
- office365/intune/devices/management/virtual_endpoint.py +8 -0
- office365/onedrive/idle_session_signout.py +15 -0
- office365/onedrive/sharepoint_settings.py +13 -0
- office365/onedrive/sitepages/title_area.py +15 -5
- office365/outlook/calendar/sharing/__init__.py +0 -0
- office365/outlook/calendar/sharing/message_action.py +5 -0
- office365/outlook/calendar/sharing_message.py +19 -0
- office365/outlook/calendar/timezones/custom.py +9 -0
- office365/outlook/mail/automatic_replies_setting.py +7 -0
- office365/outlook/mail/messages/rules/predicates.py +5 -0
- office365/outlook/mail/messages/rules/rule.py +4 -3
- office365/runtime/client_object.py +9 -1
- office365/runtime/client_object_collection.py +2 -2
- office365/runtime/client_result.py +19 -2
- office365/runtime/odata/query_options.py +3 -0
- office365/runtime/odata/v4/batch_request.py +12 -15
- office365/runtime/queries/batch.py +4 -0
- office365/sharepoint/appprincipal/identity_provider.py +7 -1
- office365/sharepoint/apps/context_site.py +41 -0
- office365/sharepoint/authpolicy/events/collection.py +11 -0
- office365/sharepoint/authpolicy/events/{auth_event.py → event.py} +1 -0
- office365/sharepoint/authpolicy/events/role_assignment_resource_payload.py +5 -0
- office365/sharepoint/brandcenter/__init__.py +0 -0
- office365/sharepoint/brandcenter/brand_center.py +9 -0
- office365/sharepoint/brandcenter/configuration.py +5 -0
- office365/sharepoint/changes/change.py +1 -3
- office365/sharepoint/changes/collection.py +3 -0
- office365/sharepoint/changes/folder.py +6 -0
- office365/sharepoint/changes/group.py +3 -0
- office365/sharepoint/changes/list.py +13 -0
- office365/sharepoint/changes/view.py +25 -0
- office365/sharepoint/client_context.py +23 -4
- office365/sharepoint/contenttypes/fieldlinks/collection.py +3 -0
- office365/sharepoint/copilot/__init__.py +0 -0
- office365/sharepoint/copilot/file_collection.py +27 -0
- office365/sharepoint/copilot/file_collection_query_result.py +10 -0
- office365/sharepoint/copilot/list_item_extensions.py +5 -0
- office365/sharepoint/directory/group.py +9 -9
- office365/sharepoint/directory/helper.py +6 -4
- office365/sharepoint/directory/provider/alternate_id_data.py +5 -0
- office365/sharepoint/directory/provider/notification.py +8 -0
- office365/sharepoint/directory/provider/object_changes.py +5 -0
- office365/sharepoint/directory/provider/object_data.py +26 -3
- office365/sharepoint/directory/provider/provider.py +1 -0
- office365/sharepoint/directory/provider/session_data.py +9 -0
- office365/sharepoint/entity.py +4 -3
- office365/sharepoint/lists/list.py +64 -1
- office365/sharepoint/logger/log_export.py +2 -0
- office365/sharepoint/migrationcenter/service/performance/data.py +5 -5
- office365/sharepoint/multigeo/services.py +24 -0
- office365/sharepoint/navigation/menu_node.py +43 -1
- office365/sharepoint/navigation/node_collection.py +1 -1
- office365/sharepoint/oauth/token.py +22 -0
- office365/sharepoint/oauth/token_response.py +5 -0
- office365/sharepoint/publishing/pages/campaign_publication.py +10 -0
- office365/sharepoint/publishing/pages/collection.py +1 -1
- office365/sharepoint/securestore/target_application.py +2 -0
- office365/sharepoint/sharing/inherited_from.py +5 -0
- office365/sharepoint/sharing/internal/__init__.py +0 -0
- office365/sharepoint/sharing/internal/sharing_restrictions.py +22 -0
- office365/sharepoint/sharing/internal/types.py +17 -0
- office365/sharepoint/sharing/link_info.py +24 -0
- office365/sharepoint/sites/site.py +9 -0
- office365/sharepoint/sites/version_policy_manager.py +8 -0
- office365/sharepoint/tenant/administration/policies/__init__.py +0 -0
- office365/sharepoint/tenant/administration/policies/definition.py +5 -0
- office365/sharepoint/tenant/administration/recent_admin_action_report.py +2 -2
- office365/sharepoint/tenant/administration/settings_service.py +9 -1
- office365/sharepoint/tenant/administration/sites/properties.py +45 -0
- office365/sharepoint/tenant/administration/tenant.py +44 -6
- office365/sharepoint/tenant/administration/types.py +17 -1
- office365/sharepoint/utilities/wopi_host.py +45 -0
- office365/sharepoint/webs/regional_settings.py +6 -0
- office365/sharepoint/webs/web.py +56 -0
- office365/sharepoint/workflow/definition.py +5 -0
- office365/sharepoint/workflowservices/deployment_service.py +23 -0
- office365/teams/members/settings.py +2 -2
- {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from office365.runtime.client_value import ClientValue
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CopilotFileCollectionQueryResult(ClientValue):
|
|
5
|
+
""" """
|
|
6
|
+
|
|
7
|
+
@property
|
|
8
|
+
def entity_type_name(self):
|
|
9
|
+
# type: () -> str
|
|
10
|
+
return "Microsoft.SharePoint.Copilot.CopilotFileCollectionQueryResult"
|
|
@@ -7,41 +7,41 @@ from office365.sharepoint.entity_collection import EntityCollection
|
|
|
7
7
|
class Group(Entity):
|
|
8
8
|
def get_members_info(self, row_limit):
|
|
9
9
|
""""""
|
|
10
|
-
|
|
10
|
+
return_type = MembersInfo(self.context)
|
|
11
11
|
|
|
12
12
|
def _user_loaded():
|
|
13
13
|
from office365.sharepoint.directory.helper import SPHelper
|
|
14
14
|
|
|
15
15
|
SPHelper.get_members_info(
|
|
16
|
-
self.context, self.properties["Id"], row_limit,
|
|
16
|
+
self.context, self.properties["Id"], row_limit, return_type
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
self.ensure_property("Id", _user_loaded)
|
|
20
|
-
return
|
|
20
|
+
return return_type
|
|
21
21
|
|
|
22
22
|
def get_members(self):
|
|
23
23
|
""""""
|
|
24
24
|
from office365.directory.users.user import User
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
return_type = EntityCollection(self.context, User)
|
|
27
27
|
|
|
28
28
|
def _group_loaded():
|
|
29
|
-
SPHelper.get_members(self.context, self.properties["Id"],
|
|
29
|
+
SPHelper.get_members(self.context, self.properties["Id"], return_type)
|
|
30
30
|
|
|
31
31
|
self.ensure_property("Id", _group_loaded)
|
|
32
|
-
return
|
|
32
|
+
return return_type
|
|
33
33
|
|
|
34
34
|
def get_owners(self):
|
|
35
35
|
""""""
|
|
36
36
|
from office365.directory.users.user import User
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
return_type = EntityCollection(self.context, User)
|
|
39
39
|
|
|
40
40
|
def _group_loaded():
|
|
41
|
-
SPHelper.get_owners(self.context, self.properties["Id"],
|
|
41
|
+
SPHelper.get_owners(self.context, self.properties["Id"], return_type)
|
|
42
42
|
|
|
43
43
|
self.ensure_property("Id", _group_loaded)
|
|
44
|
-
return
|
|
44
|
+
return return_type
|
|
45
45
|
|
|
46
46
|
@property
|
|
47
47
|
def entity_type_name(self):
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.client_result import ClientResult
|
|
2
4
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
3
5
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
@@ -16,6 +18,7 @@ class SPHelper(Entity):
|
|
|
16
18
|
|
|
17
19
|
@staticmethod
|
|
18
20
|
def is_member_of(context, principal_name, group_id, result=None):
|
|
21
|
+
# type: (ClientContext, str, str, Optional[ClientResult[bool]]) -> ClientResult[bool]
|
|
19
22
|
"""
|
|
20
23
|
:param str principal_name: User principal name
|
|
21
24
|
:param str group_id: Group id
|
|
@@ -34,10 +37,7 @@ class SPHelper(Entity):
|
|
|
34
37
|
@staticmethod
|
|
35
38
|
def check_site_availability(context, site_url):
|
|
36
39
|
# type: (ClientContext, str) -> ClientResult[bool]
|
|
37
|
-
"""
|
|
38
|
-
:param str site_url: Site Url
|
|
39
|
-
:param office365.sharepoint.client_context.ClientContext context: SharePoint context
|
|
40
|
-
"""
|
|
40
|
+
""" """
|
|
41
41
|
return_type = ClientResult(context)
|
|
42
42
|
qry = ServiceOperationQuery(
|
|
43
43
|
SPHelper(context),
|
|
@@ -121,6 +121,7 @@ class SPHelper(Entity):
|
|
|
121
121
|
|
|
122
122
|
@staticmethod
|
|
123
123
|
def get_owners(context, group_id, return_type=None):
|
|
124
|
+
# type: (ClientContext, str, Optional[EntityCollection[User]]) -> SPHelper
|
|
124
125
|
"""
|
|
125
126
|
:param str group_id: Group identifier
|
|
126
127
|
:param office365.sharepoint.client_context.ClientContext context: SharePoint context
|
|
@@ -137,6 +138,7 @@ class SPHelper(Entity):
|
|
|
137
138
|
|
|
138
139
|
@staticmethod
|
|
139
140
|
def remove_external_members(context, group_id):
|
|
141
|
+
# type: (ClientContext, str) -> SPHelper
|
|
140
142
|
"""
|
|
141
143
|
:param str group_id: Group identifier
|
|
142
144
|
:param office365.sharepoint.client_context.ClientContext context: SharePoint context
|
|
@@ -4,6 +4,11 @@ from office365.runtime.client_value import ClientValue
|
|
|
4
4
|
class AlternateIdData(ClientValue):
|
|
5
5
|
""""""
|
|
6
6
|
|
|
7
|
+
def __init__(self, email=None, identifying_property=None, user_principal_name=None):
|
|
8
|
+
self.Email = email
|
|
9
|
+
self.IdentifyingProperty = identifying_property
|
|
10
|
+
self.UserPrincipalName = user_principal_name
|
|
11
|
+
|
|
7
12
|
@property
|
|
8
13
|
def entity_type_name(self):
|
|
9
14
|
return "SP.Directory.Provider.AlternateIdData"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
2
3
|
from office365.sharepoint.entity import Entity
|
|
3
4
|
|
|
4
5
|
|
|
@@ -10,6 +11,13 @@ class DirectoryNotification(Entity):
|
|
|
10
11
|
resource_path = ResourcePath("SP.Directory.Provider.DirectoryNotification")
|
|
11
12
|
super(DirectoryNotification, self).__init__(context, resource_path)
|
|
12
13
|
|
|
14
|
+
def notify_changes(self, directory_object_changes):
|
|
15
|
+
""" """
|
|
16
|
+
payload = {"directoryObjectChanges": directory_object_changes}
|
|
17
|
+
qry = ServiceOperationQuery(self, "NotifyChanges", None, payload, None, None)
|
|
18
|
+
self.context.add_query(qry)
|
|
19
|
+
return self
|
|
20
|
+
|
|
13
21
|
@property
|
|
14
22
|
def entity_type_name(self):
|
|
15
23
|
return "SP.Directory.Provider.DirectoryNotification"
|
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
from office365.runtime.client_value import ClientValue
|
|
2
2
|
from office365.sharepoint.directory.provider.alternate_id_data import AlternateIdData
|
|
3
|
+
from office365.sharepoint.directory.provider.session_data import DirectorySessionData
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
class DirectoryObjectData(ClientValue):
|
|
6
7
|
""""""
|
|
7
8
|
|
|
8
|
-
def __init__(
|
|
9
|
-
self
|
|
10
|
-
|
|
9
|
+
def __init__(
|
|
10
|
+
self,
|
|
11
|
+
alternate_id=AlternateIdData(),
|
|
12
|
+
attribute_expiration_times=None,
|
|
13
|
+
change_marker=None,
|
|
14
|
+
directory_object_sub_type=None,
|
|
15
|
+
directory_object_type=None,
|
|
16
|
+
directory_session_data=DirectorySessionData(),
|
|
17
|
+
id_=None,
|
|
18
|
+
is_new=None,
|
|
19
|
+
last_modified_time=None,
|
|
20
|
+
tenant_context_id=None,
|
|
21
|
+
version=None,
|
|
22
|
+
):
|
|
23
|
+
self.AlternateId = alternate_id
|
|
24
|
+
self.AttributeExpirationTimes = attribute_expiration_times
|
|
25
|
+
self.ChangeMarker = change_marker
|
|
26
|
+
self.DirectoryObjectSubType = directory_object_sub_type
|
|
27
|
+
self.DirectoryObjectType = directory_object_type
|
|
28
|
+
self.DirectorySessionData = directory_session_data
|
|
29
|
+
self.Id = id_
|
|
30
|
+
self.IsNew = is_new
|
|
31
|
+
self.LastModifiedTime = last_modified_time
|
|
32
|
+
self.TenantContextId = tenant_context_id
|
|
33
|
+
self.Version = version
|
|
11
34
|
|
|
12
35
|
@property
|
|
13
36
|
def entity_type_name(self):
|
|
@@ -14,6 +14,7 @@ class SharePointDirectoryProvider(Entity):
|
|
|
14
14
|
super(SharePointDirectoryProvider, self).__init__(context, resource_path)
|
|
15
15
|
|
|
16
16
|
def read_directory_object(self, data):
|
|
17
|
+
# type: (DirectoryObjectData) -> ClientResult[DirectoryObjectData]
|
|
17
18
|
""""""
|
|
18
19
|
return_type = ClientResult(self.context, DirectoryObjectData())
|
|
19
20
|
payload = {"data": data}
|
office365/sharepoint/entity.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
from typing import TYPE_CHECKING, Callable
|
|
1
|
+
from typing import TYPE_CHECKING, Callable, List
|
|
2
2
|
|
|
3
3
|
from typing_extensions import Self
|
|
4
4
|
|
|
5
5
|
from office365.runtime.auth.client_credential import ClientCredential
|
|
6
6
|
from office365.runtime.auth.user_credential import UserCredential
|
|
7
7
|
from office365.runtime.client_object import ClientObject
|
|
8
|
+
from office365.runtime.client_result import ClientResult
|
|
8
9
|
from office365.runtime.paths.v3.entity import EntityPath
|
|
9
10
|
from office365.runtime.queries.delete_entity import DeleteEntityQuery
|
|
10
11
|
from office365.runtime.queries.update_entity import UpdateEntityQuery
|
|
@@ -22,13 +23,13 @@ class Entity(ClientObject):
|
|
|
22
23
|
return self
|
|
23
24
|
|
|
24
25
|
def execute_batch(self, items_per_batch=100, success_callback=None):
|
|
25
|
-
# type: (int, Callable[[
|
|
26
|
+
# type: (int, Callable[[List[ClientObject|ClientResult]], None]) -> Self
|
|
26
27
|
"""Construct and submit to a server a batch request"""
|
|
27
28
|
return self.context.execute_batch(items_per_batch, success_callback)
|
|
28
29
|
|
|
29
30
|
def with_credentials(self, credentials):
|
|
30
31
|
# type: (UserCredential|ClientCredential) -> Self
|
|
31
|
-
""" """
|
|
32
|
+
"""Initializes a client to acquire a token via user or client credentials"""
|
|
32
33
|
self.context.with_credentials(credentials)
|
|
33
34
|
return self
|
|
34
35
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import json
|
|
1
2
|
import os
|
|
2
3
|
from datetime import datetime
|
|
3
|
-
from typing import TYPE_CHECKING, AnyStr, Dict, Optional
|
|
4
|
+
from typing import IO, TYPE_CHECKING, AnyStr, Callable, Dict, Optional
|
|
5
|
+
|
|
6
|
+
from typing_extensions import Self
|
|
4
7
|
|
|
5
8
|
from office365.runtime.client_result import ClientResult
|
|
6
9
|
from office365.runtime.client_value_collection import ClientValueCollection
|
|
@@ -24,6 +27,7 @@ from office365.sharepoint.files.checked_out_file_collection import (
|
|
|
24
27
|
CheckedOutFileCollection,
|
|
25
28
|
)
|
|
26
29
|
from office365.sharepoint.files.file import File
|
|
30
|
+
from office365.sharepoint.files.system_object_type import FileSystemObjectType
|
|
27
31
|
from office365.sharepoint.flows.synchronization_result import FlowSynchronizationResult
|
|
28
32
|
from office365.sharepoint.folders.folder import Folder
|
|
29
33
|
from office365.sharepoint.forms.collection import FormCollection
|
|
@@ -77,6 +81,64 @@ class List(SecurableObject):
|
|
|
77
81
|
def __repr__(self):
|
|
78
82
|
return self.id or self.title or self.entity_type_name
|
|
79
83
|
|
|
84
|
+
def export(self, local_file, include_content=False, item_exported=None):
|
|
85
|
+
# type: (IO, bool, Callable[[ListItem|File|Folder], None]) -> Self
|
|
86
|
+
"""Exports SharePoint List"""
|
|
87
|
+
import zipfile
|
|
88
|
+
|
|
89
|
+
def _append_file(name, data):
|
|
90
|
+
with zipfile.ZipFile(local_file.name, "a", zipfile.ZIP_DEFLATED) as zf:
|
|
91
|
+
zf.writestr(name, data)
|
|
92
|
+
|
|
93
|
+
def _download_content(list_item):
|
|
94
|
+
# type: (ListItem) -> None
|
|
95
|
+
def _after_downloaded(result):
|
|
96
|
+
# type: (ClientResult[AnyStr]) -> None
|
|
97
|
+
item_path = list_item.properties["FileRef"].replace(
|
|
98
|
+
self.root_folder.serverRelativeUrl, ""
|
|
99
|
+
)
|
|
100
|
+
_append_file(item_path, result.value)
|
|
101
|
+
|
|
102
|
+
list_item.file.get_content().after_execute(_after_downloaded)
|
|
103
|
+
|
|
104
|
+
def _export_items(items):
|
|
105
|
+
# type: (ListItemCollection) -> None
|
|
106
|
+
|
|
107
|
+
for item in items:
|
|
108
|
+
# item_path = item.properties["FileRef"].replace(self.root_folder.serverRelativeUrl, "")
|
|
109
|
+
item_path = str(item.id) + ".json"
|
|
110
|
+
|
|
111
|
+
if item.file_system_object_type == FileSystemObjectType.Folder:
|
|
112
|
+
pass
|
|
113
|
+
else:
|
|
114
|
+
_append_file(item_path, json.dumps(item.to_json()))
|
|
115
|
+
|
|
116
|
+
if include_content:
|
|
117
|
+
_download_content(item)
|
|
118
|
+
|
|
119
|
+
if callable(item_exported):
|
|
120
|
+
item_exported(item)
|
|
121
|
+
|
|
122
|
+
def _save_schema():
|
|
123
|
+
(
|
|
124
|
+
self.items.select(
|
|
125
|
+
[
|
|
126
|
+
"*",
|
|
127
|
+
"Id",
|
|
128
|
+
"FileRef",
|
|
129
|
+
"FileDirRef",
|
|
130
|
+
"FileLeafRef",
|
|
131
|
+
"FileSystemObjectType",
|
|
132
|
+
]
|
|
133
|
+
)
|
|
134
|
+
# .expand(["File", "Folder"])
|
|
135
|
+
.get().paged(page_loaded=_export_items)
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
self.ensure_properties(["SchemaXml", "RootFolder"], _save_schema)
|
|
139
|
+
|
|
140
|
+
return self
|
|
141
|
+
|
|
80
142
|
def clear(self):
|
|
81
143
|
"""Clears the list."""
|
|
82
144
|
|
|
@@ -125,6 +187,7 @@ class List(SecurableObject):
|
|
|
125
187
|
return self
|
|
126
188
|
|
|
127
189
|
def get_async_action_config(self):
|
|
190
|
+
""" """
|
|
128
191
|
return_type = ClientResult(self.context)
|
|
129
192
|
qry = ServiceOperationQuery(
|
|
130
193
|
self, "GetAsyncActionConfig", return_type=return_type
|
|
@@ -14,12 +14,14 @@ class LogExport(Entity):
|
|
|
14
14
|
)
|
|
15
15
|
|
|
16
16
|
def get_files(self):
|
|
17
|
+
""" """
|
|
17
18
|
return_type = LogFileInfoCollection(self.context)
|
|
18
19
|
qry = ServiceOperationQuery(self, "GetFiles", None, None, None, return_type)
|
|
19
20
|
self.context.add_query(qry)
|
|
20
21
|
return return_type
|
|
21
22
|
|
|
22
23
|
def get_log_types(self):
|
|
24
|
+
""" """
|
|
23
25
|
return_type = ClientResult(self.context)
|
|
24
26
|
qry = ServiceOperationQuery(self, "GetLogTypes", None, None, None, return_type)
|
|
25
27
|
self.context.add_query(qry)
|
|
@@ -31,14 +31,14 @@ class PerformanceDataCollection(EntityCollection[PerformanceData]):
|
|
|
31
31
|
context, PerformanceData, resource_path
|
|
32
32
|
)
|
|
33
33
|
|
|
34
|
-
def get_data(self,
|
|
34
|
+
def get_data(self, start_time=None, end_time=None, agent_id=None, time_unit=None):
|
|
35
35
|
""" """
|
|
36
36
|
return_type = ClientResult(self.context, PerformanceDashboardData())
|
|
37
37
|
payload = {
|
|
38
|
-
"StartTime":
|
|
39
|
-
"EndTime":
|
|
40
|
-
"AgentId":
|
|
41
|
-
"TimeUnit":
|
|
38
|
+
"StartTime": start_time,
|
|
39
|
+
"EndTime": end_time,
|
|
40
|
+
"AgentId": agent_id,
|
|
41
|
+
"TimeUnit": time_unit,
|
|
42
42
|
}
|
|
43
43
|
qry = ServiceOperationQuery(self, "GetData", None, payload, None, return_type)
|
|
44
44
|
self.context.add_query(qry)
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
2
3
|
from office365.sharepoint.entity import Entity
|
|
3
4
|
from office365.sharepoint.entity_collection import EntityCollection
|
|
4
5
|
from office365.sharepoint.multigeo.unified_group import UnifiedGroup
|
|
6
|
+
from office365.sharepoint.multigeo.user_personal_site_location import (
|
|
7
|
+
UserPersonalSiteLocation,
|
|
8
|
+
)
|
|
5
9
|
|
|
6
10
|
|
|
7
11
|
class MultiGeoServices(Entity):
|
|
@@ -15,6 +19,26 @@ class MultiGeoServices(Entity):
|
|
|
15
19
|
data residency requirements.
|
|
16
20
|
"""
|
|
17
21
|
|
|
22
|
+
def __init__(self, context):
|
|
23
|
+
static_path = ResourcePath(
|
|
24
|
+
"Microsoft.Online.SharePoint.MultiGeo.Service.MultiGeoServicesBeta"
|
|
25
|
+
)
|
|
26
|
+
super(MultiGeoServices, self).__init__(context, static_path)
|
|
27
|
+
|
|
28
|
+
def user_personal_site_location(self, user_principal_name):
|
|
29
|
+
# type: (str) -> UserPersonalSiteLocation
|
|
30
|
+
return_type = UserPersonalSiteLocation(self.context)
|
|
31
|
+
qry = ServiceOperationQuery(
|
|
32
|
+
self,
|
|
33
|
+
"UserPersonalSiteLocation",
|
|
34
|
+
[user_principal_name],
|
|
35
|
+
None,
|
|
36
|
+
None,
|
|
37
|
+
return_type,
|
|
38
|
+
)
|
|
39
|
+
self.context.add_query(qry)
|
|
40
|
+
return return_type
|
|
41
|
+
|
|
18
42
|
@property
|
|
19
43
|
def unified_groups(self):
|
|
20
44
|
# type: () -> EntityCollection[UnifiedGroup]
|
|
@@ -1,15 +1,57 @@
|
|
|
1
1
|
from office365.runtime.client_value import ClientValue
|
|
2
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
3
|
+
from office365.sharepoint.translation.resource_entry import SPResourceEntry
|
|
2
4
|
|
|
3
5
|
|
|
4
6
|
class MenuNode(ClientValue):
|
|
5
7
|
"""Represents a navigation node in the navigation hierarchy. A navigation hierarchy is a tree structure of
|
|
6
8
|
navigation nodes."""
|
|
7
9
|
|
|
8
|
-
def __init__(
|
|
10
|
+
def __init__(
|
|
11
|
+
self,
|
|
12
|
+
audience_ids=None,
|
|
13
|
+
current_lcid=None,
|
|
14
|
+
title=None,
|
|
15
|
+
is_deleted=None,
|
|
16
|
+
is_hidden=None,
|
|
17
|
+
key=None,
|
|
18
|
+
nodes=None,
|
|
19
|
+
node_type=None,
|
|
20
|
+
open_in_new_window=None,
|
|
21
|
+
simple_url=None,
|
|
22
|
+
translations=None,
|
|
23
|
+
):
|
|
9
24
|
"""
|
|
25
|
+
:param list[str] audience_ids:
|
|
10
26
|
:param int current_lcid:
|
|
11
27
|
:param str title: Specifies the title of the navigation node. The value is in the preferred language of the
|
|
12
28
|
user, if available, or is in the default language of the site (2) as a fallback.
|
|
29
|
+
:param int node_type: Specifies the type of the navigation node.
|
|
30
|
+
:param bool is_deleted: A client MUST use this property set to TRUE to indicate that this node MUST be
|
|
31
|
+
deleted by the server. When set to TRUE the server MUST delete the node including all the child nodes
|
|
32
|
+
when present. When set to FALSE the server SHOULD NOT delete this node.
|
|
33
|
+
:param bool is_hidden: Specifies whether the node will be hidden in the navigation menu. During editing,
|
|
34
|
+
all nodes temporarily become visible so that they can be edited.
|
|
35
|
+
:param str key: Specifies the identifier for the navigation node in the menu tree. If the navigation node does
|
|
36
|
+
not exist on the protocol server, this value MUST be an empty string.
|
|
37
|
+
:param list[MenuNode] nodes:
|
|
38
|
+
:param bool open_in_new_window:
|
|
39
|
+
:param str simple_url: If the NodeType (section 3.2.5.244.1.1.7) property is set to "SimpleLink",
|
|
40
|
+
this property represents the URL of the navigation node. The URL can be relative or absolute.
|
|
41
|
+
If the value is a relative URL, it can begin with URL tokens "~site" and "~sitecollection".
|
|
42
|
+
These tokens indicate that the URL is either relative to the site (2) or to the site collection
|
|
43
|
+
respectively. If the NodeType (section 3.2.5.244.1.1.7) property is not set to "SimpleLink",
|
|
44
|
+
the value MUST be an empty string.
|
|
45
|
+
:param list[SPResourceEntry] translations:
|
|
13
46
|
"""
|
|
47
|
+
self.AudienceIds = audience_ids
|
|
14
48
|
self.CurrentLCID = current_lcid
|
|
49
|
+
self.IsDeleted = is_deleted
|
|
50
|
+
self.IsHidden = is_hidden
|
|
51
|
+
self.Key = key
|
|
52
|
+
self.Nodes = ClientValueCollection(MenuNode, nodes)
|
|
53
|
+
self.NodeType = node_type
|
|
54
|
+
self.OpenInNewWindow = open_in_new_window
|
|
55
|
+
self.SimpleUrl = simple_url
|
|
15
56
|
self.Title = title
|
|
57
|
+
self.Translations = ClientValueCollection(SPResourceEntry, translations)
|
|
@@ -39,7 +39,7 @@ class NavigationNodeCollection(EntityCollection[NavigationNode]):
|
|
|
39
39
|
:param int previous_node_id: Identifier of the navigation node after which the node identified by nodeId moves to
|
|
40
40
|
"""
|
|
41
41
|
params = {"nodeId": node_id, "previousNodeId": previous_node_id}
|
|
42
|
-
qry = ServiceOperationQuery(self, "
|
|
42
|
+
qry = ServiceOperationQuery(self, "MoveAfter", params)
|
|
43
43
|
self.context.add_query(qry)
|
|
44
44
|
return self
|
|
45
45
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
3
|
+
from office365.sharepoint.entity import Entity
|
|
4
|
+
from office365.sharepoint.oauth.token_response import TokenResponse
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Token(Entity):
|
|
8
|
+
""""""
|
|
9
|
+
|
|
10
|
+
def __init__(self, context):
|
|
11
|
+
super(Token, self).__init__(context, ResourcePath("SP.OAuth.Token"))
|
|
12
|
+
|
|
13
|
+
def acquire(self):
|
|
14
|
+
""" """
|
|
15
|
+
return_type = TokenResponse(self.context)
|
|
16
|
+
qry = ServiceOperationQuery(self, "Acquire", return_type=return_type)
|
|
17
|
+
self.context.add_query(qry)
|
|
18
|
+
return return_type
|
|
19
|
+
|
|
20
|
+
@property
|
|
21
|
+
def entity_type_name(self):
|
|
22
|
+
return "SP.OAuth.Token"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
|
+
from office365.runtime.client_result import ClientResult
|
|
3
4
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
4
5
|
from office365.sharepoint.publishing.highlights_info import HighlightsInfo
|
|
5
6
|
from office365.sharepoint.publishing.pages.page import SitePage
|
|
@@ -15,6 +16,15 @@ class CampaignPublication(SitePage):
|
|
|
15
16
|
self.context.add_query(qry)
|
|
16
17
|
return return_type
|
|
17
18
|
|
|
19
|
+
def send_test_email(self):
|
|
20
|
+
""" """
|
|
21
|
+
return_type = ClientResult(self.context)
|
|
22
|
+
qry = ServiceOperationQuery(
|
|
23
|
+
self, "SendTestEmail", None, None, None, return_type
|
|
24
|
+
)
|
|
25
|
+
self.context.add_query(qry)
|
|
26
|
+
return return_type
|
|
27
|
+
|
|
18
28
|
@property
|
|
19
29
|
def email_endpoint(self):
|
|
20
30
|
# type: () -> Optional[str]
|
|
@@ -62,7 +62,7 @@ class SitePageCollection(SitePageMetadataCollection[SitePage]):
|
|
|
62
62
|
return return_type
|
|
63
63
|
|
|
64
64
|
def get_page_column_state(self, url):
|
|
65
|
-
"""
|
|
65
|
+
"""
|
|
66
66
|
Determines whether a specific SitePage is a single or multicolumn page.
|
|
67
67
|
|
|
68
68
|
:param str url: URL of the SitePage for which to return state.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
2
|
+
from office365.sharepoint.client_context import ClientContext
|
|
2
3
|
from office365.sharepoint.entity import Entity
|
|
3
4
|
|
|
4
5
|
|
|
@@ -10,6 +11,7 @@ class TargetApplication(Entity):
|
|
|
10
11
|
|
|
11
12
|
@staticmethod
|
|
12
13
|
def create(context, application_id, friendly_name):
|
|
14
|
+
# type: (ClientContext, str, str) -> "TargetApplication"
|
|
13
15
|
"""
|
|
14
16
|
Creates a target application
|
|
15
17
|
|
|
File without changes
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
|
+
from office365.sharepoint.entity import Entity
|
|
3
|
+
from office365.sharepoint.sharing.internal.types import CAnonymousLinkUseLimit
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SharingRestrictions(Entity):
|
|
7
|
+
""" """
|
|
8
|
+
|
|
9
|
+
def __init__(self, context):
|
|
10
|
+
static_path = ResourcePath(
|
|
11
|
+
"Microsoft.SharePoint.Sharing.Internal.SharingRestrictions"
|
|
12
|
+
)
|
|
13
|
+
super(SharingRestrictions, self).__init__(context, static_path)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def anonymous_link_use_limit(self):
|
|
17
|
+
return self.properties.get("anonymousLinkUseLimit", CAnonymousLinkUseLimit())
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def entity_type_name(self):
|
|
21
|
+
# type: () -> str
|
|
22
|
+
return "Microsoft.SharePoint.Sharing.Internal.SharingRestrictions"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from office365.runtime.client_value import ClientValue
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class CAnonymousLinkUseLimit(ClientValue):
|
|
5
|
+
|
|
6
|
+
@property
|
|
7
|
+
def entity_type_name(self):
|
|
8
|
+
# type: () -> str
|
|
9
|
+
return "Microsoft.SharePoint.Sharing.Internal.CAnonymousLinkUseLimit"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class CExternalSharingEnforcement(ClientValue):
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def entity_type_name(self):
|
|
16
|
+
# type: () -> str
|
|
17
|
+
return "Microsoft.SharePoint.Sharing.Internal.CExternalSharingEnforcement"
|
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
from office365.runtime.client_value import ClientValue
|
|
2
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
3
|
+
from office365.sharepoint.sharing.inherited_from import InheritedFrom
|
|
4
|
+
from office365.sharepoint.sharing.links.info import SharingLinkInfo
|
|
5
|
+
from office365.sharepoint.sharing.principal import Principal
|
|
2
6
|
|
|
3
7
|
|
|
4
8
|
class LinkInfo(ClientValue):
|
|
5
9
|
"""This class provides metadata for the tokenized sharing link including settings details, inheritance status,
|
|
6
10
|
and an optional array of members."""
|
|
11
|
+
|
|
12
|
+
def __init__(
|
|
13
|
+
self,
|
|
14
|
+
inherited_from=InheritedFrom(),
|
|
15
|
+
is_inherited=None,
|
|
16
|
+
link_details=SharingLinkInfo(),
|
|
17
|
+
link_members=None,
|
|
18
|
+
link_status=None,
|
|
19
|
+
total_link_members_count=None,
|
|
20
|
+
):
|
|
21
|
+
"""
|
|
22
|
+
:param bool is_inherited: Boolean that indicates if the tokenized sharing link is present due to
|
|
23
|
+
inherited permissions from a parent object.
|
|
24
|
+
"""
|
|
25
|
+
self.inherited_from = inherited_from
|
|
26
|
+
self.isInherited = is_inherited
|
|
27
|
+
self.linkDetails = link_details
|
|
28
|
+
self.linkMembers = ClientValueCollection(Principal, link_members)
|
|
29
|
+
self.linkStatus = link_status
|
|
30
|
+
self.totalLinkMembersCount = total_link_members_count
|
|
@@ -132,6 +132,15 @@ class Site(Entity):
|
|
|
132
132
|
self.ensure_property("Url", _site_loaded)
|
|
133
133
|
return return_type
|
|
134
134
|
|
|
135
|
+
def get_block_download_policy_for_files_data(self):
|
|
136
|
+
""" """
|
|
137
|
+
return_type = ClientResult(self.context, str())
|
|
138
|
+
qry = ServiceOperationQuery(
|
|
139
|
+
self, "GetBlockDownloadPolicyForFilesData", None, None, None, return_type
|
|
140
|
+
)
|
|
141
|
+
self.context.add_query(qry)
|
|
142
|
+
return return_type
|
|
143
|
+
|
|
135
144
|
def get_migration_status(self):
|
|
136
145
|
""""""
|
|
137
146
|
return_type = EntityCollection(self.context, SPMigrationJobStatus)
|