Office365-REST-Python-Client 2.4.2__py3-none-any.whl → 2.4.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 (411) hide show
  1. {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/METADATA +65 -31
  2. {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/RECORD +401 -259
  3. office365/base_item.py +27 -5
  4. office365/booking/business.py +7 -0
  5. office365/booking/currency.py +5 -0
  6. office365/booking/solutions_root.py +32 -0
  7. office365/communications/calls/invitation_participant_info.py +17 -1
  8. office365/communications/calls/options.py +9 -0
  9. office365/communications/onlinemeetings/provider_type.py +3 -0
  10. office365/communications/presences/presence.py +14 -0
  11. office365/communications/presences/status_message.py +12 -0
  12. office365/directory/administrative_unit.py +22 -0
  13. office365/directory/applications/collection.py +2 -1
  14. office365/directory/applications/roles/assignment.py +45 -5
  15. office365/directory/applications/roles/assignment_collection.py +8 -0
  16. office365/directory/applications/roles/role.py +6 -1
  17. office365/directory/audit/signins/activity.py +31 -0
  18. office365/directory/audit/signins/location.py +17 -0
  19. office365/directory/audit/signins/signin.py +33 -0
  20. office365/directory/authentication/authentication.py +9 -0
  21. office365/directory/authentication/methods/details.py +25 -0
  22. office365/directory/authentication/methods/email.py +16 -0
  23. office365/directory/authentication/methods/root.py +27 -0
  24. office365/directory/certificates/authority.py +6 -1
  25. office365/directory/extensions/extended_property.py +8 -1
  26. office365/directory/extensions/extension.py +1 -1
  27. office365/directory/extensions/extension_property.py +0 -3
  28. office365/directory/extensions/open_type.py +8 -0
  29. office365/directory/groups/collection.py +2 -4
  30. office365/directory/groups/group.py +18 -4
  31. office365/directory/identities/governance.py +2 -0
  32. office365/directory/identities/object_identity.py +3 -3
  33. office365/directory/insights/resource_reference.py +15 -0
  34. office365/directory/insights/shared.py +36 -0
  35. office365/directory/insights/sharing_detail.py +11 -0
  36. office365/directory/insights/trending.py +8 -0
  37. office365/directory/insights/usage_details.py +16 -0
  38. office365/directory/insights/used.py +30 -0
  39. office365/directory/invitations/invitation.py +33 -1
  40. office365/directory/licenses/assigned_plan.py +19 -1
  41. office365/directory/licenses/assignment_state.py +5 -0
  42. office365/directory/licenses/service_plan_info.py +4 -0
  43. office365/directory/licenses/subscribed_sku.py +41 -0
  44. office365/directory/licenses/units_detail.py +11 -0
  45. office365/directory/object.py +3 -1
  46. office365/directory/object_collection.py +3 -4
  47. office365/directory/password_credential.py +5 -1
  48. office365/directory/permissions/email_identity.py +5 -0
  49. office365/directory/permissions/grants/condition_set.py +26 -0
  50. office365/directory/permissions/grants/resource_specific.py +21 -0
  51. office365/directory/policies/authentication_flows.py +9 -0
  52. office365/directory/policies/authentication_strength.py +10 -0
  53. office365/directory/policies/authorization.py +8 -0
  54. office365/directory/policies/cross_tenant_access.py +5 -0
  55. office365/directory/policies/root.py +35 -2
  56. office365/directory/protection/information.py +5 -0
  57. office365/directory/protection/risk_detection.py +11 -0
  58. office365/directory/protection/riskyusers/activity.py +5 -0
  59. office365/directory/protection/riskyusers/collection.py +32 -0
  60. office365/directory/protection/riskyusers/history_item.py +20 -0
  61. office365/directory/protection/riskyusers/risky_user.py +26 -0
  62. office365/directory/protection/root.py +31 -0
  63. office365/directory/rolemanagement/application.py +35 -0
  64. office365/directory/{roles → rolemanagement}/management.py +8 -1
  65. office365/directory/{roles → rolemanagement}/role.py +14 -0
  66. office365/directory/{roles → rolemanagement}/template.py +8 -0
  67. office365/directory/rolemanagement/unified_role_assignment.py +45 -0
  68. office365/directory/rolemanagement/unified_role_definition.py +6 -0
  69. office365/directory/security/alerts/alert.py +21 -0
  70. office365/directory/security/alerts/history_state.py +5 -0
  71. office365/directory/security/attacksimulations/automation.py +21 -0
  72. office365/directory/security/attacksimulations/automation_run.py +5 -0
  73. office365/directory/security/attacksimulations/repeat_offender.py +6 -0
  74. office365/directory/security/attacksimulations/root.py +26 -0
  75. office365/directory/security/attacksimulations/simulation.py +17 -0
  76. office365/directory/security/cases/__init__.py +0 -0
  77. office365/directory/security/cases/ediscovery.py +6 -0
  78. office365/directory/security/cases/root.py +22 -0
  79. office365/directory/security/incidents/incident.py +67 -0
  80. office365/directory/security/security.py +10 -1
  81. office365/directory/serviceprincipals/service_principal.py +89 -4
  82. office365/directory/synchronization/__init__.py +0 -0
  83. office365/directory/synchronization/job.py +16 -0
  84. office365/directory/synchronization/progress.py +5 -0
  85. office365/directory/synchronization/status.py +13 -0
  86. office365/directory/synchronization/synchronization.py +24 -0
  87. office365/directory/tenant_information.py +17 -0
  88. office365/directory/tenant_relationship.py +21 -0
  89. office365/directory/users/activities/activity.py +45 -1
  90. office365/directory/users/collection.py +8 -0
  91. office365/directory/users/password_profile.py +18 -2
  92. office365/directory/users/user.py +254 -29
  93. office365/entity.py +3 -3
  94. office365/graph_client.py +64 -12
  95. office365/intune/audit/actor.py +5 -0
  96. office365/intune/audit/event.py +21 -24
  97. office365/intune/audit/event_collection.py +26 -0
  98. office365/intune/audit/property.py +5 -0
  99. office365/intune/audit/resource.py +11 -0
  100. office365/intune/brand.py +6 -0
  101. office365/intune/devices/compliance/__init__.py +0 -0
  102. office365/intune/devices/compliance/policy.py +6 -0
  103. office365/intune/devices/compliance/policy_state.py +5 -0
  104. office365/intune/devices/data.py +5 -0
  105. office365/intune/devices/detail.py +10 -0
  106. office365/intune/devices/enrollment/__init__.py +0 -0
  107. office365/intune/devices/enrollment/configuration.py +25 -0
  108. office365/intune/devices/enrollment/configuration_assignment.py +5 -0
  109. office365/intune/devices/enrollment/limit_configuration.py +5 -0
  110. office365/intune/devices/managed.py +44 -3
  111. office365/intune/devices/management/__init__.py +0 -0
  112. office365/intune/devices/management/management.py +69 -0
  113. office365/intune/devices/management/reports/__init__.py +0 -0
  114. office365/intune/devices/management/reports/reports.py +5 -0
  115. office365/intune/devices/management/settings.py +18 -0
  116. office365/intune/organizations/branding.py +15 -0
  117. office365/intune/organizations/organization.py +14 -0
  118. office365/intune/printing/__init__.py +0 -0
  119. office365/intune/printing/base.py +11 -0
  120. office365/intune/printing/capabilities.py +5 -0
  121. office365/intune/printing/connectors/__init__.py +0 -0
  122. office365/intune/printing/connectors/connector.py +6 -0
  123. office365/intune/printing/operations/__init__.py +0 -0
  124. office365/intune/printing/print.py +24 -0
  125. office365/intune/printing/printer.py +6 -0
  126. office365/intune/printing/services/__init__.py +0 -0
  127. office365/intune/printing/services/endpoint.py +5 -0
  128. office365/intune/printing/services/service.py +17 -0
  129. office365/intune/printing/share.py +5 -0
  130. office365/intune/printing/shares/__init__.py +0 -0
  131. office365/intune/printing/taskdefinitions/__init__.py +0 -0
  132. office365/intune/provisioned_plan.py +5 -1
  133. office365/intune/servicecommunications/__init__.py +0 -0
  134. office365/intune/servicecommunications/announcement.py +39 -0
  135. office365/intune/servicecommunications/announcement_base.py +5 -0
  136. office365/intune/servicecommunications/health/__init__.py +0 -0
  137. office365/intune/servicecommunications/health/health.py +7 -0
  138. office365/intune/servicecommunications/issues/__init__.py +0 -0
  139. office365/intune/servicecommunications/issues/issue.py +29 -0
  140. office365/intune/servicecommunications/messages/__init__.py +0 -0
  141. office365/intune/servicecommunications/messages/update.py +10 -0
  142. office365/intune/termsandconditions/__init__.py +0 -0
  143. office365/intune/vpp_token.py +10 -0
  144. office365/onedrive/admin.py +16 -0
  145. office365/onedrive/columns/content_approval_status.py +5 -0
  146. office365/onedrive/columns/datetime.py +15 -0
  147. office365/onedrive/columns/default_value.py +4 -0
  148. office365/onedrive/columns/definition.py +49 -3
  149. office365/onedrive/columns/definition_collection.py +17 -6
  150. office365/onedrive/columns/lookup.py +5 -1
  151. office365/onedrive/columns/types.py +13 -0
  152. office365/onedrive/contenttypes/content_type.py +8 -0
  153. office365/onedrive/driveitems/audio.py +12 -1
  154. office365/onedrive/driveitems/driveItem.py +147 -69
  155. office365/onedrive/driveitems/image.py +8 -1
  156. office365/onedrive/driveitems/item_preview_info.py +20 -2
  157. office365/onedrive/driveitems/remote_item.py +19 -4
  158. office365/onedrive/drives/drive.py +7 -1
  159. office365/onedrive/drives/quota.py +18 -0
  160. office365/onedrive/drives/recipient.py +4 -0
  161. office365/onedrive/files/system_info.py +8 -6
  162. office365/onedrive/folders/folder.py +3 -3
  163. office365/onedrive/internal/paths/children.py +1 -4
  164. office365/onedrive/internal/paths/shared.py +7 -2
  165. office365/onedrive/lists/collection.py +12 -6
  166. office365/onedrive/lists/list.py +13 -5
  167. office365/onedrive/operations/long_running.py +7 -0
  168. office365/onedrive/operations/pending.py +13 -0
  169. office365/onedrive/operations/pending_content_update.py +5 -0
  170. office365/onedrive/permissions/collection.py +5 -6
  171. office365/onedrive/permissions/sharing_link.py +16 -1
  172. office365/onedrive/sensitivitylabels/__init__.py +0 -0
  173. office365/onedrive/sensitivitylabels/assignment.py +17 -0
  174. office365/onedrive/sensitivitylabels/assignment_method.py +4 -0
  175. office365/onedrive/sensitivitylabels/extract_result.py +13 -0
  176. office365/onedrive/sharepoint_settings.py +25 -0
  177. office365/onedrive/sites/sites_with_root.py +11 -1
  178. office365/onedrive/termstore/groups/collection.py +1 -1
  179. office365/onedrive/termstore/groups/group.py +1 -0
  180. office365/onedrive/termstore/sets/collection.py +1 -1
  181. office365/onenote/operations/operation.py +10 -1
  182. office365/onenote/resources/resource.py +1 -0
  183. office365/outlook/calendar/calendar.py +116 -6
  184. office365/outlook/calendar/dateTimeTimeZone.py +4 -0
  185. office365/outlook/calendar/email_address.py +7 -0
  186. office365/outlook/calendar/events/event.py +0 -4
  187. office365/outlook/calendar/events/reminder.py +22 -3
  188. office365/outlook/calendar/group.py +0 -2
  189. office365/outlook/calendar/location_constraint.py +16 -1
  190. office365/outlook/calendar/meetingtimes/activity_domain.py +10 -0
  191. office365/outlook/calendar/meetingtimes/suggestion.py +1 -1
  192. office365/outlook/calendar/meetingtimes/time_constraint.py +18 -0
  193. office365/outlook/calendar/permissions/__init__.py +0 -0
  194. office365/outlook/calendar/permissions/collection.py +24 -0
  195. office365/outlook/calendar/{permission.py → permissions/permission.py} +35 -2
  196. office365/outlook/calendar/place.py +7 -0
  197. office365/outlook/calendar/role_type.py +17 -0
  198. office365/outlook/calendar/schedule/information.py +5 -4
  199. office365/outlook/calendar/schedule/item.py +20 -1
  200. office365/outlook/calendar/sharing_message.py +2 -2
  201. office365/outlook/calendar/time_zone_base.py +3 -0
  202. office365/outlook/calendar/working_hours.py +17 -1
  203. office365/outlook/contacts/collection.py +39 -0
  204. office365/outlook/contacts/contact.py +21 -11
  205. office365/outlook/geo_coordinates.py +20 -0
  206. office365/outlook/item.py +5 -4
  207. office365/outlook/locale_info.py +3 -0
  208. office365/outlook/mail/automatic_replies_setting.py +14 -0
  209. office365/outlook/mail/folders/folder.py +52 -3
  210. office365/outlook/mail/folders/search.py +11 -0
  211. office365/outlook/mail/importance.py +1 -0
  212. office365/outlook/mail/item_body.py +3 -0
  213. office365/outlook/mail/location.py +27 -2
  214. office365/outlook/mail/location_constraint_item.py +5 -0
  215. office365/outlook/mail/mailbox_settings.py +13 -1
  216. office365/outlook/mail/messages/collection.py +7 -0
  217. office365/outlook/mail/messages/followup_flag.py +21 -0
  218. office365/outlook/mail/messages/internet_header.py +16 -0
  219. office365/outlook/mail/messages/message.py +184 -6
  220. office365/outlook/mail/messages/rules/__init__.py +0 -0
  221. office365/outlook/mail/messages/rules/actions.py +38 -0
  222. office365/outlook/mail/messages/rules/predicates.py +5 -0
  223. office365/outlook/mail/messages/rules/rule.py +32 -0
  224. office365/outlook/mail/patterned_recurrence.py +14 -1
  225. office365/outlook/mail/physical_address.py +5 -1
  226. office365/outlook/mail/recipient.py +3 -0
  227. office365/outlook/mail/recurrence_pattern.py +18 -1
  228. office365/outlook/mail/recurrence_range.py +16 -2
  229. office365/outlook/timezone_information.py +3 -0
  230. office365/reports/root.py +28 -1
  231. office365/reports/security/__init__.py +0 -0
  232. office365/reports/security/root.py +21 -0
  233. office365/reports/userregistration/__init__.py +0 -0
  234. office365/reports/userregistration/method_count.py +17 -0
  235. office365/reports/userregistration/method_summary.py +21 -0
  236. office365/runtime/auth/authentication_context.py +123 -25
  237. office365/runtime/auth/client_credential.py +2 -2
  238. office365/runtime/auth/providers/acs_token_provider.py +6 -3
  239. office365/runtime/auth/providers/saml_token_provider.py +10 -7
  240. office365/runtime/auth/token_response.py +3 -3
  241. office365/runtime/client_object_collection.py +12 -7
  242. office365/runtime/client_result.py +9 -0
  243. office365/runtime/client_runtime_context.py +10 -8
  244. office365/runtime/http/request_options.py +2 -1
  245. office365/runtime/odata/request.py +4 -4
  246. office365/runtime/paths/appid.py +2 -1
  247. office365/runtime/paths/entity.py +2 -2
  248. office365/{sharepoint/internal/paths/entity.py → runtime/paths/key.py} +5 -3
  249. office365/runtime/paths/resource_path.py +3 -0
  250. office365/runtime/types/event_handler.py +6 -0
  251. office365/search/external/__init__.py +0 -0
  252. office365/search/external/configuration.py +8 -0
  253. office365/search/external/connection.py +27 -0
  254. office365/{external → search/external}/external.py +1 -1
  255. office365/search/external/search_settings.py +5 -0
  256. office365/search/query.py +3 -1
  257. office365/search/request.py +3 -1
  258. office365/search/sharepoint_onedrive_options.py +3 -0
  259. office365/search/sort_property.py +9 -0
  260. office365/sharepoint/activities/client_request.py +4 -1
  261. office365/sharepoint/activities/logger.py +25 -0
  262. office365/sharepoint/activities/revision_info.py +9 -0
  263. office365/sharepoint/addtoonedrive/mount_point.py +25 -0
  264. office365/sharepoint/addtoonedrive/mounted_folder_info.py +5 -0
  265. office365/sharepoint/alerts/alert.py +31 -0
  266. office365/sharepoint/apps/license_collection.py +1 -2
  267. office365/sharepoint/changes/item.py +14 -0
  268. office365/sharepoint/client_context.py +91 -30
  269. office365/sharepoint/clientsidecomponent/component_context_info.py +7 -0
  270. office365/sharepoint/clientsidecomponent/identifier.py +3 -0
  271. office365/sharepoint/compliance/tag_info.py +17 -0
  272. office365/sharepoint/contenttypes/collection.py +6 -7
  273. office365/sharepoint/contenttypes/content_type.py +49 -1
  274. office365/sharepoint/contenttypes/fieldlinks/collection.py +5 -6
  275. office365/sharepoint/features/known_list.py +2 -0
  276. office365/sharepoint/fields/collection.py +70 -39
  277. office365/sharepoint/fields/computed.py +5 -2
  278. office365/sharepoint/fields/creation_information.py +5 -4
  279. office365/sharepoint/fields/field.py +73 -15
  280. office365/sharepoint/fields/user.py +3 -3
  281. office365/sharepoint/files/checked_out_file.py +3 -2
  282. office365/sharepoint/files/file.py +9 -4
  283. office365/sharepoint/files/versions/version.py +7 -9
  284. office365/sharepoint/folders/collection.py +2 -2
  285. office365/sharepoint/folders/coloring.py +39 -0
  286. office365/sharepoint/folders/coloring_information.py +15 -0
  287. office365/sharepoint/folders/folder.py +21 -10
  288. office365/sharepoint/forms/customization.py +8 -0
  289. office365/sharepoint/listitems/listitem.py +29 -10
  290. office365/sharepoint/lists/bloom_filter.py +0 -1
  291. office365/sharepoint/lists/creation_information.py +18 -4
  292. office365/sharepoint/lists/list.py +203 -27
  293. office365/sharepoint/lists/render_data_parameters.py +21 -1
  294. office365/sharepoint/lists/template_type.py +10 -0
  295. office365/sharepoint/navigation/configured_metadata_items.py +25 -1
  296. office365/sharepoint/navigation/metadata_settings.py +6 -4
  297. office365/sharepoint/permissions/irm/file_settings.py +43 -0
  298. office365/sharepoint/permissions/securable_object.py +5 -6
  299. office365/sharepoint/portal/sites/manager.py +5 -6
  300. office365/sharepoint/portal/userprofiles/documents_shared_with_group.py +3 -0
  301. office365/sharepoint/publishing/base_custom_property.py +8 -0
  302. office365/sharepoint/publishing/navigation/structural_navigation_cache_wrapper.py +8 -0
  303. office365/sharepoint/publishing/pagecopywithassets/__init__.py +0 -0
  304. office365/sharepoint/publishing/pagecopywithassets/response.py +8 -0
  305. office365/sharepoint/publishing/pages/campaign_publication.py +7 -0
  306. office365/sharepoint/publishing/pages/collection.py +1 -1
  307. office365/sharepoint/publishing/pages/page.py +4 -1
  308. office365/sharepoint/publishing/pages/reposts/metadata.py +8 -0
  309. office365/sharepoint/publishing/personmagazine/person_magazine.py +4 -1
  310. office365/sharepoint/search/administration/tenant_crawl_versions_info_provider.py +8 -1
  311. office365/sharepoint/search/query/auto_completion_match.py +3 -0
  312. office365/sharepoint/search/query/property_value.py +18 -0
  313. office365/sharepoint/search/request.py +16 -2
  314. office365/sharepoint/sharing/abilities.py +22 -0
  315. office365/sharepoint/sharing/direct_abilities.py +27 -0
  316. office365/sharepoint/sharing/link_abilities.py +9 -1
  317. office365/sharepoint/sharing/links/data.py +26 -1
  318. office365/sharepoint/sharing/links/info.py +1 -1
  319. office365/sharepoint/sharing/links/partial_success_response.py +5 -0
  320. office365/sharepoint/sharing/links/share_settings.py +24 -1
  321. office365/sharepoint/sharing/object_sharing_information.py +65 -2
  322. office365/sharepoint/sharing/object_sharing_information_user.py +9 -0
  323. office365/sharepoint/sharing/object_sharing_settings.py +17 -4
  324. office365/sharepoint/sharing/principal.py +10 -0
  325. office365/sharepoint/sharing/securable_object_extensions.py +1 -17
  326. office365/sharepoint/sharing/site_sharing_report_helper.py +2 -1
  327. office365/sharepoint/sharing/user_sharing_result.py +18 -8
  328. office365/sharepoint/sitehealth/result.py +10 -0
  329. office365/sharepoint/sites/language.py +11 -1
  330. office365/sharepoint/sites/language_collection.py +1 -0
  331. office365/sharepoint/sites/site.py +42 -7
  332. office365/sharepoint/taxonomy/create_xml_parameters.py +22 -15
  333. office365/sharepoint/taxonomy/field.py +10 -8
  334. office365/sharepoint/taxonomy/groups/collection.py +8 -1
  335. office365/sharepoint/taxonomy/groups/group.py +26 -0
  336. office365/sharepoint/taxonomy/sets/collection.py +15 -0
  337. office365/sharepoint/taxonomy/sets/name.py +23 -0
  338. office365/sharepoint/taxonomy/sets/set.py +16 -1
  339. office365/sharepoint/taxonomy/stores/store.py +0 -8
  340. office365/sharepoint/tenant/administration/audit/search_request_status.py +8 -0
  341. office365/sharepoint/tenant/administration/deny_add_and_customize_pages_status.py +3 -0
  342. office365/sharepoint/tenant/administration/hubsites/permission.py +10 -0
  343. office365/sharepoint/tenant/administration/sites/properties.py +12 -10
  344. office365/sharepoint/tenant/administration/tenant.py +2 -1
  345. office365/sharepoint/tenant/apps/information.py +3 -1
  346. office365/sharepoint/tenant/management/office365_tenant.py +14 -11
  347. office365/sharepoint/types/resource_path.py +3 -1
  348. office365/sharepoint/userprofiles/people_manager.py +0 -2
  349. office365/sharepoint/userprofiles/sharedwithme/document.py +16 -0
  350. office365/sharepoint/userprofiles/sharedwithme/document_user.py +12 -0
  351. office365/sharepoint/userprofiles/sharedwithme/item_collection.py +41 -0
  352. office365/sharepoint/userprofiles/sharedwithme/items.py +18 -1
  353. office365/sharepoint/viva/site_manager.py +14 -0
  354. office365/sharepoint/webhooks/subscription_collection.py +5 -6
  355. office365/sharepoint/webparts/definition.py +1 -1
  356. office365/sharepoint/webparts/webpart.py +18 -4
  357. office365/sharepoint/webs/context_web_information.py +2 -4
  358. office365/sharepoint/webs/web.py +31 -12
  359. office365/sharepoint/workflowservices/manager.py +0 -2
  360. office365/subscriptions/collection.py +42 -0
  361. office365/subscriptions/subscription.py +120 -2
  362. office365/teams/apps/catalog.py +23 -0
  363. office365/teams/associated_info.py +12 -0
  364. office365/teams/channels/channel.py +2 -3
  365. office365/teams/channels/collection.py +1 -1
  366. office365/teams/channels/iIdentity.py +5 -0
  367. office365/teams/chats/chat.py +12 -2
  368. office365/teams/chats/collection.py +1 -2
  369. office365/teams/chats/messages/__init__.py +0 -0
  370. office365/teams/chats/messages/info.py +14 -0
  371. office365/teams/chats/{message.py → messages/message.py} +18 -3
  372. office365/teams/info.py +20 -0
  373. office365/teams/members/aad_user_conversation.py +2 -2
  374. office365/teams/members/conversation_collection.py +3 -3
  375. office365/teams/schedule/change_request.py +4 -2
  376. office365/teams/schedule/change_tracked_entity.py +11 -2
  377. office365/teams/summary.py +15 -0
  378. office365/teams/tabs/configuration.py +12 -1
  379. office365/teams/tabs/tab.py +0 -1
  380. office365/teams/team.py +34 -1
  381. office365/teams/teamwork/__init__.py +0 -0
  382. office365/teams/teamwork/activity_topic.py +5 -0
  383. office365/teams/teamwork/tags/__init__.py +0 -0
  384. office365/teams/teamwork/tags/identity.py +6 -0
  385. office365/teams/teamwork/tags/member.py +5 -0
  386. office365/teams/teamwork/tags/tag.py +15 -0
  387. office365/{directory/security/cases_root.py → teams/viva/employee_experience_user.py} +1 -1
  388. office365/todo/attachments/session.py +34 -0
  389. office365/todo/linked_resource.py +10 -1
  390. office365/todo/tasks/task.py +4 -0
  391. office365/directory/identities/protection_root.py +0 -5
  392. office365/directory/rbac/application.py +0 -18
  393. office365/directory/rbac/unified_role_assignment.py +0 -8
  394. office365/external/connection.py +0 -5
  395. office365/intune/devices/management.py +0 -35
  396. office365/onedrive/internal/queries/download_content.py +0 -26
  397. office365/onedrive/internal/queries/upload_content.py +0 -23
  398. office365/outlook/mail/messages/message_rule.py +0 -15
  399. office365/runtime/auth/providers/oauth_token_provider.py +0 -25
  400. office365/teams/team_info.py +0 -6
  401. {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/LICENSE +0 -0
  402. {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/WHEEL +0 -0
  403. {Office365_REST_Python_Client-2.4.2.dist-info → Office365_REST_Python_Client-2.4.4.dist-info}/top_level.txt +0 -0
  404. /office365/{directory/rbac → booking}/__init__.py +0 -0
  405. /office365/directory/{roles → protection}/__init__.py +0 -0
  406. /office365/{external → directory/protection/riskyusers}/__init__.py +0 -0
  407. /office365/{teams/messages → directory/rolemanagement}/__init__.py +0 -0
  408. /office365/outlook/calendar/{time_slot.py → meetingtimes/time_slot.py} +0 -0
  409. /office365/teams/chats/{message_attachment.py → messages/attachment.py} +0 -0
  410. /office365/teams/{member_settings.py → members/settings.py} +0 -0
  411. /office365/teams/{user_teamwork.py → teamwork/user.py} +0 -0
@@ -12,30 +12,34 @@ from office365.onedrive.driveitems.image import Image
12
12
  from office365.onedrive.driveitems.item_preview_info import ItemPreviewInfo
13
13
  from office365.onedrive.driveitems.photo import Photo
14
14
  from office365.onedrive.driveitems.publication_facet import PublicationFacet
15
+ from office365.onedrive.driveitems.remote_item import RemoteItem
15
16
  from office365.onedrive.driveitems.special_folder import SpecialFolder
16
17
  from office365.onedrive.driveitems.thumbnail_set import ThumbnailSet
18
+ from office365.onedrive.drives.recipient import DriveRecipient
17
19
  from office365.onedrive.files.file import File
18
20
  from office365.onedrive.files.system_info import FileSystemInfo
19
21
  from office365.onedrive.folders.folder import Folder
20
22
  from office365.onedrive.internal.paths.children import ChildrenPath
21
23
  from office365.onedrive.internal.paths.url import UrlPath
22
24
  from office365.onedrive.internal.queries.resumable_file_upload import create_resumable_file_upload_query
23
- from office365.onedrive.internal.queries.upload_content import create_upload_content_query
24
25
  from office365.onedrive.listitems.item_reference import ItemReference
25
26
  from office365.onedrive.listitems.list_item import ListItem
27
+ from office365.onedrive.operations.pending import PendingOperations
26
28
  from office365.onedrive.permissions.collection import PermissionCollection
27
29
  from office365.onedrive.permissions.permission import Permission
30
+ from office365.onedrive.sensitivitylabels.extract_result import ExtractSensitivityLabelsResult
28
31
  from office365.onedrive.shares.shared import Shared
29
32
  from office365.onedrive.versions.drive_item import DriveItemVersion
30
33
  from office365.onedrive.workbooks.workbook import Workbook
31
34
  from office365.runtime.client_result import ClientResult
35
+ from office365.runtime.client_value_collection import ClientValueCollection
32
36
  from office365.runtime.http.http_method import HttpMethod
33
37
  from office365.runtime.paths.resource_path import ResourcePath
34
38
  from office365.runtime.queries.create_entity import CreateEntityQuery
35
39
  from office365.runtime.queries.function import FunctionQuery
36
40
  from office365.runtime.queries.service_operation import ServiceOperationQuery
37
41
  from office365.runtime.queries.upload_session import UploadSessionQuery
38
- from office365.subscriptions.subscription import Subscription
42
+ from office365.subscriptions.collection import SubscriptionCollection
39
43
 
40
44
 
41
45
  class DriveItem(BaseItem):
@@ -54,11 +58,12 @@ class DriveItem(BaseItem):
54
58
  """
55
59
  Creates a PowerPoint file
56
60
 
57
- :param str name:
61
+ :param str name: File name
58
62
  """
59
63
  return self.upload(name, None)
60
64
 
61
- def create_link(self, link_type, scope="", expiration_datetime=None, password=None, message=None):
65
+ def create_link(self, link_type, scope="", expiration_datetime=None, password=None, message=None,
66
+ retain_inherited_permissions=None):
62
67
  """
63
68
  The createLink action will create a new sharing link if the specified link type doesn't already exist
64
69
  for the calling application. If a sharing link of the specified type already exists for the app,
@@ -66,18 +71,22 @@ class DriveItem(BaseItem):
66
71
 
67
72
  :param str link_type: The type of sharing link to create. Either view, edit, or embed.
68
73
  :param str scope: The scope of link to create. Either anonymous or organization.
69
- :param str expiration_datetime: A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates
74
+ :param str or datetime.datetime expiration_datetime: A String with format of yyyy-MM-ddTHH:mm:ssZ of DateTime indicates
70
75
  the expiration time of the permission.
71
76
  :param str password: The password of the sharing link that is set by the creator. Optional
72
77
  and OneDrive Personal only.
73
78
  :param str message:
79
+ :param bool retain_inherited_permissions: Optional. If true (default), any existing inherited permissions
80
+ are retained on the shared item when sharing this item for the first time.
81
+ If false, all existing permissions are removed when sharing for the first time.
74
82
  """
75
83
  payload = {
76
84
  "type": link_type,
77
85
  "scope": scope,
78
86
  "message": message,
79
87
  "expirationDateTime": expiration_datetime,
80
- "password": password
88
+ "password": password,
89
+ "retainInheritedPermissions": retain_inherited_permissions
81
90
  }
82
91
  return_type = Permission(self.context)
83
92
  self.permissions.add_child(return_type)
@@ -85,6 +94,17 @@ class DriveItem(BaseItem):
85
94
  self.context.add_query(qry)
86
95
  return return_type
87
96
 
97
+ def extract_sensitivity_labels(self):
98
+ """
99
+ Extract one or more sensitivity labels assigned to a drive item and update the metadata of a drive
100
+ item with the latest details of the assigned label. In case of failure to extract the sensitivity labels
101
+ of a file, an extraction error will be thrown with the applicable error code and message.
102
+ """
103
+ return_type = ClientResult(self.context, ExtractSensitivityLabelsResult())
104
+ qry = ServiceOperationQuery(self, "extractSensitivityLabels", return_type=return_type)
105
+ self.context.add_query(qry)
106
+ return return_type
107
+
88
108
  def follow(self):
89
109
  """
90
110
  Follow a driveItem.
@@ -161,26 +181,57 @@ class DriveItem(BaseItem):
161
181
 
162
182
  def upload(self, name, content):
163
183
  """The simple upload API allows you to provide the contents of a new file or update the contents of an
164
- existing file in a single API call. This method only supports files up to 4MB in size.
184
+ existing file in a single API call.
185
+
186
+ Note: This method only supports files up to 4MB in size.
165
187
 
166
188
  :param name: The contents of the request body should be the binary stream of the file to be uploaded.
167
189
  :type name: str
168
190
  :param content: The contents of the request body should be the binary stream of the file to be uploaded.
169
191
  :type content: str or bytes or None
170
- :rtype: DriveItem
171
192
  """
172
- qry = create_upload_content_query(self, name, content)
193
+ return_type = DriveItem(self.context, UrlPath(name, self.resource_path))
194
+ qry = ServiceOperationQuery(return_type, "content", None, content, None, return_type)
173
195
  self.children.add_child(qry.return_type)
174
- self.context.add_query(qry)
175
- return qry.return_type
176
196
 
177
- def get_content(self):
178
- """Download the contents of the primary stream (file) of a DriveItem. Only driveItems with the file property
179
- can be downloaded. """
180
- from office365.onedrive.internal.queries.download_content import create_download_content_query
181
- qry = create_download_content_query(self)
197
+ def _modify_query(request):
198
+ """
199
+ :type request: office365.runtime.http.request_options.RequestOptions
200
+ """
201
+ request.method = HttpMethod.Put
202
+
203
+ self.context.add_query(qry).before_query_execute(_modify_query)
204
+ return return_type
205
+
206
+ def upload_file(self, path_or_file):
207
+ """Uploads a file
208
+
209
+ :param str or typing.IO path_or_file:
210
+ """
211
+ if hasattr(path_or_file, 'read'):
212
+ content = path_or_file.read()
213
+ name = os.path.basename(path_or_file.name)
214
+ return self.upload(name, content)
215
+ else:
216
+ with open(path_or_file, 'rb') as f:
217
+ content = f.read()
218
+ name = os.path.basename(path_or_file)
219
+ return self.upload(name, content)
220
+
221
+ def get_content(self, format_name=None):
222
+ """
223
+ Download the contents of the primary stream (file) of a DriveItem. O
224
+ nly driveItems with the file property can be downloaded.
225
+
226
+ :type format_name: str or None
227
+ """
228
+ return_type = ClientResult(self.context)
229
+ action_name = "content"
230
+ if format_name is not None:
231
+ action_name = action_name + r"?format={0}".format(format_name)
232
+ qry = FunctionQuery(self, action_name, None, return_type)
182
233
  self.context.add_query(qry)
183
- return qry.return_type
234
+ return return_type
184
235
 
185
236
  def download(self, file_object):
186
237
  """
@@ -189,31 +240,38 @@ class DriveItem(BaseItem):
189
240
 
190
241
  :type file_object: typing.IO
191
242
  """
243
+
192
244
  def _save_content(return_type):
193
245
  """
194
246
  :type return_type: ClientResult
195
247
  """
196
248
  file_object.write(return_type.value)
249
+
197
250
  self.get_content().after_execute(_save_content)
198
251
  return self
199
252
 
200
253
  def download_session(self, file_object, chunk_downloaded=None, chunk_size=1024 * 1024):
201
254
  """
255
+ By default, file gets downloaded immediately.
256
+ For a large files reading the whole content of a file at once into memory should be avoided.
257
+
258
+ This method allows to stream content into the file
259
+
202
260
  :type file_object: typing.IO
203
- :type chunk_downloaded: (int)->None or None
204
- :type chunk_size: int
261
+ :param (int)->None or None chunk_downloaded: A callback
262
+ :param int chunk_size: The number of bytes it should read into memory.
205
263
  """
206
- from office365.onedrive.internal.queries.download_content import create_download_session_content_query
207
- qry = create_download_session_content_query(self)
208
264
 
209
- def _construct_download_request(request):
265
+ def _construct_request(request):
210
266
  """
211
267
  :type request: office365.runtime.http.request_options.RequestOptions
212
268
  """
213
269
  request.stream = True
214
- request.method = HttpMethod.Get
215
270
 
216
- def _process_download_response(response):
271
+ def _process_response(response):
272
+ """
273
+ :type response: requests.Response
274
+ """
217
275
  bytes_read = 0
218
276
  for chunk in response.iter_content(chunk_size=chunk_size):
219
277
  bytes_read += len(chunk)
@@ -221,9 +279,8 @@ class DriveItem(BaseItem):
221
279
  chunk_downloaded(bytes_read)
222
280
  file_object.write(chunk)
223
281
 
224
- self.context.before_execute(_construct_download_request)
225
- self.context.after_execute(_process_download_response)
226
- self.context.add_query(qry)
282
+ self.get_content().before_execute(_construct_request)
283
+ self.context.after_execute(_process_response)
227
284
  return self
228
285
 
229
286
  def create_folder(self, name, conflict_behavior=ConflictBehavior.Rename):
@@ -248,12 +305,8 @@ class DriveItem(BaseItem):
248
305
 
249
306
  :param format_name: Specify the format the item's content should be downloaded as.
250
307
  :type format_name: str
251
- :rtype: ClientResult
252
308
  """
253
- from office365.onedrive.internal.queries.download_content import create_download_content_query
254
- qry = create_download_content_query(self, format_name)
255
- self.context.add_query(qry)
256
- return qry.return_type
309
+ return self.get_content(format_name)
257
310
 
258
311
  def copy(self, name=None, parent=None, conflict_behavior=ConflictBehavior.Fail):
259
312
  """Asynchronously creates a copy of an driveItem (including any children), under a new parent item or with a
@@ -285,7 +338,7 @@ class DriveItem(BaseItem):
285
338
  return
286
339
  return_type.set_property("__value", location)
287
340
 
288
- def _create_query(parent_reference):
341
+ def _create_and_add_query(parent_reference):
289
342
  """
290
343
  :param office365.onedrive.listitems.item_reference.ItemReference or None parent_reference: Reference to the
291
344
  parent item the copy will be created in.
@@ -296,18 +349,17 @@ class DriveItem(BaseItem):
296
349
  }
297
350
  self.context.before_execute(_create_request)
298
351
  self.context.after_execute(_process_response)
299
- return ServiceOperationQuery(self, "copy", None, payload, None, return_type)
352
+ qry = ServiceOperationQuery(self, "copy", None, payload, None, return_type)
353
+ self.context.add_query(qry)
300
354
 
301
355
  if isinstance(parent, DriveItem):
302
356
  def _drive_item_loaded():
303
357
  parent_reference = ItemReference(drive_id=parent.parent_reference.driveId, _id=parent.id)
304
- next_qry = _create_query(parent_reference)
305
- self.context.add_query(next_qry)
358
+ _create_and_add_query(parent_reference)
306
359
 
307
360
  parent.ensure_property("parentReference", _drive_item_loaded)
308
361
  else:
309
- qry = _create_query(parent)
310
- self.context.add_query(qry)
362
+ _create_and_add_query(parent)
311
363
  return return_type
312
364
 
313
365
  def move(self, name=None, parent=None):
@@ -322,7 +374,7 @@ class DriveItem(BaseItem):
322
374
 
323
375
  return_type = ClientResult(self.context, str())
324
376
 
325
- def _create_query(parent_reference):
377
+ def _create_and_add_query(parent_reference):
326
378
  payload = {
327
379
  "name": name,
328
380
  "parentReference": parent_reference
@@ -332,18 +384,16 @@ class DriveItem(BaseItem):
332
384
  request.method = HttpMethod.Patch
333
385
 
334
386
  self.context.before_execute(_construct_request)
335
- return ServiceOperationQuery(self, "move", None, payload, None, return_type)
387
+ qry = ServiceOperationQuery(self, "move", None, payload, None, return_type)
388
+ self.context.add_query(qry)
336
389
 
337
390
  if isinstance(parent, DriveItem):
338
391
  def _drive_item_loaded():
339
- parent_reference = ItemReference(_id=parent.id)
340
- next_qry = _create_query(parent_reference)
341
- self.context.add_query(next_qry)
392
+ _create_and_add_query(ItemReference(_id=parent.id))
342
393
 
343
394
  parent.ensure_property("parentReference", _drive_item_loaded)
344
395
  else:
345
- qry = _create_query(parent)
346
- self.context.add_query(qry)
396
+ _create_and_add_query(parent)
347
397
  return return_type
348
398
 
349
399
  def rename(self, new_name):
@@ -363,31 +413,43 @@ class DriveItem(BaseItem):
363
413
  self.context.add_query(qry)
364
414
  return return_type
365
415
 
366
- def invite(self, recipients, message, require_sign_in=True, send_invitation=True, roles=None):
367
- """Sends a sharing invitation for a driveItem. A sharing invitation provides permissions to the recipients
416
+ def invite(self, recipients, message, require_sign_in=True, send_invitation=True, roles=None,
417
+ expiration_datetime=None, password=None, retain_inherited_permissions=None):
418
+ """
419
+ Sends a sharing invitation for a driveItem. A sharing invitation provides permissions to the recipients
368
420
  and optionally sends them an email with a sharing link.
369
421
 
370
- :param list[DriveRecipient] recipients: A collection of recipients who will receive access and the sharing
371
- invitation.
422
+ :param list[str] recipients: A collection of recipients who will receive access and the sharing
423
+ invitation.
372
424
  :param str message: A plain text formatted message that is included in the sharing invitation.
373
- Maximum length 2000 characters.
425
+ Maximum length 2000 characters.
374
426
  :param bool require_sign_in: Specifies whether the recipient of the invitation is required to sign-in to view
375
- the shared item.
427
+ the shared item.
376
428
  :param bool send_invitation: If true, a sharing link is sent to the recipient. Otherwise, a permission is
377
- granted directly without sending a notification.
429
+ granted directly without sending a notification.
378
430
  :param list[str] roles: Specify the roles that are to be granted to the recipients of the sharing invitation.
431
+ :param datetime.datetime expiration_datetime: Specifies the dateTime after which the permission expires.
432
+ For OneDrive for Business and SharePoint, expirationDateTime is only applicable for sharingLink permissions.
433
+ Available on OneDrive for Business, SharePoint, and premium personal OneDrive accounts.
434
+ :param str password: The password set on the invite by the creator. Optional and OneDrive Personal only.
435
+ :param bool retain_inherited_permissions: Optional. If true (default), any existing inherited permissions
436
+ are retained on the shared item when sharing this item for the first time. If false, all existing
437
+ permissions are removed when sharing for the first time.
379
438
  """
380
439
  if roles is None:
381
440
  roles = ["read"]
382
- return_type = EntityCollection(self.context, Permission)
441
+ return_type = PermissionCollection(self.context)
383
442
  payload = {
384
443
  "requireSignIn": require_sign_in,
385
444
  "sendInvitation": send_invitation,
386
445
  "roles": roles,
387
- "recipients": recipients,
388
- "message": message
446
+ "recipients": ClientValueCollection(DriveRecipient, [DriveRecipient.from_email(r) for r in recipients]),
447
+ "message": message,
448
+ "expirationDateTime": expiration_datetime.isoformat() + "Z" if expiration_datetime else None,
449
+ "password": password,
450
+ "retainInheritedPermissions": retain_inherited_permissions
389
451
  }
390
- qry = ServiceOperationQuery(self, "invite", payload, None, None, return_type)
452
+ qry = ServiceOperationQuery(self, "invite", None, payload, None, return_type)
391
453
  self.context.add_query(qry)
392
454
  return return_type
393
455
 
@@ -402,26 +464,29 @@ class DriveItem(BaseItem):
402
464
  """
403
465
  return_type = EntityCollection(self.context, ItemActivityStat, self.resource_path)
404
466
 
405
- def _create_query(binding_type):
467
+ def _create_query():
406
468
  params = {
407
469
  "startDateTime": start_dt.strftime('%m-%d-%Y') if start_dt else None,
408
470
  "endDateTime": end_dt.strftime('%m-%d-%Y') if end_dt else None,
409
471
  "interval": interval
410
472
  }
411
- return FunctionQuery(binding_type, "getActivitiesByInterval", params, return_type)
412
-
413
- # if isinstance(self.resource_path, RootPath):
414
- # def _loaded():
415
- # drive_item = self.context.drives[self.parent_reference.driveId].items[self.id]
416
- # next_qry = _create_query(drive_item)
417
- # self.context.add_query(next_qry)
418
- # self.ensure_property("parentReference", _loaded)
419
- # else:
420
- qry = _create_query(self)
473
+ return FunctionQuery(self, "getActivitiesByInterval", params, return_type)
474
+
475
+ qry = _create_query()
421
476
  self.context.add_query(qry)
422
477
 
423
478
  return return_type
424
479
 
480
+ def permanent_delete(self):
481
+ """
482
+ Permanently delete a driveItem.
483
+ Note that if you delete items using this method, they will be permanently removed and won't be sent to the
484
+ recycle bin. Therefore, they cannot be restored afterward.
485
+ """
486
+ qry = ServiceOperationQuery(self, "permanentDelete")
487
+ self.context.add_query(qry)
488
+ return self
489
+
425
490
  def restore(self, parent_reference=None, name=None):
426
491
  """
427
492
  Restore a driveItem that has been deleted and is currently in the recycle bin.
@@ -560,6 +625,12 @@ class DriveItem(BaseItem):
560
625
  """For files that are Excel spreadsheets, accesses the workbook API to work with the spreadsheet's contents. """
561
626
  return self.properties.get('workbook', Workbook(self.context, ResourcePath("workbook", self.resource_path)))
562
627
 
628
+ @property
629
+ def pending_operations(self):
630
+ """If present, indicates that one or more operations that might affect the state of the driveItem are pending
631
+ completion. Read-only."""
632
+ return self.properties.get('pendingOperations', PendingOperations())
633
+
563
634
  @property
564
635
  def permissions(self):
565
636
  """The set of permissions for the item. Read-only. Nullable."""
@@ -572,6 +643,11 @@ class DriveItem(BaseItem):
572
643
  in locations that support such actions. This property is not returned by default. Read-only."""
573
644
  return self.properties.get('publication', PublicationFacet())
574
645
 
646
+ @property
647
+ def remote_item(self):
648
+ """Remote item data, if the item is shared from a drive other than the one being accessed. Read-only."""
649
+ return self.properties.get('remoteItem', RemoteItem())
650
+
575
651
  @property
576
652
  def special_folder(self):
577
653
  """If the current item is also available as a special folder, this facet is returned. Read-only."""
@@ -610,13 +686,15 @@ class DriveItem(BaseItem):
610
686
  """The set of subscriptions on the driveItem.
611
687
  """
612
688
  return self.properties.get('subscriptions',
613
- EntityCollection(self.context, Subscription,
614
- ResourcePath("subscriptions", self.resource_path)))
689
+ SubscriptionCollection(self.context,
690
+ ResourcePath("subscriptions", self.resource_path)))
615
691
 
616
692
  def get_property(self, name, default_value=None):
617
693
  if default_value is None:
618
694
  property_mapping = {
619
695
  "fileSystemInfo": self.file_system_info,
696
+ "remoteItem": self.remote_item,
697
+ "specialFolder": self.special_folder
620
698
  }
621
699
  default_value = property_mapping.get(name, None)
622
700
  return super(DriveItem, self).get_property(name, default_value)
@@ -8,4 +8,11 @@ class Image(ClientValue):
8
8
 
9
9
  Note: If the service is unable to determine the width and height of the image, the Image resource may be empty.
10
10
  """
11
- pass
11
+
12
+ def __init__(self, height=None, width=None):
13
+ """
14
+ :param int height:
15
+ :param int width:
16
+ """
17
+ self.height = height
18
+ self.width = width
@@ -2,8 +2,26 @@ from office365.runtime.client_value import ClientValue
2
2
 
3
3
 
4
4
  class ItemPreviewInfo(ClientValue):
5
- """Contains information about how to embed a preview of a driveItem."""
5
+ """Contains information about how to embed a preview of a driveItem.
6
6
 
7
- def __init__(self, post_url=None):
7
+ Either getUrl, postUrl, or both may be returned depending on the current state of support for the specified options.
8
+
9
+ postParameters is a string formatted as application/x-www-form-urlencoded,
10
+ and if performing a POST to the postUrl the content-type should be set accordingly. For example:
11
+
12
+ POST https://www.onedrive.com/embed_by_post
13
+ Content-Type: application/x-www-form-urlencoded
14
+
15
+ param1=value&param2=another%20value
16
+ """
17
+
18
+ def __init__(self, get_url=None, post_parameters=None, post_url=None):
19
+ """
20
+ :param str get_url: URL suitable for embedding using HTTP GET (iframes, etc.)
21
+ :param str post_parameters: POST parameters to include if using postUrl
22
+ :param str post_url: URL suitable for embedding using HTTP POST (form post, JS, etc.)
23
+ """
24
+ self.getUrl = get_url
25
+ self.postParameters = post_parameters
8
26
  self.postUrl = post_url
9
27
 
@@ -1,4 +1,8 @@
1
1
  from office365.directory.permissions.identity_set import IdentitySet
2
+ from office365.onedrive.driveitems.image import Image
3
+ from office365.onedrive.files.file import File
4
+ from office365.onedrive.files.system_info import FileSystemInfo
5
+ from office365.onedrive.folders.folder import Folder
2
6
  from office365.runtime.client_value import ClientValue
3
7
 
4
8
 
@@ -8,13 +12,24 @@ class RemoteItem(ClientValue):
8
12
  This resource provides the unique IDs of the source drive and target item.
9
13
 
10
14
  DriveItems with a non-null remoteItem facet are resources that are shared, added to the user's OneDrive,
11
- or on items returned from hetrogenous collections of items (like search results).
15
+ or on items returned from heterogeneous collections of items (like search results).
12
16
  """
13
17
 
14
- def __init__(self, created_by=IdentitySet(), created_datetime=None):
18
+ def __init__(self, _id=None, created_by=IdentitySet(), created_datetime=None,
19
+ file=File(), file_system_info=FileSystemInfo(), folder=Folder(), image=Image()):
15
20
  """
16
- :param IdentitySet created_by:
17
- :param datetime.datetime created_datetime:
21
+ :param str _id: Unique identifier for the remote item in its drive. Read-only.
22
+ :param IdentitySet created_by: Identity of the user, device, and application which created the item. Read-only.
23
+ :param datetime.datetime created_datetime: Date and time of item creation. Read-only.
24
+ :param File file: Indicates that the remote item is a file. Read-only.
25
+ :param FileSystemInfo file_system_info: Information about the remote item from the local file system. Read-only.
26
+ :param Folder folder: Indicates that the remote item is a folder. Read-only.
27
+ :param Image image: Image metadata, if the item is an image. Read-only.
18
28
  """
29
+ self.id = _id
19
30
  self.createdBy = created_by
20
31
  self.createdDateTime = created_datetime
32
+ self.file = file
33
+ self.fileSystemInfo = file_system_info
34
+ self.folder = folder
35
+ self.image = image
@@ -4,6 +4,7 @@ from office365.entity_collection import EntityCollection
4
4
  from office365.onedrive.driveitems.conflict_behavior import ConflictBehavior
5
5
  from office365.onedrive.driveitems.driveItem import DriveItem
6
6
  from office365.onedrive.driveitems.system_facet import SystemFacet
7
+ from office365.onedrive.drives.quota import Quota
7
8
  from office365.onedrive.internal.paths.root import RootPath
8
9
  from office365.onedrive.lists.list import List
9
10
  from office365.onedrive.sharepoint_ids import SharePointIds
@@ -125,9 +126,14 @@ class Drive(BaseItem):
125
126
  EntityCollection(self.context, DriveItem,
126
127
  ResourcePath("following", self.resource_path)))
127
128
 
129
+ @property
130
+ def quota(self):
131
+ """Optional. Information about the drive's storage space quota. Read-only."""
132
+ return self.properties.get("quota", Quota())
133
+
128
134
  @property
129
135
  def special(self):
130
- """Collection of common folders available in OneDrive. Read-only. Nullable."""
136
+ """Collection of auth folders available in OneDrive. Read-only. Nullable."""
131
137
  return self.properties.get('special',
132
138
  EntityCollection(self.context, DriveItem,
133
139
  ResourcePath("special", self.resource_path)))
@@ -0,0 +1,18 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class Quota(ClientValue):
5
+ """
6
+ The quota resource provides details about space constraints on a drive resource.
7
+ In OneDrive Personal, the values reflect the total/used unified storage quota across multiple Microsoft services.
8
+ """
9
+
10
+ def __init__(self, deleted=None, remaining=None, state=None):
11
+ """
12
+ :param int deleted: Total space consumed by files in the recycle bin, in bytes. Read-only.
13
+ :param int remaining: Total space remaining before reaching the quota limit, in bytes. Read-only.
14
+ :param str state: Enumeration value that indicates the state of the storage space. Read-only.
15
+ """
16
+ self.deleted = deleted
17
+ self.remaining = remaining
18
+ self.state = state
@@ -21,4 +21,8 @@ class DriveRecipient(ClientValue):
21
21
 
22
22
  @staticmethod
23
23
  def from_email(value):
24
+ """
25
+ Creates Drive recipient from email address
26
+ :type value: str
27
+ """
24
28
  return DriveRecipient(email=value)
@@ -5,12 +5,14 @@ class FileSystemInfo(ClientValue):
5
5
  """The FileSystemInfo resource contains properties that are reported by the device's local file system for the
6
6
  local version of an item. """
7
7
 
8
- def __init__(self, created_date_time=None):
8
+ def __init__(self, created_datetime=None, last_accessed_datetime=None, last_modified_datetime=None):
9
9
  """
10
- :param str created_date_time: The UTC date and time the file was created on a client.
11
-
10
+ :param datetime.datetime created_datetime: The UTC date and time the file was created on a client.
11
+ :param datetime.datetime last_accessed_datetime: The UTC date and time the file was last accessed.
12
+ Available for the recent file list only.
13
+ :param datetime.datetime last_modified_datetime: The UTC date and time the file was last modified on a client.
12
14
  """
13
15
  super(FileSystemInfo, self).__init__()
14
- self.createdDateTime = created_date_time
15
- self.lastAccessedDateTime = None
16
- self.lastModifiedDateTime = None
16
+ self.createdDateTime = created_datetime
17
+ self.lastAccessedDateTime = last_accessed_datetime
18
+ self.lastModifiedDateTime = last_modified_datetime
@@ -1,3 +1,4 @@
1
+ from office365.onedrive.folders.view import FolderView
1
2
  from office365.runtime.client_value import ClientValue
2
3
 
3
4
 
@@ -7,11 +8,10 @@ class Folder(ClientValue):
7
8
  DriveItems with a non-null folder facet are containers for other DriveItems.
8
9
  """
9
10
 
10
- def __init__(self, child_count=None, view=None):
11
+ def __init__(self, child_count=None, view=FolderView()):
11
12
  """
12
13
  :param int child_count: Number of children contained immediately within this container.
13
- :param office365.onedrive.folderView.FolderView view: A collection of properties defining the recommended
14
- view for the folder.
14
+ :param FolderView view: A collection of properties defining the recommended view for the folder.
15
15
  """
16
16
  super(Folder, self).__init__()
17
17
  self.childCount = child_count
@@ -10,8 +10,5 @@ class ChildrenPath(EntityPath):
10
10
  @property
11
11
  def collection(self):
12
12
  if self._collection is None:
13
- if isinstance(self.parent, EntityPath):
14
- self._collection = self.parent.collection
15
- else:
16
- self._collection = self.parent.parent
13
+ self._collection = self.parent.collection
17
14
  return self._collection
@@ -4,6 +4,10 @@ from office365.runtime.paths.resource_path import ResourcePath
4
4
 
5
5
 
6
6
  def _url_to_shared_token(url):
7
+ """
8
+ Converts url into shared token
9
+ :param str url:
10
+ """
7
11
  value = base64.b64encode(url.encode("ascii")).decode("ascii")
8
12
  if value.endswith("="):
9
13
  value = value[:-1]
@@ -13,5 +17,6 @@ def _url_to_shared_token(url):
13
17
  class SharedPath(ResourcePath):
14
18
  """Shared token path"""
15
19
 
16
- def __init__(self, url, parent=None):
17
- super(SharedPath, self).__init__(_url_to_shared_token(url), parent)
20
+ @property
21
+ def segment(self):
22
+ return _url_to_shared_token(self.key)