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
@@ -0,0 +1,529 @@
1
+ """SharePoint service limits — the single source of truth.
2
+
3
+ Declares the limits the library can act on as :class:`~office365.runtime.limits.Limit`
4
+ values (value + kind + unit + scope + docs), and re-exports the guard-rail helpers
5
+ (:func:`warn_if_exceeds`, :func:`ensure_within`, :func:`bounded`, ...).
6
+
7
+ Sources:
8
+
9
+ - SharePoint in Microsoft 365 limits —
10
+ https://learn.microsoft.com/en-us/office365/servicedescriptions/sharepoint-online-service-description/sharepoint-online-limits
11
+ - Software boundaries and limits (SharePoint Server 2016/2019) —
12
+ https://learn.microsoft.com/en-us/sharepoint/install/software-boundaries-limits-2019
13
+
14
+ The list-view threshold (:data:`LIST_VIEW_THRESHOLD`) is the one most callers
15
+ hit: SharePoint blocks queries that filter/sort on a non-indexed column and would
16
+ scan/return more items than it, and trims some single-shot collection loads to it.
17
+ """
18
+
19
+ from __future__ import annotations
20
+
21
+ from office365.runtime.limits import (
22
+ DEFAULT_BATCH_SIZE,
23
+ SAFE_PAGE_SIZE,
24
+ Limit,
25
+ LimitDecl,
26
+ LimitExceededError,
27
+ LimitKind,
28
+ LimitReport,
29
+ bounded,
30
+ catalog,
31
+ ensure_within,
32
+ exceeds,
33
+ hint,
34
+ limit,
35
+ limits_of,
36
+ register_catalog,
37
+ verify_limits,
38
+ warn_if_exceeds,
39
+ )
40
+
41
+ __all__ = [
42
+ "LIST_VIEW_THRESHOLD",
43
+ "SAFE_PAGE_SIZE",
44
+ "Limit",
45
+ "LimitDecl",
46
+ "LimitExceededError",
47
+ "LimitKind",
48
+ "LimitReport",
49
+ "Limits",
50
+ "bounded",
51
+ "catalog",
52
+ "ensure_within",
53
+ "exceeds",
54
+ "hint",
55
+ "limit",
56
+ "limits_of",
57
+ "register_catalog",
58
+ "verify_limits",
59
+ "warn_if_exceeds",
60
+ ]
61
+
62
+ _DOC_ONLINE = (
63
+ "https://learn.microsoft.com/en-us/office365/servicedescriptions/"
64
+ "sharepoint-online-service-description/sharepoint-online-limits"
65
+ )
66
+ _DOC_SERVER = "https://learn.microsoft.com/en-us/sharepoint/install/software-boundaries-limits-2019"
67
+
68
+ _KB = 1024
69
+ _MB = 1024 * _KB
70
+ _GB = 1024 * _MB
71
+ _TB = 1024 * _GB
72
+
73
+ _BOUNDARY = LimitKind.BOUNDARY
74
+ _THRESHOLD = LimitKind.THRESHOLD
75
+ _SUPPORTED = LimitKind.SUPPORTED
76
+
77
+
78
+ class Limits:
79
+ """SharePoint limits the client can act on, as :class:`Limit` values.
80
+
81
+ Each attribute is a :class:`Limit` — ``Limits.LIST_VIEW.value`` is ``5000``,
82
+ ``str(Limits.FILE_UPLOAD)`` is ``"250 GB"``. Iterate with
83
+ :meth:`catalog` to render a reference table.
84
+ """
85
+
86
+ # --- Queries and list/folder operations ---------------------------------
87
+ LIST_VIEW = Limit(
88
+ "list view threshold",
89
+ 5000,
90
+ _THRESHOLD,
91
+ "items",
92
+ "list",
93
+ "page through the data or index the filtered/sorted column to exceed it",
94
+ f"{_DOC_SERVER}#list-and-library-limits",
95
+ )
96
+ LIST_VIEW_ADMIN = Limit(
97
+ "list view threshold (auditors/admins)",
98
+ 20000,
99
+ _THRESHOLD,
100
+ "items",
101
+ "list",
102
+ "",
103
+ f"{_DOC_SERVER}#list-and-library-limits",
104
+ )
105
+ INDEX_ADD_REMOVE = Limit(
106
+ "index add/remove threshold",
107
+ 20000,
108
+ _THRESHOLD,
109
+ "items",
110
+ "list",
111
+ "applies while adding or removing a column index",
112
+ f"{_DOC_SERVER}#list-and-library-limits",
113
+ )
114
+ DELETE_ITEMS = Limit(
115
+ "delete list/folder threshold",
116
+ 100000,
117
+ _THRESHOLD,
118
+ "items",
119
+ "list",
120
+ "",
121
+ f"{_DOC_SERVER}#list-and-library-limits",
122
+ )
123
+ RENAME_FOLDER = Limit(
124
+ "rename folder threshold",
125
+ 100000,
126
+ _THRESHOLD,
127
+ "items",
128
+ "folder",
129
+ "renaming a folder within the same library",
130
+ f"{_DOC_SERVER}#list-and-library-limits",
131
+ )
132
+ LOOKUP_JOINS = Limit(
133
+ "list view lookup threshold",
134
+ 8,
135
+ _THRESHOLD,
136
+ "joins",
137
+ "query",
138
+ "queries with more joins are blocked",
139
+ f"{_DOC_SERVER}#list-and-library-limits",
140
+ )
141
+ MAX_LIST_ITEMS = Limit(
142
+ "max items per list/library",
143
+ 30_000_000,
144
+ _SUPPORTED,
145
+ "items",
146
+ "list",
147
+ "",
148
+ f"{_DOC_ONLINE}#items-in-lists-and-libraries",
149
+ )
150
+
151
+ # --- Columns ------------------------------------------------------------
152
+ MAX_INDEXED_COLUMNS = Limit(
153
+ "max indexed columns",
154
+ 20,
155
+ _SUPPORTED,
156
+ "columns",
157
+ "list",
158
+ "SharePoint Online allows roughly 20 indexed columns",
159
+ f"{_DOC_SERVER}#list-and-library-limits",
160
+ )
161
+ TEXT_COLUMN = Limit(
162
+ "single line of text column length",
163
+ 255,
164
+ _THRESHOLD,
165
+ "chars",
166
+ "column",
167
+ "indexed text columns are limited to 255 characters",
168
+ f"{_DOC_SERVER}#column-limits",
169
+ )
170
+ LIST_ROW_BYTES = Limit(
171
+ "list row size",
172
+ 8000,
173
+ _BOUNDARY,
174
+ "bytes",
175
+ "list item",
176
+ "300 bytes are reserved; ~7,700 are usable",
177
+ f"{_DOC_SERVER}#column-limits",
178
+ )
179
+
180
+ # --- Files: upload, download, paths -------------------------------------
181
+ FILE_UPLOAD = Limit(
182
+ "file upload",
183
+ 250 * _GB,
184
+ _BOUNDARY,
185
+ "bytes",
186
+ "file",
187
+ "SharePoint Server 2016/2019 caps at 10 GB (15 GB in Subscription Edition)",
188
+ f"{_DOC_ONLINE}#file-size-and-file-path-length",
189
+ )
190
+ LIST_ITEM_ATTACHMENT = Limit(
191
+ "file attached to a list item",
192
+ 250 * _MB,
193
+ _BOUNDARY,
194
+ "bytes",
195
+ "list item",
196
+ "",
197
+ f"{_DOC_ONLINE}#file-size-and-file-path-length",
198
+ )
199
+ ZIP_DOWNLOAD = Limit(
200
+ "ZIP download",
201
+ 20 * _GB,
202
+ _BOUNDARY,
203
+ "bytes",
204
+ "download",
205
+ "the autogenerated ZIP when downloading multiple files",
206
+ f"{_DOC_ONLINE}#file-size-and-file-path-length",
207
+ )
208
+ UPLOAD_SIMPLE = Limit(
209
+ "simple upload (Files/add)",
210
+ 4 * _MB,
211
+ _THRESHOLD,
212
+ "bytes",
213
+ "file",
214
+ "larger files use a resumable upload session",
215
+ "",
216
+ )
217
+ UPLOAD_SESSION_CHUNK = Limit(
218
+ "upload session chunk",
219
+ 4 * _MB,
220
+ _SUPPORTED,
221
+ "bytes",
222
+ "file",
223
+ "default chunk size for resumable uploads",
224
+ "",
225
+ )
226
+ FILE_PATH_LENGTH = Limit(
227
+ "decoded file path length",
228
+ 400,
229
+ _BOUNDARY,
230
+ "chars",
231
+ "file",
232
+ "the folder path plus file name after decoding",
233
+ f"{_DOC_ONLINE}#file-size-and-file-path-length",
234
+ )
235
+ LONG_ONEDRIVE_URL = Limit(
236
+ "long OneDrive URL",
237
+ 400,
238
+ _BOUNDARY,
239
+ "chars",
240
+ "url",
241
+ "the decoded full file URL; OneDrive/SharePoint sync fails beyond it",
242
+ f"{_DOC_ONLINE}#file-size-and-file-path-length",
243
+ )
244
+ FILE_NAME_LENGTH = Limit(
245
+ "file name length",
246
+ 128,
247
+ _THRESHOLD,
248
+ "chars",
249
+ "file",
250
+ "the FileLeafRef name; the migration path scanner flags longer names",
251
+ f"{_DOC_SERVER}#list-and-library-limits",
252
+ )
253
+ LARGE_EXCEL_FILE = Limit(
254
+ "Excel workbook opened in the browser",
255
+ 10 * _MB,
256
+ _THRESHOLD,
257
+ "bytes",
258
+ "file",
259
+ "larger Excel files prompt to open in the Excel client instead of the browser",
260
+ _DOC_ONLINE,
261
+ )
262
+
263
+ # --- Batching -----------------------------------------------------------
264
+ BATCH_ITEMS = Limit(
265
+ "items per bulk/batch operation",
266
+ DEFAULT_BATCH_SIZE,
267
+ _BOUNDARY,
268
+ "items",
269
+ "batch",
270
+ "the OData batch size the client uses",
271
+ f"{_DOC_SERVER}#list-and-library-limits",
272
+ )
273
+ BATCH_BYTES = Limit(
274
+ "batch request size",
275
+ 1 * _MB,
276
+ _SUPPORTED,
277
+ "bytes",
278
+ "batch",
279
+ "conservative client cap for a SharePoint OData batch",
280
+ "",
281
+ )
282
+
283
+ # --- Managed metadata ---------------------------------------------------
284
+ MANAGED_TERMS = Limit(
285
+ "managed metadata terms",
286
+ 1_000_000,
287
+ _SUPPORTED,
288
+ "terms",
289
+ "tenant",
290
+ "global and site-level terms combined",
291
+ f"{_DOC_ONLINE}#managed-metadata",
292
+ )
293
+ MANAGED_TERM_LABELS = Limit(
294
+ "managed metadata term labels",
295
+ 2_000_000,
296
+ _SUPPORTED,
297
+ "labels",
298
+ "tenant",
299
+ "",
300
+ f"{_DOC_ONLINE}#managed-metadata",
301
+ )
302
+ MANAGED_TERM_PROPERTIES = Limit(
303
+ "managed metadata term properties",
304
+ 1_000_000,
305
+ _SUPPORTED,
306
+ "properties",
307
+ "tenant",
308
+ "",
309
+ f"{_DOC_ONLINE}#managed-metadata",
310
+ )
311
+ TERM_SETS = Limit(
312
+ "global term sets",
313
+ 1000,
314
+ _SUPPORTED,
315
+ "term sets",
316
+ "tenant",
317
+ "",
318
+ f"{_DOC_ONLINE}#managed-metadata",
319
+ )
320
+ TERM_GROUPS = Limit(
321
+ "global term groups",
322
+ 1000,
323
+ _SUPPORTED,
324
+ "term groups",
325
+ "tenant",
326
+ "",
327
+ f"{_DOC_ONLINE}#managed-metadata",
328
+ )
329
+ DEFAULT_TERMS = Limit(
330
+ "terms per managed metadata column (default)",
331
+ 50,
332
+ _SUPPORTED,
333
+ "terms",
334
+ "column",
335
+ "more than this is allowed but downstream experiences aren't guaranteed",
336
+ f"{_DOC_ONLINE}#managed-metadata",
337
+ )
338
+
339
+ # --- Security -----------------------------------------------------------
340
+ PERMISSION_INHERITANCE = Limit(
341
+ "permission inheritance break/reinherit",
342
+ 100_000,
343
+ _THRESHOLD,
344
+ "items",
345
+ "list",
346
+ "above this many items you can't break or reinherit permissions on the list/folder",
347
+ f"{_DOC_ONLINE}#items-in-lists-and-libraries",
348
+ )
349
+ UNIQUE_SCOPES = Limit(
350
+ "unique security scopes",
351
+ 50_000,
352
+ _THRESHOLD,
353
+ "scopes",
354
+ "list",
355
+ "the recommended general limit is 5,000",
356
+ f"{_DOC_ONLINE}#unique-security-scopes-per-list-or-library",
357
+ )
358
+ UNIQUE_SCOPES_RECOMMENDED = Limit(
359
+ "recommended unique security scopes",
360
+ 5000,
361
+ _SUPPORTED,
362
+ "scopes",
363
+ "list",
364
+ "",
365
+ f"{_DOC_ONLINE}#unique-security-scopes-per-list-or-library",
366
+ )
367
+ ACL_PROPAGATION = Limit(
368
+ "ACL propagation child objects",
369
+ 500,
370
+ _THRESHOLD,
371
+ "objects",
372
+ "list",
373
+ "propagation fails beyond this many uniquely scoped children",
374
+ f"{_DOC_SERVER}#list-and-library-limits",
375
+ )
376
+ GROUPS_PER_SITE = Limit(
377
+ "SharePoint groups per site",
378
+ 10_000,
379
+ _SUPPORTED,
380
+ "groups",
381
+ "site",
382
+ "",
383
+ f"{_DOC_ONLINE}#sharepoint-groups",
384
+ )
385
+ GROUP_MEMBERS = Limit(
386
+ "users per SharePoint group",
387
+ 5000,
388
+ _SUPPORTED,
389
+ "users",
390
+ "group",
391
+ "",
392
+ f"{_DOC_ONLINE}#sharepoint-groups",
393
+ )
394
+ COMPLIANCE_POLICIES = Limit(
395
+ "compliance policies per tenant",
396
+ 10_000,
397
+ _SUPPORTED,
398
+ "policies",
399
+ "tenant",
400
+ "eDiscovery/retention holds count toward this, shared with DLP and sensitivity labels",
401
+ f"{_DOC_ONLINE}#hold-limits",
402
+ )
403
+
404
+ # --- Versions -----------------------------------------------------------
405
+ MAJOR_VERSIONS = Limit(
406
+ "major versions",
407
+ 50_000,
408
+ _SUPPORTED,
409
+ "versions",
410
+ "file",
411
+ "SharePoint Server 2019 allows 400,000",
412
+ f"{_DOC_ONLINE}#versions",
413
+ )
414
+ MINOR_VERSIONS = Limit(
415
+ "minor versions",
416
+ 511,
417
+ _BOUNDARY,
418
+ "versions",
419
+ "file",
420
+ "",
421
+ f"{_DOC_ONLINE}#versions",
422
+ )
423
+
424
+ # --- Site structure and storage -----------------------------------------
425
+ LISTS_PER_SITE = Limit(
426
+ "lists and libraries per site collection",
427
+ 2000,
428
+ _SUPPORTED,
429
+ "lists",
430
+ "site",
431
+ "",
432
+ f"{_DOC_ONLINE}#lists-and-libraries",
433
+ )
434
+ SUBSITES_PER_SITE = Limit(
435
+ "subsites per site",
436
+ 2000,
437
+ _THRESHOLD,
438
+ "sites",
439
+ "site",
440
+ "",
441
+ f"{_DOC_ONLINE}#subsites",
442
+ )
443
+ SITE_STORAGE = Limit(
444
+ "max storage per site collection",
445
+ 25 * _TB,
446
+ _BOUNDARY,
447
+ "bytes",
448
+ "site",
449
+ "",
450
+ f"{_DOC_ONLINE}#limits-by-plan",
451
+ )
452
+ SITE_METADATA = Limit(
453
+ "overall site metadata",
454
+ 1000 * _GB,
455
+ _SUPPORTED,
456
+ "bytes",
457
+ "site",
458
+ "metadata rarely reaches this size",
459
+ f"{_DOC_ONLINE}#overall-site-metadata",
460
+ )
461
+
462
+ # --- Move/copy and sync -------------------------------------------------
463
+ MOVE_COPY_BYTES = Limit(
464
+ "move/copy total file size",
465
+ 100 * _GB,
466
+ _THRESHOLD,
467
+ "bytes",
468
+ "transfer",
469
+ "across sites and containers",
470
+ f"{_DOC_ONLINE}#moving-and-copying-across-sites-and-containers",
471
+ )
472
+ MOVE_COPY_FILES = Limit(
473
+ "move/copy file count",
474
+ 30_000,
475
+ _THRESHOLD,
476
+ "files",
477
+ "transfer",
478
+ "",
479
+ f"{_DOC_ONLINE}#moving-and-copying-across-sites-and-containers",
480
+ )
481
+ CROSS_GEO_FILE = Limit(
482
+ "cross-geo copy/move file size",
483
+ 15 * _GB,
484
+ _THRESHOLD,
485
+ "bytes",
486
+ "file",
487
+ "",
488
+ f"{_DOC_ONLINE}#moving-and-copying-across-sites-and-containers",
489
+ )
490
+ ONENOTE_FILE = Limit(
491
+ "OneNote file in move/copy",
492
+ 2 * _GB,
493
+ _THRESHOLD,
494
+ "bytes",
495
+ "file",
496
+ "",
497
+ f"{_DOC_ONLINE}#moving-and-copying-across-sites-and-containers",
498
+ )
499
+ MIGRATION_FILE_SIZE = Limit(
500
+ "large file for migration (SMAT)",
501
+ 15 * _GB,
502
+ _SUPPORTED,
503
+ "bytes",
504
+ "file",
505
+ "SMAT flags files over this as slow/hard to migrate; SPO upload allows 250 GB (SP2019 10-15 GB)",
506
+ "",
507
+ )
508
+ SYNC_FILES = Limit(
509
+ "files in a synced library",
510
+ 300_000,
511
+ _SUPPORTED,
512
+ "files",
513
+ "library",
514
+ "OneDrive sync performance limit",
515
+ f"{_DOC_ONLINE}#sync",
516
+ )
517
+
518
+ @classmethod
519
+ def catalog(cls) -> list[Limit]:
520
+ """Every declared limit, ordered by definition."""
521
+ return [value for value in vars(cls).values() if isinstance(value, Limit)]
522
+
523
+
524
+ # The list-view threshold is the one callers reference most often; keep a module
525
+ # constant for backward compatibility and ergonomics.
526
+ LIST_VIEW_THRESHOLD = Limits.LIST_VIEW.value
527
+
528
+ # Register this product's vocabulary with the limits registry (``office365.limits``).
529
+ register_catalog(Limits, product="sharepoint")
@@ -1,5 +1,8 @@
1
1
  from __future__ import annotations
2
2
 
3
+ from typing import Optional
4
+ from uuid import UUID
5
+
3
6
  from office365.runtime.client_result import ClientResult
4
7
  from office365.runtime.paths.service_operation import ServiceOperationPath
5
8
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -12,8 +15,7 @@ class TranslationJob(Entity):
12
15
 
13
16
  def __init__(self, context, target_language: str):
14
17
  super().__init__(
15
- context,
16
- ServiceOperationPath("SP.Translation.TranslationJob", {"targetLanguage": target_language}),
18
+ context, ServiceOperationPath("SP.Translation.TranslationJob", {"targetLanguage": target_language})
17
19
  )
18
20
 
19
21
  @staticmethod
@@ -33,3 +35,71 @@ class TranslationJob(Entity):
33
35
  @property
34
36
  def entity_type_name(self) -> str:
35
37
  return "SP.Translation.TranslationJob"
38
+
39
+ @property
40
+ def job_id(self) -> Optional[UUID]:
41
+ """Gets the JobId property"""
42
+ return self.properties.get("JobId", None)
43
+
44
+ @property
45
+ def name(self) -> Optional[str]:
46
+ """Gets the Name property"""
47
+ return self.properties.get("Name", None)
48
+
49
+ @property
50
+ def output_save_behavior(self) -> Optional[int]:
51
+ """Gets the OutputSaveBehavior property"""
52
+ return self.properties.get("OutputSaveBehavior", None)
53
+
54
+ def translate_file(self, input_file: str, output_file: str) -> ClientResult[str]:
55
+ """TranslateFile operation.
56
+
57
+ Args:
58
+ input_file (str): inputFile parameter
59
+ output_file (str): outputFile parameter
60
+ """
61
+ return_type = ClientResult(self.context, str())
62
+ qry = ServiceOperationQuery(
63
+ self, "TranslateFile", None, {"inputFile": input_file, "outputFile": output_file}, None, return_type
64
+ )
65
+ self.context.add_query(qry)
66
+ return return_type
67
+
68
+ def translate_folder(self, input_folder: str, output_folder: str, recursion: bool) -> ClientResult[str]:
69
+ """TranslateFolder operation.
70
+
71
+ Args:
72
+ input_folder (str): inputFolder parameter
73
+ output_folder (str): outputFolder parameter
74
+ recursion (bool): recursion parameter
75
+ """
76
+ return_type = ClientResult(self.context, str())
77
+ qry = ServiceOperationQuery(
78
+ self,
79
+ "TranslateFolder",
80
+ None,
81
+ {"inputFolder": input_folder, "outputFolder": output_folder, "recursion": recursion},
82
+ None,
83
+ return_type,
84
+ )
85
+ self.context.add_query(qry)
86
+ return return_type
87
+
88
+ def translate_library(self, input_library: str, output_library: str) -> ClientResult[str]:
89
+ """TranslateLibrary operation.
90
+
91
+ Args:
92
+ input_library (str): inputLibrary parameter
93
+ output_library (str): outputLibrary parameter
94
+ """
95
+ return_type = ClientResult(self.context, str())
96
+ qry = ServiceOperationQuery(
97
+ self,
98
+ "TranslateLibrary",
99
+ None,
100
+ {"inputLibrary": input_library, "outputLibrary": output_library},
101
+ None,
102
+ return_type,
103
+ )
104
+ self.context.add_query(qry)
105
+ return return_type
@@ -1,7 +1,11 @@
1
+ from typing import Optional
2
+
1
3
  from office365.runtime.client_result import ClientResult
2
4
  from office365.runtime.client_value_collection import ClientValueCollection
5
+ from office365.runtime.queries.function import FunctionQuery
3
6
  from office365.runtime.queries.service_operation import ServiceOperationQuery
4
7
  from office365.sharepoint.entity import Entity
8
+ from office365.sharepoint.translation.item_info import TranslationItemInfo
5
9
  from office365.sharepoint.translation.jobs.info import TranslationJobInfo
6
10
 
7
11
 
@@ -15,18 +19,52 @@ class TranslationJobStatus(Entity):
15
19
  def get_all_jobs(context, return_type=None):
16
20
  if return_type is None:
17
21
  return_type = ClientResult(context, ClientValueCollection(TranslationJobInfo))
18
- qry = ServiceOperationQuery(
19
- TranslationJobStatus(context),
20
- "GetAllJobs",
21
- None,
22
- None,
23
- None,
24
- return_type,
25
- True,
26
- )
22
+ qry = ServiceOperationQuery(TranslationJobStatus(context), "GetAllJobs", None, None, None, return_type, True)
27
23
  context.add_query(qry)
28
24
  return return_type
29
25
 
30
26
  @property
31
27
  def entity_type_name(self):
32
28
  return "SP.Translation.TranslationJobStatus"
29
+
30
+ @property
31
+ def canceled(self) -> Optional[int]:
32
+ """Gets the Canceled property"""
33
+ return self.properties.get("Canceled", None)
34
+
35
+ @property
36
+ def count(self) -> Optional[int]:
37
+ """Gets the Count property"""
38
+ return self.properties.get("Count", None)
39
+
40
+ @property
41
+ def failed(self) -> Optional[int]:
42
+ """Gets the Failed property"""
43
+ return self.properties.get("Failed", None)
44
+
45
+ @property
46
+ def in_progress(self) -> Optional[int]:
47
+ """Gets the InProgress property"""
48
+ return self.properties.get("InProgress", None)
49
+
50
+ @property
51
+ def name(self) -> Optional[str]:
52
+ """Gets the Name property"""
53
+ return self.properties.get("Name", None)
54
+
55
+ @property
56
+ def not_started(self) -> Optional[int]:
57
+ """Gets the NotStarted property"""
58
+ return self.properties.get("NotStarted", None)
59
+
60
+ @property
61
+ def succeeded(self) -> Optional[int]:
62
+ """Gets the Succeeded property"""
63
+ return self.properties.get("Succeeded", None)
64
+
65
+ def get_all_items(self) -> ClientResult[ClientValueCollection[TranslationItemInfo]]:
66
+ """GetAllItems operation."""
67
+ return_type = ClientResult(self.context, ClientValueCollection[TranslationItemInfo]())
68
+ qry = FunctionQuery(self, "GetAllItems", [], return_type)
69
+ self.context.add_query(qry)
70
+ return return_type