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.
Files changed (245) hide show
  1. office365/communications/callrecords/call_record.py +18 -0
  2. office365/communications/calls/call.py +3 -0
  3. office365/communications/presences/presence.py +3 -0
  4. office365/communications/quotas.py +66 -0
  5. office365/communications/virtualevents/virtual_event.py +3 -0
  6. office365/directory/domains/domain.py +3 -0
  7. office365/directory/licenses/subscribed_sku.py +3 -0
  8. office365/directory/objects/object.py +3 -0
  9. office365/directory/quotas.py +34 -0
  10. office365/entity_collection.py +2 -2
  11. office365/graph_client.py +46 -2
  12. office365/limits.py +66 -0
  13. office365/migration/__init__.py +6 -1
  14. office365/migration/adapters/__init__.py +14 -4
  15. office365/migration/adapters/filesystem.py +4 -1
  16. office365/migration/assessment/export.py +5 -5
  17. office365/migration/assessment/issue.py +19 -0
  18. office365/migration/assessment/report.py +11 -0
  19. office365/migration/assessment/scanners/base.py +37 -49
  20. office365/migration/base.py +33 -8
  21. office365/migration/checkpoint.py +1 -1
  22. office365/migration/outlook/assessor.py +4 -4
  23. office365/migration/package/__init__.py +82 -0
  24. office365/migration/package/builder.py +603 -0
  25. office365/migration/package/crypto.py +54 -0
  26. office365/migration/package/manifest_xml.py +495 -0
  27. office365/migration/package/staging.py +180 -0
  28. office365/migration/report.py +7 -2
  29. office365/migration/report_io.py +79 -0
  30. office365/migration/runner.py +117 -10
  31. office365/migration/server_job.py +126 -14
  32. office365/migration/session.py +132 -49
  33. office365/migration/settings.py +67 -0
  34. office365/migration/sharepoint/__init__.py +2 -0
  35. office365/migration/sharepoint/adapters.py +207 -41
  36. office365/migration/sharepoint/assessor.py +45 -9
  37. office365/migration/sharepoint/options.py +57 -0
  38. office365/migration/sharepoint/package_target.py +209 -0
  39. office365/migration/sharepoint/registry.py +22 -0
  40. office365/migration/sharepoint/resolvers.py +96 -0
  41. office365/migration/sharepoint/scanners/__init__.py +29 -0
  42. office365/migration/sharepoint/scanners/browser_file_handling.py +55 -0
  43. office365/migration/sharepoint/scanners/checked_out_files.py +57 -0
  44. office365/migration/sharepoint/scanners/file_versions.py +56 -0
  45. office365/migration/sharepoint/scanners/files.py +5 -2
  46. office365/migration/sharepoint/scanners/large_excel_files.py +56 -0
  47. office365/migration/sharepoint/scanners/large_lists.py +58 -0
  48. office365/migration/sharepoint/scanners/large_sites.py +4 -3
  49. office365/migration/sharepoint/scanners/long_onedrive_urls.py +52 -0
  50. office365/migration/sharepoint/scanners/lookup.py +38 -0
  51. office365/migration/sharepoint/scanners/paths.py +9 -4
  52. office365/migration/sharepoint/scanners/permissions.py +20 -2
  53. office365/migration/sharepoint/scanners/smat.py +51 -0
  54. office365/migration/sharepoint/scanners/summary.py +1 -0
  55. office365/migration/sharepoint/scanners/thicket_folders.py +38 -0
  56. office365/migration/sharepoint/scanners/unsupported_site_templates.py +90 -0
  57. office365/migration/sharepoint/tenant_assessor.py +5 -3
  58. office365/migration/sharepoint/transfer.py +4 -2
  59. office365/migration/tasks.py +121 -0
  60. office365/migration/validators.py +2 -19
  61. office365/onedrive/driveitems/driveItem.py +116 -12
  62. office365/onedrive/termstore/groups/collection.py +2 -9
  63. office365/onedrive/termstore/sets/collection.py +2 -9
  64. office365/onedrive/termstore/terms/collection.py +3 -10
  65. office365/onedrive/workbooks/workbook.py +7 -0
  66. office365/outlook/contacts/folders/collection.py +4 -13
  67. office365/runtime/auth/authentication_context.py +5 -0
  68. office365/runtime/client_object.py +18 -0
  69. office365/runtime/client_object_collection.py +75 -245
  70. office365/runtime/client_request.py +77 -1
  71. office365/runtime/client_request_exception.py +127 -39
  72. office365/runtime/client_runtime_context.py +79 -8
  73. office365/runtime/converters/csv_writer.py +10 -4
  74. office365/runtime/converters/dataframe.py +84 -4
  75. office365/runtime/converters/json_file.py +12 -3
  76. office365/runtime/converters/parquet.py +67 -0
  77. office365/runtime/converters/records.py +31 -12
  78. office365/runtime/converters/registry.py +185 -0
  79. office365/runtime/converters/scalars.py +31 -0
  80. office365/runtime/converters/sql.py +69 -0
  81. office365/runtime/converters/streamers.py +105 -0
  82. office365/runtime/converters/streams.py +42 -0
  83. office365/runtime/converters/upsert.py +101 -0
  84. office365/runtime/exceptions.py +105 -0
  85. office365/runtime/http/prefer.py +26 -0
  86. office365/runtime/http/throttling.py +258 -56
  87. office365/runtime/imports.py +571 -0
  88. office365/runtime/limits.py +455 -0
  89. office365/runtime/odata/request.py +11 -2
  90. office365/runtime/odata/type.py +1 -0
  91. office365/runtime/odata/v3/batch_request.py +4 -2
  92. office365/runtime/odata/v4/batch_request.py +22 -7
  93. office365/runtime/operations.py +29 -0
  94. office365/runtime/parallel.py +12 -14
  95. office365/runtime/paths/v4/entity.py +2 -2
  96. office365/runtime/queries/batch.py +18 -1
  97. office365/runtime/queries/get_or_create.py +109 -0
  98. office365/runtime/record_collection.py +443 -0
  99. office365/runtime/retry.py +92 -26
  100. office365/runtime/transport/base.py +6 -1
  101. office365/runtime/transport/requests_transport.py +4 -0
  102. office365/runtime/transport/throttled_transport.py +67 -0
  103. office365/runtime/verification.py +40 -0
  104. office365/sharepoint/activities/logger.py +118 -8
  105. office365/sharepoint/administration/analytics/usage_service.py +15 -7
  106. office365/sharepoint/administration/sitemove/service.py +791 -8
  107. office365/sharepoint/alerts/alert.py +79 -0
  108. office365/sharepoint/apps/app_collection.py +25 -0
  109. office365/sharepoint/apps/launcher.py +16 -0
  110. office365/sharepoint/authpolicy/tenant/compliancereport.py +5 -0
  111. office365/sharepoint/businessdata/app_bdc_catalog.py +135 -0
  112. office365/sharepoint/businessdata/entityfieldvaluedictionary.py +65 -0
  113. office365/sharepoint/businessdata/entityidentifier.py +23 -0
  114. office365/sharepoint/businessdata/entityinstance.py +52 -0
  115. office365/sharepoint/businessdata/entityview.py +31 -0
  116. office365/sharepoint/businessdata/externalsubscriptionstore.py +9 -0
  117. office365/sharepoint/businessdata/typedescriptor.py +37 -0
  118. office365/sharepoint/client_context.py +40 -23
  119. office365/sharepoint/clientsidecomponent/hostedapps/app.py +21 -0
  120. office365/sharepoint/clientsidecomponent/hostedapps/manager.py +16 -0
  121. office365/sharepoint/comments/comment.py +84 -2
  122. office365/sharepoint/contentcenter/machinelearning/models/model.py +0 -23
  123. office365/sharepoint/contentcenter/machinelearning/publications/publication.py +0 -9
  124. office365/sharepoint/contentcenter/machinelearning/samples/sample.py +0 -14
  125. office365/sharepoint/contentcenter/machinelearning/workitems/item.py +0 -80
  126. office365/sharepoint/contentsolution/template_api.py +148 -0
  127. office365/sharepoint/contenttypes/collection.py +32 -10
  128. office365/sharepoint/convergence/addnoliveblobsinodcservicestateapi.py +9 -0
  129. office365/sharepoint/convergence/consumer_permissions.py +15 -0
  130. office365/sharepoint/convergence/migration_complete_state_api.py +25 -0
  131. office365/sharepoint/convergence/odcmetadatacleanedupapi.py +9 -0
  132. office365/sharepoint/documentmanagement/document_id.py +12 -0
  133. office365/sharepoint/entity.py +11 -2
  134. office365/sharepoint/entity_collection.py +2 -2
  135. office365/sharepoint/exceptions.py +194 -0
  136. office365/sharepoint/fields/builtin_field_id.py +45 -34
  137. office365/sharepoint/fields/builtin_field_name.py +123 -0
  138. office365/sharepoint/fields/coercion.py +131 -0
  139. office365/sharepoint/fields/collection.py +54 -37
  140. office365/sharepoint/fields/field.py +17 -0
  141. office365/sharepoint/fields/name.py +46 -2
  142. office365/sharepoint/files/collection.py +7 -1
  143. office365/sharepoint/files/file.py +54 -8
  144. office365/sharepoint/files/versions/version.py +38 -13
  145. office365/sharepoint/folders/collection.py +4 -0
  146. office365/sharepoint/folders/folder.py +91 -21
  147. office365/sharepoint/htmlpages/html_page.py +16 -0
  148. office365/sharepoint/htmlpages/html_page_service.py +19 -0
  149. office365/sharepoint/ir/migration.py +9 -0
  150. office365/sharepoint/listitems/caml/__init__.py +31 -0
  151. office365/sharepoint/listitems/caml/builder.py +129 -0
  152. office365/sharepoint/listitems/caml/expressions.py +424 -0
  153. office365/sharepoint/listitems/caml/fields.py +68 -0
  154. office365/sharepoint/listitems/caml/guard.py +63 -0
  155. office365/sharepoint/listitems/caml/query.py +71 -2
  156. office365/sharepoint/listitems/caml/values.py +113 -0
  157. office365/sharepoint/listitems/collection.py +21 -20
  158. office365/sharepoint/listitems/upsert.py +75 -0
  159. office365/sharepoint/lists/collection.py +29 -22
  160. office365/sharepoint/lists/exporter.py +4 -3
  161. office365/sharepoint/lists/list.py +397 -39
  162. office365/sharepoint/lists/smart_wiki_library_utility.py +58 -0
  163. office365/sharepoint/logger/export.py +12 -0
  164. office365/sharepoint/marketplace/app_metadata.py +97 -1
  165. office365/sharepoint/marketplace/appstatequeryjobdefinition.py +9 -0
  166. office365/sharepoint/marketplace/corporatecuratedgallery/carddesigns/card_designs.py +35 -0
  167. office365/sharepoint/marketplace/sitecollection/appcatalog/allowed_item.py +5 -0
  168. office365/sharepoint/marketplace/tenant/appcatalog/accessor.py +107 -30
  169. office365/sharepoint/microfeed/data.py +0 -6
  170. office365/sharepoint/microservice/manager.py +61 -0
  171. office365/sharepoint/migrationcenter/common/task.py +193 -4
  172. office365/sharepoint/migrationcenter/common/task_entity_data.py +1 -1
  173. office365/sharepoint/migrationcenter/deploy_status.py +13 -0
  174. office365/sharepoint/migrationcenter/service/properties.py +20 -0
  175. office365/sharepoint/migrationcenter/service/storage.py +34 -0
  176. office365/sharepoint/migrationcenter/spflight.py +13 -0
  177. office365/sharepoint/migrationcenter/urlparseresult.py +77 -0
  178. office365/sharepoint/multigeo/service/spmultigeoproxy.py +13 -0
  179. office365/sharepoint/navigation/servicerest.py +127 -0
  180. office365/sharepoint/oauth/authentication.py +13 -0
  181. office365/sharepoint/portal/theme_manager.py +120 -8
  182. office365/sharepoint/principal/users/user.py +10 -0
  183. office365/sharepoint/publishing/campaign/campaign.py +36 -1
  184. office365/sharepoint/publishing/feedvideopage.py +0 -7
  185. office365/sharepoint/publishing/pages/3d/page.py +0 -6
  186. office365/sharepoint/publishing/pages/page.py +0 -117
  187. office365/sharepoint/publishing/pages/reposts/repost.py +0 -7
  188. office365/sharepoint/publishing/pages/topics/topic.py +0 -7
  189. office365/sharepoint/publishing/subtitlefile.py +0 -40
  190. office365/sharepoint/quotamanagement/consumer/consumer_quota_info_api.py +14 -0
  191. office365/sharepoint/quotamanagement/consumer/non_quota_backfill_api.py +23 -0
  192. office365/sharepoint/quotamanagement/consumer/nonquotamigrationapi.py +9 -0
  193. office365/sharepoint/quotamanagement/consumer/quotamigrationapi.py +13 -0
  194. office365/sharepoint/request.py +57 -16
  195. office365/sharepoint/search/administration/document_crawl_log.py +24 -7
  196. office365/sharepoint/search/administration/providers/crawl_versions_info.py +29 -0
  197. office365/sharepoint/search/administration/providers/recycle_bin_info.py +23 -0
  198. office365/sharepoint/search/administration/providers/site_content_processing_info.py +67 -0
  199. office365/sharepoint/sites/site.py +976 -65
  200. office365/sharepoint/sites/siteprovisioninginfoprovider.py +13 -0
  201. office365/sharepoint/tenant/administration/datagovernance/insight_client.py +292 -23
  202. office365/sharepoint/tenant/administration/ddiadapter.py +97 -0
  203. office365/sharepoint/tenant/administration/internal/aad/collection.py +20 -0
  204. office365/sharepoint/tenant/administration/internal/aad/permission_grant.py +0 -19
  205. office365/sharepoint/tenant/administration/internal/appservice/permission_request.py +72 -1
  206. office365/sharepoint/tenant/administration/internal/appservice/principal.py +1 -3
  207. office365/sharepoint/tenant/administration/odb_license_enforcement_service.py +26 -0
  208. office365/sharepoint/tenant/administration/sites/properties.py +564 -6
  209. office365/sharepoint/tenant/administration/spdatagovernancesarrestapiclient.py +60 -1
  210. office365/sharepoint/tenant/insights/reports/manager.py +24 -12
  211. office365/sharepoint/tenant/management/office365_tenant.py +451 -2
  212. office365/sharepoint/tenantadministration/catalog_management_collection.py +69 -0
  213. office365/sharepoint/tenantadministration/catalog_management_custom_properties_collection.py +237 -0
  214. office365/sharepoint/tenantadministration/catalog_management_restricted_content_discovery_collection.py +56 -0
  215. office365/sharepoint/tenantadministration/sp_data_governance_client_exception.py +7 -0
  216. office365/sharepoint/thresholds.py +529 -0
  217. office365/sharepoint/translation/jobs/job.py +72 -2
  218. office365/sharepoint/translation/jobs/status.py +47 -9
  219. office365/sharepoint/translation/sync_translator.py +15 -2
  220. office365/sharepoint/utilities/move_copy_util.py +2 -1
  221. office365/sharepoint/viva/connections/page.py +27 -0
  222. office365/sharepoint/viva/home.py +38 -0
  223. office365/sharepoint/viva/learningmanager.py +9 -0
  224. office365/sharepoint/viva/vivaresources.py +60 -0
  225. office365/sharepoint/webhooks/subscription.py +0 -11
  226. office365/sharepoint/webparts/definitions/definition.py +13 -0
  227. office365/sharepoint/webparts/limited_manager.py +29 -7
  228. office365/sharepoint/webs/context_web_information.py +14 -9
  229. office365/sharepoint/webs/templates/__init__.py +11 -0
  230. office365/sharepoint/webs/templates/type.py +74 -15
  231. office365/sharepoint/workflow/definition.py +6 -0
  232. office365/sharepoint/workflow/deployment_service.py +155 -0
  233. office365/sharepoint/workflow/instances/service.py +33 -0
  234. office365/sharepoint/workflow/interopservice.py +68 -0
  235. office365/sharepoint/workflow/messagingservice.py +24 -0
  236. office365/sharepoint/workflow/servicesmanager.py +41 -2
  237. office365/sharepoint/workflow/subscriptions/service.py +67 -0
  238. office365/sharepoint/workflow/subscriptions/subscription.py +31 -0
  239. office365/sharepoint/workflow/task.py +425 -0
  240. office365_rest_python_client-3.2.0.dist-info/METADATA +605 -0
  241. {office365_rest_python_client-3.1.0.dist-info → office365_rest_python_client-3.2.0.dist-info}/RECORD +242 -185
  242. office365/migration/_util.py +0 -73
  243. office365/sharepoint/listitems/caml/types.py +0 -70
  244. office365_rest_python_client-3.1.0.dist-info/METADATA +0 -475
  245. {office365_rest_python_client-3.1.0.dist-info → office365_rest_python_client-3.2.0.dist-info}/WHEEL +0 -0
@@ -16,8 +16,7 @@ class SyncTranslator(Entity):
16
16
 
17
17
  def __init__(self, context, target_language: str):
18
18
  super().__init__(
19
- context,
20
- ServiceOperationPath("SP.Translation.SyncTranslator", {"targetLanguage": target_language}),
19
+ context, ServiceOperationPath("SP.Translation.SyncTranslator", {"targetLanguage": target_language})
21
20
  )
22
21
 
23
22
  def translate(self, input_file: str, output_file: str) -> ClientResult[TranslationItemInfo]:
@@ -44,3 +43,17 @@ class SyncTranslator(Entity):
44
43
  @property
45
44
  def entity_type_name(self) -> str:
46
45
  return "SP.Translation.SyncTranslator"
46
+
47
+ def translate_stream(self, input_file: bytes, file_extension: str) -> ClientResult[bytes]:
48
+ """TranslateStream operation.
49
+
50
+ Args:
51
+ input_file (bytes): inputFile parameter
52
+ file_extension (str): fileExtension parameter
53
+ """
54
+ return_type = ClientResult(self.context, bytes())
55
+ qry = ServiceOperationQuery(
56
+ self, "TranslateStream", None, {"inputFile": input_file, "fileExtension": file_extension}, None, return_type
57
+ )
58
+ self.context.add_query(qry)
59
+ return return_type
@@ -9,13 +9,14 @@ from office365.runtime.client_result import ClientResult
9
9
  from office365.runtime.operations import Progress, ProgressCallback
10
10
  from office365.runtime.queries.service_operation import ServiceOperationQuery
11
11
  from office365.sharepoint.entity import Entity
12
+ from office365.sharepoint.thresholds import Limits
12
13
  from office365.sharepoint.types.resource_path import ResourcePath as SPResPath
13
14
 
14
15
  if TYPE_CHECKING:
15
16
  from office365.sharepoint.files.file import File
16
17
  from office365.sharepoint.folders.folder import Folder
17
18
 
18
- _DEFAULT_CHUNK_SIZE = 4 * 1024 * 1024 # simple-upload threshold / upload-session chunk
19
+ _DEFAULT_CHUNK_SIZE = Limits.UPLOAD_SESSION_CHUNK.value # simple-upload threshold / upload-session chunk
19
20
 
20
21
  UploadSource = Union[
21
22
  str,
@@ -1,7 +1,34 @@
1
+ from office365.runtime.client_result import ClientResult
2
+ from office365.runtime.queries.function import FunctionQuery
3
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
1
4
  from office365.sharepoint.entity import Entity
5
+ from office365.sharepoint.viva.connections.configurationanddata import ConnectionsConfigurationAndData
6
+ from office365.sharepoint.viva.spotlightconfiguration import SpotlightConfiguration
2
7
 
3
8
 
4
9
  class VivaConnectionsPage(Entity):
5
10
  @property
6
11
  def entity_type_name(self):
7
12
  return "Microsoft.SharePoint.EmployeeEngagement.VivaConnectionsPage"
13
+
14
+ def get_data(self) -> ClientResult[ConnectionsConfigurationAndData]:
15
+ """GetData operation."""
16
+ return_type = ClientResult(self.context, ConnectionsConfigurationAndData())
17
+ qry = FunctionQuery(self, "GetData", [], return_type)
18
+ self.context.add_query(qry)
19
+ return return_type
20
+
21
+ def set_spotlight_configuration(
22
+ self, configuration: SpotlightConfiguration
23
+ ) -> ClientResult[ConnectionsConfigurationAndData]:
24
+ """SetSpotlightConfiguration operation.
25
+
26
+ Args:
27
+ configuration (SpotlightConfiguration): configuration parameter
28
+ """
29
+ return_type = ClientResult(self.context, ConnectionsConfigurationAndData())
30
+ qry = ServiceOperationQuery(
31
+ self, "SetSpotlightConfiguration", None, {"configuration": configuration}, None, return_type
32
+ )
33
+ self.context.add_query(qry)
34
+ return return_type
@@ -1,7 +1,45 @@
1
+ from typing_extensions import Self
2
+
3
+ from office365.runtime.client_result import ClientResult
4
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
1
5
  from office365.sharepoint.entity import Entity
6
+ from office365.sharepoint.viva.home_title_region import VivaHomeTitleRegion
7
+ from office365.sharepoint.viva.targetedsitedetails import TargetedSiteDetails
2
8
 
3
9
 
4
10
  class VivaHome(Entity):
5
11
  @property
6
12
  def entity_type_name(self):
7
13
  return "Microsoft.SharePoint.EmployeeEngagement.VivaHome"
14
+
15
+ def title_region(self, viva_home_title_region: VivaHomeTitleRegion) -> Self:
16
+ """TitleRegion operation.
17
+
18
+ Args:
19
+ viva_home_title_region (VivaHomeTitleRegion): vivaHomeTitleRegion parameter
20
+ """
21
+ qry = ServiceOperationQuery(
22
+ self, "TitleRegion", None, {"vivaHomeTitleRegion": viva_home_title_region}, None, None
23
+ )
24
+ self.context.add_query(qry)
25
+ return self
26
+
27
+ def update_go_to_vc_button_flag(
28
+ self, is_go_back_to_connections_button_disabled: bool
29
+ ) -> ClientResult[TargetedSiteDetails]:
30
+ """UpdateGoToVCButtonFlag operation.
31
+
32
+ Args:
33
+ is_go_back_to_connections_button_disabled (bool): isGoBackToConnectionsButtonDisabled parameter
34
+ """
35
+ return_type = ClientResult(self.context, TargetedSiteDetails())
36
+ qry = ServiceOperationQuery(
37
+ self,
38
+ "UpdateGoToVCButtonFlag",
39
+ None,
40
+ {"isGoBackToConnectionsButtonDisabled": is_go_back_to_connections_button_disabled},
41
+ None,
42
+ return_type,
43
+ )
44
+ self.context.add_query(qry)
45
+ return return_type
@@ -1,3 +1,6 @@
1
+ from typing_extensions import Self
2
+
3
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
1
4
  from office365.sharepoint.entity import Entity
2
5
 
3
6
 
@@ -5,3 +8,9 @@ class SPVivaLearningManager(Entity):
5
8
  @property
6
9
  def entity_type_name(self) -> str:
7
10
  return "Microsoft.SharePoint.Administration.Claims.SPVivaLearningManager"
11
+
12
+ def register_list_event_receiver(self) -> Self:
13
+ """RegisterListEventReceiver operation."""
14
+ qry = ServiceOperationQuery(self, "RegisterListEventReceiver", None, {}, None, None)
15
+ self.context.add_query(qry)
16
+ return self
@@ -1,7 +1,67 @@
1
+ from typing_extensions import Self
2
+
3
+ from office365.runtime.client_result import ClientResult
4
+ from office365.runtime.client_value_collection import ClientValueCollection
5
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
1
6
  from office365.sharepoint.entity import Entity
7
+ from office365.sharepoint.viva.resource_link import VivaResourceLink
2
8
 
3
9
 
4
10
  class VivaResources(Entity):
5
11
  @property
6
12
  def entity_type_name(self) -> str:
7
13
  return "Microsoft.SharePoint.EmployeeEngagement.VivaResources"
14
+
15
+ def add_link(self, new_link: VivaResourceLink) -> ClientResult[int]:
16
+ """AddLink operation.
17
+
18
+ Args:
19
+ new_link (VivaResourceLink): newLink parameter
20
+ """
21
+ return_type = ClientResult(self.context, int())
22
+ qry = ServiceOperationQuery(self, "AddLink", None, {"newLink": new_link}, None, return_type)
23
+ self.context.add_query(qry)
24
+ return return_type
25
+
26
+ def remove_link(self, id_: int) -> Self:
27
+ """RemoveLink operation.
28
+
29
+ Args:
30
+ id_ (int): id parameter
31
+ """
32
+ qry = ServiceOperationQuery(self, "RemoveLink", None, {"id": id_}, None, None)
33
+ self.context.add_query(qry)
34
+ return self
35
+
36
+ def reorder_link(self, link_id: int, prev_link_id: int) -> Self:
37
+ """ReorderLink operation.
38
+
39
+ Args:
40
+ link_id (int): linkId parameter
41
+ prev_link_id (int): prevLinkId parameter
42
+ """
43
+ qry = ServiceOperationQuery(
44
+ self, "ReorderLink", None, {"linkId": link_id, "prevLinkId": prev_link_id}, None, None
45
+ )
46
+ self.context.add_query(qry)
47
+ return self
48
+
49
+ def update_link(self, updated_link: VivaResourceLink) -> Self:
50
+ """UpdateLink operation.
51
+
52
+ Args:
53
+ updated_link (VivaResourceLink): updatedLink parameter
54
+ """
55
+ qry = ServiceOperationQuery(self, "UpdateLink", None, {"updatedLink": updated_link}, None, None)
56
+ self.context.add_query(qry)
57
+ return self
58
+
59
+ def update_links(self, links: ClientValueCollection[VivaResourceLink]) -> Self:
60
+ """UpdateLinks operation.
61
+
62
+ Args:
63
+ links (ClientValueCollection[VivaResourceLink]): links parameter
64
+ """
65
+ qry = ServiceOperationQuery(self, "UpdateLinks", None, {"links": links}, None, None)
66
+ self.context.add_query(qry)
67
+ return self
@@ -1,6 +1,5 @@
1
1
  from datetime import datetime
2
2
  from typing import Optional, Union
3
- from uuid import UUID
4
3
 
5
4
  from typing_extensions import Self
6
5
 
@@ -77,16 +76,6 @@ class Subscription(Entity):
77
76
  """Gets the scenarios property"""
78
77
  return self.properties.get("scenarios", StringCollection())
79
78
 
80
- def remove(self, subscription_id: UUID) -> Self:
81
- """Remove operation.
82
-
83
- Args:
84
- subscription_id (UUID): subscriptionId parameter
85
- """
86
- qry = ServiceOperationQuery(self, "Remove", None, {"subscriptionId": subscription_id}, None, None)
87
- self.context.add_query(qry)
88
- return self
89
-
90
79
  def delete(self) -> Self:
91
80
  """Delete operation."""
92
81
  qry = ServiceOperationQuery(self, "Delete", None, {}, None, None)
@@ -77,3 +77,16 @@ class WebPartDefinition(Entity):
77
77
  @property
78
78
  def entity_type_name(self):
79
79
  return "SP.WebParts.WebPartDefinition"
80
+
81
+ def move_web_part_to(self, zone_id: str, zone_index: int) -> Self:
82
+ """MoveWebPartTo operation.
83
+
84
+ Args:
85
+ zone_id (str): zoneID parameter
86
+ zone_index (int): zoneIndex parameter
87
+ """
88
+ qry = ServiceOperationQuery(
89
+ self, "MoveWebPartTo", None, {"zoneID": zone_id, "zoneIndex": zone_index}, None, None
90
+ )
91
+ self.context.add_query(qry)
92
+ return self
@@ -1,13 +1,11 @@
1
- from typing import Union
1
+ from typing import Optional, Union
2
2
 
3
3
  from office365.runtime.client_result import ClientResult
4
4
  from office365.runtime.paths.resource_path import ResourcePath
5
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
6
6
  from office365.runtime.types.odata_property import odata
7
7
  from office365.sharepoint.entity import Entity
8
- from office365.sharepoint.webparts.definitions.collection import (
9
- WebPartDefinitionCollection,
10
- )
8
+ from office365.sharepoint.webparts.definitions.collection import WebPartDefinitionCollection
11
9
  from office365.sharepoint.webparts.definitions.definition import WebPartDefinition
12
10
 
13
11
 
@@ -36,7 +34,6 @@ class LimitedWebPartManager(Entity):
36
34
  web_part.ensure_property("Id").after_execute(lambda _: _web_part_loaded())
37
35
  else:
38
36
  _export_web_part(web_part)
39
-
40
37
  return return_type
41
38
 
42
39
  def import_web_part(self, web_part_xml: str) -> WebPartDefinition:
@@ -65,10 +62,35 @@ class LimitedWebPartManager(Entity):
65
62
  """A collection of the Web Parts on the Web Part Page available to the current user based
66
63
  on the current user’s permissions."""
67
64
  return self.properties.get(
68
- "WebParts",
69
- WebPartDefinitionCollection(self.context, ResourcePath("WebParts", self.resource_path)),
65
+ "WebParts", WebPartDefinitionCollection(self.context, ResourcePath("WebParts", self.resource_path))
70
66
  )
71
67
 
72
68
  @property
73
69
  def entity_type_name(self):
74
70
  return "SP.WebParts.LimitedWebPartManager"
71
+
72
+ @property
73
+ def has_personalized_parts(self) -> Optional[bool]:
74
+ """Gets the HasPersonalizedParts property"""
75
+ return self.properties.get("HasPersonalizedParts", None)
76
+
77
+ @property
78
+ def has_web_part_connections(self) -> Optional[bool]:
79
+ """Gets the HasWebPartConnections property"""
80
+ return self.properties.get("HasWebPartConnections", None)
81
+
82
+ @property
83
+ def scope(self) -> Optional[int]:
84
+ """Gets the Scope property"""
85
+ return self.properties.get("Scope", None)
86
+
87
+ def export_web_part_ex(self, web_part_id: str) -> ClientResult[str]:
88
+ """ExportWebPartEx operation.
89
+
90
+ Args:
91
+ web_part_id (UUID): webPartId parameter
92
+ """
93
+ return_type = ClientResult(self.context, str())
94
+ qry = ServiceOperationQuery(self, "ExportWebPartEx", None, {"webPartId": web_part_id}, None, return_type)
95
+ self.context.add_query(qry)
96
+ return return_type
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- import math
4
3
  import time
5
4
  from dataclasses import dataclass, field
6
5
  from typing import Optional
@@ -8,6 +7,11 @@ from typing import Optional
8
7
  from office365.runtime.client_value import ClientValue
9
8
  from office365.runtime.types.collections import StringCollection
10
9
 
10
+ # Conservative fallback when the server omits FormDigestTimeoutSeconds, and a
11
+ # safety margin so a digest is refreshed before it can expire mid-flight.
12
+ _DEFAULT_TIMEOUT_SECONDS = 1800
13
+ _REFRESH_MARGIN_SECONDS = 60
14
+
11
15
 
12
16
  @dataclass
13
17
  class ContextWebInformation(ClientValue):
@@ -19,14 +23,15 @@ class ContextWebInformation(ClientValue):
19
23
  SiteFullUrl: Optional[str] = None
20
24
  SupportedSchemaVersions: StringCollection = field(default_factory=StringCollection)
21
25
  WebFullUrl: Optional[str] = None
22
- _valid_from: float = 0.0
26
+ # Set at construction time (which is when the digest is fetched/mapped);
27
+ # excluded from the public constructor and repr.
28
+ _valid_from: float = field(default_factory=time.time, init=False, repr=False)
23
29
 
24
30
  @property
25
- def is_valid(self):
26
- """
27
- Determines whether FormDigest has been expired or not
28
- """
29
- if self.FormDigestTimeoutSeconds is None:
31
+ def is_valid(self) -> bool:
32
+ """Whether the form digest is still valid (with a refresh margin)."""
33
+ if self.FormDigestValue is None:
30
34
  return False
31
- expires_in_sec = math.ceil(time.time() - self._valid_from)
32
- return expires_in_sec < self.FormDigestTimeoutSeconds
35
+ timeout = self.FormDigestTimeoutSeconds or _DEFAULT_TIMEOUT_SECONDS
36
+ elapsed = time.time() - self._valid_from
37
+ return elapsed + _REFRESH_MARGIN_SECONDS < timeout
@@ -0,0 +1,11 @@
1
+ """SharePoint web (site) templates — the template entity, collection, and catalog."""
2
+
3
+ from office365.sharepoint.webs.templates.collection import WebTemplateCollection
4
+ from office365.sharepoint.webs.templates.template import WebTemplate
5
+ from office365.sharepoint.webs.templates.type import WebTemplateType
6
+
7
+ __all__ = [
8
+ "WebTemplate",
9
+ "WebTemplateCollection",
10
+ "WebTemplateType",
11
+ ]
@@ -2,40 +2,99 @@ from enum import Enum
2
2
 
3
3
 
4
4
  class WebTemplateType(Enum):
5
- """Enum representing SharePoint web templates with their internal names and values."""
5
+ """SharePoint web (site) templates — internal name plus configuration id.
6
+
7
+ The value is the ``WebTemplate`` passed to ``WebCreationInformation`` (the
8
+ ``Name#Configuration`` string returned by ``Get-SpoWebTemplate``). The catalog
9
+ below is the union of the classic on-premises site definitions and the
10
+ Microsoft 365 templates; the classic ones that have no Microsoft 365
11
+ equivalent are the migration assessment's unsupported set.
12
+
13
+ See https://techcommunity.microsoft.com/discussions/sharepointdev/sharepoint-site-templates/2093214
14
+ """
6
15
 
7
16
  def __str__(self):
8
17
  return self.value
9
18
 
10
- # Global/Common Templates
11
- GLOBAL = "GLOBAL#0" # Global template (classic team site)
19
+ @property
20
+ def name_part(self) -> str:
21
+ """The template name without the ``#configuration`` suffix (e.g. ``"STS"``)."""
22
+ return self.value.split("#", 1)[0]
23
+
24
+ # Global / common
25
+ GLOBAL = "GLOBAL#0" # Global template
12
26
  STS = "STS#0" # Classic team site
27
+ BLANK_SITE = "STS#1" # Blank site
28
+ DOCUMENT_WORKSPACE = "STS#2" # Document workspace
13
29
  STS_MODERN = "STS#3" # Modern team site
14
30
  GROUP = "GROUP#0" # M365 Group-connected team site
15
31
 
16
- # Publishing Templates
17
- BLANK_INTERNET = "BLANKINTERNET#0" # Publishing portal
32
+ # Publishing
33
+ BLANK_INTERNET = "BLANKINTERNET#0" # Publishing site
34
+ PRESS_RELEASES = "BLANKINTERNET#1" # Press releases site
35
+ PUBLISHING_WITH_WORKFLOW = "BLANKINTERNET#2" # Publishing site with workflow
36
+ PUBLISHING_PORTAL = "BLANKINTERNETCONTAINER#0" # Publishing portal
18
37
  CMS_PUBLISHING = "CMSPUBLISHING#0" # Publishing site
19
38
  ENTERPRISE_WIKI = "ENTERWIKI#0" # Enterprise wiki
20
39
 
21
- # Collaboration Templates
22
- DOCUMENT_WORKSPACE = "STS#2" # Document workspace
40
+ # Collaboration
23
41
  BLOG = "BLOG#0" # Blog site
24
42
  WIKI = "WIKI#0" # Wiki site
25
43
  PROJECT_SITE = "PROJECTSITE#0" # Project site
44
+ GROUP_WORK_SITE = "SGS#0" # Group work site
45
+ COMMUNITY_SITE = "COMMUNITY#0" # Community site
46
+ COMMUNITY_AREA = "SPSCOMMU#0" # Community area
26
47
 
27
- # Meeting Workspaces
48
+ # Meeting workspaces
28
49
  MEETING_BASIC = "MPS#0" # Basic meeting workspace
29
50
  MEETING_BLANK = "MPS#1" # Blank meeting workspace
51
+ MEETING_DECISION = "MPS#2" # Decision meeting workspace
52
+ MEETING_SOCIAL = "MPS#3" # Social meeting workspace
53
+ MEETING_MULTIPAGE = "MPS#4" # Multipage meeting workspace
30
54
 
31
- # Special Templates
32
- SEARCH_CENTER = "SRCHCEN#0" # Search center
33
- BI_CENTER = "BICENTER#0" # Business Intelligence Center
34
- DEV_SITE = "DEV#0" # Developer site
55
+ # Search / catalog
56
+ SEARCH_CENTER = "SRCHCEN#0" # Enterprise search center
57
+ BASIC_SEARCH_CENTER = "SRCHCENTERLITE#0" # Basic search center
58
+ FAST_SEARCH_CENTER = "SRCHCENTERFAST#0" # FAST search center
35
59
  APP_CATALOG = "APPCATALOG#0" # App catalog
60
+ PRODUCT_CATALOG = "PRODUCTCATALOG#0" # Product catalog
61
+ DEV_SITE = "DEV#0" # Developer site
36
62
  COMMUNICATION_SITE = "SITEPAGEPUBLISHING#0" # Communication site
37
63
 
38
- # Custom/Add-on Templates
39
- COMMUNITY_SITE = "COMMUNITY#0" # Community site
40
- PRODUCT_CATALOG = "PRODUCTCATALOG#0" # Product catalog
64
+ # Records / document centers
65
+ DOCUMENT_CENTER = "BDR#0" # Document center
41
66
  RECORDS_CENTER = "OFFILE#0" # Records center
67
+ VISIO_PROCESS_REPOSITORY = "visprus#0" # Visio process repository
68
+
69
+ # Business intelligence / reporting
70
+ BI_CENTER = "BICENTER#0" # Business Intelligence Center
71
+ BUSINESS_INTELLIGENCE_CENTER = "PPSMASite#0" # Business Intelligence Center
72
+ REPORT_CENTER = "SPSREPORTCENTER#0" # Report center
73
+
74
+ # Access services web databases
75
+ ACCESS_SERVICES = "ACCSRV#0" # Access services site
76
+ ASSETS_WEB_DATABASE = "ACCSRV#1" # Assets web database
77
+ CHARITABLE_CONTRIBUTIONS_WEB_DATABASE = "ACCSRV#3" # Charitable contributions web database
78
+ CONTACTS_WEB_DATABASE = "ACCSRV#4" # Contacts web database
79
+ PROJECTS_WEB_DATABASE = "ACCSRV#5" # Projects web database
80
+ ISSUES_WEB_DATABASE = "ACCSRV#6" # Issues web database
81
+
82
+ # Administration / personal / legacy portals
83
+ CENTRAL_ADMIN = "CENTRALADMIN#0" # Central administration site
84
+ TENANT_ADMIN = "TENANTADMIN#0" # Tenant administration site
85
+ SHAREPOINT_ONLINE_TENANT_ADMIN = "TenantAdminSpo#0" # SharePoint Online tenant admin
86
+ SHARED_SERVICES_ADMINISTRATION = "OSRV#0" # Shared services administration site
87
+ SHAREPOINT_PORTAL_SERVER_SITE = "SPS#0" # SharePoint Portal Server site
88
+ SHAREPOINT_PORTAL_PERSONAL_SPACE = "SPSPERS#0" # SharePoint Portal Server personal space
89
+ PERSONALIZATION_SITE = "SPSMSITE#0" # Personalization site
90
+ MY_SITE_HOST = "SPSMSITEHOST#0" # My Site host
91
+ CONTENTS_AREA = "SPSTOC#0" # Contents area template
92
+ TOPIC_AREA = "SPSTOPIC#0" # Topic area template
93
+ NEWS_SITE = "SPSNEWS#0" # News site
94
+ NEWS_HOME = "SPSNHOME#0" # News home
95
+ SITE_DIRECTORY = "SPSSITES#0" # Site directory
96
+ COLLABORATION_PORTAL = "SPSPORTAL#0" # Collaboration portal
97
+ PROFILES = "PROFILES#0" # Profiles
98
+ EXPRESS_TEAM_SITE = "EXPRESS#0" # Express team site
99
+ EXPRESS_HOSTED_SITE = "EHS#0" # Express hosted site
100
+ POWERPOINT_BROADCAST = "PowerPointBroadcast#0" # PowerPoint broadcast site
@@ -1,4 +1,5 @@
1
1
  from typing import Optional
2
+ from uuid import UUID
2
3
 
3
4
  from office365.sharepoint.entity import Entity
4
5
 
@@ -69,3 +70,8 @@ class WorkflowDefinition(Entity):
69
70
  @property
70
71
  def entity_type_name(self):
71
72
  return "SP.WorkflowServices.WorkflowDefinition"
73
+
74
+ @property
75
+ def id(self) -> Optional[UUID]:
76
+ """Gets the Id property"""
77
+ return self.properties.get("Id", None)
@@ -1,3 +1,9 @@
1
+ from datetime import datetime
2
+ from uuid import UUID
3
+
4
+ from typing_extensions import Self
5
+
6
+ from office365.runtime.client_result import ClientResult
1
7
  from office365.runtime.queries.service_operation import ServiceOperationQuery
2
8
  from office365.sharepoint.entity import Entity
3
9
  from office365.sharepoint.entity_collection import EntityCollection
@@ -26,3 +32,152 @@ class WorkflowDeploymentService(Entity):
26
32
  @property
27
33
  def entity_type_name(self):
28
34
  return "SP.WorkflowServices.WorkflowDeploymentService"
35
+
36
+ def delete_collateral(self, workflow_definition_id: UUID, leaf_file_name: str) -> Self:
37
+ """DeleteCollateral operation.
38
+
39
+ Args:
40
+ workflow_definition_id (UUID): workflowDefinitionId parameter
41
+ leaf_file_name (str): leafFileName parameter
42
+ """
43
+ qry = ServiceOperationQuery(
44
+ self,
45
+ "DeleteCollateral",
46
+ None,
47
+ {"workflowDefinitionId": workflow_definition_id, "leafFileName": leaf_file_name},
48
+ None,
49
+ None,
50
+ )
51
+ self.context.add_query(qry)
52
+ return self
53
+
54
+ def delete_definition(self, definition_id: UUID) -> Self:
55
+ """DeleteDefinition operation.
56
+
57
+ Args:
58
+ definition_id (UUID): definitionId parameter
59
+ """
60
+ qry = ServiceOperationQuery(self, "DeleteDefinition", None, {"definitionId": definition_id}, None, None)
61
+ self.context.add_query(qry)
62
+ return self
63
+
64
+ def deprecate_definition(self, definition_id: UUID) -> Self:
65
+ """DeprecateDefinition operation.
66
+
67
+ Args:
68
+ definition_id (UUID): definitionId parameter
69
+ """
70
+ qry = ServiceOperationQuery(self, "DeprecateDefinition", None, {"definitionId": definition_id}, None, None)
71
+ self.context.add_query(qry)
72
+ return self
73
+
74
+ def get_activity_signatures(self, last_changed: datetime) -> ClientResult[dict]:
75
+ """GetActivitySignatures operation.
76
+
77
+ Args:
78
+ last_changed (datetime): lastChanged parameter
79
+ """
80
+ return_type = ClientResult(self.context, dict())
81
+ qry = ServiceOperationQuery(
82
+ self, "GetActivitySignatures", None, {"lastChanged": last_changed}, None, return_type
83
+ )
84
+ self.context.add_query(qry)
85
+ return return_type
86
+
87
+ def get_collateral_uri(self, workflow_definition_id: UUID, leaf_file_name: str) -> ClientResult[str]:
88
+ """GetCollateralUri operation.
89
+
90
+ Args:
91
+ workflow_definition_id (UUID): workflowDefinitionId parameter
92
+ leaf_file_name (str): leafFileName parameter
93
+ """
94
+ return_type = ClientResult(self.context, str())
95
+ qry = ServiceOperationQuery(
96
+ self,
97
+ "GetCollateralUri",
98
+ None,
99
+ {"workflowDefinitionId": workflow_definition_id, "leafFileName": leaf_file_name},
100
+ None,
101
+ return_type,
102
+ )
103
+ self.context.add_query(qry)
104
+ return return_type
105
+
106
+ def is_integrated_app(self) -> ClientResult[bool]:
107
+ """IsIntegratedApp operation."""
108
+ return_type = ClientResult(self.context, bool())
109
+ qry = ServiceOperationQuery(self, "IsIntegratedApp", None, {}, None, return_type)
110
+ self.context.add_query(qry)
111
+ return return_type
112
+
113
+ def package_definition(
114
+ self, definition_id: UUID, package_default_filename: str, package_title: str, package_description: str
115
+ ) -> ClientResult[str]:
116
+ """PackageDefinition operation.
117
+
118
+ Args:
119
+ definition_id (UUID): definitionId parameter
120
+ package_default_filename (str): packageDefaultFilename parameter
121
+ package_title (str): packageTitle parameter
122
+ package_description (str): packageDescription parameter
123
+ """
124
+ return_type = ClientResult(self.context, str())
125
+ qry = ServiceOperationQuery(
126
+ self,
127
+ "PackageDefinition",
128
+ None,
129
+ {
130
+ "definitionId": definition_id,
131
+ "packageDefaultFilename": package_default_filename,
132
+ "packageTitle": package_title,
133
+ "packageDescription": package_description,
134
+ },
135
+ None,
136
+ return_type,
137
+ )
138
+ self.context.add_query(qry)
139
+ return return_type
140
+
141
+ def publish_definition(self, definition_id: UUID) -> Self:
142
+ """PublishDefinition operation.
143
+
144
+ Args:
145
+ definition_id (UUID): definitionId parameter
146
+ """
147
+ qry = ServiceOperationQuery(self, "PublishDefinition", None, {"definitionId": definition_id}, None, None)
148
+ self.context.add_query(qry)
149
+ return self
150
+
151
+ def save_collateral(self, workflow_definition_id: UUID, leaf_file_name: str, file_content: bytes) -> Self:
152
+ """SaveCollateral operation.
153
+
154
+ Args:
155
+ workflow_definition_id (UUID): workflowDefinitionId parameter
156
+ leaf_file_name (str): leafFileName parameter
157
+ file_content (bytes): fileContent parameter
158
+ """
159
+ qry = ServiceOperationQuery(
160
+ self,
161
+ "SaveCollateral",
162
+ None,
163
+ {
164
+ "workflowDefinitionId": workflow_definition_id,
165
+ "leafFileName": leaf_file_name,
166
+ "fileContent": file_content,
167
+ },
168
+ None,
169
+ None,
170
+ )
171
+ self.context.add_query(qry)
172
+ return self
173
+
174
+ def validate_activity(self, activity_xaml: str) -> ClientResult[str]:
175
+ """ValidateActivity operation.
176
+
177
+ Args:
178
+ activity_xaml (str): activityXaml parameter
179
+ """
180
+ return_type = ClientResult(self.context, str())
181
+ qry = ServiceOperationQuery(self, "ValidateActivity", None, {"activityXaml": activity_xaml}, None, return_type)
182
+ self.context.add_query(qry)
183
+ return return_type