Office365-REST-Python-Client 3.1.0__py3-none-any.whl → 3.2.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/communications/callrecords/call_record.py +18 -0
- office365/communications/calls/call.py +3 -0
- office365/communications/presences/presence.py +3 -0
- office365/communications/quotas.py +66 -0
- office365/communications/virtualevents/virtual_event.py +3 -0
- office365/directory/domains/domain.py +3 -0
- office365/directory/licenses/subscribed_sku.py +3 -0
- office365/directory/objects/object.py +3 -0
- office365/directory/quotas.py +34 -0
- office365/entity_collection.py +2 -2
- office365/graph_client.py +46 -2
- office365/limits.py +66 -0
- office365/migration/__init__.py +6 -1
- office365/migration/adapters/__init__.py +14 -4
- office365/migration/adapters/filesystem.py +4 -1
- office365/migration/assessment/export.py +5 -5
- office365/migration/assessment/issue.py +19 -0
- office365/migration/assessment/report.py +11 -0
- office365/migration/assessment/scanners/base.py +37 -49
- office365/migration/base.py +33 -8
- office365/migration/checkpoint.py +1 -1
- office365/migration/outlook/assessor.py +4 -4
- office365/migration/package/__init__.py +82 -0
- office365/migration/package/builder.py +603 -0
- office365/migration/package/crypto.py +54 -0
- office365/migration/package/manifest_xml.py +495 -0
- office365/migration/package/staging.py +180 -0
- office365/migration/report.py +7 -2
- office365/migration/report_io.py +79 -0
- office365/migration/runner.py +117 -10
- office365/migration/server_job.py +126 -14
- office365/migration/session.py +132 -49
- office365/migration/settings.py +67 -0
- office365/migration/sharepoint/__init__.py +2 -0
- office365/migration/sharepoint/adapters.py +207 -41
- office365/migration/sharepoint/assessor.py +45 -9
- office365/migration/sharepoint/options.py +57 -0
- office365/migration/sharepoint/package_target.py +209 -0
- office365/migration/sharepoint/registry.py +22 -0
- office365/migration/sharepoint/resolvers.py +96 -0
- office365/migration/sharepoint/scanners/__init__.py +29 -0
- office365/migration/sharepoint/scanners/browser_file_handling.py +55 -0
- office365/migration/sharepoint/scanners/checked_out_files.py +57 -0
- office365/migration/sharepoint/scanners/file_versions.py +56 -0
- office365/migration/sharepoint/scanners/files.py +5 -2
- office365/migration/sharepoint/scanners/large_excel_files.py +56 -0
- office365/migration/sharepoint/scanners/large_lists.py +58 -0
- office365/migration/sharepoint/scanners/large_sites.py +4 -3
- office365/migration/sharepoint/scanners/long_onedrive_urls.py +52 -0
- office365/migration/sharepoint/scanners/lookup.py +38 -0
- office365/migration/sharepoint/scanners/paths.py +9 -4
- office365/migration/sharepoint/scanners/permissions.py +20 -2
- office365/migration/sharepoint/scanners/smat.py +51 -0
- office365/migration/sharepoint/scanners/summary.py +1 -0
- office365/migration/sharepoint/scanners/thicket_folders.py +38 -0
- office365/migration/sharepoint/scanners/unsupported_site_templates.py +90 -0
- office365/migration/sharepoint/tenant_assessor.py +5 -3
- office365/migration/sharepoint/transfer.py +4 -2
- office365/migration/tasks.py +121 -0
- office365/migration/validators.py +2 -19
- office365/onedrive/driveitems/driveItem.py +116 -12
- office365/onedrive/termstore/groups/collection.py +2 -9
- office365/onedrive/termstore/sets/collection.py +2 -9
- office365/onedrive/termstore/terms/collection.py +3 -10
- office365/onedrive/workbooks/workbook.py +7 -0
- office365/outlook/contacts/folders/collection.py +4 -13
- office365/runtime/auth/authentication_context.py +5 -0
- office365/runtime/client_object.py +18 -0
- office365/runtime/client_object_collection.py +75 -245
- office365/runtime/client_request.py +77 -1
- office365/runtime/client_request_exception.py +127 -39
- office365/runtime/client_runtime_context.py +79 -8
- office365/runtime/converters/csv_writer.py +10 -4
- office365/runtime/converters/dataframe.py +84 -4
- office365/runtime/converters/json_file.py +12 -3
- office365/runtime/converters/parquet.py +67 -0
- office365/runtime/converters/records.py +31 -12
- office365/runtime/converters/registry.py +185 -0
- office365/runtime/converters/scalars.py +31 -0
- office365/runtime/converters/sql.py +69 -0
- office365/runtime/converters/streamers.py +105 -0
- office365/runtime/converters/streams.py +42 -0
- office365/runtime/converters/upsert.py +101 -0
- office365/runtime/exceptions.py +105 -0
- office365/runtime/http/prefer.py +26 -0
- office365/runtime/http/throttling.py +258 -56
- office365/runtime/imports.py +571 -0
- office365/runtime/limits.py +455 -0
- office365/runtime/odata/request.py +11 -2
- office365/runtime/odata/type.py +1 -0
- office365/runtime/odata/v3/batch_request.py +4 -2
- office365/runtime/odata/v4/batch_request.py +22 -7
- office365/runtime/operations.py +29 -0
- office365/runtime/parallel.py +12 -14
- office365/runtime/paths/v4/entity.py +2 -2
- office365/runtime/queries/batch.py +18 -1
- office365/runtime/queries/get_or_create.py +109 -0
- office365/runtime/record_collection.py +443 -0
- office365/runtime/retry.py +92 -26
- office365/runtime/transport/base.py +6 -1
- office365/runtime/transport/requests_transport.py +4 -0
- office365/runtime/transport/throttled_transport.py +67 -0
- office365/runtime/verification.py +40 -0
- office365/sharepoint/activities/logger.py +118 -8
- office365/sharepoint/administration/analytics/usage_service.py +15 -7
- office365/sharepoint/administration/sitemove/service.py +791 -8
- office365/sharepoint/alerts/alert.py +79 -0
- office365/sharepoint/apps/app_collection.py +25 -0
- office365/sharepoint/apps/launcher.py +16 -0
- office365/sharepoint/authpolicy/tenant/compliancereport.py +5 -0
- office365/sharepoint/businessdata/app_bdc_catalog.py +135 -0
- office365/sharepoint/businessdata/entityfieldvaluedictionary.py +65 -0
- office365/sharepoint/businessdata/entityidentifier.py +23 -0
- office365/sharepoint/businessdata/entityinstance.py +52 -0
- office365/sharepoint/businessdata/entityview.py +31 -0
- office365/sharepoint/businessdata/externalsubscriptionstore.py +9 -0
- office365/sharepoint/businessdata/typedescriptor.py +37 -0
- office365/sharepoint/client_context.py +40 -23
- office365/sharepoint/clientsidecomponent/hostedapps/app.py +21 -0
- office365/sharepoint/clientsidecomponent/hostedapps/manager.py +16 -0
- office365/sharepoint/comments/comment.py +84 -2
- office365/sharepoint/contentcenter/machinelearning/models/model.py +0 -23
- office365/sharepoint/contentcenter/machinelearning/publications/publication.py +0 -9
- office365/sharepoint/contentcenter/machinelearning/samples/sample.py +0 -14
- office365/sharepoint/contentcenter/machinelearning/workitems/item.py +0 -80
- office365/sharepoint/contentsolution/template_api.py +148 -0
- office365/sharepoint/contenttypes/collection.py +32 -10
- office365/sharepoint/convergence/addnoliveblobsinodcservicestateapi.py +9 -0
- office365/sharepoint/convergence/consumer_permissions.py +15 -0
- office365/sharepoint/convergence/migration_complete_state_api.py +25 -0
- office365/sharepoint/convergence/odcmetadatacleanedupapi.py +9 -0
- office365/sharepoint/documentmanagement/document_id.py +12 -0
- office365/sharepoint/entity.py +11 -2
- office365/sharepoint/entity_collection.py +2 -2
- office365/sharepoint/exceptions.py +194 -0
- office365/sharepoint/fields/builtin_field_id.py +45 -34
- office365/sharepoint/fields/builtin_field_name.py +123 -0
- office365/sharepoint/fields/coercion.py +131 -0
- office365/sharepoint/fields/collection.py +54 -37
- office365/sharepoint/fields/field.py +17 -0
- office365/sharepoint/fields/name.py +46 -2
- office365/sharepoint/files/collection.py +7 -1
- office365/sharepoint/files/file.py +54 -8
- office365/sharepoint/files/versions/version.py +38 -13
- office365/sharepoint/folders/collection.py +4 -0
- office365/sharepoint/folders/folder.py +91 -21
- office365/sharepoint/htmlpages/html_page.py +16 -0
- office365/sharepoint/htmlpages/html_page_service.py +19 -0
- office365/sharepoint/ir/migration.py +9 -0
- office365/sharepoint/listitems/caml/__init__.py +31 -0
- office365/sharepoint/listitems/caml/builder.py +129 -0
- office365/sharepoint/listitems/caml/expressions.py +424 -0
- office365/sharepoint/listitems/caml/fields.py +68 -0
- office365/sharepoint/listitems/caml/guard.py +63 -0
- office365/sharepoint/listitems/caml/query.py +71 -2
- office365/sharepoint/listitems/caml/values.py +113 -0
- office365/sharepoint/listitems/collection.py +21 -20
- office365/sharepoint/listitems/upsert.py +75 -0
- office365/sharepoint/lists/collection.py +29 -22
- office365/sharepoint/lists/exporter.py +4 -3
- office365/sharepoint/lists/list.py +397 -39
- office365/sharepoint/lists/smart_wiki_library_utility.py +58 -0
- office365/sharepoint/logger/export.py +12 -0
- office365/sharepoint/marketplace/app_metadata.py +97 -1
- office365/sharepoint/marketplace/appstatequeryjobdefinition.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/carddesigns/card_designs.py +35 -0
- office365/sharepoint/marketplace/sitecollection/appcatalog/allowed_item.py +5 -0
- office365/sharepoint/marketplace/tenant/appcatalog/accessor.py +107 -30
- office365/sharepoint/microfeed/data.py +0 -6
- office365/sharepoint/microservice/manager.py +61 -0
- office365/sharepoint/migrationcenter/common/task.py +193 -4
- office365/sharepoint/migrationcenter/common/task_entity_data.py +1 -1
- office365/sharepoint/migrationcenter/deploy_status.py +13 -0
- office365/sharepoint/migrationcenter/service/properties.py +20 -0
- office365/sharepoint/migrationcenter/service/storage.py +34 -0
- office365/sharepoint/migrationcenter/spflight.py +13 -0
- office365/sharepoint/migrationcenter/urlparseresult.py +77 -0
- office365/sharepoint/multigeo/service/spmultigeoproxy.py +13 -0
- office365/sharepoint/navigation/servicerest.py +127 -0
- office365/sharepoint/oauth/authentication.py +13 -0
- office365/sharepoint/portal/theme_manager.py +120 -8
- office365/sharepoint/principal/users/user.py +10 -0
- office365/sharepoint/publishing/campaign/campaign.py +36 -1
- office365/sharepoint/publishing/feedvideopage.py +0 -7
- office365/sharepoint/publishing/pages/3d/page.py +0 -6
- office365/sharepoint/publishing/pages/page.py +0 -117
- office365/sharepoint/publishing/pages/reposts/repost.py +0 -7
- office365/sharepoint/publishing/pages/topics/topic.py +0 -7
- office365/sharepoint/publishing/subtitlefile.py +0 -40
- office365/sharepoint/quotamanagement/consumer/consumer_quota_info_api.py +14 -0
- office365/sharepoint/quotamanagement/consumer/non_quota_backfill_api.py +23 -0
- office365/sharepoint/quotamanagement/consumer/nonquotamigrationapi.py +9 -0
- office365/sharepoint/quotamanagement/consumer/quotamigrationapi.py +13 -0
- office365/sharepoint/request.py +57 -16
- office365/sharepoint/search/administration/document_crawl_log.py +24 -7
- office365/sharepoint/search/administration/providers/crawl_versions_info.py +29 -0
- office365/sharepoint/search/administration/providers/recycle_bin_info.py +23 -0
- office365/sharepoint/search/administration/providers/site_content_processing_info.py +67 -0
- office365/sharepoint/sites/site.py +976 -65
- office365/sharepoint/sites/siteprovisioninginfoprovider.py +13 -0
- office365/sharepoint/tenant/administration/datagovernance/insight_client.py +292 -23
- office365/sharepoint/tenant/administration/ddiadapter.py +97 -0
- office365/sharepoint/tenant/administration/internal/aad/collection.py +20 -0
- office365/sharepoint/tenant/administration/internal/aad/permission_grant.py +0 -19
- office365/sharepoint/tenant/administration/internal/appservice/permission_request.py +72 -1
- office365/sharepoint/tenant/administration/internal/appservice/principal.py +1 -3
- office365/sharepoint/tenant/administration/odb_license_enforcement_service.py +26 -0
- office365/sharepoint/tenant/administration/sites/properties.py +564 -6
- office365/sharepoint/tenant/administration/spdatagovernancesarrestapiclient.py +60 -1
- office365/sharepoint/tenant/insights/reports/manager.py +24 -12
- office365/sharepoint/tenant/management/office365_tenant.py +451 -2
- office365/sharepoint/tenantadministration/catalog_management_collection.py +69 -0
- office365/sharepoint/tenantadministration/catalog_management_custom_properties_collection.py +237 -0
- office365/sharepoint/tenantadministration/catalog_management_restricted_content_discovery_collection.py +56 -0
- office365/sharepoint/tenantadministration/sp_data_governance_client_exception.py +7 -0
- office365/sharepoint/thresholds.py +529 -0
- office365/sharepoint/translation/jobs/job.py +72 -2
- office365/sharepoint/translation/jobs/status.py +47 -9
- office365/sharepoint/translation/sync_translator.py +15 -2
- office365/sharepoint/utilities/move_copy_util.py +2 -1
- office365/sharepoint/viva/connections/page.py +27 -0
- office365/sharepoint/viva/home.py +38 -0
- office365/sharepoint/viva/learningmanager.py +9 -0
- office365/sharepoint/viva/vivaresources.py +60 -0
- office365/sharepoint/webhooks/subscription.py +0 -11
- office365/sharepoint/webparts/definitions/definition.py +13 -0
- office365/sharepoint/webparts/limited_manager.py +29 -7
- office365/sharepoint/webs/context_web_information.py +14 -9
- office365/sharepoint/webs/templates/__init__.py +11 -0
- office365/sharepoint/webs/templates/type.py +74 -15
- office365/sharepoint/workflow/definition.py +6 -0
- office365/sharepoint/workflow/deployment_service.py +155 -0
- office365/sharepoint/workflow/instances/service.py +33 -0
- office365/sharepoint/workflow/interopservice.py +68 -0
- office365/sharepoint/workflow/messagingservice.py +24 -0
- office365/sharepoint/workflow/servicesmanager.py +41 -2
- office365/sharepoint/workflow/subscriptions/service.py +67 -0
- office365/sharepoint/workflow/subscriptions/subscription.py +31 -0
- office365/sharepoint/workflow/task.py +425 -0
- office365_rest_python_client-3.2.0.dist-info/METADATA +605 -0
- {office365_rest_python_client-3.1.0.dist-info → office365_rest_python_client-3.2.0.dist-info}/RECORD +242 -185
- office365/migration/_util.py +0 -73
- office365/sharepoint/listitems/caml/types.py +0 -70
- office365_rest_python_client-3.1.0.dist-info/METADATA +0 -475
- {office365_rest_python_client-3.1.0.dist-info → office365_rest_python_client-3.2.0.dist-info}/WHEEL +0 -0
|
@@ -51,12 +51,6 @@ class SitePage(SitePageMetadata):
|
|
|
51
51
|
self.context.add_query(qry)
|
|
52
52
|
return self
|
|
53
53
|
|
|
54
|
-
def ensure_title_resource(self) -> Self:
|
|
55
|
-
""""""
|
|
56
|
-
qry = ServiceOperationQuery(self, "EnsureTitleResource")
|
|
57
|
-
self.context.add_query(qry)
|
|
58
|
-
return self
|
|
59
|
-
|
|
60
54
|
def get_dependency_metadata(self) -> ClientResult[ClientValueCollection[SitePageDependencyMetadata]]:
|
|
61
55
|
""" """
|
|
62
56
|
return_type = ClientResult(self.context, ClientValueCollection(SitePageDependencyMetadata))
|
|
@@ -357,117 +351,6 @@ class SitePage(SitePageMetadata):
|
|
|
357
351
|
"""Gets the TemplateScope property"""
|
|
358
352
|
return self.properties.get("TemplateScope", None)
|
|
359
353
|
|
|
360
|
-
def create_app_page(self, web_part_data_as_json: str) -> ClientResult[str]:
|
|
361
|
-
"""CreateAppPage operation.
|
|
362
|
-
|
|
363
|
-
Args:
|
|
364
|
-
web_part_data_as_json (str): webPartDataAsJson parameter
|
|
365
|
-
"""
|
|
366
|
-
return_type = ClientResult(self.context, str())
|
|
367
|
-
qry = ServiceOperationQuery(
|
|
368
|
-
self, "CreateAppPage", None, {"webPartDataAsJson": web_part_data_as_json}, None, return_type
|
|
369
|
-
)
|
|
370
|
-
self.context.add_query(qry)
|
|
371
|
-
return return_type
|
|
372
|
-
|
|
373
|
-
def get_page_column_state(self, url: str) -> ClientResult[int]:
|
|
374
|
-
"""GetPageColumnState operation.
|
|
375
|
-
|
|
376
|
-
Args:
|
|
377
|
-
url (str): url parameter
|
|
378
|
-
"""
|
|
379
|
-
return_type = ClientResult(self.context, int())
|
|
380
|
-
qry = FunctionQuery(self, "GetPageColumnState", [url], return_type)
|
|
381
|
-
self.context.add_query(qry)
|
|
382
|
-
return return_type
|
|
383
|
-
|
|
384
|
-
def is_site_page(self, url: str) -> ClientResult[bool]:
|
|
385
|
-
"""IsSitePage operation.
|
|
386
|
-
|
|
387
|
-
Args:
|
|
388
|
-
url (str): url parameter
|
|
389
|
-
"""
|
|
390
|
-
return_type = ClientResult(self.context, bool())
|
|
391
|
-
qry = FunctionQuery(self, "IsSitePage", [url], return_type)
|
|
392
|
-
self.context.add_query(qry)
|
|
393
|
-
return return_type
|
|
394
|
-
|
|
395
|
-
def set_html_pages_feature(self, enabled: bool) -> Self:
|
|
396
|
-
"""SetHtmlPagesFeature operation.
|
|
397
|
-
|
|
398
|
-
Args:
|
|
399
|
-
enabled (bool): enabled parameter
|
|
400
|
-
"""
|
|
401
|
-
qry = ServiceOperationQuery(self, "SetHtmlPagesFeature", None, {"enabled": enabled}, None, None)
|
|
402
|
-
self.context.add_query(qry)
|
|
403
|
-
return self
|
|
404
|
-
|
|
405
|
-
def set_multilingual(self, enabled: bool) -> Self:
|
|
406
|
-
"""SetMultilingual operation.
|
|
407
|
-
|
|
408
|
-
Args:
|
|
409
|
-
enabled (bool): enabled parameter
|
|
410
|
-
"""
|
|
411
|
-
qry = ServiceOperationQuery(self, "SetMultilingual", None, {"enabled": enabled}, None, None)
|
|
412
|
-
self.context.add_query(qry)
|
|
413
|
-
return self
|
|
414
|
-
|
|
415
|
-
def set_scheduling(self, enabled: bool) -> Self:
|
|
416
|
-
"""SetScheduling operation.
|
|
417
|
-
|
|
418
|
-
Args:
|
|
419
|
-
enabled (bool): enabled parameter
|
|
420
|
-
"""
|
|
421
|
-
qry = ServiceOperationQuery(self, "SetScheduling", None, {"enabled": enabled}, None, None)
|
|
422
|
-
self.context.add_query(qry)
|
|
423
|
-
return self
|
|
424
|
-
|
|
425
|
-
def update_app_page(
|
|
426
|
-
self, page_id: int, web_part_data_as_json: str, title: str, include_in_navigation: bool
|
|
427
|
-
) -> ClientResult[str]:
|
|
428
|
-
"""UpdateAppPage operation.
|
|
429
|
-
|
|
430
|
-
Args:
|
|
431
|
-
page_id (int): pageId parameter
|
|
432
|
-
web_part_data_as_json (str): webPartDataAsJson parameter
|
|
433
|
-
title (str): title parameter
|
|
434
|
-
include_in_navigation (bool): includeInNavigation parameter
|
|
435
|
-
"""
|
|
436
|
-
return_type = ClientResult(self.context, str())
|
|
437
|
-
qry = ServiceOperationQuery(
|
|
438
|
-
self,
|
|
439
|
-
"UpdateAppPage",
|
|
440
|
-
None,
|
|
441
|
-
{
|
|
442
|
-
"pageId": page_id,
|
|
443
|
-
"webPartDataAsJson": web_part_data_as_json,
|
|
444
|
-
"title": title,
|
|
445
|
-
"includeInNavigation": include_in_navigation,
|
|
446
|
-
},
|
|
447
|
-
None,
|
|
448
|
-
return_type,
|
|
449
|
-
)
|
|
450
|
-
self.context.add_query(qry)
|
|
451
|
-
return return_type
|
|
452
|
-
|
|
453
|
-
def update_full_page_app(self, server_relative_url: str, web_part_data_as_json: str) -> Self:
|
|
454
|
-
"""UpdateFullPageApp operation.
|
|
455
|
-
|
|
456
|
-
Args:
|
|
457
|
-
server_relative_url (str): serverRelativeUrl parameter
|
|
458
|
-
web_part_data_as_json (str): webPartDataAsJson parameter
|
|
459
|
-
"""
|
|
460
|
-
qry = ServiceOperationQuery(
|
|
461
|
-
self,
|
|
462
|
-
"UpdateFullPageApp",
|
|
463
|
-
None,
|
|
464
|
-
{"serverRelativeUrl": server_relative_url, "webPartDataAsJson": web_part_data_as_json},
|
|
465
|
-
None,
|
|
466
|
-
None,
|
|
467
|
-
)
|
|
468
|
-
self.context.add_query(qry)
|
|
469
|
-
return self
|
|
470
|
-
|
|
471
354
|
def amplify(self, request: AmplifyRequestParams) -> ClientResult[ClientAmplifyAnywhereResults]:
|
|
472
355
|
"""Amplify operation.
|
|
473
356
|
|
|
@@ -64,13 +64,6 @@ class RepostPage(SitePage):
|
|
|
64
64
|
"""Gets the ShouldSaveAsDraft property"""
|
|
65
65
|
return self.properties.get("ShouldSaveAsDraft", None)
|
|
66
66
|
|
|
67
|
-
def is_content_type_available(self) -> ClientResult[bool]:
|
|
68
|
-
"""IsContentTypeAvailable operation."""
|
|
69
|
-
return_type = ClientResult(self.context, bool())
|
|
70
|
-
qry = FunctionQuery(self, "IsContentTypeAvailable", [], return_type)
|
|
71
|
-
self.context.add_query(qry)
|
|
72
|
-
return return_type
|
|
73
|
-
|
|
74
67
|
def amplify(self, request: AmplifyRequestParams) -> ClientResult[ClientAmplifyAnywhereResults]:
|
|
75
68
|
"""Amplify operation.
|
|
76
69
|
|
|
@@ -47,13 +47,6 @@ class TopicSitePage(SitePage):
|
|
|
47
47
|
def entity_type_name(self):
|
|
48
48
|
return "SP.Publishing.TopicSitePage"
|
|
49
49
|
|
|
50
|
-
def is_content_type_available(self) -> ClientResult[bool]:
|
|
51
|
-
"""IsContentTypeAvailable operation."""
|
|
52
|
-
return_type = ClientResult(self.context, bool())
|
|
53
|
-
qry = FunctionQuery(self, "IsContentTypeAvailable", [], return_type)
|
|
54
|
-
self.context.add_query(qry)
|
|
55
|
-
return return_type
|
|
56
|
-
|
|
57
50
|
def amplify(self, request: AmplifyRequestParams) -> ClientResult[ClientAmplifyAnywhereResults]:
|
|
58
51
|
"""Amplify operation.
|
|
59
52
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
from typing import Optional
|
|
2
2
|
|
|
3
|
-
from typing_extensions import Self
|
|
4
|
-
|
|
5
|
-
from office365.runtime.client_result import ClientResult
|
|
6
|
-
from office365.runtime.queries.function import FunctionQuery
|
|
7
|
-
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
8
3
|
from office365.sharepoint.entity import Entity
|
|
9
4
|
|
|
10
5
|
|
|
@@ -27,38 +22,3 @@ class SubtitleFile(Entity):
|
|
|
27
22
|
@property
|
|
28
23
|
def entity_type_name(self):
|
|
29
24
|
return "SP.Publishing.SubtitleFile"
|
|
30
|
-
|
|
31
|
-
def add(self, language: str, extension: str, stream: bytes) -> Self:
|
|
32
|
-
"""Add operation.
|
|
33
|
-
|
|
34
|
-
Args:
|
|
35
|
-
language (str): language parameter
|
|
36
|
-
extension (str): extension parameter
|
|
37
|
-
stream (bytes): stream parameter
|
|
38
|
-
"""
|
|
39
|
-
qry = ServiceOperationQuery(
|
|
40
|
-
self, "Add", None, {"language": language, "extension": extension, "stream": stream}, None, None
|
|
41
|
-
)
|
|
42
|
-
self.context.add_query(qry)
|
|
43
|
-
return self
|
|
44
|
-
|
|
45
|
-
def get_subtitle_file(self, name: str) -> ClientResult[bytes]:
|
|
46
|
-
"""GetSubtitleFile operation.
|
|
47
|
-
|
|
48
|
-
Args:
|
|
49
|
-
name (str): name parameter
|
|
50
|
-
"""
|
|
51
|
-
return_type = ClientResult(self.context, bytes())
|
|
52
|
-
qry = FunctionQuery(self, "GetSubtitleFile", [name], return_type, return_raw_content=True)
|
|
53
|
-
self.context.add_query(qry)
|
|
54
|
-
return return_type
|
|
55
|
-
|
|
56
|
-
def remove(self, name: str) -> Self:
|
|
57
|
-
"""Remove operation.
|
|
58
|
-
|
|
59
|
-
Args:
|
|
60
|
-
name (str): name parameter
|
|
61
|
-
"""
|
|
62
|
-
qry = ServiceOperationQuery(self, "Remove", None, {"name": name}, None, None)
|
|
63
|
-
self.context.add_query(qry)
|
|
64
|
-
return self
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from office365.runtime.client_result import ClientResult
|
|
4
|
+
from office365.runtime.queries.function import FunctionQuery
|
|
5
|
+
from office365.sharepoint.entity import Entity
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ConsumerQuotaInfoApi(Entity):
|
|
9
|
+
def get_quota_info(self) -> ClientResult[str]:
|
|
10
|
+
"""GetQuotaInfo operation."""
|
|
11
|
+
return_type = ClientResult(self.context, str())
|
|
12
|
+
qry = FunctionQuery(self, "GetQuotaInfo", [], return_type)
|
|
13
|
+
self.context.add_query(qry)
|
|
14
|
+
return return_type
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from office365.runtime.client_result import ClientResult
|
|
4
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
5
|
+
from office365.runtime.types.collections import StringCollection
|
|
1
6
|
from office365.sharepoint.entity import Entity
|
|
2
7
|
|
|
3
8
|
|
|
@@ -5,3 +10,21 @@ class NonQuotaBackfillApi(Entity):
|
|
|
5
10
|
@property
|
|
6
11
|
def entity_type_name(self):
|
|
7
12
|
return "Microsoft.SharePoint.QuotaManagement.Consumer.NonQuotaBackfillApi"
|
|
13
|
+
|
|
14
|
+
def backfill_non_quota(self, backfill_userfacts: list[str]) -> ClientResult[str]:
|
|
15
|
+
"""BackfillNonQuota operation.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
backfill_userfacts (list[str]): backfillUserfacts parameter
|
|
19
|
+
"""
|
|
20
|
+
return_type = ClientResult(self.context, str())
|
|
21
|
+
qry = ServiceOperationQuery(
|
|
22
|
+
self,
|
|
23
|
+
"BackfillNonQuota",
|
|
24
|
+
None,
|
|
25
|
+
{"backfillUserfacts": StringCollection(backfill_userfacts)},
|
|
26
|
+
None,
|
|
27
|
+
return_type,
|
|
28
|
+
)
|
|
29
|
+
self.context.add_query(qry)
|
|
30
|
+
return return_type
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from office365.runtime.client_result import ClientResult
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -5,3 +7,10 @@ class NonQuotaMigrationApi(Entity):
|
|
|
5
7
|
@property
|
|
6
8
|
def entity_type_name(self) -> str:
|
|
7
9
|
return "Microsoft.SharePoint.QuotaManagement.Consumer.NonQuotaMigrationApi"
|
|
10
|
+
|
|
11
|
+
def migrate_non_quota(self) -> ClientResult[str]:
|
|
12
|
+
"""MigrateNonQuota operation."""
|
|
13
|
+
return_type = ClientResult(self.context, str())
|
|
14
|
+
qry = ServiceOperationQuery(self, "MigrateNonQuota", None, {}, None, return_type)
|
|
15
|
+
self.context.add_query(qry)
|
|
16
|
+
return return_type
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from office365.runtime.client_result import ClientResult
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -5,3 +7,14 @@ class QuotaMigrationApi(Entity):
|
|
|
5
7
|
@property
|
|
6
8
|
def entity_type_name(self) -> str:
|
|
7
9
|
return "Microsoft.SharePoint.QuotaManagement.Consumer.QuotaMigrationApi"
|
|
10
|
+
|
|
11
|
+
def migrate_quota(self, is_max_quota_call: bool) -> ClientResult[str]:
|
|
12
|
+
"""MigrateQuota operation.
|
|
13
|
+
|
|
14
|
+
Args:
|
|
15
|
+
is_max_quota_call (bool): IsMaxQuotaCall parameter
|
|
16
|
+
"""
|
|
17
|
+
return_type = ClientResult(self.context, str())
|
|
18
|
+
qry = ServiceOperationQuery(self, "MigrateQuota", None, {"IsMaxQuotaCall": is_max_quota_call}, None, return_type)
|
|
19
|
+
self.context.add_query(qry)
|
|
20
|
+
return return_type
|
office365/sharepoint/request.py
CHANGED
|
@@ -20,6 +20,7 @@ from office365.runtime.odata.v3.json_light_format import JsonLightFormat
|
|
|
20
20
|
from office365.runtime.queries.client_query import ClientQuery
|
|
21
21
|
from office365.runtime.queries.delete_entity import DeleteEntityQuery
|
|
22
22
|
from office365.runtime.queries.update_entity import UpdateEntityQuery
|
|
23
|
+
from office365.sharepoint.exceptions import SecurityValidationException
|
|
23
24
|
from office365.sharepoint.webs.context_web_information import ContextWebInformation
|
|
24
25
|
|
|
25
26
|
|
|
@@ -70,7 +71,14 @@ class SharePointRequest(ODataRequest):
|
|
|
70
71
|
|
|
71
72
|
def _authenticate_request(self, request: RequestOptions) -> None:
|
|
72
73
|
"""Authenticate the request, resolving the auth context lazily so it can be
|
|
73
|
-
swapped via :meth:`reuse`.
|
|
74
|
+
swapped via :meth:`reuse`.
|
|
75
|
+
|
|
76
|
+
A transport carrying its own handler (``session.auth``, e.g. ``HttpNtlmAuth``)
|
|
77
|
+
signs the request itself. Such a session counts as credentials when no
|
|
78
|
+
provider is configured on the auth context.
|
|
79
|
+
"""
|
|
80
|
+
if not self._auth_context.is_configured and self._transport.auth is not None:
|
|
81
|
+
return
|
|
74
82
|
self._auth_context.authenticate_request(request)
|
|
75
83
|
|
|
76
84
|
def set_base_url(self, url: str) -> Self:
|
|
@@ -102,28 +110,61 @@ class SharePointRequest(ODataRequest):
|
|
|
102
110
|
request.ensure_header("IF-MATCH", "*")
|
|
103
111
|
return request
|
|
104
112
|
|
|
105
|
-
def
|
|
106
|
-
"""
|
|
107
|
-
client = ODataRequest(self._base_url, JsonLightFormat())
|
|
108
|
-
client._transport = self._transport
|
|
109
|
-
client.beforeExecute += self._auth_context.authenticate_request
|
|
110
|
-
request = RequestOptions(f"{self.service_root_url}/contextInfo")
|
|
111
|
-
request.method = HttpMethod.Post
|
|
112
|
-
response = client.execute_request_direct(request)
|
|
113
|
-
json_format = JsonLightFormat()
|
|
114
|
-
json_format.function = "GetContextWebInformation"
|
|
115
|
-
return_value = ContextWebInformation()
|
|
116
|
-
client.map_json(response.json(), return_value, json_format)
|
|
117
|
-
return return_value
|
|
113
|
+
def _fetch_context_web_information(self) -> ContextWebInformation:
|
|
114
|
+
"""Fetches the form digest (``/_api/contextInfo``), retrying throttling.
|
|
118
115
|
|
|
119
|
-
|
|
116
|
+
A throttled digest refresh would otherwise abort the whole run; retry
|
|
117
|
+
transient failures honoring the server's ``Retry-After``.
|
|
118
|
+
"""
|
|
119
|
+
from office365.runtime.retry import response_retry_after, retry
|
|
120
|
+
|
|
121
|
+
def _attempt() -> ContextWebInformation:
|
|
122
|
+
client = ODataRequest(self._base_url, JsonLightFormat())
|
|
123
|
+
client._transport = self._transport
|
|
124
|
+
client.beforeExecute += self._authenticate_request
|
|
125
|
+
request = RequestOptions(f"{self.service_root_url}/contextInfo")
|
|
126
|
+
request.method = HttpMethod.Post
|
|
127
|
+
response = client.execute_request_direct(request)
|
|
128
|
+
json_format = JsonLightFormat()
|
|
129
|
+
json_format.function = "GetContextWebInformation"
|
|
130
|
+
return_value = ContextWebInformation()
|
|
131
|
+
client.map_json(response.json(), return_value, json_format)
|
|
132
|
+
return return_value
|
|
133
|
+
|
|
134
|
+
return retry(
|
|
135
|
+
_attempt,
|
|
136
|
+
on_failure=lambda _attempt_num, ex: response_retry_after(getattr(ex, "response", None)),
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
def _ensure_digest(self) -> None:
|
|
140
|
+
"""Single-flight fetch of a valid form digest."""
|
|
120
141
|
if not self.context_info.is_valid:
|
|
121
142
|
with self._digest_lock:
|
|
122
143
|
if not self.context_info.is_valid:
|
|
123
|
-
self._ctx_web_info = self.
|
|
144
|
+
self._ctx_web_info = self._fetch_context_web_information()
|
|
145
|
+
|
|
146
|
+
def warm_up(self) -> None:
|
|
147
|
+
"""Fetch the form digest once (e.g. before dispatching parallel batches)."""
|
|
148
|
+
self._ensure_digest()
|
|
149
|
+
|
|
150
|
+
def invalidate_digest(self) -> None:
|
|
151
|
+
"""Drop the cached digest so the next request re-fetches it."""
|
|
152
|
+
with self._digest_lock:
|
|
153
|
+
self._ctx_web_info = None
|
|
154
|
+
|
|
155
|
+
def ensure_form_digest(self, request: RequestOptions) -> None:
|
|
156
|
+
self._ensure_digest()
|
|
124
157
|
assert self._ctx_web_info is not None
|
|
125
158
|
request.set_header("X-RequestDigest", self._ctx_web_info.FormDigestValue)
|
|
126
159
|
|
|
160
|
+
def execute_request_direct(self, request: RequestOptions) -> Response:
|
|
161
|
+
"""Send a request, recovering once from an expired/invalidated form digest."""
|
|
162
|
+
try:
|
|
163
|
+
return super().execute_request_direct(request)
|
|
164
|
+
except SecurityValidationException:
|
|
165
|
+
self.invalidate_digest()
|
|
166
|
+
return super().execute_request_direct(request)
|
|
167
|
+
|
|
127
168
|
@property
|
|
128
169
|
def context_info(self) -> ContextWebInformation:
|
|
129
170
|
"""Returns a ContextWebInformation object that specifies metadata about the site."""
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
from datetime import datetime
|
|
3
4
|
from typing import TYPE_CHECKING, Optional
|
|
4
5
|
|
|
5
6
|
from office365.runtime.client_result import ClientResult
|
|
@@ -28,13 +29,7 @@ class DocumentCrawlLog(Entity):
|
|
|
28
29
|
context.add_query(qry)
|
|
29
30
|
return return_type
|
|
30
31
|
|
|
31
|
-
def get_crawled_urls(
|
|
32
|
-
self,
|
|
33
|
-
get_count_only=False,
|
|
34
|
-
max_rows=None,
|
|
35
|
-
query_string=None,
|
|
36
|
-
content_source_id=None,
|
|
37
|
-
):
|
|
32
|
+
def get_crawled_urls(self, get_count_only=False, max_rows=None, query_string=None, content_source_id=None):
|
|
38
33
|
"""Retrieves information about all the contents that were crawled.
|
|
39
34
|
|
|
40
35
|
Args:
|
|
@@ -70,3 +65,25 @@ class DocumentCrawlLog(Entity):
|
|
|
70
65
|
@property
|
|
71
66
|
def entity_type_name(self):
|
|
72
67
|
return "Microsoft.SharePoint.Client.Search.Administration.DocumentCrawlLog"
|
|
68
|
+
|
|
69
|
+
def get_unsuccesful_crawled_urls_for_ediscovery(
|
|
70
|
+
self, display_url: str, start_date_time: datetime, end_date_time: datetime
|
|
71
|
+
) -> ClientResult[SimpleDataTable]:
|
|
72
|
+
"""GetUnsuccesfulCrawledUrlsForEdiscovery operation.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
display_url (str): displayUrl parameter
|
|
76
|
+
start_date_time (datetime): startDateTime parameter
|
|
77
|
+
end_date_time (datetime): endDateTime parameter
|
|
78
|
+
"""
|
|
79
|
+
return_type = ClientResult(self.context, SimpleDataTable())
|
|
80
|
+
qry = ServiceOperationQuery(
|
|
81
|
+
self,
|
|
82
|
+
"GetUnsuccesfulCrawledUrlsForEdiscovery",
|
|
83
|
+
None,
|
|
84
|
+
{"displayUrl": display_url, "startDateTime": start_date_time, "endDateTime": end_date_time},
|
|
85
|
+
None,
|
|
86
|
+
return_type,
|
|
87
|
+
)
|
|
88
|
+
self.context.add_query(qry)
|
|
89
|
+
return return_type
|
|
@@ -57,3 +57,32 @@ class TenantCrawlVersionsInfoProvider(Entity):
|
|
|
57
57
|
@property
|
|
58
58
|
def entity_type_name(self):
|
|
59
59
|
return "Microsoft.SharePoint.Client.Search.Administration.TenantCrawlVersionsInfoProvider"
|
|
60
|
+
|
|
61
|
+
def enable_crawl_versions(self, site_id: str) -> ClientResult[bool]:
|
|
62
|
+
"""EnableCrawlVersions operation.
|
|
63
|
+
|
|
64
|
+
Args:
|
|
65
|
+
site_id (UUID): siteId parameter
|
|
66
|
+
"""
|
|
67
|
+
return_type = ClientResult(self.context, bool())
|
|
68
|
+
qry = ServiceOperationQuery(self, "EnableCrawlVersions", None, {"siteId": site_id}, None, return_type)
|
|
69
|
+
self.context.add_query(qry)
|
|
70
|
+
return return_type
|
|
71
|
+
|
|
72
|
+
def enable_crawl_versions_for_tenant(self) -> ClientResult[bool]:
|
|
73
|
+
"""EnableCrawlVersionsForTenant operation."""
|
|
74
|
+
return_type = ClientResult(self.context, bool())
|
|
75
|
+
qry = ServiceOperationQuery(self, "EnableCrawlVersionsForTenant", None, {}, None, return_type)
|
|
76
|
+
self.context.add_query(qry)
|
|
77
|
+
return return_type
|
|
78
|
+
|
|
79
|
+
def get_site_crawl_version_status(self, site_id: str) -> ClientResult[dict]:
|
|
80
|
+
"""GetSiteCrawlVersionStatus operation.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
site_id (UUID): siteId parameter
|
|
84
|
+
"""
|
|
85
|
+
return_type = ClientResult(self.context, dict())
|
|
86
|
+
qry = ServiceOperationQuery(self, "GetSiteCrawlVersionStatus", None, {"siteId": site_id}, None, return_type)
|
|
87
|
+
self.context.add_query(qry)
|
|
88
|
+
return return_type
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from office365.runtime.client_result import ClientResult
|
|
2
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
1
3
|
from office365.sharepoint.entity import Entity
|
|
2
4
|
|
|
3
5
|
|
|
@@ -7,3 +9,24 @@ class TenantRecycleBinInfoProvider(Entity):
|
|
|
7
9
|
@property
|
|
8
10
|
def entity_type_name(self) -> str:
|
|
9
11
|
return "Microsoft.SharePoint.Client.Search.Administration.TenantRecycleBinInfoProvider"
|
|
12
|
+
|
|
13
|
+
def disable_recycle_bin_discoverability_for_tenant(self) -> ClientResult[bool]:
|
|
14
|
+
"""DisableRecycleBinDiscoverabilityForTenant operation."""
|
|
15
|
+
return_type = ClientResult(self.context, bool())
|
|
16
|
+
qry = ServiceOperationQuery(self, "DisableRecycleBinDiscoverabilityForTenant", None, {}, None, return_type)
|
|
17
|
+
self.context.add_query(qry)
|
|
18
|
+
return return_type
|
|
19
|
+
|
|
20
|
+
def enable_recycle_bin_discoverability_for_tenant(self) -> ClientResult[bool]:
|
|
21
|
+
"""EnableRecycleBinDiscoverabilityForTenant operation."""
|
|
22
|
+
return_type = ClientResult(self.context, bool())
|
|
23
|
+
qry = ServiceOperationQuery(self, "EnableRecycleBinDiscoverabilityForTenant", None, {}, None, return_type)
|
|
24
|
+
self.context.add_query(qry)
|
|
25
|
+
return return_type
|
|
26
|
+
|
|
27
|
+
def is_recycle_bin_discoverability_enabled_for_tenant(self) -> ClientResult[bool]:
|
|
28
|
+
"""IsRecycleBinDiscoverabilityEnabledForTenant operation."""
|
|
29
|
+
return_type = ClientResult(self.context, bool())
|
|
30
|
+
qry = ServiceOperationQuery(self, "IsRecycleBinDiscoverabilityEnabledForTenant", None, {}, None, return_type)
|
|
31
|
+
self.context.add_query(qry)
|
|
32
|
+
return return_type
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
from uuid import UUID
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Self
|
|
4
|
+
|
|
1
5
|
from office365.runtime.client_result import ClientResult
|
|
2
6
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
3
7
|
from office365.sharepoint.entity import Entity
|
|
@@ -13,3 +17,66 @@ class SiteContentProcessingInfoProvider(Entity):
|
|
|
13
17
|
@property
|
|
14
18
|
def entity_type_name(self):
|
|
15
19
|
return "Microsoft.SharePoint.Client.Search.Administration.SiteContentProcessingInfoProvider"
|
|
20
|
+
|
|
21
|
+
def notify_content_processing_status(self, web_id: str, list_id: str, unique_id: str, properties: dict) -> Self:
|
|
22
|
+
"""NotifyContentProcessingStatus operation.
|
|
23
|
+
|
|
24
|
+
Args:
|
|
25
|
+
web_id (UUID): webId parameter
|
|
26
|
+
list_id (UUID): listId parameter
|
|
27
|
+
unique_id (UUID): uniqueId parameter
|
|
28
|
+
properties (dict): properties parameter
|
|
29
|
+
"""
|
|
30
|
+
qry = ServiceOperationQuery(
|
|
31
|
+
self,
|
|
32
|
+
"NotifyContentProcessingStatus",
|
|
33
|
+
None,
|
|
34
|
+
{"webId": web_id, "listId": list_id, "uniqueId": unique_id, "properties": properties},
|
|
35
|
+
None,
|
|
36
|
+
None,
|
|
37
|
+
)
|
|
38
|
+
self.context.add_query(qry)
|
|
39
|
+
return self
|
|
40
|
+
|
|
41
|
+
def report_content_processing_status(
|
|
42
|
+
self,
|
|
43
|
+
web_id: UUID,
|
|
44
|
+
list_id: UUID,
|
|
45
|
+
unique_id: UUID,
|
|
46
|
+
azure_container_token_uri: str,
|
|
47
|
+
encryption_key: bytes,
|
|
48
|
+
priority: int,
|
|
49
|
+
error_code: int,
|
|
50
|
+
error_description: str,
|
|
51
|
+
) -> Self:
|
|
52
|
+
"""ReportContentProcessingStatus operation.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
web_id (str): webId parameter
|
|
56
|
+
list_id (str): listId parameter
|
|
57
|
+
unique_id (str): uniqueId parameter
|
|
58
|
+
azure_container_token_uri (str): azureContainerTokenUri parameter
|
|
59
|
+
encryption_key (bytes): encryptionKey parameter
|
|
60
|
+
priority (int): priority parameter
|
|
61
|
+
error_code (int): errorCode parameter
|
|
62
|
+
error_description (str): errorDescription parameter
|
|
63
|
+
"""
|
|
64
|
+
qry = ServiceOperationQuery(
|
|
65
|
+
self,
|
|
66
|
+
"ReportContentProcessingStatus",
|
|
67
|
+
None,
|
|
68
|
+
{
|
|
69
|
+
"webId": web_id,
|
|
70
|
+
"listId": list_id,
|
|
71
|
+
"uniqueId": unique_id,
|
|
72
|
+
"azureContainerTokenUri": azure_container_token_uri,
|
|
73
|
+
"encryptionKey": encryption_key,
|
|
74
|
+
"priority": priority,
|
|
75
|
+
"errorCode": error_code,
|
|
76
|
+
"errorDescription": error_description,
|
|
77
|
+
},
|
|
78
|
+
None,
|
|
79
|
+
None,
|
|
80
|
+
)
|
|
81
|
+
self.context.add_query(qry)
|
|
82
|
+
return self
|