Office365-REST-Python-Client 2.5.1__py3-none-any.whl → 2.5.3__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 (271) hide show
  1. {Office365_REST_Python_Client-2.5.1.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/METADATA +6 -6
  2. {Office365_REST_Python_Client-2.5.1.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/RECORD +265 -259
  3. office365/base_item.py +12 -20
  4. office365/communications/onlinemeetings/collection.py +1 -1
  5. office365/communications/onlinemeetings/online_meeting.py +20 -35
  6. office365/communications/presences/presence.py +18 -7
  7. office365/delta_collection.py +10 -1
  8. office365/delta_path.py +1 -1
  9. office365/directory/administrative_unit.py +6 -7
  10. office365/directory/applications/application.py +24 -18
  11. office365/directory/applications/roles/assignment.py +13 -1
  12. office365/directory/applications/roles/collection.py +13 -0
  13. office365/directory/applications/roles/role.py +6 -1
  14. office365/directory/audit/directory.py +8 -7
  15. office365/directory/audit/log_root.py +3 -0
  16. office365/directory/audit/signins/signin.py +19 -29
  17. office365/directory/authentication/authentication.py +1 -0
  18. office365/directory/authentication/methods/details.py +8 -6
  19. office365/directory/authentication/methods/phone.py +3 -1
  20. office365/directory/extensions/extension_property.py +7 -9
  21. office365/directory/groups/collection.py +10 -3
  22. office365/directory/groups/group.py +19 -19
  23. office365/directory/groups/lifecycle_policy.py +8 -7
  24. office365/directory/identities/provider.py +5 -6
  25. office365/directory/insights/usage_details.py +8 -3
  26. office365/directory/internal/paths/me.py +1 -1
  27. office365/directory/invitations/collection.py +1 -1
  28. office365/directory/invitations/invitation.py +6 -6
  29. office365/directory/object_collection.py +2 -3
  30. office365/directory/permissions/email_identity.py +7 -0
  31. office365/directory/permissions/grants/resource_specific.py +10 -9
  32. office365/directory/permissions/identity.py +3 -0
  33. office365/directory/permissions/identity_set.py +3 -0
  34. office365/directory/policies/base.py +4 -4
  35. office365/directory/policies/root.py +6 -4
  36. office365/directory/protection/information.py +3 -3
  37. office365/directory/rolemanagement/application.py +2 -0
  38. office365/directory/rolemanagement/role.py +11 -10
  39. office365/directory/rolemanagement/template.py +9 -8
  40. office365/directory/rolemanagement/unified_role_assignment.py +5 -4
  41. office365/directory/rolemanagement/unified_role_definition.py +6 -4
  42. office365/directory/security/security.py +3 -0
  43. office365/directory/serviceprincipals/collection.py +20 -4
  44. office365/directory/serviceprincipals/service_principal.py +79 -12
  45. office365/directory/users/activities/activity.py +5 -4
  46. office365/directory/users/user.py +29 -34
  47. office365/entity.py +2 -2
  48. office365/entity_collection.py +12 -5
  49. office365/graph_client.py +90 -8
  50. office365/intune/audit/event.py +4 -3
  51. office365/intune/devices/enrollment/configuration.py +6 -4
  52. office365/intune/devices/managed.py +9 -12
  53. office365/onedrive/analytics/item_activity_stat.py +4 -3
  54. office365/onedrive/columns/column_link.py +4 -4
  55. office365/onedrive/columns/definition.py +29 -32
  56. office365/onedrive/columns/definition_collection.py +1 -1
  57. office365/onedrive/contenttypes/content_type.py +16 -18
  58. office365/onedrive/documentsets/version.py +7 -3
  59. office365/onedrive/driveitems/driveItem.py +48 -49
  60. office365/onedrive/drives/drive.py +7 -2
  61. office365/onedrive/internal/paths/children.py +2 -2
  62. office365/onedrive/internal/paths/root.py +1 -1
  63. office365/onedrive/internal/paths/shared.py +1 -1
  64. office365/onedrive/internal/paths/site.py +3 -3
  65. office365/onedrive/internal/paths/url.py +2 -2
  66. office365/onedrive/listitems/list_item.py +2 -0
  67. office365/onedrive/lists/list.py +7 -4
  68. office365/onedrive/permissions/collection.py +28 -7
  69. office365/onedrive/permissions/permission.py +5 -7
  70. office365/onedrive/permissions/sharing_link.py +1 -1
  71. office365/onedrive/sharepoint.py +1 -0
  72. office365/onedrive/shares/collection.py +2 -5
  73. office365/onedrive/shares/drive_item.py +4 -0
  74. office365/onedrive/sites/site.py +6 -0
  75. office365/onedrive/termstore/groups/collection.py +3 -8
  76. office365/onedrive/termstore/groups/group.py +8 -0
  77. office365/onedrive/termstore/sets/collection.py +2 -6
  78. office365/onedrive/termstore/sets/name.py +5 -0
  79. office365/onedrive/termstore/sets/set.py +7 -0
  80. office365/onedrive/termstore/store.py +10 -13
  81. office365/onedrive/versions/drive_item.py +3 -1
  82. office365/onedrive/workbooks/ranges/range.py +9 -13
  83. office365/onedrive/workbooks/ranges/view.py +1 -0
  84. office365/onedrive/workbooks/tables/rows/row.py +3 -0
  85. office365/onedrive/workbooks/tables/table.py +7 -4
  86. office365/onedrive/workbooks/worksheets/worksheet.py +12 -4
  87. office365/onenote/entity_hierarchy_model.py +4 -0
  88. office365/onenote/internal/multipart_page_query.py +4 -5
  89. office365/onenote/notebooks/notebook.py +4 -0
  90. office365/onenote/pages/collection.py +3 -2
  91. office365/onenote/resources/resource.py +5 -4
  92. office365/onenote/sectiongroups/section_group.py +10 -7
  93. office365/onenote/sections/section.py +1 -1
  94. office365/outlook/calendar/attendees/base.py +2 -1
  95. office365/outlook/calendar/calendar.py +18 -10
  96. office365/outlook/calendar/events/collection.py +0 -2
  97. office365/outlook/calendar/group.py +7 -8
  98. office365/outlook/calendar/meetingtimes/suggestion.py +8 -4
  99. office365/outlook/calendar/meetingtimes/time_slot.py +3 -0
  100. office365/outlook/calendar/permissions/collection.py +1 -1
  101. office365/outlook/calendar/rooms/__init__.py +0 -0
  102. office365/outlook/calendar/rooms/list.py +27 -0
  103. office365/outlook/calendar/rooms/room.py +8 -0
  104. office365/outlook/calendar/schedule/information.py +0 -1
  105. office365/outlook/contacts/collection.py +0 -8
  106. office365/outlook/contacts/contact.py +14 -14
  107. office365/outlook/contacts/folder.py +3 -0
  108. office365/outlook/mail/attachments/attachment.py +31 -31
  109. office365/outlook/mail/attachments/collection.py +34 -6
  110. office365/outlook/mail/conversation.py +6 -4
  111. office365/outlook/mail/folders/collection.py +0 -7
  112. office365/outlook/mail/folders/folder.py +50 -18
  113. office365/outlook/mail/messages/collection.py +0 -1
  114. office365/outlook/mail/messages/message.py +58 -68
  115. office365/outlook/mail/physical_address.py +11 -5
  116. office365/outlook/mail/recipient.py +3 -1
  117. office365/outlook/mail/recurrence_range.py +14 -6
  118. office365/outlook/user.py +1 -0
  119. office365/planner/planner.py +9 -12
  120. office365/planner/plans/collection.py +17 -18
  121. office365/planner/plans/container.py +11 -0
  122. office365/planner/plans/plan.py +21 -10
  123. office365/runtime/auth/authentication_context.py +3 -3
  124. office365/runtime/auth/providers/acs_token_provider.py +7 -9
  125. office365/runtime/auth/providers/saml_token_provider.py +5 -2
  126. office365/runtime/client_object.py +6 -15
  127. office365/runtime/client_object_collection.py +36 -35
  128. office365/runtime/client_result.py +6 -7
  129. office365/runtime/client_runtime_context.py +10 -16
  130. office365/runtime/client_value_collection.py +3 -10
  131. office365/runtime/compat.py +2 -0
  132. office365/runtime/odata/query_options.py +1 -3
  133. office365/runtime/odata/reader.py +1 -1
  134. office365/runtime/odata/request.py +2 -4
  135. office365/runtime/odata/type.py +17 -0
  136. office365/runtime/odata/v4/upload_session_request.py +27 -30
  137. office365/runtime/paths/appid.py +1 -1
  138. office365/runtime/{odata/url_builder.py → paths/builder.py} +24 -9
  139. office365/runtime/paths/item.py +3 -1
  140. office365/runtime/paths/resource_path.py +12 -16
  141. office365/runtime/paths/service_operation.py +8 -7
  142. office365/runtime/paths/v3/__init__.py +0 -0
  143. office365/runtime/paths/{key.py → v3/entity.py} +5 -5
  144. office365/runtime/paths/v4/__init__.py +0 -0
  145. office365/runtime/paths/{entity.py → v4/entity.py} +13 -11
  146. office365/runtime/queries/function.py +1 -1
  147. office365/runtime/types/event_handler.py +1 -3
  148. office365/search/entity.py +15 -8
  149. office365/search/external/external.py +1 -0
  150. office365/search/sort_property.py +3 -0
  151. office365/sharepoint/attachments/attachment.py +3 -1
  152. office365/sharepoint/attachments/collection.py +3 -0
  153. office365/sharepoint/changes/change.py +12 -1
  154. office365/sharepoint/changes/collection.py +1 -1
  155. office365/sharepoint/changes/list.py +3 -0
  156. office365/sharepoint/changes/token.py +4 -0
  157. office365/sharepoint/changes/type.py +23 -23
  158. office365/sharepoint/changes/web.py +7 -3
  159. office365/sharepoint/client_context.py +21 -18
  160. office365/sharepoint/clientsidecomponent/hostedapps/manager.py +3 -3
  161. office365/sharepoint/contenttypes/content_type.py +47 -56
  162. office365/sharepoint/contenttypes/content_type_id.py +1 -1
  163. office365/sharepoint/documentmanagement/document_id.py +2 -2
  164. office365/sharepoint/documentmanagement/document_set.py +6 -7
  165. office365/sharepoint/entity_collection.py +9 -0
  166. office365/sharepoint/features/feature.py +6 -8
  167. office365/sharepoint/fields/collection.py +6 -5
  168. office365/sharepoint/fields/field.py +28 -46
  169. office365/sharepoint/fields/related_field_collection.py +1 -1
  170. office365/sharepoint/fields/user_value.py +3 -3
  171. office365/sharepoint/files/checked_out_file.py +4 -2
  172. office365/sharepoint/files/checked_out_file_collection.py +1 -1
  173. office365/sharepoint/files/collection.py +84 -14
  174. office365/sharepoint/files/file.py +118 -110
  175. office365/sharepoint/files/versions/collection.py +5 -3
  176. office365/sharepoint/files/versions/event.py +6 -3
  177. office365/sharepoint/files/versions/version.py +31 -18
  178. office365/sharepoint/folders/collection.py +5 -10
  179. office365/sharepoint/folders/folder.py +41 -24
  180. office365/sharepoint/forms/collection.py +1 -1
  181. office365/sharepoint/forms/form.py +4 -4
  182. office365/sharepoint/internal/paths/static_operation.py +9 -0
  183. office365/sharepoint/internal/paths/web.py +20 -0
  184. office365/sharepoint/listitems/collection.py +4 -0
  185. office365/sharepoint/listitems/listitem.py +37 -38
  186. office365/sharepoint/listitems/versions/collection.py +1 -1
  187. office365/sharepoint/listitems/versions/version.py +18 -11
  188. office365/sharepoint/lists/collection.py +1 -2
  189. office365/sharepoint/lists/list.py +106 -153
  190. office365/sharepoint/marketplace/app_metadata_collection.py +3 -1
  191. office365/sharepoint/navigation/node.py +16 -15
  192. office365/sharepoint/navigation/node_collection.py +9 -3
  193. office365/sharepoint/permissions/base_permissions.py +11 -6
  194. office365/sharepoint/permissions/roles/assignments/collection.py +8 -12
  195. office365/sharepoint/permissions/roles/definitions/definition.py +3 -1
  196. office365/sharepoint/permissions/securable_object.py +38 -31
  197. office365/sharepoint/portal/groups/service.py +12 -16
  198. office365/sharepoint/portal/groups/site_manager.py +0 -1
  199. office365/sharepoint/principal/groups/group.py +24 -30
  200. office365/sharepoint/principal/principal.py +21 -19
  201. office365/sharepoint/principal/users/collection.py +5 -0
  202. office365/sharepoint/principal/users/user.py +20 -26
  203. office365/sharepoint/publishing/pages/collection.py +1 -4
  204. office365/sharepoint/publishing/pages/metadata.py +38 -51
  205. office365/sharepoint/publishing/pages/metadata_collection.py +5 -2
  206. office365/sharepoint/publishing/pages/page.py +12 -21
  207. office365/sharepoint/publishing/pages/reposts/repost.py +5 -9
  208. office365/sharepoint/publishing/pages/service.py +36 -49
  209. office365/sharepoint/pushnotifications/collection.py +3 -1
  210. office365/sharepoint/recyclebin/item.py +11 -9
  211. office365/sharepoint/recyclebin/item_collection.py +1 -1
  212. office365/sharepoint/search/service.py +8 -6
  213. office365/sharepoint/sharing/links/info.py +5 -2
  214. office365/sharepoint/sharing/links/share_response.py +3 -0
  215. office365/sharepoint/sharing/links/share_settings.py +3 -0
  216. office365/sharepoint/sharing/object_sharing_information.py +25 -19
  217. office365/sharepoint/sharing/object_sharing_information_user.py +10 -19
  218. office365/sharepoint/sharing/result.py +18 -41
  219. office365/sharepoint/sharing/role.py +20 -0
  220. office365/sharepoint/sharing/role_type.py +1 -0
  221. office365/sharepoint/sharing/user_sharing_result.py +12 -0
  222. office365/sharepoint/sites/language.py +6 -0
  223. office365/sharepoint/sites/language_collection.py +3 -0
  224. office365/sharepoint/sites/site.py +65 -86
  225. office365/sharepoint/storagemetrics/storage_metrics.py +5 -6
  226. office365/sharepoint/taxonomy/item.py +11 -10
  227. office365/sharepoint/taxonomy/stores/store.py +8 -8
  228. office365/sharepoint/taxonomy/terms/label.py +3 -0
  229. office365/sharepoint/taxonomy/terms/term.py +31 -0
  230. office365/sharepoint/tenant/administration/collaboration/insights_overview.py +10 -0
  231. office365/sharepoint/tenant/administration/hubsites/collection.py +1 -2
  232. office365/sharepoint/tenant/administration/hubsites/hub_site.py +20 -24
  233. office365/sharepoint/tenant/administration/internal/permission_grant.py +7 -0
  234. office365/sharepoint/tenant/administration/sites/properties.py +55 -44
  235. office365/sharepoint/tenant/administration/tenant.py +69 -69
  236. office365/sharepoint/types/resource_path.py +2 -2
  237. office365/sharepoint/ui/applicationpages/peoplepicker/query_parameters.py +1 -1
  238. office365/sharepoint/usercustomactions/collection.py +1 -2
  239. office365/sharepoint/userprofiles/my_site_links.py +4 -4
  240. office365/sharepoint/userprofiles/people_manager.py +1 -3
  241. office365/sharepoint/userprofiles/user_profile.py +9 -11
  242. office365/sharepoint/utilities/principal_info.py +12 -0
  243. office365/sharepoint/viva/employee_engagement.py +1 -1
  244. office365/sharepoint/webparts/definition_collection.py +1 -1
  245. office365/sharepoint/webs/collection.py +8 -0
  246. office365/sharepoint/webs/template_collection.py +3 -5
  247. office365/sharepoint/webs/web.py +75 -95
  248. office365/subscriptions/collection.py +1 -1
  249. office365/subscriptions/subscription.py +13 -11
  250. office365/teams/apps/app.py +1 -0
  251. office365/teams/channels/channel.py +1 -3
  252. office365/teams/collection.py +12 -16
  253. office365/teams/info.py +7 -4
  254. office365/teams/members/conversation_collection.py +1 -3
  255. office365/teams/operations/async_operation.py +3 -5
  256. office365/teams/schedule/groups/group.py +3 -0
  257. office365/teams/team.py +18 -20
  258. office365/todo/attachments/base.py +7 -9
  259. office365/todo/linked_resource.py +6 -6
  260. office365/todo/tasks/list.py +1 -0
  261. office365/todo/tasks/task.py +3 -0
  262. office365/onedrive/internal/queries/resumable_file_upload.py +0 -36
  263. office365/outlook/internal/queries/attachment_upload.py +0 -53
  264. office365/runtime/odata/path_builder.py +0 -23
  265. office365/sharepoint/internal/key_value.py +0 -28
  266. office365/sharepoint/internal/queries/create_file.py +0 -20
  267. office365/sharepoint/internal/queries/upload_session.py +0 -103
  268. {Office365_REST_Python_Client-2.5.1.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/LICENSE +0 -0
  269. {Office365_REST_Python_Client-2.5.1.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/WHEEL +0 -0
  270. {Office365_REST_Python_Client-2.5.1.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/top_level.txt +0 -0
  271. /office365/planner/plans/{plan_details.py → details.py} +0 -0
@@ -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.entity_collection import EntityCollection
@@ -15,33 +16,34 @@ class Conversation(Entity):
15
16
 
16
17
  @property
17
18
  def has_attachments(self):
19
+ # type: () -> Optional[bool]
18
20
  """
19
21
  Indicates whether any of the posts within this Conversation has at least one attachment.
20
22
  Supports $filter (eq, ne) and $search.
21
- :rtype: bool or None
22
23
  """
23
24
  return self.properties.get("hasAttachments", None)
24
25
 
25
26
  @property
26
27
  def last_delivered_datetime(self):
28
+ # type: () -> Optional[datetime.datetime]
27
29
  """The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time."""
28
30
  return self.properties.get("lastDeliveredDateTime", datetime.datetime.min)
29
31
 
30
32
  @property
31
33
  def preview(self):
34
+ # type: () -> Optional[str]
32
35
  """
33
36
  A short summary from the body of the latest post in this conversation.
34
37
  Supports $filter (eq, ne, le, ge).
35
- :rtype: str or None
36
38
  """
37
39
  return self.properties.get("preview", None)
38
40
 
39
41
  @property
40
42
  def topic(self):
43
+ # type: () -> Optional[str]
41
44
  """
42
45
  The topic of the conversation. This property can be set when the conversation is created, but it cannot be
43
46
  updated.
44
- :rtype: str or None
45
47
  """
46
48
  return self.properties.get("topic", None)
47
49
 
@@ -49,12 +51,12 @@ class Conversation(Entity):
49
51
  def unique_senders(self):
50
52
  """
51
53
  All the users that sent a message to this Conversation.
52
- :rtype: str or None
53
54
  """
54
55
  return self.properties.get("uniqueSenders", StringCollection())
55
56
 
56
57
  @property
57
58
  def threads(self):
59
+ # type: () -> EntityCollection[ConversationThread]
58
60
  """A collection of all the conversation threads in the conversation."""
59
61
  return self.properties.get(
60
62
  "threads",
@@ -5,10 +5,3 @@ from office365.outlook.mail.folders.folder import MailFolder
5
5
  class MailFolderCollection(DeltaCollection[MailFolder]):
6
6
  def __init__(self, context, resource_path=None):
7
7
  super(MailFolderCollection, self).__init__(context, MailFolder, resource_path)
8
-
9
- def __getitem__(self, key):
10
- """
11
- :param str key: MailFolder identifier or display name
12
- :rtype: MailFolder
13
- """
14
- return super(MailFolderCollection, self).__getitem__(key)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.extensions.extended_property import (
2
4
  MultiValueLegacyExtendedProperty,
3
5
  SingleValueLegacyExtendedProperty,
@@ -26,57 +28,84 @@ class MailFolder(Entity):
26
28
  self.context.add_query(qry)
27
29
  return return_type
28
30
 
29
- @property
30
- def child_folder_count(self):
31
+ def empty(self, delete_sub_folders=False):
31
32
  """
32
- The number of immediate child mailFolders in the current mailFolder.
33
- :rtype: int or None
33
+ Empties the folder
34
+ :param bool delete_sub_folders: true to indicate that subfolders should also be deleted; otherwise, false.
34
35
  """
36
+
37
+ def _empty(col):
38
+ # type: (MessageCollection) -> None
39
+ if not col.has_next:
40
+ [m.delete_object() for m in col]
41
+
42
+ self.messages.get_all(page_loaded=_empty)
43
+ return self
44
+
45
+ def mark_all_items_as_read(self):
46
+ """Marks all items in folder as read."""
47
+
48
+ def _mark_all_items_as_read(col):
49
+ # type: (MessageCollection) -> None
50
+ [m.set_property("isRead", True).update() for m in col.current_page]
51
+
52
+ self.messages.get_all(1, page_loaded=_mark_all_items_as_read)
53
+ return self
54
+
55
+ def mark_all_items_as_unread(self):
56
+ """Marks all items in folder as unread."""
57
+
58
+ def _mark_all_items_as_unread(col):
59
+ # type: (MessageCollection) -> None
60
+ [m.set_property("isRead", False).update() for m in col.current_page]
61
+
62
+ self.messages.get_all(page_loaded=_mark_all_items_as_unread)
63
+ return self
64
+
65
+ @property
66
+ def child_folder_count(self):
67
+ # type: () -> Optional[int]
68
+ """The number of immediate child mailFolders in the current mailFolder."""
35
69
  return self.properties.get("childFolderCount", None)
36
70
 
37
71
  @property
38
72
  def display_name(self):
39
- """
40
- The name of the Mail folder
41
- :rtype: str or None
42
- """
73
+ # type: () -> Optional[str]
74
+ """The name of the Mail folder"""
43
75
  return self.properties.get("displayName", None)
44
76
 
45
77
  @property
46
78
  def is_hidden(self):
79
+ # type: () -> Optional[bool]
47
80
  """
48
81
  Indicates whether the mailFolder is hidden. This property can be set only when creating the folder.
49
82
  Find more information in Hidden mail folders.
50
- :rtype: bool or None
51
83
  """
52
84
  return self.properties.get("isHidden", None)
53
85
 
54
86
  @property
55
87
  def parent_folder_id(self):
88
+ # type: () -> Optional[str]
56
89
  """
57
90
  The unique identifier for the mailFolder's parent mailFolder.
58
- :rtype: str or None
59
91
  """
60
92
  return self.properties.get("parentFolderId", None)
61
93
 
62
94
  @property
63
95
  def total_item_count(self):
64
- """
65
- The number of items in the mailFolder.
66
- :rtype: int
67
- """
96
+ # type: () -> Optional[int]
97
+ """The number of items in the mailFolder."""
68
98
  return self.properties.get("totalItemCount", None)
69
99
 
70
100
  @property
71
101
  def unread_item_count(self):
72
- """
73
- The number of items in the mailFolder marked as unread.
74
- :rtype: int
75
- """
102
+ # type: () -> Optional[int]
103
+ """The number of items in the mailFolder marked as unread."""
76
104
  return self.properties.get("unreadItemCount", None)
77
105
 
78
106
  @property
79
107
  def child_folders(self):
108
+ # type: () -> EntityCollection[MailFolder]
80
109
  """The collection of child folders in the mailFolder."""
81
110
  return self.properties.get(
82
111
  "childFolders",
@@ -89,6 +118,7 @@ class MailFolder(Entity):
89
118
 
90
119
  @property
91
120
  def message_rules(self):
121
+ # type: () -> EntityCollection[MessageRule]
92
122
  """"""
93
123
  return self.properties.get(
94
124
  "messageRules",
@@ -112,6 +142,7 @@ class MailFolder(Entity):
112
142
 
113
143
  @property
114
144
  def multi_value_extended_properties(self):
145
+ # type: () -> EntityCollection[MultiValueLegacyExtendedProperty]
115
146
  """The collection of multi-value extended properties defined for the MailFolder."""
116
147
  return self.properties.get(
117
148
  "multiValueExtendedProperties",
@@ -124,6 +155,7 @@ class MailFolder(Entity):
124
155
 
125
156
  @property
126
157
  def single_value_extended_properties(self):
158
+ # type: () -> EntityCollection[SingleValueLegacyExtendedProperty]
127
159
  """The collection of single-value extended properties defined for the MailFolder."""
128
160
  return self.properties.get(
129
161
  "singleValueExtendedProperties",
@@ -16,7 +16,6 @@ class MessageCollection(DeltaCollection[Message]):
16
16
  :param str subject: The subject of the message.
17
17
  :param str or ItemBody body: The body of the message. It can be in HTML or text format
18
18
  :param list[str] to_recipients:
19
- :rtype: Message
20
19
  """
21
20
  if to_recipients is not None:
22
21
  kwargs["toRecipients"] = ClientValueCollection(
@@ -1,7 +1,9 @@
1
1
  import os
2
2
  import uuid
3
3
  from datetime import datetime
4
- from typing import Optional
4
+ from typing import IO, AnyStr, Optional
5
+
6
+ from typing_extensions import Self
5
7
 
6
8
  from office365.directory.extensions.extended_property import (
7
9
  MultiValueLegacyExtendedProperty,
@@ -26,11 +28,8 @@ class Message(OutlookItem):
26
28
  """A message in a mailbox folder."""
27
29
 
28
30
  def add_extended_property(self, name, value):
29
- """
30
- Create a single-value extended property for a message
31
- :param str name: A property name
32
- :param str value:
33
- """
31
+ # type: (str, str) -> Self
32
+ """Create a single-value extended property for a message"""
34
33
  prop_id = str(uuid.uuid4())
35
34
  prop_type = "String"
36
35
  prop_value = [
@@ -63,25 +62,20 @@ class Message(OutlookItem):
63
62
  return self
64
63
 
65
64
  def download(self, file_object):
66
- """Download MIME content of a message into a file
67
-
68
- :type file_object: typing.IO
69
- """
65
+ # type: (IO) -> Self
66
+ """Download MIME content of a message into a file"""
70
67
 
71
68
  def _save_content(return_type):
72
- """
73
- :type return_type: ClientResult
74
- """
69
+ # type: (ClientResult[AnyStr]) -> None
75
70
  file_object.write(return_type.value)
76
71
 
77
72
  self.get_content().after_execute(_save_content)
78
73
  return self
79
74
 
80
75
  def get_content(self):
81
- """
82
- Get MIME content of a message
83
- """
84
- return_type = ClientResult[str](self.context)
76
+ # type: () -> ClientResult[AnyStr]
77
+ """Get MIME content of a message"""
78
+ return_type = ClientResult(self.context)
85
79
  qry = FunctionQuery(self, "$value", None, return_type)
86
80
  self.context.add_query(qry)
87
81
  return return_type
@@ -180,17 +174,30 @@ class Message(OutlookItem):
180
174
  self.context.add_query(qry)
181
175
  return self
182
176
 
183
- def move(self, destination_id):
177
+ def move(self, destination):
184
178
  """
185
179
  Move a message to another folder within the specified user's mailbox.
186
180
  This creates a new copy of the message in the destination folder and removes the original message.
187
181
 
188
- :param str destination_id: The destination folder ID, or a well-known folder name.
182
+ :param str or MailFolder destination: The destination folder ID, or a well-known folder name.
189
183
  For a list of supported well-known folder names, see mailFolder resource type.
190
184
  """
191
- payload = {"DestinationId": destination_id}
192
- qry = ServiceOperationQuery(self, "move", None, payload, None, None)
193
- self.context.add_query(qry)
185
+ from office365.outlook.mail.folders.folder import MailFolder
186
+
187
+ def _move(destination_id):
188
+ # type: (str) -> None
189
+ payload = {"DestinationId": destination_id}
190
+ qry = ServiceOperationQuery(self, "move", None, payload, None, None)
191
+ self.context.add_query(qry)
192
+
193
+ if isinstance(destination, MailFolder):
194
+
195
+ def _loaded():
196
+ _move(destination.id)
197
+
198
+ destination.ensure_property("id", _loaded)
199
+ else:
200
+ _move(destination)
194
201
  return self
195
202
 
196
203
  def forward(self, to_recipients, comment=""):
@@ -211,13 +218,12 @@ class Message(OutlookItem):
211
218
 
212
219
  @property
213
220
  def has_attachments(self):
221
+ # type: () -> Optional[bool]
214
222
  """
215
223
  Indicates whether the message has attachments. This property doesn't include inline attachments,
216
224
  so if a message contains only inline attachments, this property is false. To verify the existence
217
225
  of inline attachments, parse the body property to look for a src attribute,
218
226
  such as <IMG src="cid:image001.jpg@01D26CD8.6C05F070">.
219
-
220
- :rtype: bool or None
221
227
  """
222
228
  return self.properties.get("hasAttachments", None)
223
229
 
@@ -235,6 +241,7 @@ class Message(OutlookItem):
235
241
 
236
242
  @property
237
243
  def extensions(self):
244
+ # type: () -> EntityCollection[Extension]
238
245
  """The collection of open extensions defined for the message. Nullable."""
239
246
  return self.properties.get(
240
247
  "extensions",
@@ -245,44 +252,33 @@ class Message(OutlookItem):
245
252
 
246
253
  @property
247
254
  def body(self):
248
- """The body of the message. It can be in HTML or text format.
249
-
250
- :rtype: ItemBody
251
- """
255
+ """The body of the message. It can be in HTML or text format."""
252
256
  return self.properties.setdefault("body", ItemBody())
253
257
 
254
258
  @body.setter
255
259
  def body(self, value):
256
- """The body of the message. It can be in HTML or text format.
257
-
258
- :type value: str or ItemBody
259
- """
260
+ # type: (str|ItemBody) -> None
261
+ """Sets the body of the message. It can be in HTML or text format."""
260
262
  if not isinstance(value, ItemBody):
261
263
  value = ItemBody(value)
262
264
  self.set_property("body", value)
263
265
 
264
266
  @property
265
267
  def body_preview(self):
266
- """
267
- The first 255 characters of the message body. It is in text format.
268
- :rtype: str or None
269
- """
268
+ # type: () -> Optional[str]
269
+ """The first 255 characters of the message body. It is in text format."""
270
270
  return self.properties.get("bodyPreview", None)
271
271
 
272
272
  @property
273
273
  def conversation_id(self):
274
- """
275
- The ID of the conversation the email belongs to.
276
- :rtype: str or None
277
- """
274
+ # type: () -> Optional[str]
275
+ """The ID of the conversation the email belongs to."""
278
276
  return self.properties.get("conversationId", None)
279
277
 
280
278
  @property
281
279
  def conversation_index(self):
282
- """
283
- Indicates the position of the message within the conversation.
284
- :rtype: str or None
285
- """
280
+ # type: () -> Optional[str]
281
+ """Indicates the position of the message within the conversation."""
286
282
  return self.properties.get("conversationIndex", None)
287
283
 
288
284
  @property
@@ -303,23 +299,22 @@ class Message(OutlookItem):
303
299
 
304
300
  @property
305
301
  def importance(self):
306
- """
307
- The importance of the message.
308
- :rtype: str
309
- """
302
+ # type: () -> Optional[str]
303
+ """The importance of the message."""
310
304
  return self.properties.get("importance", None)
311
305
 
312
306
  @property
313
307
  def inference_classification(self):
308
+ # type: () -> Optional[str]
314
309
  """
315
310
  The classification of the message for the user, based on inferred relevance or importance,
316
311
  or on an explicit override. The possible values are: focused or other.
317
- :rtype: str
318
312
  """
319
313
  return self.properties.get("inferenceClassification", None)
320
314
 
321
315
  @property
322
316
  def internet_message_headers(self):
317
+ # type: () -> ClientValueCollection[InternetMessageHeader]
323
318
  """
324
319
  A collection of message headers defined by RFC5322. The set includes message headers indicating the network
325
320
  path taken by a message from the sender to the recipient. It can also contain custom message headers that
@@ -331,41 +326,37 @@ class Message(OutlookItem):
331
326
 
332
327
  @property
333
328
  def internet_message_id(self):
334
- """
335
- The message ID in the format specified by RFC2822
336
- :rtype: str
337
- """
329
+ # type: () -> Optional[str]
330
+ """The message ID in the format specified by RFC2822"""
338
331
  return self.properties.get("internetMessageId", None)
339
332
 
340
333
  @property
341
334
  def is_delivery_receipt_requested(self):
335
+ # type: () -> Optional[bool]
342
336
  """
343
337
  Indicates whether a read receipt is requested for the message.
344
- :rtype: bool
345
338
  """
346
339
  return self.properties.get("isDeliveryReceiptRequested", None)
347
340
 
348
341
  @property
349
342
  def is_draft(self):
343
+ # type: () -> Optional[bool]
350
344
  """
351
345
  Indicates whether the message is a draft. A message is a draft if it hasn't been sent yet.
352
- :rtype: bool
353
346
  """
354
347
  return self.properties.get("isDraft", None)
355
348
 
356
349
  @property
357
350
  def is_read(self):
358
- """
359
- Indicates whether the message has been read.
360
- :rtype: bool
361
- """
351
+ # type: () -> Optional[bool]
352
+ """Indicates whether the message has been read."""
362
353
  return self.properties.get("isRead", None)
363
354
 
364
355
  @property
365
356
  def is_read_receipt_requested(self):
357
+ # type: () -> Optional[bool]
366
358
  """
367
359
  Indicates whether a read receipt is requested for the message.
368
- :rtype: bool
369
360
  """
370
361
  return self.properties.get("isReadReceiptRequested", None)
371
362
 
@@ -389,10 +380,8 @@ class Message(OutlookItem):
389
380
 
390
381
  @subject.setter
391
382
  def subject(self, value):
392
- """
393
- The subject of the message.
394
- :type value: str
395
- """
383
+ # type: (str) -> None
384
+ """Sets the subject of the message."""
396
385
  self.set_property("subject", value)
397
386
 
398
387
  @property
@@ -429,13 +418,13 @@ class Message(OutlookItem):
429
418
 
430
419
  @property
431
420
  def parent_folder_id(self):
432
- """The unique identifier for the message's parent mailFolder.
433
- :rtype: str or None
434
- """
421
+ # type: () -> Optional[str]
422
+ """The unique identifier for the message's parent mailFolder."""
435
423
  return self.properties.get("parentFolderId", None)
436
424
 
437
425
  @property
438
426
  def web_link(self):
427
+ # type: () -> Optional[str]
439
428
  """
440
429
  The URL to open the message in Outlook on the web.
441
430
 
@@ -447,12 +436,12 @@ class Message(OutlookItem):
447
436
  You will be prompted to login if you are not already logged in with the browser.
448
437
 
449
438
  This URL cannot be accessed from within an iFrame.
450
- :rtype: str or None
451
439
  """
452
440
  return self.properties.get("webLink", None)
453
441
 
454
442
  @property
455
443
  def multi_value_extended_properties(self):
444
+ # type: () -> EntityCollection[MultiValueLegacyExtendedProperty]
456
445
  """The collection of multi-value extended properties defined for the event."""
457
446
  return self.properties.get(
458
447
  "multiValueExtendedProperties",
@@ -465,6 +454,7 @@ class Message(OutlookItem):
465
454
 
466
455
  @property
467
456
  def single_value_extended_properties(self):
457
+ # type: () -> EntityCollection[SingleValueLegacyExtendedProperty]
468
458
  """The collection of single-value extended properties defined for the message"""
469
459
  return self.properties.get(
470
460
  "singleValueExtendedProperties",
@@ -1,5 +1,10 @@
1
+ from typing import TYPE_CHECKING
2
+
1
3
  from office365.runtime.client_value import ClientValue
2
4
 
5
+ if TYPE_CHECKING:
6
+ from typing import Optional # noqa
7
+
3
8
 
4
9
  class PhysicalAddress(ClientValue):
5
10
  """The physical address of a contact."""
@@ -12,12 +17,13 @@ class PhysicalAddress(ClientValue):
12
17
  state=None,
13
18
  street=None,
14
19
  ):
20
+ # type: (Optional[str], Optional[str], Optional[str], Optional[str], Optional[str]) -> None
15
21
  """
16
- :param str city: The city.
17
- :param str country_or_region: The country or region. It's a free-format string value, for example, "United States".
18
- :param str postal_code: The postal code.
19
- :param str state:
20
- :param str street:
22
+ :param city: The city.
23
+ :param country_or_region: The country or region. It's a free-format string value, for example, "United States".
24
+ :param postal_code: The postal code.
25
+ :param state:
26
+ :param street:
21
27
  """
22
28
  super(PhysicalAddress, self).__init__()
23
29
  self.city = city
@@ -5,10 +5,12 @@ from office365.runtime.client_value import ClientValue
5
5
  class Recipient(ClientValue):
6
6
  """Represents information about a user in the sending or receiving end of an event, message or group post."""
7
7
 
8
- def __init__(self, email_address=EmailAddress()):
8
+ def __init__(self, email_address=None):
9
9
  """
10
10
  :param EmailAddress email_address: The recipient's email address.
11
11
  """
12
+ if email_address is None:
13
+ email_address = EmailAddress()
12
14
  super(Recipient, self).__init__()
13
15
  self.emailAddress = email_address
14
16
 
@@ -1,9 +1,16 @@
1
+ from typing import TYPE_CHECKING
2
+
1
3
  from office365.runtime.client_value import ClientValue
2
4
 
5
+ if TYPE_CHECKING:
6
+ import datetime # noqa
7
+
8
+ from typing import Optional # noqa
9
+
3
10
 
4
11
  class RecurrenceRange(ClientValue):
5
12
  """
6
- Describes a date range over which a recurring event. This shared object is used to define the recurrence
13
+ Describes a date range over which a recurring event. This shared hobject is used to define the recurrence
7
14
  of access reviews, calendar events, and access package assignments in Azure AD.
8
15
  """
9
16
 
@@ -15,17 +22,18 @@ class RecurrenceRange(ClientValue):
15
22
  recurrence_timezone=None,
16
23
  range_type=None,
17
24
  ):
25
+ # type: (Optional[datetime.date], Optional[datetime.date], Optional[int], Optional[str], Optional[str]) -> None
18
26
  """
19
- :param datetime.date start_date: The date to start applying the recurrence pattern. The first occurrence of
27
+ :param start_date: The date to start applying the recurrence pattern. The first occurrence of
20
28
  the meeting may be this date or later, depending on the recurrence pattern of the event. Must be the
21
29
  same value as the start property of the recurring event. Required.
22
- :param datetime.date end_date: The date to stop applying the recurrence pattern. Depending on the recurrence pattern of
30
+ :param end_date: The date to stop applying the recurrence pattern. Depending on the recurrence pattern of
23
31
  the event, the last occurrence of the meeting may not be this date. Required if type is endDate.
24
- :param int number_of_occurrences: The number of times to repeat the event. Required and must be positive
32
+ :param number_of_occurrences: The number of times to repeat the event. Required and must be positive
25
33
  if type is numbered.
26
- :param str recurrence_timezone: Time zone for the startDate and endDate properties. Optional. If not specified,
34
+ :param recurrence_timezone: Time zone for the startDate and endDate properties. Optional. If not specified,
27
35
  the time zone of the event is used.
28
- :param str range_type: The recurrence range. The possible values are: endDate, noEnd, numbered. Required.
36
+ :param range_type: The recurrence range. The possible values are: endDate, noEnd, numbered. Required.
29
37
  """
30
38
  self.endDate = end_date
31
39
  self.numberOfOccurrences = number_of_occurrences
office365/outlook/user.py CHANGED
@@ -41,6 +41,7 @@ class OutlookUser(Entity):
41
41
 
42
42
  @property
43
43
  def master_categories(self):
44
+ # type: () -> EntityCollection[OutlookCategory]
44
45
  """A list of categories defined for the user."""
45
46
  return self.properties.get(
46
47
  "masterCategories",
@@ -1,7 +1,7 @@
1
1
  from office365.entity import Entity
2
2
  from office365.entity_collection import EntityCollection
3
3
  from office365.planner.buckets.bucket import PlannerBucket
4
- from office365.planner.plans.plan import PlannerPlan
4
+ from office365.planner.plans.collection import PlannerPlanCollection
5
5
  from office365.planner.tasks.task import PlannerTask
6
6
  from office365.runtime.paths.resource_path import ResourcePath
7
7
 
@@ -14,9 +14,8 @@ class Planner(Entity):
14
14
 
15
15
  @property
16
16
  def buckets(self):
17
- """
18
- Read-only. Nullable. Returns the plannerBuckets assigned to the user.
19
- """
17
+ # type: () -> EntityCollection[PlannerBucket]
18
+ """Returns the plannerBuckets assigned to the user."""
20
19
  return self.properties.get(
21
20
  "buckets",
22
21
  EntityCollection(
@@ -26,9 +25,8 @@ class Planner(Entity):
26
25
 
27
26
  @property
28
27
  def tasks(self):
29
- """
30
- Read-only. Nullable. Returns the plannerTasks assigned to the user.
31
- """
28
+ # type: () -> EntityCollection[PlannerTask]
29
+ """Returns the plannerTasks assigned to the user."""
32
30
  return self.properties.get(
33
31
  "tasks",
34
32
  EntityCollection(
@@ -38,12 +36,11 @@ class Planner(Entity):
38
36
 
39
37
  @property
40
38
  def plans(self):
41
- """
42
- Read-only. Nullable. Returns the plannerTasks assigned to the user.
43
- """
39
+ # type: () -> PlannerPlanCollection
40
+ """Returns the plannerTasks assigned to the user."""
44
41
  return self.properties.get(
45
42
  "plans",
46
- EntityCollection(
47
- self.context, PlannerPlan, ResourcePath("plans", self.resource_path)
43
+ PlannerPlanCollection(
44
+ self.context, ResourcePath("plans", self.resource_path)
48
45
  ),
49
46
  )