Office365-REST-Python-Client 2.5.14__py3-none-any.whl → 2.6.0__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.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/METADATA +2 -2
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/RECORD +210 -112
- office365/admin/__init__.py +0 -0
- office365/admin/admin.py +69 -0
- office365/admin/microsoft365_apps.py +5 -0
- office365/admin/people_settings.py +5 -0
- office365/admin/report_settings.py +5 -0
- office365/{onedrive → admin}/sharepoint.py +1 -1
- office365/azure_env.py +60 -0
- office365/directory/applications/app_ids.py +6 -0
- office365/directory/authentication/authentication.py +16 -0
- office365/directory/authentication/method_target.py +2 -1
- office365/directory/authentication/methods/microsoft_authenticator.py +6 -0
- office365/directory/authentication/methods/root.py +11 -0
- office365/directory/authentication/methods/sms.py +9 -0
- office365/directory/certificates/self_signed.py +31 -2
- office365/directory/identities/conditional_access_root.py +14 -0
- office365/directory/identitygovernance/privilegedaccess/approval.py +8 -0
- office365/directory/identitygovernance/privilegedaccess/group.py +30 -0
- office365/directory/identitygovernance/privilegedaccess/group_assignment_schedule_instance.py +7 -0
- office365/directory/identitygovernance/privilegedaccess/unified_role_assignment_schedule_request.py +7 -0
- office365/directory/identitygovernance/userconsent/request_collection.py +10 -0
- office365/directory/identitygovernance/workflow/__init__.py +0 -0
- office365/directory/identitygovernance/workflow/base.py +5 -0
- office365/directory/policies/cross_tenant_access.py +13 -0
- office365/directory/policies/feature_rollout.py +16 -0
- office365/directory/policies/root.py +39 -23
- office365/directory/policies/template.py +5 -0
- office365/directory/protection/threatassessment/email_file_request.py +20 -0
- office365/directory/protection/threatassessment/request.py +25 -0
- office365/directory/rolemanagement/application.py +15 -0
- office365/directory/rolemanagement/resource_action.py +8 -4
- office365/directory/rolemanagement/role_permission.py +3 -3
- office365/directory/security/alerts/collection.py +49 -0
- office365/directory/security/scorecontrol/__init__.py +0 -0
- office365/directory/security/scorecontrol/profile.py +6 -0
- office365/directory/security/security.py +17 -4
- office365/directory/serviceprincipals/service_principal.py +36 -28
- office365/directory/tenantinformation/__init__.py +0 -0
- office365/directory/tenantinformation/multi_organization.py +11 -0
- office365/directory/tenantinformation/relationship.py +61 -0
- office365/directory/users/insights_settings.py +5 -0
- office365/graph_client.py +52 -132
- office365/graph_request.py +78 -19
- office365/intune/servicecommunications/health/health.py +1 -1
- office365/intune/servicecommunications/issues/issue.py +2 -2
- office365/onedrive/columns/definition.py +1 -1
- office365/onedrive/contenttypes/content_type.py +1 -1
- office365/onedrive/driveitems/driveItem.py +13 -1
- office365/onedrive/drives/drive.py +1 -1
- office365/onedrive/filestorage/__init__.py +0 -0
- office365/onedrive/filestorage/container.py +7 -0
- office365/onedrive/filestorage/file_storage.py +20 -0
- office365/onedrive/listitems/field_value_set.py +1 -1
- office365/onedrive/listitems/list_item.py +1 -1
- office365/onedrive/lists/list.py +1 -1
- office365/onedrive/recyclebin/__init__.py +0 -0
- office365/onedrive/recyclebin/item.py +6 -0
- office365/onedrive/recyclebin/recyclebin.py +29 -0
- office365/onedrive/recyclebin/settings.py +13 -0
- office365/onedrive/shares/drive_item.py +1 -1
- office365/onedrive/sitepages/base.py +1 -1
- office365/onedrive/sitepages/canvas_layout.py +2 -2
- office365/onedrive/sitepages/sections/__init__.py +0 -0
- office365/onedrive/sitepages/{horizontal_section.py → sections/horizontal.py} +1 -1
- office365/onedrive/sitepages/webparts/data.py +5 -0
- office365/onedrive/sitepages/webparts/position.py +5 -0
- office365/onedrive/sitepages/webparts/standard.py +9 -0
- office365/onedrive/sitepages/webparts/web_part.py +12 -0
- office365/onedrive/sites/site.py +1 -1
- office365/onedrive/storage/storage.py +10 -0
- office365/onedrive/workbooks/charts/axes.py +41 -1
- office365/onedrive/workbooks/charts/axis.py +5 -0
- office365/onedrive/workbooks/charts/chart.py +64 -5
- office365/onedrive/workbooks/charts/fill.py +5 -0
- office365/onedrive/workbooks/charts/font.py +5 -0
- office365/onedrive/workbooks/charts/legend/__init__.py +0 -0
- office365/onedrive/workbooks/charts/legend/format.py +5 -0
- office365/onedrive/workbooks/charts/legend/legend.py +26 -0
- office365/onedrive/workbooks/charts/point.py +5 -0
- office365/onedrive/workbooks/charts/series/__init__.py +0 -0
- office365/onedrive/workbooks/charts/series/format.py +5 -0
- office365/onedrive/workbooks/charts/series/series.py +31 -0
- office365/onedrive/workbooks/charts/title.py +5 -0
- office365/onedrive/workbooks/filter.py +10 -0
- office365/onedrive/workbooks/filter_criteria.py +3 -3
- office365/onedrive/workbooks/ranges/fill.py +11 -1
- office365/onedrive/workbooks/ranges/range.py +26 -0
- office365/onedrive/workbooks/ranges/view.py +14 -0
- office365/onedrive/workbooks/sort_field.py +8 -3
- office365/onedrive/workbooks/tables/sort.py +20 -0
- office365/onedrive/workbooks/worksheets/worksheet.py +11 -0
- office365/partners/billing/azure_usage.py +17 -0
- office365/partners/billing/billed_usage.py +21 -0
- office365/partners/billing/billing.py +17 -0
- office365/partners/billing/operation.py +5 -0
- office365/partners/partners.py +17 -0
- office365/reports/root.py +9 -0
- office365/reports/userregistration/feature_summary.py +5 -0
- office365/runtime/auth/auth_cookies.py +48 -0
- office365/runtime/auth/authentication_context.py +36 -19
- office365/runtime/auth/entra/__init__.py +0 -0
- office365/runtime/auth/entra/authentication_context.py +165 -0
- office365/runtime/auth/providers/acs_token_provider.py +12 -27
- office365/runtime/auth/providers/saml_token_provider.py +41 -54
- office365/runtime/auth/sts_profile.py +8 -8
- office365/runtime/auth/token_response.py +4 -0
- office365/sharepoint/administration/custom_fonts_resource.py +5 -0
- office365/sharepoint/administration/sitemove/__init__.py +0 -0
- office365/sharepoint/administration/sitemove/service.py +68 -0
- office365/sharepoint/administration/sitemove/service_info.py +11 -0
- office365/sharepoint/changes/item.py +15 -0
- office365/sharepoint/client_context.py +61 -37
- office365/sharepoint/directory/group.py +2 -0
- office365/sharepoint/directory/helper.py +2 -0
- office365/sharepoint/directory/provider/provider.py +6 -0
- office365/sharepoint/directory/user.py +20 -0
- office365/sharepoint/files/publish/__init__.py +0 -0
- office365/sharepoint/files/publish/status.py +9 -0
- office365/sharepoint/flows/connector_result.py +17 -0
- office365/sharepoint/flows/permissions.py +11 -7
- office365/sharepoint/fontpackages/__init__.py +0 -0
- office365/sharepoint/fontpackages/collection.py +26 -0
- office365/sharepoint/fontpackages/creation_parameters.py +5 -0
- office365/sharepoint/fontpackages/font_package.py +5 -0
- office365/sharepoint/fontpackages/oob_settings.py +5 -0
- office365/sharepoint/forms/customization.py +26 -0
- office365/sharepoint/ir/__init__.py +0 -0
- office365/sharepoint/ir/migration.py +5 -0
- office365/sharepoint/lists/list.py +30 -0
- office365/sharepoint/marketplace/app_metadata.py +12 -1
- office365/sharepoint/marketplace/app_metadata_collection.py +8 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/instance_info.py +22 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/permission_failed_info.py +5 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/permission_info.py +12 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/permission_response.py +15 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/principals_response.py +5 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/app_request_information.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/app_response_information.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/available_addins_response.py +4 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/card_design.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/card_designs.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/teams_package_download.py +14 -0
- office365/sharepoint/marketplace/tenant/appcatalog/accessor.py +62 -3
- office365/sharepoint/multigeo/services.py +14 -0
- office365/sharepoint/multigeo/storage_quota.py +9 -0
- office365/sharepoint/policy/license_utilities.py +27 -0
- office365/sharepoint/principal/principal.py +6 -0
- office365/sharepoint/request.py +95 -10
- office365/sharepoint/search/administration/document_crawl_log.py +16 -2
- office365/sharepoint/search/administration/tenant_crawl_versions_info_provider.py +1 -1
- office365/sharepoint/search/reports/abandoned_queries.py +11 -1
- office365/sharepoint/search/reports/abandonedqueries/item.py +7 -1
- office365/sharepoint/sharing/domain_restriction_settings.py +5 -0
- office365/sharepoint/sharing/information.py +12 -0
- office365/sharepoint/sitehealth/result.py +4 -4
- office365/sharepoint/sitehealth/summary.py +5 -5
- office365/sharepoint/sites/copy_job_progress.py +5 -0
- office365/sharepoint/sites/copy_migration_iInfo.py +5 -0
- office365/sharepoint/sites/home/__init__.py +0 -0
- office365/sharepoint/sites/{sph_site.py → home/site.py} +1 -1
- office365/sharepoint/sites/site.py +26 -1
- office365/sharepoint/tenant/administration/app_service_principal_public.py +17 -0
- office365/sharepoint/tenant/administration/audit/data.py +12 -0
- office365/sharepoint/tenant/administration/audit/unified_record.py +18 -0
- office365/sharepoint/tenant/administration/coms/__init__.py +0 -0
- office365/sharepoint/tenant/administration/coms/messages_fields_data.py +5 -0
- office365/sharepoint/tenant/administration/coms/messages_service_proxy.py +16 -0
- office365/sharepoint/tenant/administration/copilot/__init__.py +0 -0
- office365/sharepoint/tenant/administration/copilot/adaptive_card_config.py +11 -0
- office365/sharepoint/tenant/administration/datagovernance/__init__.py +0 -0
- office365/sharepoint/tenant/administration/datagovernance/client_base.py +9 -0
- office365/sharepoint/tenant/administration/datagovernance/insight_client.py +82 -0
- office365/sharepoint/tenant/administration/datagovernance/insight_metadata.py +5 -0
- office365/sharepoint/tenant/administration/default_time_zone_id.py +11 -0
- office365/sharepoint/tenant/administration/endpoints.py +53 -2
- office365/sharepoint/tenant/administration/insights/onedrive_site_sharing.py +4 -0
- office365/sharepoint/tenant/administration/internal/appservice/permission_request.py +4 -0
- office365/sharepoint/tenant/administration/malware/__init__.py +0 -0
- office365/sharepoint/tenant/administration/malware/file.py +18 -0
- office365/sharepoint/tenant/administration/modified_property.py +5 -0
- office365/sharepoint/tenant/administration/policies/content_security_configuration.py +9 -0
- office365/sharepoint/tenant/administration/recent_action.py +9 -0
- office365/sharepoint/tenant/administration/reports/__init__.py +0 -0
- office365/sharepoint/tenant/administration/settings_service.py +38 -5
- office365/sharepoint/tenant/administration/sites/properties.py +78 -0
- office365/sharepoint/tenant/administration/sites/properties_collection.py +19 -0
- office365/sharepoint/tenant/administration/tenant.py +134 -7
- office365/sharepoint/tenant/administration/types.py +76 -1
- office365/sharepoint/tenant/insights/report_manager.py +29 -0
- office365/sharepoint/tenant/management/office365_tenant.py +7 -4
- office365/sharepoint/translation/job_status.py +22 -0
- office365/sharepoint/userprofiles/user_profile.py +6 -0
- office365/sharepoint/webparts/tile_data.py +21 -0
- office365/sharepoint/webs/dataleakage_prevention_status_info.py +5 -0
- office365/sharepoint/webs/web.py +80 -1
- office365/teams/chats/event_message_detail.py +8 -0
- office365/teams/deleted.py +24 -0
- office365/teams/work.py +35 -0
- office365/directory/tenant_relationship.py +0 -23
- office365/onedrive/admin.py +0 -32
- office365/onedrive/workbooks/charts/legend.py +0 -7
- office365/onedrive/workbooks/charts/series.py +0 -5
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/top_level.txt +0 -0
- /office365/{onedrive → admin}/sharepoint_settings.py +0 -0
- /office365/directory/{tenant_information.py → tenantinformation/information.py} +0 -0
- /office365/{base_item.py → onedrive/base_item.py} +0 -0
- /office365/onedrive/sitepages/{horizontal_section_column.py → sections/horizontal_column.py} +0 -0
- /office365/onedrive/sitepages/{vertical_section.py → sections/vertical.py} +0 -0
- /office365/sharepoint/sites/{home_sites_details.py → home/details.py} +0 -0
- /office365/sharepoint/sites/{home_site_reference.py → home/reference.py} +0 -0
- /office365/sharepoint/tenant/administration/{app_billing_properties.py → policies/app_billing_properties.py} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import os
|
|
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.paths.service_operation import ServiceOperationPath
|
|
@@ -8,9 +10,18 @@ from office365.sharepoint.marketplace.app_metadata import CorporateCatalogAppMet
|
|
|
8
10
|
from office365.sharepoint.marketplace.app_metadata_collection import (
|
|
9
11
|
CorporateCatalogAppMetadataCollection,
|
|
10
12
|
)
|
|
13
|
+
from office365.sharepoint.marketplace.corporatecuratedgallery.app_request_information import (
|
|
14
|
+
SPStoreAppRequestInformation,
|
|
15
|
+
)
|
|
16
|
+
from office365.sharepoint.marketplace.corporatecuratedgallery.app_response_information import (
|
|
17
|
+
SPStoreAppResponseInformation,
|
|
18
|
+
)
|
|
11
19
|
from office365.sharepoint.marketplace.corporatecuratedgallery.app_upgrade_availability import (
|
|
12
20
|
AppUpgradeAvailability,
|
|
13
21
|
)
|
|
22
|
+
from office365.sharepoint.marketplace.corporatecuratedgallery.card_designs import (
|
|
23
|
+
CardDesigns,
|
|
24
|
+
)
|
|
14
25
|
from office365.sharepoint.marketplace.corporatecuratedgallery.teams_package_download import (
|
|
15
26
|
TeamsPackageDownload,
|
|
16
27
|
)
|
|
@@ -22,7 +33,7 @@ from office365.sharepoint.marketplace.sitecollection.appcatalog.allowed_items im
|
|
|
22
33
|
class TenantCorporateCatalogAccessor(Entity):
|
|
23
34
|
"""Accessor for the tenant corporate catalog."""
|
|
24
35
|
|
|
25
|
-
def add(self, content, overwrite, url):
|
|
36
|
+
def add(self, content, overwrite, url=None):
|
|
26
37
|
"""
|
|
27
38
|
Adds a file to the corporate catalog.
|
|
28
39
|
|
|
@@ -32,13 +43,34 @@ class TenantCorporateCatalogAccessor(Entity):
|
|
|
32
43
|
:param str url: Specifies the URL of the file to be added.
|
|
33
44
|
"""
|
|
34
45
|
return_type = File(self.context)
|
|
35
|
-
|
|
36
|
-
qry = ServiceOperationQuery(self, "Add",
|
|
46
|
+
params = {"Overwrite": overwrite, "Url": url}
|
|
47
|
+
qry = ServiceOperationQuery(self, "Add", params, content, None, return_type)
|
|
48
|
+
self.context.add_query(qry)
|
|
49
|
+
return return_type
|
|
50
|
+
|
|
51
|
+
def app_from_path(self, path, overwrite):
|
|
52
|
+
# type: (str, bool) -> File
|
|
53
|
+
"""
|
|
54
|
+
Adds a file to the corporate catalog.
|
|
55
|
+
"""
|
|
56
|
+
with open(path, "rb") as f:
|
|
57
|
+
content = f.read()
|
|
58
|
+
url = os.path.basename(path)
|
|
59
|
+
return self.add(content=content, overwrite=overwrite, url=url)
|
|
60
|
+
|
|
61
|
+
def app_requests(self):
|
|
62
|
+
""""""
|
|
63
|
+
return_type = ClientResult(self.context, SPStoreAppResponseInformation())
|
|
64
|
+
payload = {"AppRequestInfo": SPStoreAppRequestInformation()}
|
|
65
|
+
qry = ServiceOperationQuery(
|
|
66
|
+
self, "AppRequests", None, payload, None, return_type
|
|
67
|
+
)
|
|
37
68
|
self.context.add_query(qry)
|
|
38
69
|
return return_type
|
|
39
70
|
|
|
40
71
|
def download_teams_solution(self, _id):
|
|
41
72
|
"""
|
|
73
|
+
Downloads a Microsoft Teams solution package associated with an app from the SharePoint App Catalog
|
|
42
74
|
:param int _id:
|
|
43
75
|
"""
|
|
44
76
|
return_type = TeamsPackageDownload(self.context)
|
|
@@ -60,6 +92,7 @@ class TenantCorporateCatalogAccessor(Entity):
|
|
|
60
92
|
|
|
61
93
|
def is_app_upgrade_available(self, _id):
|
|
62
94
|
"""
|
|
95
|
+
Determines if an upgrade is available for an app in the SharePoint app catalog
|
|
63
96
|
:param int _id:
|
|
64
97
|
"""
|
|
65
98
|
return_type = ClientResult(self.context, AppUpgradeAvailability())
|
|
@@ -70,8 +103,21 @@ class TenantCorporateCatalogAccessor(Entity):
|
|
|
70
103
|
self.context.add_query(qry)
|
|
71
104
|
return return_type
|
|
72
105
|
|
|
106
|
+
def upload(self, content, overwrite, url, xor_hash=None):
|
|
107
|
+
""""""
|
|
108
|
+
payload = {
|
|
109
|
+
"Content": content,
|
|
110
|
+
"Overwrite": overwrite,
|
|
111
|
+
"Url": url,
|
|
112
|
+
"XorHash": xor_hash,
|
|
113
|
+
}
|
|
114
|
+
qry = ServiceOperationQuery(self, "Upload", None, payload)
|
|
115
|
+
self.context.add_query(qry)
|
|
116
|
+
return self
|
|
117
|
+
|
|
73
118
|
def send_app_request_status_notification_email(self, request_guid):
|
|
74
119
|
"""
|
|
120
|
+
Sends email notifications about the status of an app request in the corporate app catalog
|
|
75
121
|
:param str request_guid:
|
|
76
122
|
"""
|
|
77
123
|
qry = ServiceOperationQuery(
|
|
@@ -90,6 +136,14 @@ class TenantCorporateCatalogAccessor(Entity):
|
|
|
90
136
|
),
|
|
91
137
|
)
|
|
92
138
|
|
|
139
|
+
@property
|
|
140
|
+
def card_designs(self):
|
|
141
|
+
"""Returns the card designs available in this corporate catalog."""
|
|
142
|
+
return self.properties.get(
|
|
143
|
+
"CardDesigns",
|
|
144
|
+
CardDesigns(self.context, ResourcePath("CardDesigns", self.resource_path)),
|
|
145
|
+
)
|
|
146
|
+
|
|
93
147
|
@property
|
|
94
148
|
def site_collection_app_catalogs_sites(self):
|
|
95
149
|
"""Returns an accessor to the allow list of site collections allowed to have site collection corporate
|
|
@@ -102,10 +156,15 @@ class TenantCorporateCatalogAccessor(Entity):
|
|
|
102
156
|
),
|
|
103
157
|
)
|
|
104
158
|
|
|
159
|
+
@property
|
|
160
|
+
def entity_type_name(self):
|
|
161
|
+
return "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.TenantCorporateCatalogAccessor"
|
|
162
|
+
|
|
105
163
|
def get_property(self, name, default_value=None):
|
|
106
164
|
if default_value is None:
|
|
107
165
|
property_mapping = {
|
|
108
166
|
"AvailableApps": self.available_apps,
|
|
167
|
+
"CardDesigns": self.card_designs,
|
|
109
168
|
"SiteCollectionAppCatalogsSites": self.site_collection_app_catalogs_sites,
|
|
110
169
|
}
|
|
111
170
|
default_value = property_mapping.get(name, None)
|
|
@@ -2,6 +2,7 @@ from office365.runtime.paths.resource_path import ResourcePath
|
|
|
2
2
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
3
3
|
from office365.sharepoint.entity import Entity
|
|
4
4
|
from office365.sharepoint.entity_collection import EntityCollection
|
|
5
|
+
from office365.sharepoint.multigeo.storage_quota import StorageQuota
|
|
5
6
|
from office365.sharepoint.multigeo.unified_group import UnifiedGroup
|
|
6
7
|
from office365.sharepoint.multigeo.user_personal_site_location import (
|
|
7
8
|
UserPersonalSiteLocation,
|
|
@@ -39,6 +40,19 @@ class MultiGeoServices(Entity):
|
|
|
39
40
|
self.context.add_query(qry)
|
|
40
41
|
return return_type
|
|
41
42
|
|
|
43
|
+
@property
|
|
44
|
+
def storage_quotas(self):
|
|
45
|
+
# type: () -> EntityCollection[UnifiedGroup]
|
|
46
|
+
""" """
|
|
47
|
+
return self.properties.get(
|
|
48
|
+
"StorageQuotas",
|
|
49
|
+
EntityCollection(
|
|
50
|
+
self.context,
|
|
51
|
+
StorageQuota,
|
|
52
|
+
ResourcePath("StorageQuotas", self.resource_path),
|
|
53
|
+
),
|
|
54
|
+
)
|
|
55
|
+
|
|
42
56
|
@property
|
|
43
57
|
def unified_groups(self):
|
|
44
58
|
# type: () -> EntityCollection[UnifiedGroup]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from office365.runtime.client_result import ClientResult
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
3
|
+
from office365.sharepoint.entity import Entity
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class PolicyLicenseUtilities(Entity):
|
|
7
|
+
""""""
|
|
8
|
+
|
|
9
|
+
@staticmethod
|
|
10
|
+
def check_tenant_m365_copilot_business_chat_license(context, return_type=None):
|
|
11
|
+
""""""
|
|
12
|
+
if return_type is None:
|
|
13
|
+
return_type = ClientResult(context, bool())
|
|
14
|
+
qry = ServiceOperationQuery(
|
|
15
|
+
PolicyLicenseUtilities(context),
|
|
16
|
+
"CheckTenantM365CopilotBusinessChatLicense",
|
|
17
|
+
None,
|
|
18
|
+
None,
|
|
19
|
+
None,
|
|
20
|
+
return_type,
|
|
21
|
+
)
|
|
22
|
+
context.add_query(qry)
|
|
23
|
+
return return_type
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def entity_type_name(self):
|
|
27
|
+
return "SP.Utilities.PolicyLicenseUtilities"
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
|
+
from office365.runtime.odata.type import ODataType
|
|
3
4
|
from office365.runtime.paths.service_operation import ServiceOperationPath
|
|
4
5
|
from office365.sharepoint.entity import Entity
|
|
6
|
+
from office365.sharepoint.principal.type import PrincipalType
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
class Principal(Entity):
|
|
@@ -60,6 +62,10 @@ class Principal(Entity):
|
|
|
60
62
|
"""Gets the type of the principal."""
|
|
61
63
|
return self.properties.get("PrincipalType", None)
|
|
62
64
|
|
|
65
|
+
@property
|
|
66
|
+
def principal_type_name(self):
|
|
67
|
+
return ODataType.resolve_enum_key(PrincipalType, self.principal_type)
|
|
68
|
+
|
|
63
69
|
@property
|
|
64
70
|
def property_ref_name(self):
|
|
65
71
|
return "Id"
|
office365/sharepoint/request.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
from typing import Optional
|
|
1
|
+
from typing import Callable, List, Optional
|
|
2
2
|
|
|
3
3
|
from requests import Response
|
|
4
4
|
from typing_extensions import Self
|
|
5
5
|
|
|
6
6
|
from office365.runtime.auth.authentication_context import AuthenticationContext
|
|
7
7
|
from office365.runtime.auth.client_credential import ClientCredential
|
|
8
|
+
from office365.runtime.auth.token_response import TokenResponse
|
|
8
9
|
from office365.runtime.auth.user_credential import UserCredential
|
|
9
10
|
from office365.runtime.http.request_options import RequestOptions
|
|
10
11
|
from office365.runtime.odata.request import ODataRequest
|
|
@@ -12,31 +13,115 @@ from office365.runtime.odata.v3.json_light_format import JsonLightFormat
|
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
class SharePointRequest(ODataRequest):
|
|
15
|
-
def __init__(
|
|
16
|
+
def __init__(
|
|
17
|
+
self, base_url, environment="commercial", allow_ntlm=False, browser_mode=False
|
|
18
|
+
):
|
|
16
19
|
"""
|
|
17
20
|
:param str base_url: Absolute Web or Site Url
|
|
21
|
+
:param str environment: The Office 365 Cloud Environment endpoint used for authentication
|
|
22
|
+
defaults to 'commercial'.
|
|
23
|
+
:param bool allow_ntlm: Flag indicates whether NTLM scheme is enabled. Disabled by default
|
|
24
|
+
:param bool browser_mode: Allow browser authentication
|
|
18
25
|
"""
|
|
19
26
|
super().__init__(JsonLightFormat())
|
|
20
|
-
self._auth_context = AuthenticationContext(
|
|
27
|
+
self._auth_context = AuthenticationContext(
|
|
28
|
+
url=base_url,
|
|
29
|
+
environment=environment,
|
|
30
|
+
allow_ntlm=allow_ntlm,
|
|
31
|
+
browser_mode=browser_mode,
|
|
32
|
+
)
|
|
21
33
|
self.beforeExecute += self._authenticate_request
|
|
22
34
|
|
|
23
35
|
def execute_request(self, path):
|
|
24
36
|
# type: (str) -> Response
|
|
25
|
-
request_url = "{0}/
|
|
37
|
+
request_url = "{0}/{1}".format(self.service_root_url, path)
|
|
26
38
|
return self.execute_request_direct(RequestOptions(request_url))
|
|
27
39
|
|
|
28
|
-
def with_credentials(self, credentials
|
|
29
|
-
# type: (UserCredential|ClientCredential
|
|
40
|
+
def with_credentials(self, credentials):
|
|
41
|
+
# type: (UserCredential|ClientCredential) -> Self
|
|
30
42
|
"""
|
|
31
43
|
Initializes a client to acquire a token via user or client credentials
|
|
32
|
-
:type credentials: UserCredential or ClientCredential
|
|
33
|
-
:param str environment: The Office 365 Cloud Environment endpoint used for authentication
|
|
34
|
-
defaults to 'commercial'.
|
|
35
44
|
"""
|
|
36
|
-
self._auth_context.with_credentials(credentials
|
|
45
|
+
self._auth_context.with_credentials(credentials)
|
|
46
|
+
return self
|
|
47
|
+
|
|
48
|
+
def with_client_certificate(
|
|
49
|
+
self,
|
|
50
|
+
tenant,
|
|
51
|
+
client_id,
|
|
52
|
+
thumbprint,
|
|
53
|
+
cert_path=None,
|
|
54
|
+
private_key=None,
|
|
55
|
+
scopes=None,
|
|
56
|
+
passphrase=None,
|
|
57
|
+
):
|
|
58
|
+
# type: (str, str, str, Optional[str], Optional[str], Optional[List[str]], Optional[str]) -> Self
|
|
59
|
+
"""
|
|
60
|
+
Creates authenticated SharePoint context via certificate credentials
|
|
61
|
+
|
|
62
|
+
:param str tenant: Tenant name
|
|
63
|
+
:param str or None cert_path: Path to A PEM encoded certificate private key.
|
|
64
|
+
:param str or None private_key: A PEM encoded certificate private key.
|
|
65
|
+
:param str thumbprint: Hex encoded thumbprint of the certificate.
|
|
66
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
67
|
+
:param list[str] or None scopes: Scopes requested to access a protected API (a resource)
|
|
68
|
+
:param str passphrase: Passphrase if the private_key is encrypted
|
|
69
|
+
"""
|
|
70
|
+
self._auth_context.with_client_certificate(
|
|
71
|
+
tenant, client_id, thumbprint, cert_path, private_key, scopes, passphrase
|
|
72
|
+
)
|
|
73
|
+
return self
|
|
74
|
+
|
|
75
|
+
def with_device_flow(self, tenant, client_id, scopes=None):
|
|
76
|
+
# type: (str, str, Optional[List[str]]) -> Self
|
|
77
|
+
"""
|
|
78
|
+
Initializes a client to acquire a token via device flow auth.
|
|
79
|
+
|
|
80
|
+
:param str tenant: Tenant name, for example: contoso.onmicrosoft.com
|
|
81
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
82
|
+
:param list[str] or None scopes: Scopes requested to access a protected API (a resource)
|
|
83
|
+
"""
|
|
84
|
+
self._auth_context.with_device_flow(tenant, client_id, scopes)
|
|
85
|
+
return self
|
|
86
|
+
|
|
87
|
+
def with_interactive(self, tenant, client_id, scopes=None):
|
|
88
|
+
# type: (str, str, Optional[List[str]]) -> Self
|
|
89
|
+
"""
|
|
90
|
+
Initializes a client to acquire a token interactively i.e. via a local browser.
|
|
91
|
+
|
|
92
|
+
Prerequisite: In Azure Portal, configure the Redirect URI of your
|
|
93
|
+
"Mobile and Desktop application" as ``http://localhost``.
|
|
94
|
+
|
|
95
|
+
:param str tenant: Tenant name, for example: contoso.onmicrosoft.com
|
|
96
|
+
:param str client_id: The OAuth client id of the calling application.
|
|
97
|
+
:param list[str] or None scopes: Scopes requested to access a protected API (a resource)
|
|
98
|
+
"""
|
|
99
|
+
self._auth_context.with_interactive(tenant, client_id, scopes)
|
|
100
|
+
return self
|
|
101
|
+
|
|
102
|
+
def with_access_token(self, token_func):
|
|
103
|
+
# type: (Callable[[], TokenResponse]) -> Self
|
|
104
|
+
"""
|
|
105
|
+
Initializes a client to acquire a token from a callback
|
|
106
|
+
:param () -> TokenResponse token_func: A token callback
|
|
107
|
+
"""
|
|
108
|
+
self._auth_context.with_access_token(token_func)
|
|
37
109
|
return self
|
|
38
110
|
|
|
39
111
|
def _authenticate_request(self, request):
|
|
40
112
|
# type: (RequestOptions) -> None
|
|
41
113
|
"""Authenticate request"""
|
|
42
114
|
self._auth_context.authenticate_request(request)
|
|
115
|
+
|
|
116
|
+
@property
|
|
117
|
+
def authentication_context(self):
|
|
118
|
+
return self._auth_context
|
|
119
|
+
|
|
120
|
+
@property
|
|
121
|
+
def base_url(self):
|
|
122
|
+
"""Represents Base Url"""
|
|
123
|
+
return self._auth_context.url
|
|
124
|
+
|
|
125
|
+
@property
|
|
126
|
+
def service_root_url(self):
|
|
127
|
+
return "{0}/_api".format(self._auth_context.url)
|
|
@@ -15,15 +15,29 @@ class DocumentCrawlLog(Entity):
|
|
|
15
15
|
)
|
|
16
16
|
super(DocumentCrawlLog, self).__init__(context, static_path)
|
|
17
17
|
|
|
18
|
-
def get_crawled_urls(
|
|
18
|
+
def get_crawled_urls(
|
|
19
|
+
self,
|
|
20
|
+
get_count_only=False,
|
|
21
|
+
max_rows=None,
|
|
22
|
+
query_string=None,
|
|
23
|
+
content_source_id=None,
|
|
24
|
+
):
|
|
19
25
|
"""
|
|
20
26
|
Retrieves information about all the contents that were crawled.
|
|
21
27
|
|
|
22
28
|
:param bool get_count_only: f true, only the count of the contents crawled MUST be returned.
|
|
23
29
|
If false, all the information about the crawled contents MUST be returned.
|
|
30
|
+
:param int max_rows:
|
|
31
|
+
:param str query_string:
|
|
32
|
+
:param int content_source_id:
|
|
24
33
|
"""
|
|
25
34
|
return_type = ClientResult(self.context, SimpleDataTable())
|
|
26
|
-
payload = {
|
|
35
|
+
payload = {
|
|
36
|
+
"getCountOnly": get_count_only,
|
|
37
|
+
"maxRows": max_rows,
|
|
38
|
+
"queryString": query_string,
|
|
39
|
+
"contentSourceID": content_source_id,
|
|
40
|
+
}
|
|
27
41
|
qry = ServiceOperationQuery(
|
|
28
42
|
self, "GetCrawledUrls", None, payload, None, return_type
|
|
29
43
|
)
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
2
|
+
from office365.sharepoint.search.reports.abandonedqueries.item import (
|
|
3
|
+
ReportAbandonedQueriesItem,
|
|
4
|
+
)
|
|
1
5
|
from office365.sharepoint.search.reports.base import ReportBase
|
|
2
6
|
|
|
3
7
|
|
|
@@ -6,4 +10,10 @@ class ReportAbandonedQueries(ReportBase):
|
|
|
6
10
|
queries that might create user dissatisfaction and to improve the discoverability of content.
|
|
7
11
|
"""
|
|
8
12
|
|
|
9
|
-
|
|
13
|
+
def __init__(self, reports=None):
|
|
14
|
+
super(ReportAbandonedQueries, self).__init__()
|
|
15
|
+
self.Reports = ClientValueCollection(ReportAbandonedQueriesItem, reports)
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def entity_type_name(self):
|
|
19
|
+
return "Microsoft.Office.Server.Search.REST.ReportAbandonedQueries"
|
|
@@ -2,4 +2,10 @@ from office365.runtime.client_value import ClientValue
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class ReportAbandonedQueriesItem(ClientValue):
|
|
5
|
-
|
|
5
|
+
|
|
6
|
+
def __init__(self, date=None):
|
|
7
|
+
self.Date = date
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def entity_type_name(self):
|
|
11
|
+
return "Microsoft.Office.Server.Search.REST.ReportAbandonedQueriesItem"
|
|
@@ -2,6 +2,9 @@ from office365.runtime.paths.resource_path import ResourcePath
|
|
|
2
2
|
from office365.sharepoint.entity import Entity
|
|
3
3
|
from office365.sharepoint.sharing.abilities import SharingAbilities
|
|
4
4
|
from office365.sharepoint.sharing.access_request_settings import AccessRequestSettings
|
|
5
|
+
from office365.sharepoint.sharing.domain_restriction_settings import (
|
|
6
|
+
DomainRestrictionSettings,
|
|
7
|
+
)
|
|
5
8
|
from office365.sharepoint.sharing.links.default_templates_collection import (
|
|
6
9
|
SharingLinkDefaultTemplatesCollection,
|
|
7
10
|
)
|
|
@@ -24,9 +27,17 @@ class SharingInformation(Entity):
|
|
|
24
27
|
|
|
25
28
|
@property
|
|
26
29
|
def anonymous_link_expiration_restriction_days(self):
|
|
30
|
+
# type: () -> Optional[int]
|
|
27
31
|
"""Tenant's anonymous link expiration restriction in days."""
|
|
28
32
|
return self.properties.get("anonymousLinkExpirationRestrictionDays", None)
|
|
29
33
|
|
|
34
|
+
@property
|
|
35
|
+
def domain_restriction_settings(self):
|
|
36
|
+
"""Whether DomainRestrictionSettings is used to limit the external Users set by Admin."""
|
|
37
|
+
return self.properties.get(
|
|
38
|
+
"anonymousLinkExpirationRestrictionDays", DomainRestrictionSettings()
|
|
39
|
+
)
|
|
40
|
+
|
|
30
41
|
@property
|
|
31
42
|
def permissions_information(self):
|
|
32
43
|
"""
|
|
@@ -62,6 +73,7 @@ class SharingInformation(Entity):
|
|
|
62
73
|
if default_value is None:
|
|
63
74
|
property_mapping = {
|
|
64
75
|
"accessRequestSettings": self.access_request_settings,
|
|
76
|
+
"domain_restriction_settings": self.domain_restriction_settings,
|
|
65
77
|
"permissionsInformation": self.permissions_information,
|
|
66
78
|
"pickerSettings": self.picker_settings,
|
|
67
79
|
"sharingAbilities": self.sharing_abilities,
|
|
@@ -2,13 +2,13 @@ from office365.runtime.client_value import ClientValue
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class SiteHealthResult(ClientValue):
|
|
5
|
-
"""Specifies the result of running a site collection
|
|
5
|
+
"""Specifies the result of running a site collection sitehealth rule."""
|
|
6
6
|
|
|
7
7
|
def __init__(self, message_as_text=None, rule_help_link=None, rule_id=None):
|
|
8
8
|
"""
|
|
9
|
-
:param str message_as_text: Specifies a summary of the results of running a site collection
|
|
10
|
-
:param str rule_help_link: Specifies a hyperlink to help information about the site collection
|
|
11
|
-
:param str rule_id: Specifies the unique identifier of the site collection
|
|
9
|
+
:param str message_as_text: Specifies a summary of the results of running a site collection sitehealth rule.
|
|
10
|
+
:param str rule_help_link: Specifies a hyperlink to help information about the site collection sitehealth rule.
|
|
11
|
+
:param str rule_id: Specifies the unique identifier of the site collection sitehealth rule.
|
|
12
12
|
"""
|
|
13
13
|
self.MessageAsText = message_as_text
|
|
14
14
|
self.RuleHelpLink = rule_help_link
|
|
@@ -6,29 +6,29 @@ from office365.sharepoint.sitehealth.result import SiteHealthResult
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class SiteHealthSummary(Entity):
|
|
9
|
-
"""Specifies a summary of the results of running a set of site collection
|
|
9
|
+
"""Specifies a summary of the results of running a set of site collection sitehealth rules."""
|
|
10
10
|
|
|
11
11
|
@property
|
|
12
12
|
def failed_error_count(self):
|
|
13
13
|
# type: () -> Optional[int]
|
|
14
|
-
"""Specifies the number of site collection
|
|
14
|
+
"""Specifies the number of site collection sitehealth rules that failed with an error."""
|
|
15
15
|
return self.properties.get("FailedErrorCount", None)
|
|
16
16
|
|
|
17
17
|
@property
|
|
18
18
|
def failed_warning_count(self):
|
|
19
19
|
# type: () -> Optional[int]
|
|
20
|
-
"""Specifies the number of site collection
|
|
20
|
+
"""Specifies the number of site collection sitehealth rules that failed with a warning."""
|
|
21
21
|
return self.properties.get("FailedWarningCount", None)
|
|
22
22
|
|
|
23
23
|
@property
|
|
24
24
|
def passed_count(self):
|
|
25
25
|
# type: () -> Optional[int]
|
|
26
|
-
"""Specifies the number of site collection
|
|
26
|
+
"""Specifies the number of site collection sitehealth rules that passed."""
|
|
27
27
|
return self.properties.get("PassedCount", None)
|
|
28
28
|
|
|
29
29
|
@property
|
|
30
30
|
def results(self):
|
|
31
|
-
"""Specifies a list of site collection
|
|
31
|
+
"""Specifies a list of site collection sitehealth rule results, one for each site collection sitehealth rule that
|
|
32
32
|
was run."""
|
|
33
33
|
return self.properties.get("Results", ClientValueCollection(SiteHealthResult))
|
|
34
34
|
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ from office365.runtime.client_result import ClientResult
|
|
|
2
2
|
from office365.runtime.paths.resource_path import ResourcePath
|
|
3
3
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
4
4
|
from office365.sharepoint.entity import Entity
|
|
5
|
-
from office365.sharepoint.sites.
|
|
5
|
+
from office365.sharepoint.sites.home.reference import SPHSiteReference
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class SPHSite(Entity):
|
|
@@ -27,10 +27,11 @@ from office365.sharepoint.sitehealth.summary import SiteHealthSummary
|
|
|
27
27
|
from office365.sharepoint.sites.azure_container_Info import (
|
|
28
28
|
ProvisionedTemporaryAzureContainerInfo,
|
|
29
29
|
)
|
|
30
|
+
from office365.sharepoint.sites.copy_job_progress import CopyJobProgress
|
|
31
|
+
from office365.sharepoint.sites.home.site import SPHSite
|
|
30
32
|
from office365.sharepoint.sites.html_field_security_setting import (
|
|
31
33
|
HTMLFieldSecuritySetting,
|
|
32
34
|
)
|
|
33
|
-
from office365.sharepoint.sites.sph_site import SPHSite
|
|
34
35
|
from office365.sharepoint.sites.upgrade_info import UpgradeInfo
|
|
35
36
|
from office365.sharepoint.sites.usage_info import UsageInfo
|
|
36
37
|
from office365.sharepoint.sites.version_policy_manager import SiteVersionPolicyManager
|
|
@@ -153,6 +154,18 @@ class Site(Entity):
|
|
|
153
154
|
self.context.add_query(qry)
|
|
154
155
|
return return_type
|
|
155
156
|
|
|
157
|
+
def get_copy_job_progress(self, copy_job_info=None):
|
|
158
|
+
"""
|
|
159
|
+
:param copy_job_info: Optional copyJobInfo object.
|
|
160
|
+
"""
|
|
161
|
+
payload = {"copyJobInfo": copy_job_info}
|
|
162
|
+
return_type = ClientResult(self.context, CopyJobProgress())
|
|
163
|
+
qry = ServiceOperationQuery(
|
|
164
|
+
self, "GetCopyJobProgress", None, payload, None, return_type
|
|
165
|
+
)
|
|
166
|
+
self.context.add_query(qry)
|
|
167
|
+
return return_type
|
|
168
|
+
|
|
156
169
|
def get_site_logo(self):
|
|
157
170
|
"""Downloads a site logo"""
|
|
158
171
|
return_type = ClientResult(self.context)
|
|
@@ -265,6 +278,18 @@ class Site(Entity):
|
|
|
265
278
|
self.ensure_property("Id", _site_loaded)
|
|
266
279
|
return return_type
|
|
267
280
|
|
|
281
|
+
def get_web_path(self, site_id, web_id):
|
|
282
|
+
"""
|
|
283
|
+
:param int site_id: The site identifier
|
|
284
|
+
:param int web_id: The web identifier
|
|
285
|
+
"""
|
|
286
|
+
params = {"siteId": site_id, "webId": web_id}
|
|
287
|
+
return_type = ClientResult(self.context, SPResPath())
|
|
288
|
+
|
|
289
|
+
qry = ServiceOperationQuery(self, "GetWebPath", params, None, None, return_type)
|
|
290
|
+
self.context.add_query(qry)
|
|
291
|
+
return return_type
|
|
292
|
+
|
|
268
293
|
def get_web_templates(self, lcid=1033, override_compat_level=0):
|
|
269
294
|
"""
|
|
270
295
|
Returns the collection of site definitions that are available for creating
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from office365.runtime.paths.resource_path import ResourcePath
|
|
2
|
+
from office365.sharepoint.entity import Entity
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class SPOWebAppServicePrincipalPublic(Entity):
|
|
6
|
+
""" """
|
|
7
|
+
|
|
8
|
+
def __init__(self, context):
|
|
9
|
+
""" """
|
|
10
|
+
static_path = ResourcePath(
|
|
11
|
+
"Microsoft.Online.SharePoint.TenantAdministration.SPOWebAppServicePrincipalPublic"
|
|
12
|
+
)
|
|
13
|
+
super(SPOWebAppServicePrincipalPublic, self).__init__(context, static_path)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def entity_type_name(self):
|
|
17
|
+
return "Microsoft.Online.SharePoint.TenantAdministration.SPOWebAppServicePrincipalPublic"
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
from office365.runtime.client_value import ClientValue
|
|
2
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
3
|
+
from office365.sharepoint.tenant.administration.modified_property import (
|
|
4
|
+
ModifiedProperty,
|
|
5
|
+
)
|
|
2
6
|
|
|
3
7
|
|
|
4
8
|
class AuditData(ClientValue):
|
|
9
|
+
|
|
10
|
+
def __init__(self, client_ip=None, correlation_id=None, modified_properties=None):
|
|
11
|
+
self.ClientIP = client_ip
|
|
12
|
+
self.CorrelationId = correlation_id
|
|
13
|
+
self.ModifiedProperties = ClientValueCollection(
|
|
14
|
+
ModifiedProperty, modified_properties
|
|
15
|
+
)
|
|
16
|
+
|
|
5
17
|
@property
|
|
6
18
|
def entity_type_name(self):
|
|
7
19
|
return "Microsoft.SharePoint.Administration.TenantAdmin.AuditData"
|