Office365-REST-Python-Client 2.5.3__py3-none-any.whl → 2.5.4__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 (27) hide show
  1. {Office365_REST_Python_Client-2.5.3.dist-info → Office365_REST_Python_Client-2.5.4.dist-info}/METADATA +15 -2
  2. {Office365_REST_Python_Client-2.5.3.dist-info → Office365_REST_Python_Client-2.5.4.dist-info}/RECORD +27 -26
  3. office365/directory/applications/template.py +5 -8
  4. office365/directory/authentication/methods/email.py +4 -4
  5. office365/directory/protection/riskyusers/history_item.py +4 -3
  6. office365/onedrive/driveitems/driveItem.py +6 -0
  7. office365/onedrive/internal/paths/shared.py +10 -5
  8. office365/onedrive/shares/drive_item.py +2 -1
  9. office365/onedrive/versions/drive_item.py +4 -8
  10. office365/onedrive/workbooks/functions/result.py +1 -1
  11. office365/onedrive/workbooks/names/collection.py +26 -0
  12. office365/onedrive/workbooks/names/named_item.py +23 -6
  13. office365/onedrive/workbooks/ranges/range.py +53 -2
  14. office365/onedrive/workbooks/tables/table.py +10 -5
  15. office365/onedrive/workbooks/workbook.py +7 -11
  16. office365/outlook/item.py +3 -4
  17. office365/runtime/auth/authentication_context.py +4 -2
  18. office365/runtime/auth/providers/acs_token_provider.py +14 -6
  19. office365/runtime/auth/providers/saml_token_provider.py +5 -2
  20. office365/runtime/auth/sts_profile.py +5 -2
  21. office365/runtime/odata/json_format.py +1 -5
  22. office365/runtime/odata/request.py +8 -13
  23. office365/runtime/paths/v4/entity.py +7 -8
  24. office365/sharepoint/client_context.py +17 -10
  25. {Office365_REST_Python_Client-2.5.3.dist-info → Office365_REST_Python_Client-2.5.4.dist-info}/LICENSE +0 -0
  26. {Office365_REST_Python_Client-2.5.3.dist-info → Office365_REST_Python_Client-2.5.4.dist-info}/WHEEL +0 -0
  27. {Office365_REST_Python_Client-2.5.3.dist-info → Office365_REST_Python_Client-2.5.4.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: Office365-REST-Python-Client
3
- Version: 2.5.3
3
+ Version: 2.5.4
4
4
  Summary: Microsoft 365 & Microsoft Graph Library for Python
5
5
  Home-page: https://github.com/vgrem/Office365-REST-Python-Client
6
6
  Author: Vadim Gremyachev
@@ -63,7 +63,6 @@ pip install Office365-REST-Python-Client
63
63
 
64
64
  ### Note
65
65
  >
66
-
67
66
  >Alternatively the _latest_ version could be directly installed via GitHub:
68
67
  >```
69
68
  >pip install git+https://github.com/vgrem/Office365-REST-Python-Client.git
@@ -211,6 +210,20 @@ The list of examples:
211
210
 
212
211
  Refer [examples section](examples/sharepoint) for another scenarios
213
212
 
213
+ ### Support for non-standard SharePoint Online Environments
214
+
215
+ Support for non-standard SharePoint Environments is currently being implemented. Currently supported:
216
+ - GCC High
217
+
218
+ To enable authentication to GCC High endpoints, add the `environment='GCCH'` parameter when calling the
219
+ `ClientContext class` with `.with_user_credentials`, `.with_client_credentials`, or `.with_credentials`
220
+
221
+ Example:
222
+ ```python
223
+ client_credentials = ClientCredential('{client_id}','{client_secret}')
224
+ ctx = ClientContext('{url}').with_credentials(client_credentials, environment='GCCH')
225
+ ```
226
+
214
227
  # Working with Outlook API
215
228
 
216
229
  The list of supported APIs:
@@ -79,7 +79,7 @@ office365/directory/applications/collection.py,sha256=5G8T3knMKkfWm05dULNcC5nMgq
79
79
  office365/directory/applications/public_client.py,sha256=LXWYVcDLeBpVT9kKjv9rQlUKnaqC_jFrve3YqDekJWs,673
80
80
  office365/directory/applications/service_principal.py,sha256=UtUu7Tw7usLPdN9gL6iXjERXDQLb5Xb37XXw2cOvPDI,374
81
81
  office365/directory/applications/spa.py,sha256=tl_EBnOl8KGXZWC2lets7O9pMW7dNpFOEbCJhm_11RQ,322
82
- office365/directory/applications/template.py,sha256=MPwXRJg91PIDq5knMPIq9CMTqLD-yx5Dd5grQuEP_8E,2314
82
+ office365/directory/applications/template.py,sha256=hXCHL3uTSXe5dTMfVKvPC_8a2cF7VnqXD7U3ANDnVac,2314
83
83
  office365/directory/applications/web.py,sha256=6TvoGsty7gyTUISQo5DLF3JdooOARkrUAJNIenNFK_U,922
84
84
  office365/directory/applications/roles/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
85
85
  office365/directory/applications/roles/assignment.py,sha256=L2ZpAKtoES9WFTTrEBykH2zG0StmV0QOTCoVxc09d3o,2871
@@ -111,7 +111,7 @@ office365/directory/authentication/password_reset_response.py,sha256=T3vjs2XW7av
111
111
  office365/directory/authentication/strength_usage.py,sha256=cHWpeYOPMqGCwyQnPcAdCfDIVsBXEheSH1a1CDs1kUI,1207
112
112
  office365/directory/authentication/methods/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  office365/directory/authentication/methods/details.py,sha256=kxX2TCsLTb6rLuKZzHyV0wwa0wn-uirROF-ADSaqrIs,2592
114
- office365/directory/authentication/methods/email.py,sha256=e1ntZLQQmuOaNkvcH1LM0eVtwOAQ2ikUExP5hlmrkJQ,555
114
+ office365/directory/authentication/methods/email.py,sha256=e_sAbUKIj2ZQzTqDaGTYCG4TEXhDocqnoyAJcsuACT4,582
115
115
  office365/directory/authentication/methods/fido.py,sha256=IjwPcdtn1nUZsRp81VShugPSCb1QnQ7SlbxgummWnnk,253
116
116
  office365/directory/authentication/methods/method.py,sha256=5mmeQruKZQuXfh16wZ__mHIday2vbbP_HUE-JIrCV5I,2391
117
117
  office365/directory/authentication/methods/password.py,sha256=5_Cr4jQl2nhUubzoB2q_hIWBgBQ-A8b5pMJb5BLdJEE,313
@@ -244,7 +244,7 @@ office365/directory/protection/root.py,sha256=x1ML0XEdJMC4ss4q4VRPT5CpUWn1lJalh3
244
244
  office365/directory/protection/riskyusers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
245
245
  office365/directory/protection/riskyusers/activity.py,sha256=BaeW4UqAneEbYVvxI3n5GhFBb1U9mlHpERbYfm4y_tg,201
246
246
  office365/directory/protection/riskyusers/collection.py,sha256=JGkaFnCejLS2htuxaRqISVmf13Z33J5Tc5_VtvJ7q1U,1422
247
- office365/directory/protection/riskyusers/history_item.py,sha256=teoLFL-92FGWMEc589QWv1c70GHlXM5eWJIEXlRwJv4,681
247
+ office365/directory/protection/riskyusers/history_item.py,sha256=ZrmePTuJAZ1gZ8IvoGEbnvVGZ50KayMTyFg33t29z8U,717
248
248
  office365/directory/protection/riskyusers/risky_user.py,sha256=JY9mpy2tmcwYeqr5KI2sWWGO6q_o4r-ywBJfJh_nTz0,1078
249
249
  office365/directory/protection/threatassessment/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
250
250
  office365/directory/protection/threatassessment/mail_request.py,sha256=F11_NkI-SlMPrATBt_3QU3bQzlvMrv4fVcwV7NFgoRE,540
@@ -431,7 +431,7 @@ office365/onedrive/driveitems/album.py,sha256=k61SvQDnWIEi1zR3gCW4BTgQrtcMxlinau
431
431
  office365/onedrive/driveitems/audio.py,sha256=aeloESP6Ru8xV38NQuK_GkUNbWmqMcnyjTs2JQ6dVkQ,878
432
432
  office365/onedrive/driveitems/bundle.py,sha256=ngvqXSLoI-EjmQoWFQvQo9jlW-yQxjMPLfgzn86oi5o,635
433
433
  office365/onedrive/driveitems/conflict_behavior.py,sha256=pfHQyJ8grB5jCJzFmPIYwSr1c4cMVaS5sYXYIVLS3So,140
434
- office365/onedrive/driveitems/driveItem.py,sha256=eZHWNknVgaCUC0SILrmrLXQXT5L1TeP9VpHNrJIVoVQ,33413
434
+ office365/onedrive/driveitems/driveItem.py,sha256=uD98Rp6l397QDO3xd08wjHTMUvpe8cAQHZMwuf4HaHY,33685
435
435
  office365/onedrive/driveitems/geo_coordinates.py,sha256=ZQz6-H0TnZqVVASO6Sxhtwf1shUvtc55yMjVWpTlVFs,799
436
436
  office365/onedrive/driveitems/image.py,sha256=Npm8rwAi1-uzyUw5aLHJtN6zQ0faHfqcJZ6ejQ4AMUw,562
437
437
  office365/onedrive/driveitems/item_preview_info.py,sha256=M7Lm6xNA_96WGQwQcDWwldd5FOfYZr_AdeyuZ1B-OIk,1087
@@ -458,7 +458,7 @@ office365/onedrive/internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
458
458
  office365/onedrive/internal/paths/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
459
459
  office365/onedrive/internal/paths/children.py,sha256=itb38n8c44o-JUd4oPCrpxjnx0mtXtI9liDFnXU1FyI,558
460
460
  office365/onedrive/internal/paths/root.py,sha256=uAn6cdfqDgwNeiBTfkbqSBMCO4VJbd2iWG78S7XdhLw,268
461
- office365/onedrive/internal/paths/shared.py,sha256=S2nRj8LFFpVSxlZ5wzB7Wzb9--3GZ0rbf3h-9Do7Re0,510
461
+ office365/onedrive/internal/paths/shared.py,sha256=Pvrlbl3vzamJTT0bZWfByOfkPokRVWP_dQ-y9N5HOGM,738
462
462
  office365/onedrive/internal/paths/site.py,sha256=mQm5NqcevjAI5R89iJHV-DlJxsdvGrCQYzTsuTWSY1Y,682
463
463
  office365/onedrive/internal/paths/url.py,sha256=BxKpPiLhQRDATfHbBHxgSI-P224ksyxuDiu6bsrdf9s,878
464
464
  office365/onedrive/internal/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -490,7 +490,7 @@ office365/onedrive/sensitivitylabels/assignment_method.py,sha256=nTZYobBvISUrl1_
490
490
  office365/onedrive/sensitivitylabels/extract_result.py,sha256=MXq_Nzowwh4gx3b3DFI8qDr1YOxoTeP6qFLubjSYM4A,595
491
491
  office365/onedrive/shares/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
492
492
  office365/onedrive/shares/collection.py,sha256=xR4_OtUsbDddPiUfSf5teRhegYlSdSkjy1MBBS5WvoU,589
493
- office365/onedrive/shares/drive_item.py,sha256=3cGFhnlQYVrbfkt3nLyDr_rRzf4IG_zuGfNx8Rnv608,3248
493
+ office365/onedrive/shares/drive_item.py,sha256=_S-68ko-QO-jJRdCez_i43aTHQ4qtbotmpEwLNLLlt8,3303
494
494
  office365/onedrive/shares/shared.py,sha256=UC2OMgKs3EJdBw0c85wH2f3ka1coDHOj8E1zj3rVTSk,1163
495
495
  office365/onedrive/sites/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
496
496
  office365/onedrive/sites/site.py,sha256=80GuT-6pLSiC9jcO59RXXI8egohE-RORC-ugX_sibYQ,9685
@@ -514,13 +514,13 @@ office365/onedrive/termstore/terms/label.py,sha256=dxTJtaDXULjNAXv4jG50akVM9X28J
514
514
  office365/onedrive/termstore/terms/term.py,sha256=Jmm4Fwt8gruMSfd01s62nSU0fFfhPfEcAjLNwrs_Gus,2387
515
515
  office365/onedrive/versions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
516
516
  office365/onedrive/versions/base_item.py,sha256=CBG2sIi_DJoWa0K0Lt6O21BMJ4HRPhfSf7xF5R_H1xk,1283
517
- office365/onedrive/versions/drive_item.py,sha256=G0T4cAUxZUmV4Rsc-YQ4RvG3QeXX26ANay8P40V8mXY,1095
517
+ office365/onedrive/versions/drive_item.py,sha256=tLWoFkK64ofRbA9cDiv2UpaUBVYDb5Thj7FeBjJWHrI,1077
518
518
  office365/onedrive/versions/list_item.py,sha256=lmVTPFAzq5zjrQDrqluauF7TLwSeACLwrQuxrNF0_Co,1229
519
519
  office365/onedrive/workbooks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
520
520
  office365/onedrive/workbooks/filter.py,sha256=pWQ-tafMN9ap2rWOEE2vuc6BWV5OLIcwbF5K55zA6p0,121
521
521
  office365/onedrive/workbooks/filter_criteria.py,sha256=lXtBgHDhp-n5T1freN6E0uxYBuwr-2nHJBepYdvY49c,165
522
522
  office365/onedrive/workbooks/session_info.py,sha256=oBxY0F1P2F2dI2XX6Aw1SHMFHwafVyY31leKK7UdGGE,484
523
- office365/onedrive/workbooks/workbook.py,sha256=_IeguF1z06xXZz4DvtfUfbpZtkRT5bHIdXMojuR32Fg,6293
523
+ office365/onedrive/workbooks/workbook.py,sha256=w0SrTQLr3oNuTFaLbyHEPXdZ2Tn7NxXH5qEScCWhKLw,6256
524
524
  office365/onedrive/workbooks/applications/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
525
525
  office365/onedrive/workbooks/applications/application.py,sha256=wrLHNCPEHytEomqsULdyrEgSumB_gUNhP6fUtiyCy8Q,913
526
526
  office365/onedrive/workbooks/charts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -536,9 +536,10 @@ office365/onedrive/workbooks/comments/comment.py,sha256=rwqsinCE6cNAUHjlIISYzIzf
536
536
  office365/onedrive/workbooks/comments/reply.py,sha256=Q6YXtEVcQEkgvChw1nA-shp6oydM-RS2WCjFcBB-sUM,124
537
537
  office365/onedrive/workbooks/functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
538
538
  office365/onedrive/workbooks/functions/functions.py,sha256=vGr4pf5FdYYb4LwIttxwRrSXCKTvIVJcwuoCsZ7T_wA,2666
539
- office365/onedrive/workbooks/functions/result.py,sha256=VWRLaa5KgvDADLjUqYHHw2cl5mLJmbNyzjdMZ5RtaGI,163
539
+ office365/onedrive/workbooks/functions/result.py,sha256=_RxlG0iGf7AC5n0E3Kkk7KgqV1Dg9lIyL35uCkix8FQ,161
540
540
  office365/onedrive/workbooks/names/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
541
- office365/onedrive/workbooks/names/named_item.py,sha256=tp7Uq9hGjGX_TGmFuZzu7zYleXS2Tt8JgIiMLXpKi8U,1210
541
+ office365/onedrive/workbooks/names/collection.py,sha256=aJ_wyEPWJ1p281vvc1Ou_FEE348eIAI6iquRpHPsPeA,1224
542
+ office365/onedrive/workbooks/names/named_item.py,sha256=vwqh1kpWNVjTKPkBDw7UjriIeTqe8Uqex1oovRb-kQ0,1862
542
543
  office365/onedrive/workbooks/operations/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
543
544
  office365/onedrive/workbooks/operations/error.py,sha256=CtrnxEb9EPAQB_EyCdK0tPWlhS2wIX1o5UNWN0ytrQM,432
544
545
  office365/onedrive/workbooks/operations/workbook.py,sha256=4UCXgDTg57LKELdB3QneuhGIWiZ2hCT8Y7KdMUUxFkg,835
@@ -547,14 +548,14 @@ office365/onedrive/workbooks/ranges/border.py,sha256=2oyXmSPbERiXDIR8MoMk4x69ILr
547
548
  office365/onedrive/workbooks/ranges/fill.py,sha256=AHH-tCcwtMPufjgmRherPGJRdb5al9aMKxitwm4JweM,126
548
549
  office365/onedrive/workbooks/ranges/format.py,sha256=UdXxa4M4q-8lugfVYA-X1aRJ5Lmcv-7IuoDF7gt_Hdk,974
549
550
  office365/onedrive/workbooks/ranges/format_protection.py,sha256=76aOuRaHmYzu2BhKkO5W-ghhysg5yebsmkvCOAHeEEA,140
550
- office365/onedrive/workbooks/ranges/range.py,sha256=nhFRwoO_lU2uPkggSVysgYFLGGaRFrKQC74lYBIP0W0,2667
551
+ office365/onedrive/workbooks/ranges/range.py,sha256=wJs5aMAzmKF2tzJ-CpPYLvjqOQgDpGZmsmnA1OlI6CA,4961
551
552
  office365/onedrive/workbooks/ranges/reference.py,sha256=B4DTuDUl0inscB1Mah0z6wuqpSy29OJwMObOJaNjMiE,111
552
553
  office365/onedrive/workbooks/ranges/sort.py,sha256=0dvB3GVFXmseZQv21W9vWoxCEf7S6f-bRiynim4SO5E,126
553
554
  office365/onedrive/workbooks/ranges/view.py,sha256=3XEcGvW9ovCsvd57a2iMy8yFV2mhTiBPe6k3CxGHCjE,663
554
555
  office365/onedrive/workbooks/tables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
555
556
  office365/onedrive/workbooks/tables/collection.py,sha256=SkcuWlgQz0xYOGnT2c9wdZIbjllNfOY5gf_n-Wpndhs,1553
556
557
  office365/onedrive/workbooks/tables/pivot_table.py,sha256=yF4bjsvmo6o03lncpsCALlAXuDru2Bn97KMZe0mE4Co,1212
557
- office365/onedrive/workbooks/tables/table.py,sha256=3scdNu9X2P28SaISOkmZCOCKnzIonYg_Y80NPREGQiM,3162
558
+ office365/onedrive/workbooks/tables/table.py,sha256=1IOOqTSRy4t7kpFacyghgbQSBEq_x633waffj1yJk-M,3368
558
559
  office365/onedrive/workbooks/tables/columns/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
559
560
  office365/onedrive/workbooks/tables/columns/collection.py,sha256=g66gGi7KsoDrQW72zBx9DoRvmVeOtOyLp0kGxyOZA8k,1410
560
561
  office365/onedrive/workbooks/tables/columns/column.py,sha256=mmXIUnBA0Bxdhi3YNA9TRxz97MCGEAKqgL3dQrvw-l8,1533
@@ -600,7 +601,7 @@ office365/outlook/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
600
601
  office365/outlook/category.py,sha256=ZjPZ6oaG-2ADtE2R5vB2DmA-d5A8_K1EsTXUaEji9aA,742
601
602
  office365/outlook/convert_id_result.py,sha256=F9E2HcZQAjzUfefUTckURjFdGnnZwJWxt6UcRdUxpPo,564
602
603
  office365/outlook/geo_coordinates.py,sha256=ctZo-pzcz7NAS7qk7WAJDlj1KGy6vJnBsAgJbhrtaoE,1041
603
- office365/outlook/item.py,sha256=reGhDgvnvXb9Tm0pwc7ouc1c_2L16F7ZAh_7ZmabE9k,1731
604
+ office365/outlook/item.py,sha256=2_l-mpxb4z7X_gIqWe-E_ZwdmIwSEzgNmlHB3YwEnuw,1757
604
605
  office365/outlook/locale_info.py,sha256=-fKxustawroQ6ZdCjT0LbPkqQCGK4YGGfl4LWXLUS1s,880
605
606
  office365/outlook/timezone_information.py,sha256=PYknRB92bxmyUSVCQAJiUljnmulpRHhxL8N-ZArBluE,662
606
607
  office365/outlook/user.py,sha256=JJeqBsUiltGTGFeSJkWC9LZie00Un3iQKqAJKPEPxIQ,2823
@@ -725,19 +726,19 @@ office365/runtime/client_value.py,sha256=CB-fG87zgYiBaqEFbLx6Q6g9_uz16tnHOlf_Aej
725
726
  office365/runtime/client_value_collection.py,sha256=H4E8-xA0cbzizC3XrPqHi14398JG_Sg1yaqvvpOWICs,2809
726
727
  office365/runtime/compat.py,sha256=P9eGgmuLE7KeHr9rgv-_WCI2sLHER5Hxd99F8k98KRU,1610
727
728
  office365/runtime/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
728
- office365/runtime/auth/authentication_context.py,sha256=iyFd2GxpqcCazlSkHymNxu_hbFp5Lbu5EXdtmyn70kg,8726
729
+ office365/runtime/auth/authentication_context.py,sha256=QBUXzKnm4yeKd1BBUf0eZ3EVSr0BqUYk5TlRXLZC29Q,8860
729
730
  office365/runtime/auth/authentication_provider.py,sha256=B6XwQWg13Fyf9Qmv1L2jEfRmf9bkBJpYmWReNojJsRQ,320
730
731
  office365/runtime/auth/client_credential.py,sha256=nJjmCF6kAChl2XIUxF4MELL0cc5IGTMQuD7IVIK30Bo,274
731
732
  office365/runtime/auth/credential_type.py,sha256=mwqBEoFTi2ZdFM0DhsHY8NuOjQjkCaR14btpEjIBAQ0,114
732
- office365/runtime/auth/sts_profile.py,sha256=NZaREgjudwPp4FcXweMcssX5lZakKqrOLbwSpAT2RIo,1254
733
+ office365/runtime/auth/sts_profile.py,sha256=0hI7o-DGrdfQs5dewnunWPKdWOlR66O5YhhCNFZhNUI,1384
733
734
  office365/runtime/auth/token_response.py,sha256=OOgO7wmkx-qNxIqX2I4H2zRBp58hiRE6tIaf3mJxnZo,858
734
735
  office365/runtime/auth/user_credential.py,sha256=TyjvuTQs3NioqQAXwZVnfYLaGVEJWDDFnLVz6-x41oU,223
735
736
  office365/runtime/auth/user_realm_info.py,sha256=BIcLI25MiV_5PAgm0ouByo0D2eA23SIDc01Ze18K4yE,237
736
737
  office365/runtime/auth/providers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
737
- office365/runtime/auth/providers/acs_token_provider.py,sha256=nTZRuDKp1YHeLWs5tic14LoY6UodJFeGuMHRp9O46Rg,4540
738
+ office365/runtime/auth/providers/acs_token_provider.py,sha256=gU_Jo5E0mpHUoRZONLjib-ZY43ugYNTRg8R_SAw8OoU,4963
738
739
  office365/runtime/auth/providers/network_credential_provider.py,sha256=QhftPyDa2C0dO8GjEdBd-09lQGoJlIZTeAiAXtdfc2Y,488
739
740
  office365/runtime/auth/providers/ntlm_provider.py,sha256=XXnSRCVndNpXufzd_ZA_Iti4OMVc3bhRlAoXBSny2Gw,963
740
- office365/runtime/auth/providers/saml_token_provider.py,sha256=YimSuen02fmF-IpOW51_uXhaYGXu1oHUEQ6Ad5vtLHc,12470
741
+ office365/runtime/auth/providers/saml_token_provider.py,sha256=Y7EVc5S6ojY-2diEzTdKVa-SZv1_xJ7df-kKw4afg-8,12722
741
742
  office365/runtime/auth/providers/templates/FederatedSAML.xml,sha256=VpJDhxe51ovXuy8yZ0N0ySQmNtaQ8TbkkumC50TcBSs,2115
742
743
  office365/runtime/auth/providers/templates/RST2.xml,sha256=NR4uiTf9wdI8-7ZsJbpb19YJsQzESNXHOmrAyStJRZU,1513
743
744
  office365/runtime/auth/providers/templates/SAML.xml,sha256=GLQ3Jo3umqI839avwPvkQEQMkal4RwPRzxSK_J_8lQA,1526
@@ -747,14 +748,14 @@ office365/runtime/http/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
747
748
  office365/runtime/http/http_method.py,sha256=7QH3nYGPJGpbfDcRq1NT5xf_V4osTKVoUA_KeZP5nzQ,148
748
749
  office365/runtime/http/request_options.py,sha256=i6ch8EKMiSy8osUnrciKY1EN6U9VNkcLLK6YKI3dAgc,904
749
750
  office365/runtime/odata/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
750
- office365/runtime/odata/json_format.py,sha256=hWvL3Pcx4rwwuZn4Xi_Vk17xDDjUZ4EACo8WQeDE0YI,881
751
+ office365/runtime/odata/json_format.py,sha256=Ei4zWXCwOK94cotaCNg5JlFCypnNjokn7Cw6108zrv4,851
751
752
  office365/runtime/odata/method.py,sha256=X2nvUuiWaN7AoT1QHGX0CfuGEIRMPSUBiKJHi7v7W3k,283
752
753
  office365/runtime/odata/model.py,sha256=P57zeqsrVrwj_O7w9aY1iVIWuo5uCZmPemr5vslUIFo,357
753
754
  office365/runtime/odata/parameter.py,sha256=njlj75eY1HLczOXhrgIFlM5OqrLpVjCrbYdEdKJDhss,163
754
755
  office365/runtime/odata/property.py,sha256=TSkDzGdxOjHoe7L5gJtgOLjr7Y_7oQgZdT2ZWHWAxyA,139
755
756
  office365/runtime/odata/query_options.py,sha256=5CPQxobvmzRHnyizUGJazdBOMUfZC0pUzI1OZZb8P5E,3793
756
757
  office365/runtime/odata/reader.py,sha256=IjfjjX_PjbHQwIm6TmTEYU_t0RvtvweZAvChzSv5x4U,2381
757
- office365/runtime/odata/request.py,sha256=WwqbWO2yvOnfZrgJGpzqAdZVIl-iMEfUT_k3Es2ybNU,6164
758
+ office365/runtime/odata/request.py,sha256=HNJ8QbNHVWZoenKpdQbe1mCurDOX_E6DZHBHBgW9_2s,6108
758
759
  office365/runtime/odata/type.py,sha256=DoG1D12VxToZH-rIW7bxWVLy3X6Kew14IxkEEV6kgLY,3516
759
760
  office365/runtime/odata/type_information.py,sha256=sxKByrfFFeDyTNIfUk1E6LbRoMgSZKvES1QBNvA2hsA,210
760
761
  office365/runtime/odata/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -778,7 +779,7 @@ office365/runtime/paths/service_operation.py,sha256=Bow8NixW4LjeQ32SVzOKF6RQEMhI
778
779
  office365/runtime/paths/v3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
779
780
  office365/runtime/paths/v3/entity.py,sha256=5Z0yWD8LF90kpYulrZ_K02v-ApwPADPuz5d3sVhCmR4,436
780
781
  office365/runtime/paths/v4/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
781
- office365/runtime/paths/v4/entity.py,sha256=D9en7D3td7ZJaRq29On_toyuyu_-wEmSZkvCzQ28how,1033
782
+ office365/runtime/paths/v4/entity.py,sha256=ogmVlMambJHm8PMQCgjq6nwbERxPp7vv35eY002VKk4,1056
782
783
  office365/runtime/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
783
784
  office365/runtime/queries/batch.py,sha256=IP5EtBcrHqMlajW6sLHt2_4bj9TRYukfVLZSZ5yjlNg,1811
784
785
  office365/runtime/queries/client_query.py,sha256=qmIwm1LcJhxj5FYY1V8TylJd5zcUOpyeodNcnNH5OYY,2086
@@ -811,7 +812,7 @@ office365/search/external/connection.py,sha256=9yw_UhSvrsyMnJxPJuCe4it7jmN8cF3H3
811
812
  office365/search/external/external.py,sha256=_Pk_eMWic2eedPZmEIN1Sj5ZGbk1BsA6VVIgM7Qtc8M,734
812
813
  office365/search/external/search_settings.py,sha256=2pWKbktGwjHEhdehBnaUAPlG8aS3pIrnayzlRtNl_j0,179
813
814
  office365/sharepoint/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
814
- office365/sharepoint/client_context.py,sha256=k0VxzBgiMhT7q2k9nTt_a4bgUZiHTngHAsONlkZcx60,26725
815
+ office365/sharepoint/client_context.py,sha256=EoNyhDsMMeCcG1MjresyLQQgbubm4kOkmkrBpRNKg6w,27352
815
816
  office365/sharepoint/entity.py,sha256=PpLLcLJupCtPrrYtllFEet4MoVsCByEFRypBb2mEobI,1404
816
817
  office365/sharepoint/entity_collection.py,sha256=b5q1hAhB0iGPGKG8imVPuuiBwO9LU_weetNOkndUwkk,1252
817
818
  office365/sharepoint/request.py,sha256=EGrMNJCPKcjBEPLKZskinAKpqqknsKY4o9eHZsi2HWM,239
@@ -1862,8 +1863,8 @@ office365/todo/tasks/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
1862
1863
  office365/todo/tasks/list.py,sha256=i8figSfqkRm1wuUZXJntZWnnidT0XIY2SGvCCuRK8C8,1138
1863
1864
  office365/todo/tasks/list_collection.py,sha256=bDKOXgzdCDWnJqPZgBQYZ9yaFNOqXrv5DL1uWy5fg_M,584
1864
1865
  office365/todo/tasks/task.py,sha256=ZWGkBieQ7_7Om4RgBhXfCs6651a2mi_tFttZgaIcY4o,2120
1865
- Office365_REST_Python_Client-2.5.3.dist-info/LICENSE,sha256=oiA-FsK_tSE0PNl3jtQ9ohZjFjPyQK3ejw6le4hzL5Q,1083
1866
- Office365_REST_Python_Client-2.5.3.dist-info/METADATA,sha256=2WHCIFM1h6tWYR-uJuACndO9e_NkCqjFHRI7k94mJuA,17725
1867
- Office365_REST_Python_Client-2.5.3.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
1868
- Office365_REST_Python_Client-2.5.3.dist-info/top_level.txt,sha256=xmwMgIZYmOTzckcPR2A1-3ebpPhfqj1l_QOvsOf30X4,10
1869
- Office365_REST_Python_Client-2.5.3.dist-info/RECORD,,
1866
+ Office365_REST_Python_Client-2.5.4.dist-info/LICENSE,sha256=oiA-FsK_tSE0PNl3jtQ9ohZjFjPyQK3ejw6le4hzL5Q,1083
1867
+ Office365_REST_Python_Client-2.5.4.dist-info/METADATA,sha256=AAqxy6U30jU9bvkVZUOI-eBGB5ymi3aavXqS30YeU1I,18313
1868
+ Office365_REST_Python_Client-2.5.4.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
1869
+ Office365_REST_Python_Client-2.5.4.dist-info/top_level.txt,sha256=xmwMgIZYmOTzckcPR2A1-3ebpPhfqj1l_QOvsOf30X4,10
1870
+ Office365_REST_Python_Client-2.5.4.dist-info/RECORD,,
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
  from office365.runtime.client_result import ClientResult
3
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -25,11 +27,8 @@ class ApplicationTemplate(Entity):
25
27
 
26
28
  @property
27
29
  def display_name(self):
28
- """
29
- The name of the application.
30
-
31
- :rtype: str or None
32
- """
30
+ # type: () -> Optional[str]
31
+ """The name of the application."""
33
32
  return self.properties.get("displayName", None)
34
33
 
35
34
  @property
@@ -44,9 +43,7 @@ class ApplicationTemplate(Entity):
44
43
 
45
44
  @property
46
45
  def supported_provisioning_types(self):
47
- """
48
- The list of provisioning modes supported by this application
49
- """
46
+ """The list of provisioning modes supported by this application"""
50
47
  return self.properties.get("supportedProvisioningTypes", StringCollection())
51
48
 
52
49
  @property
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.authentication.methods.method import AuthenticationMethod
2
4
 
3
5
 
@@ -9,8 +11,6 @@ class EmailAuthenticationMethod(AuthenticationMethod):
9
11
 
10
12
  @property
11
13
  def email_address(self):
12
- """
13
- The email address registered to this user.
14
- :rtype: str
15
- """
14
+ # type: () -> Optional[str]
15
+ """The email address registered to this user."""
16
16
  return self.properties.get("emailAddress", None)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.protection.riskyusers.activity import RiskUserActivity
2
4
  from office365.directory.protection.riskyusers.risky_user import RiskyUser
3
5
 
@@ -13,7 +15,6 @@ class RiskyUserHistoryItem(RiskyUser):
13
15
 
14
16
  @property
15
17
  def initiated_by(self):
16
- """The ID of actor that does the operation.
17
- :rtype: str
18
- """
18
+ # type: () -> Optional[str]
19
+ """The ID of actor that does the operation."""
19
20
  return self.properties.get("initiatedBy", None)
@@ -795,6 +795,12 @@ class DriveItem(BaseItem):
795
795
  ),
796
796
  )
797
797
 
798
+ def set_property(self, name, value, persist_changes=True):
799
+ super(DriveItem, self).set_property(name, value, persist_changes)
800
+ if name == "parentReference":
801
+ self._resource_path.parent.patch(self.parent_reference.driveId)
802
+ return self
803
+
798
804
  def get_property(self, name, default_value=None):
799
805
  # type: (str, P_T) -> P_T
800
806
  if default_value is None:
@@ -1,22 +1,27 @@
1
1
  import base64
2
2
 
3
3
  from office365.runtime.paths.resource_path import ResourcePath
4
+ from office365.runtime.paths.v4.entity import EntityPath
4
5
 
5
6
 
6
7
  def _url_to_shared_token(url):
7
- """
8
- Converts url into shared token
9
- :param str url:
10
- """
8
+ # type: (str) -> str
9
+ """Converts url into shared token"""
11
10
  value = base64.b64encode(url.encode("ascii")).decode("ascii")
12
11
  if value.endswith("="):
13
12
  value = value[:-1]
14
13
  return "u!" + value.replace("/", "_").replace("+", "-")
15
14
 
16
15
 
17
- class SharedPath(ResourcePath):
16
+ class SharedPath(EntityPath):
18
17
  """Shared token path"""
19
18
 
19
+ def patch(self, key):
20
+ self._key = "items"
21
+ self._parent = ResourcePath(key, ResourcePath("drives"))
22
+ self.__class__ = ResourcePath
23
+ return self
24
+
20
25
  @property
21
26
  def segment(self):
22
27
  return _url_to_shared_token(self._key)
@@ -8,6 +8,7 @@ from office365.onedrive.lists.list import List
8
8
  from office365.onedrive.permissions.permission import Permission
9
9
  from office365.onedrive.sites.site import Site
10
10
  from office365.runtime.paths.resource_path import ResourcePath
11
+ from office365.runtime.paths.v4.entity import EntityPath
11
12
 
12
13
 
13
14
  class SharedDriveItem(BaseItem):
@@ -47,7 +48,7 @@ class SharedDriveItem(BaseItem):
47
48
  """Used to access the underlying driveItem"""
48
49
  return self.properties.get(
49
50
  "driveItem",
50
- DriveItem(self.context, ResourcePath("driveItem", self.resource_path)),
51
+ DriveItem(self.context, EntityPath("driveItem", self.resource_path)),
51
52
  )
52
53
 
53
54
  @property
@@ -1,4 +1,4 @@
1
- from typing import Optional
1
+ from typing import AnyStr, Optional
2
2
 
3
3
  from office365.onedrive.versions.base_item import BaseItemVersion
4
4
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -17,16 +17,12 @@ class DriveItemVersion(BaseItemVersion):
17
17
 
18
18
  @property
19
19
  def content(self):
20
- """
21
- The content stream for this version of the item.
22
- :rtype: str or bytes
23
- """
20
+ # type: () -> Optional[AnyStr]
21
+ """The content stream for this version of the item."""
24
22
  return self.properties.get("content", None)
25
23
 
26
24
  @property
27
25
  def size(self):
28
26
  # type: () -> Optional[int]
29
- """
30
- Indicates the size of the content stream for this version of the item.
31
- """
27
+ """Indicates the size of the content stream for this version of the item."""
32
28
  return self.properties.get("size", None)
@@ -4,4 +4,4 @@ from office365.entity import Entity
4
4
  class WorkbookFunctionResult(Entity):
5
5
  @property
6
6
  def value(self):
7
- return self.properties.get("__value", None)
7
+ return self.properties.get("value", None)
@@ -0,0 +1,26 @@
1
+ from office365.entity_collection import EntityCollection
2
+ from office365.onedrive.workbooks.names.named_item import WorkbookNamedItem
3
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
4
+
5
+
6
+ class WorkbookNamedItemCollection(EntityCollection[WorkbookNamedItem]):
7
+ def __init__(self, context, resource_path=None):
8
+ super(WorkbookNamedItemCollection, self).__init__(
9
+ context, WorkbookNamedItem, resource_path
10
+ )
11
+
12
+ def add(self, name, reference, comment=None):
13
+ """
14
+ Adds a new name to the collection of the given scope using the user's locale for the formula.
15
+
16
+ :param str name: The name of the object.
17
+ :param str reference: Represents the formula that the name is defined to refer to.
18
+ For example, =Sheet14!$B$2:$H$12, =4.75,
19
+ :param str comment: Represents the comment associated with this name.
20
+ """
21
+ return_type = WorkbookNamedItem(self.context)
22
+ self.add_child(return_type)
23
+ payload = {"name": name, "reference": reference, "comment": comment}
24
+ qry = ServiceOperationQuery(self, "add", None, payload, None, return_type)
25
+ self.context.add_query(qry)
26
+ return return_type
@@ -1,5 +1,9 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
4
+ from office365.onedrive.workbooks.ranges.range import WorkbookRange
2
5
  from office365.runtime.paths.resource_path import ResourcePath
6
+ from office365.runtime.queries.function import FunctionQuery
3
7
 
4
8
 
5
9
  class WorkbookNamedItem(Entity):
@@ -7,18 +11,26 @@ class WorkbookNamedItem(Entity):
7
11
  (as seen in the type below), range object, reference to a range. This object can be used to obtain range
8
12
  object associated with names."""
9
13
 
14
+ def range(self):
15
+ """Returns the range object that is associated with the name. Throws an exception if the named item's type
16
+ isn't a range."""
17
+ return_type = WorkbookRange(
18
+ self.context, ResourcePath("range", self.resource_path)
19
+ )
20
+ qry = FunctionQuery(self, "range", return_type=return_type)
21
+ self.context.add_query(qry)
22
+ return return_type
23
+
10
24
  @property
11
25
  def name(self):
12
- """The name of the object. Read-only.
13
- :rtype str or None
14
- """
26
+ # type: () -> Optional[str]
27
+ """The name of the object."""
15
28
  return self.properties.get("name", None)
16
29
 
17
30
  @property
18
31
  def comment(self):
19
- """Represents the comment associated with this name.
20
- :rtype str or None
21
- """
32
+ # type: () -> Optional[str]
33
+ """Represents the comment associated with this name."""
22
34
  return self.properties.get("comment", None)
23
35
 
24
36
  @property
@@ -33,3 +45,8 @@ class WorkbookNamedItem(Entity):
33
45
  self.context, ResourcePath("worksheet", self.resource_path)
34
46
  ),
35
47
  )
48
+
49
+ @property
50
+ def property_ref_name(self):
51
+ # type: () -> str
52
+ return "name"
@@ -1,4 +1,4 @@
1
- from typing import Optional
1
+ from typing import List, Optional
2
2
 
3
3
  from office365.entity import Entity
4
4
  from office365.onedrive.workbooks.ranges.format import WorkbookRangeFormat
@@ -6,13 +6,50 @@ from office365.onedrive.workbooks.ranges.sort import WorkbookRangeSort
6
6
  from office365.onedrive.workbooks.ranges.view import WorkbookRangeView
7
7
  from office365.runtime.paths.resource_path import ResourcePath
8
8
  from office365.runtime.queries.function import FunctionQuery
9
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
9
10
 
10
11
 
11
12
  class WorkbookRange(Entity):
12
13
  """Range represents a set of one or more contiguous cells such as a cell, a row, a column, block of cells, etc."""
13
14
 
15
+ def cell(self, row, column):
16
+ """
17
+ Gets the range object containing the single cell based on row and column numbers. The cell can be outside
18
+ the bounds of its parent range, so long as it's stays within the worksheet grid.
19
+ :param int row: Row number of the cell to be retrieved. Zero-indexed.
20
+ :param int column: Column number of the cell to be retrieved. Zero-indexed.
21
+ """
22
+ return_type = WorkbookRange(self.context)
23
+ params = {"row": row, "column": column}
24
+ qry = FunctionQuery(self, "cell", params, return_type=return_type)
25
+ self.context.add_query(qry)
26
+ return return_type
27
+
28
+ def clear(self, apply_to=None):
29
+ """Clear range values such as format, fill, and border.
30
+ :param str apply_to:
31
+ """
32
+ payload = {"applyTo": apply_to}
33
+ qry = ServiceOperationQuery(self, "clear", parameters_type=payload)
34
+ self.context.add_query(qry)
35
+ return self
36
+
37
+ def insert(self, shift):
38
+ """
39
+ Inserts a cell or a range of cells into the worksheet in place of this range, and shifts the other cells to
40
+ make space. Returns a new Range object at the now blank space.
41
+ :param str shift: Specifies which way to shift the cells. The possible values are: Down, Right.
42
+ """
43
+ return_type = WorkbookRange(self.context)
44
+ payload = {"shift": shift}
45
+ qry = ServiceOperationQuery(
46
+ self, "insert", parameters_type=payload, return_type=return_type
47
+ )
48
+ self.context.add_query(qry)
49
+ return return_type
50
+
14
51
  def visible_view(self):
15
- """"""
52
+ """Get the range visible from a filtered range."""
16
53
  return_type = WorkbookRangeView(self.context)
17
54
  qry = FunctionQuery(self, "visibleView", return_type=return_type)
18
55
  self.context.add_query(qry)
@@ -63,6 +100,20 @@ class WorkbookRange(Entity):
63
100
  WorkbookRangeSort(self.context, ResourcePath("sort", self.resource_path)),
64
101
  )
65
102
 
103
+ @property
104
+ def values(self):
105
+ # type: () -> List
106
+ """Represents the raw values of the specified range. The data returned could be of type string, number,
107
+ or a boolean. Cell that contains an error returns the error string."""
108
+ return self.properties.get("values", None)
109
+
110
+ @property
111
+ def value_types(self):
112
+ # type: () -> List
113
+ """Represents the type of data of each cell. The possible values are:
114
+ Unknown, Empty, String, Integer, Double, Boolean, Error."""
115
+ return self.properties.get("valueTypes", None)
116
+
66
117
  @property
67
118
  def worksheet(self):
68
119
  """The worksheet containing the current range"""
@@ -16,16 +16,23 @@ from office365.runtime.queries.service_operation import ServiceOperationQuery
16
16
  class WorkbookTable(Entity):
17
17
  """Represents an Excel table."""
18
18
 
19
+ def __repr__(self):
20
+ return self.name or self.id or self.entity_type_name
21
+
19
22
  def data_body_range(self):
20
23
  """Gets the range object associated with the data body of the table."""
21
- return_type = WorkbookRange(self.context)
24
+ return_type = WorkbookRange(
25
+ self.context, ResourcePath("dataBodyRange", self.resource_path)
26
+ )
22
27
  qry = FunctionQuery(self, "dataBodyRange", return_type=return_type)
23
28
  self.context.add_query(qry)
24
29
  return return_type
25
30
 
26
31
  def range(self):
27
32
  """Get the range object associated with the entire table."""
28
- return_type = WorkbookRange(self.context)
33
+ return_type = WorkbookRange(
34
+ self.context, ResourcePath("range", self.resource_path)
35
+ )
29
36
  qry = FunctionQuery(self, "range", return_type=return_type)
30
37
  self.context.add_query(qry)
31
38
  return return_type
@@ -58,9 +65,7 @@ class WorkbookTable(Entity):
58
65
  @property
59
66
  def columns(self):
60
67
  # type: () -> WorkbookTableColumnCollection
61
- """
62
- Represents a collection of all the columns in the table.
63
- """
68
+ """Represents a collection of all the columns in the table."""
64
69
  return self.properties.get(
65
70
  "columns",
66
71
  WorkbookTableColumnCollection(
@@ -3,7 +3,7 @@ from office365.entity_collection import EntityCollection
3
3
  from office365.onedrive.workbooks.applications.application import WorkbookApplication
4
4
  from office365.onedrive.workbooks.comments.comment import WorkbookComment
5
5
  from office365.onedrive.workbooks.functions.functions import WorkbookFunctions
6
- from office365.onedrive.workbooks.names.named_item import WorkbookNamedItem
6
+ from office365.onedrive.workbooks.names.collection import WorkbookNamedItemCollection
7
7
  from office365.onedrive.workbooks.operations.workbook import WorkbookOperation
8
8
  from office365.onedrive.workbooks.session_info import WorkbookSessionInfo
9
9
  from office365.onedrive.workbooks.tables.collection import WorkbookTableCollection
@@ -11,6 +11,7 @@ from office365.onedrive.workbooks.worksheets.collection import (
11
11
  WorkbookWorksheetCollection,
12
12
  )
13
13
  from office365.runtime.client_result import ClientResult
14
+ from office365.runtime.http.request_options import RequestOptions
14
15
  from office365.runtime.paths.resource_path import ResourcePath
15
16
  from office365.runtime.queries.function import FunctionQuery
16
17
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -56,9 +57,7 @@ class Workbook(Entity):
56
57
  self.context.add_query(qry)
57
58
 
58
59
  def _construct_request(request):
59
- """
60
- :type request: office365.runtime.http.request_options.RequestOptions
61
- """
60
+ # type: (RequestOptions) -> None
62
61
  request.set_header("workbook-session-id", session_id)
63
62
 
64
63
  self.context.before_execute(_construct_request)
@@ -66,15 +65,12 @@ class Workbook(Entity):
66
65
 
67
66
  def close_session(self, session_id):
68
67
  """Use this API to close an existing workbook session.
69
-
70
68
  :param str session_id: Identifier of the workbook session
71
69
  """
72
70
  qry = ServiceOperationQuery(self, "closeSession")
73
71
 
74
72
  def _construct_request(request):
75
- """
76
- :type request: office365.runtime.http.request_options.RequestOptions
77
- """
73
+ # type: (RequestOptions) -> None
78
74
  request.set_header("workbook-session-id", session_id)
79
75
 
80
76
  self.context.before_execute(_construct_request)
@@ -93,6 +89,7 @@ class Workbook(Entity):
93
89
 
94
90
  @property
95
91
  def comments(self):
92
+ # type: () -> EntityCollection[WorkbookComment]
96
93
  """"""
97
94
  return self.properties.get(
98
95
  "comments",
@@ -126,13 +123,12 @@ class Workbook(Entity):
126
123
 
127
124
  @property
128
125
  def names(self):
129
- # type: () -> EntityCollection[WorkbookNamedItem]
126
+ # type: () -> WorkbookNamedItemCollection
130
127
  """Represents a collection of workbook scoped named items (named ranges and constants). Read-only."""
131
128
  return self.properties.get(
132
129
  "names",
133
- EntityCollection(
130
+ WorkbookNamedItemCollection(
134
131
  self.context,
135
- WorkbookNamedItem,
136
132
  ResourcePath("names", self.resource_path),
137
133
  ),
138
134
  )
office365/outlook/item.py CHANGED
@@ -1,4 +1,5 @@
1
1
  import datetime
2
+ from typing import Optional
2
3
 
3
4
  from office365.entity import Entity
4
5
  from office365.runtime.types.collections import StringCollection
@@ -7,18 +8,16 @@ from office365.runtime.types.collections import StringCollection
7
8
  class OutlookItem(Entity):
8
9
  @property
9
10
  def change_key(self):
11
+ # type: () -> Optional[str]
10
12
  """
11
13
  Identifies the version of the item. Every time the item is changed, changeKey changes as well.
12
14
  This allows Exchange to apply changes to the correct version of the object.
13
- :rtype: str
14
15
  """
15
16
  return self.properties.get("ChangeKey", None)
16
17
 
17
18
  @property
18
19
  def categories(self):
19
- """
20
- The categories associated with the item
21
- """
20
+ """The categories associated with the item"""
22
21
  return self.properties.get("categories", StringCollection())
23
22
 
24
23
  @property
@@ -173,8 +173,9 @@ class AuthenticationContext(object):
173
173
  :param UserCredential or ClientCredential credentials:
174
174
  """
175
175
  if isinstance(credentials, ClientCredential):
176
+ environment = kwargs.get("environment")
176
177
  provider = ACSTokenProvider(
177
- self.url, credentials.clientId, credentials.clientSecret
178
+ self.url, credentials.clientId, credentials.clientSecret, environment
178
179
  )
179
180
  elif isinstance(credentials, UserCredential):
180
181
  allow_ntlm = kwargs.get("allow_ntlm", False)
@@ -184,8 +185,9 @@ class AuthenticationContext(object):
184
185
  provider = NtlmProvider(credentials.userName, credentials.password)
185
186
  else:
186
187
  browser_mode = kwargs.get("browser_mode", False)
188
+ environment = kwargs.get("environment")
187
189
  provider = SamlTokenProvider(
188
- self.url, credentials.userName, credentials.password, browser_mode
190
+ self.url, credentials.userName, credentials.password, browser_mode, environment
189
191
  )
190
192
  else:
191
193
  raise ValueError("Unknown credential type")
@@ -10,13 +10,15 @@ from office365.runtime.http.request_options import RequestOptions
10
10
 
11
11
 
12
12
  class ACSTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
13
- def __init__(self, url, client_id, client_secret):
13
+ def __init__(self, url, client_id, client_secret, environment='commercial'):
14
14
  """
15
15
  Provider to acquire the access token from a Microsoft Azure Access Control Service (ACS)
16
16
 
17
17
  :param str client_id: The OAuth client id of the calling application.
18
18
  :param str client_secret: Secret string that the application uses to prove its identity when requesting a token
19
19
  :param str url: SharePoint web or site url
20
+ :param str environment: The Office 365 Cloud Environment endpoint used for authentication
21
+ defaults to 'commercial'.
20
22
  """
21
23
  self.url = url
22
24
  self.redirect_url = None
@@ -25,6 +27,7 @@ class ACSTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
25
27
  self._client_id = client_id
26
28
  self._client_secret = client_secret
27
29
  self._cached_token = None
30
+ self._environment = environment
28
31
 
29
32
  def authenticate_request(self, request):
30
33
  # type: (RequestOptions) -> None
@@ -62,7 +65,7 @@ class ACSTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
62
65
  self.SharePointPrincipal, target_host, target_realm
63
66
  )
64
67
  principal_id = self.get_formatted_principal(self._client_id, None, target_realm)
65
- sts_url = self.get_security_token_service_url(target_realm)
68
+ sts_url = self.get_security_token_service_url(target_realm, environment=self._environment)
66
69
  oauth2_request = {
67
70
  "grant_type": "client_credentials",
68
71
  "client_id": principal_id,
@@ -101,10 +104,15 @@ class ACSTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
101
104
  return "{0}@{1}".format(principal_name, realm)
102
105
 
103
106
  @staticmethod
104
- def get_security_token_service_url(realm):
105
- return "https://accounts.accesscontrol.windows.net/{0}/tokens/OAuth/2".format(
106
- realm
107
- )
107
+ def get_security_token_service_url(realm, environment):
108
+ if environment == "GCCH":
109
+ return "https://login.microsoftonline.us/{0}/tokens/OAuth/2".format(
110
+ realm
111
+ )
112
+ else:
113
+ return "https://accounts.accesscontrol.windows.net/{0}/tokens/OAuth/2".format(
114
+ realm
115
+ )
108
116
 
109
117
  def _get_authorization_header(self):
110
118
  return "Bearer {0}".format(self._cached_token.accessToken)
@@ -40,7 +40,7 @@ def is_valid_auth_cookies(values):
40
40
 
41
41
 
42
42
  class SamlTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
43
- def __init__(self, url, username, password, browser_mode):
43
+ def __init__(self, url, username, password, browser_mode, environment='commercial'):
44
44
  """
45
45
  SAML Security Token Service provider (claims-based authentication)
46
46
 
@@ -48,11 +48,14 @@ class SamlTokenProvider(AuthenticationProvider, office365.logger.LoggerContext):
48
48
  :param str username: Typically a UPN in the form of an email address
49
49
  :param str password: The password
50
50
  :param bool browser_mode:
51
+ :param str environment: The Office 365 Cloud Environment endpoint used for authentication.
52
+ By default, this will be set to commercial ('commercial', 'GCCH')
51
53
  """
52
54
  # Security Token Service info
53
- self._sts_profile = STSProfile(resolve_base_url(url))
55
+ self._sts_profile = STSProfile(resolve_base_url(url), environment)
54
56
  # Obtain authentication cookies, using the browser mode
55
57
  self._browser_mode = browser_mode
58
+ self._environment = environment
56
59
  # Last occurred error
57
60
  self.error = ""
58
61
  self._username = username
@@ -4,13 +4,16 @@ from office365.runtime.compat import timezone, urlparse
4
4
 
5
5
 
6
6
  class STSProfile(object):
7
- def __init__(self, authority_url):
7
+ def __init__(self, authority_url, environment):
8
8
  """
9
9
 
10
10
  :type authority_url: str
11
11
  """
12
12
  self.authorityUrl = authority_url
13
- self.serviceUrl = "https://login.microsoftonline.com"
13
+ if environment == "GCCH":
14
+ self.serviceUrl = "https://login.microsoftonline.us"
15
+ else:
16
+ self.serviceUrl = "https://login.microsoftonline.com"
14
17
  self.securityTokenServicePath = "extSTS.srf"
15
18
  self.userRealmServicePath = "GetUserRealm.srf"
16
19
  self.tokenIssuer = "urn:federation:MicrosoftOnline"
@@ -5,9 +5,7 @@ class ODataJsonFormat(object):
5
5
  """OData JSON format"""
6
6
 
7
7
  def __init__(self, metadata_level=None):
8
- """
9
- :type metadata_level: str
10
- """
8
+ # type: (str) -> None
11
9
  self.metadata_level = metadata_level
12
10
 
13
11
  __metaclass__ = ABCMeta
@@ -28,7 +26,6 @@ class ODataJsonFormat(object):
28
26
  def media_type(self):
29
27
  """
30
28
  Gets media type
31
-
32
29
  :rtype: str
33
30
  """
34
31
  raise NotImplementedError
@@ -36,7 +33,6 @@ class ODataJsonFormat(object):
36
33
  @property
37
34
  def include_control_information(self):
38
35
  """Determines whether control information that is represented as annotations should be included in payload
39
-
40
36
  :rtype: bool
41
37
  """
42
38
  raise NotImplementedError
@@ -1,4 +1,5 @@
1
1
  import copy
2
+ from typing import Any, Optional
2
3
 
3
4
  import requests
4
5
 
@@ -69,11 +70,7 @@ class ODataRequest(ClientRequest):
69
70
  self.map_json(response.json(), return_type, json_format)
70
71
 
71
72
  def map_json(self, json, return_type, json_format=None):
72
- """
73
- :type json: any
74
- :type return_type: ClientValue or ClientResult or ClientObject
75
- :type json_format: office365.runtime.odata.json_format.ODataJsonFormat
76
- """
73
+ # type: (Any, ClientValue | ClientResult | ClientObject, Optional[ODataJsonFormat]) -> None
77
74
  if json_format is None:
78
75
  json_format = self.json_format
79
76
 
@@ -82,19 +79,17 @@ class ODataRequest(ClientRequest):
82
79
  return_type.set_property(k, v, False)
83
80
 
84
81
  def _next_property(self, json, json_format):
85
- """
86
- :type json: Any
87
- :type json_format: office365.runtime.odata.json_format.ODataJsonFormat
88
- """
82
+ # type: (Any, ODataJsonFormat) -> None
89
83
  if isinstance(json_format, JsonLightFormat):
90
84
  json = json.get(json_format.security, json)
91
85
  json = json.get(json_format.function, json)
92
86
 
93
87
  if isinstance(json, dict):
94
- next_link_url = json.get(json_format.collection_next, None)
95
- json = json.get(json_format.collection, json)
96
- if next_link_url:
97
- yield "__nextLinkUrl", next_link_url
88
+ if isinstance(json.get(json_format.collection, None), list):
89
+ next_link_url = json.get(json_format.collection_next, None)
90
+ json = json.get(json_format.collection, json)
91
+ if next_link_url:
92
+ yield "__nextLinkUrl", next_link_url
98
93
 
99
94
  if isinstance(json, list):
100
95
  for index, item in enumerate(json):
@@ -1,12 +1,13 @@
1
+ from typing import Optional
2
+
3
+ from typing_extensions import Self
4
+
1
5
  from office365.runtime.paths.resource_path import ResourcePath
2
6
 
3
7
 
4
8
  class EntityPath(ResourcePath):
5
9
  def __init__(self, key=None, parent=None, collection=None):
6
- """
7
- :param str or None key: Entity key
8
- :param ResourcePath or None collection:
9
- """
10
+ # type: (Optional[str], Optional[ResourcePath], Optional[ResourcePath]) -> None
10
11
  super(EntityPath, self).__init__(key, parent)
11
12
  self._collection = collection
12
13
 
@@ -26,10 +27,8 @@ class EntityPath(ResourcePath):
26
27
  return str(self._key or "<key>")
27
28
 
28
29
  def patch(self, key):
29
- """
30
- Patches path
31
- :type key: str or None
32
- """
30
+ # type: (str) -> Self
31
+ """Patches the path"""
33
32
  self._key = key
34
33
  self._parent = self.collection
35
34
  self.__class__ = EntityPath
@@ -81,7 +81,7 @@ class ClientContext(ClientRuntimeContext):
81
81
  thumbprint,
82
82
  cert_path=None,
83
83
  private_key=None,
84
- scopes=None,
84
+ scopes=None
85
85
  ):
86
86
  # type: (str, str, str, Optional[str], Optional[str], Optional[List[str]]) -> Self
87
87
  """
@@ -93,7 +93,6 @@ class ClientContext(ClientRuntimeContext):
93
93
  :param str thumbprint: Hex encoded thumbprint of the certificate.
94
94
  :param str client_id: The OAuth client id of the calling application.
95
95
  :param list[str] or None scopes: Scopes requested to access a protected API (a resource)
96
-
97
96
  """
98
97
  self.authentication_context.with_client_certificate(
99
98
  tenant, client_id, thumbprint, cert_path, private_key, scopes
@@ -137,25 +136,28 @@ class ClientContext(ClientRuntimeContext):
137
136
  return self
138
137
 
139
138
  def with_user_credentials(
140
- self, username, password, allow_ntlm=False, browser_mode=False
139
+ self, username, password, allow_ntlm=False, browser_mode=False, environment='commercial'
141
140
  ):
142
- # type: (str, str, bool, bool) -> Self
141
+ # type: (str, str, bool, bool, Optional[str]) -> Self
143
142
  """
144
143
  Initializes a client to acquire a token via user credentials.
145
144
  :param str username: Typically, a UPN in the form of an email address
146
145
  :param str password: The password
147
146
  :param bool allow_ntlm: Flag indicates whether NTLM scheme is enabled. Disabled by default
148
147
  :param bool browser_mode:
148
+ :param str environment: The Office 365 Cloud Environment endpoint used for authentication
149
+ defaults to 'commercial'.
149
150
  """
150
151
  self.authentication_context.with_credentials(
151
152
  UserCredential(username, password),
152
153
  allow_ntlm=allow_ntlm,
153
154
  browser_mode=browser_mode,
155
+ environment=environment
154
156
  )
155
157
  return self
156
158
 
157
- def with_client_credentials(self, client_id, client_secret):
158
- # type: (str, str) -> Self
159
+ def with_client_credentials(self, client_id, client_secret, environment='commercial'):
160
+ # type: (str, str, Optional[str]) -> Self
159
161
  """
160
162
  Initializes a client to acquire a token via client credentials (SharePoint App-Only)
161
163
 
@@ -164,19 +166,24 @@ class ClientContext(ClientRuntimeContext):
164
166
 
165
167
  :param str client_id: The OAuth client id of the calling application
166
168
  :param str client_secret: Secret string that the application uses to prove its identity when requesting a token
169
+ :param str environment: The Office 365 Cloud Environment endpoint used for authentication
170
+ defaults to 'commercial'.
167
171
  """
168
172
  self.authentication_context.with_credentials(
169
- ClientCredential(client_id, client_secret)
173
+ ClientCredential(client_id, client_secret),
174
+ environment=environment
170
175
  )
171
176
  return self
172
177
 
173
- def with_credentials(self, credentials):
174
- # type: (UserCredential|ClientCredential) -> Self
178
+ def with_credentials(self, credentials, environment='commercial'):
179
+ # type: (UserCredential|ClientCredential, Optional[str]) -> Self
175
180
  """
176
181
  Initializes a client to acquire a token via user or client credentials
177
182
  :type credentials: UserCredential or ClientCredential
183
+ :param str environment: The Office 365 Cloud Environment endpoint used for authentication
184
+ defaults to 'commercial'.
178
185
  """
179
- self.authentication_context.with_credentials(credentials)
186
+ self.authentication_context.with_credentials(credentials, environment=environment)
180
187
  return self
181
188
 
182
189
  def execute_batch(self, items_per_batch=100, success_callback=None):