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,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity_collection import EntityCollection
2
4
  from office365.onenote.entity_hierarchy_model import OnenoteEntityHierarchyModel
3
5
  from office365.onenote.notebooks.notebook import Notebook
@@ -10,22 +12,21 @@ class SectionGroup(OnenoteEntityHierarchyModel):
10
12
 
11
13
  @property
12
14
  def section_groups_url(self):
13
- """The URL for the sectionGroups navigation property, which returns all the section groups in the section group.
14
-
15
- :rtype: str or None
15
+ # type: () -> Optional[str]
16
+ """
17
+ The URL for the sectionGroups navigation property, which returns all the section groups in the section group.
16
18
  """
17
19
  return self.properties.get("sectionGroupsUrl", None)
18
20
 
19
21
  @property
20
22
  def sections_url(self):
21
- """The URL for the sections navigation property, which returns all the sections in the section group.
22
-
23
- :rtype: str or None
24
- """
23
+ # type: () -> Optional[str]
24
+ """The URL for the sections navigation property, which returns all the sections in the section group."""
25
25
  return self.properties.get("sectionsUrl", None)
26
26
 
27
27
  @property
28
28
  def parent_notebook(self):
29
+ # type: () -> Notebook
29
30
  """The notebook that contains the section group. Read-only."""
30
31
  return self.properties.get(
31
32
  "parentNotebook",
@@ -34,6 +35,7 @@ class SectionGroup(OnenoteEntityHierarchyModel):
34
35
 
35
36
  @property
36
37
  def sections(self):
38
+ # type: () -> EntityCollection[OnenoteSection]
37
39
  """The sections in the section group. Read-only. Nullable."""
38
40
  return self.properties.get(
39
41
  "sections",
@@ -46,6 +48,7 @@ class SectionGroup(OnenoteEntityHierarchyModel):
46
48
 
47
49
  @property
48
50
  def section_groups(self):
51
+ # type: () -> EntityCollection[SectionGroup]
49
52
  """Retrieve a list of onenoteSection objects from the specified notebook."""
50
53
  return self.properties.get(
51
54
  "sectionGroups",
@@ -59,7 +59,7 @@ class OnenoteSection(OnenoteEntityHierarchyModel):
59
59
  """
60
60
  The collection of pages in the section. Read-only. Nullable.
61
61
  """
62
- from office365.onenote.pages.page import OnenotePage
62
+ from office365.onenote.pages.page import OnenotePage # noqa
63
63
 
64
64
  return self.properties.get(
65
65
  "pages",
@@ -7,7 +7,8 @@ class AttendeeBase(Recipient):
7
7
  def __init__(self, email_address=None, attendee_type=None):
8
8
  """
9
9
 
10
- :param office365.mail.emailAddress.EmailAddress email_address: Includes the name and SMTP address of the attendees
10
+ :param office365.mail.emailAddress.EmailAddress email_address: Includes the name and SMTP address of the
11
+ attendees
11
12
  :param str attendee_type: The type of attendees. The possible values are: required, optional, resource.
12
13
  Currently if the attendees is a person, findMeetingTimes always considers the person is of the Required type.
13
14
  """
@@ -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,
@@ -25,6 +27,9 @@ class Calendar(Entity):
25
27
  of a Microsoft 365 group.
26
28
  """
27
29
 
30
+ def __repr__(self):
31
+ return self.name or self.id or self.entity_type_name
32
+
28
33
  def allowed_calendar_sharing_roles(self, user):
29
34
  """
30
35
  :param str user: User identifier or principal name
@@ -74,62 +79,62 @@ class Calendar(Entity):
74
79
 
75
80
  @property
76
81
  def can_edit(self):
82
+ # type: () -> Optional[bool]
77
83
  """
78
84
  true if the user can write to the calendar, false otherwise.
79
85
  This property is true for the user who created the calendar.
80
86
  This property is also true for a user who has been shared a calendar and granted write access.
81
- :rtype: bool or None
82
87
  """
83
88
  return self.properties.get("canEdit", None)
84
89
 
85
90
  @property
86
91
  def can_share(self):
92
+ # type: () -> Optional[bool]
87
93
  """
88
94
  true if the user has the permission to share the calendar, false otherwise.
89
95
  Only the user who created the calendar can share it.
90
- :rtype: bool or None
91
96
  """
92
97
  return self.properties.get("canShare", None)
93
98
 
94
99
  @property
95
100
  def can_view_private_items(self):
101
+ # type: () -> Optional[bool]
96
102
  """
97
103
  true if the user can read calendar items that have been marked private, false otherwise.
98
- :rtype: bool or None
99
104
  """
100
105
  return self.properties.get("canViewPrivateItems", None)
101
106
 
102
107
  @property
103
108
  def change_key(self):
109
+ # type: () -> Optional[str]
104
110
  """
105
111
  Identifies the version of the calendar object. Every time the calendar is changed, changeKey changes as well.
106
112
  This allows Exchange to apply changes to the correct version of the object.
107
- :rtype: str
108
113
  """
109
114
  return self.properties.get("changeKey", None)
110
115
 
111
116
  @property
112
117
  def color(self):
118
+ # type: () -> Optional[str]
113
119
  """
114
120
  Specifies the color theme to distinguish the calendar from other calendars in a UI.
115
121
  The property values are: auto, lightBlue, lightGreen, lightOrange, lightGray, lightYellow, lightTeal,
116
122
  lightPink, lightBrown, lightRed, maxColor.
117
- :rtype: str
118
123
  """
119
124
  return self.properties.get("color", None)
120
125
 
121
126
  @property
122
127
  def default_online_meeting_provider(self):
128
+ # type: () -> Optional[str]
123
129
  """
124
130
  The default online meeting provider for meetings sent from this calendar.
125
131
  Possible values are: unknown, skypeForBusiness, skypeForConsumer, teamsForBusiness.
126
- :rtype: str
127
132
  """
128
133
  return self.properties.get("defaultOnlineMeetingProvider", None)
129
134
 
130
135
  @property
131
136
  def name(self):
132
- # type: () -> str
137
+ # type: () -> Optional[str]
133
138
  """
134
139
  The calendar name
135
140
  """
@@ -137,26 +142,26 @@ class Calendar(Entity):
137
142
 
138
143
  @property
139
144
  def is_default_calendar(self):
145
+ # type: () -> Optional[bool]
140
146
  """
141
147
  true if this is the default calendar where new events are created by default, false otherwise.
142
- :rtype: bool or None
143
148
  """
144
149
  return self.properties.get("isDefaultCalendar", None)
145
150
 
146
151
  @property
147
152
  def is_removable(self):
153
+ # type: () -> Optional[bool]
148
154
  """
149
155
  Indicates whether this user calendar can be deleted from the user mailbox.
150
- :rtype: bool or None
151
156
  """
152
157
  return self.properties.get("isRemovable", None)
153
158
 
154
159
  @property
155
160
  def is_tallying_responses(self):
161
+ # type: () -> Optional[bool]
156
162
  """
157
163
  Indicates whether this user calendar supports tracking of meeting responses.
158
164
  Only meeting invites sent from users' primary calendars support tracking of meeting responses.
159
- :rtype: bool or None
160
165
  """
161
166
  return self.properties.get("isTallyingResponses", None)
162
167
 
@@ -179,6 +184,7 @@ class Calendar(Entity):
179
184
 
180
185
  @property
181
186
  def calendar_view(self):
187
+ # type: () -> EventCollection
182
188
  """The calendar view for the calendar. Navigation property. Read-only."""
183
189
  return self.properties.get(
184
190
  "calendarView",
@@ -199,6 +205,7 @@ class Calendar(Entity):
199
205
 
200
206
  @property
201
207
  def multi_value_extended_properties(self):
208
+ # type: () -> EntityCollection[MultiValueLegacyExtendedProperty]
202
209
  """The collection of multi-value extended properties defined for the Calendar."""
203
210
  return self.properties.get(
204
211
  "multiValueExtendedProperties",
@@ -211,6 +218,7 @@ class Calendar(Entity):
211
218
 
212
219
  @property
213
220
  def single_value_extended_properties(self):
221
+ # type: () -> EntityCollection[SingleValueLegacyExtendedProperty]
214
222
  """The collection of single-value extended properties defined for the calendar. Read-only. Nullable."""
215
223
  return self.properties.get(
216
224
  "singleValueExtendedProperties",
@@ -1,8 +1,6 @@
1
1
  import datetime
2
2
  from typing import List
3
3
 
4
- from typing_extensions import Self
5
-
6
4
  from office365.delta_collection import DeltaCollection
7
5
  from office365.outlook.calendar.attendees.attendee import Attendee
8
6
  from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
  from office365.entity_collection import EntityCollection
3
5
  from office365.outlook.calendar.calendar import Calendar
@@ -11,22 +13,19 @@ class CalendarGroup(Entity):
11
13
 
12
14
  @property
13
15
  def name(self):
14
- """
15
- The group name.
16
- :rtype: str
17
- """
16
+ # type: () -> Optional[str]
17
+ """The group name"""
18
18
  return self.properties.get("name", None)
19
19
 
20
20
  @property
21
21
  def class_id(self):
22
- """
23
- The class identifier
24
- :rtype: str
25
- """
22
+ # type: () -> Optional[str]
23
+ """The class identifier"""
26
24
  return self.properties.get("classId", None)
27
25
 
28
26
  @property
29
27
  def calendars(self):
28
+ # type: () -> EntityCollection[Calendar]
30
29
  """The calendars in the calendar group. Navigation property. Read-only. Nullable."""
31
30
  return self.properties.get(
32
31
  "calendars",
@@ -18,13 +18,14 @@ class MeetingTimeSuggestion(ClientValue):
18
18
  locations=None,
19
19
  meeting_timeslot=TimeSlot(),
20
20
  ):
21
+ # type: (list[AttendeeAvailability], float, list[Location], TimeSlot) -> None
21
22
  """
22
- :param list[AttendeeAvailability] attendee_availability: An array that shows the availability status of each
23
+ :param attendee_availability: An array that shows the availability status of each
23
24
  attendees for this meeting suggestion.
24
- :param float confidence: A percentage that represents the likelhood of all the attendees attending.
25
- :param list[Location] locations: An array that specifies the name and geographic location of each meeting location
25
+ :param confidence: A percentage that represents the likelhood of all the attendees attending.
26
+ :param locations: An array that specifies the name and geographic location of each meeting location
26
27
  for this meeting suggestion.
27
- :param TimeSlot meeting_timeslot: A time period suggested for the meeting.
28
+ :param meeting_timeslot: A time period suggested for the meeting.
28
29
  """
29
30
  self.attendeeAvailability = ClientValueCollection(
30
31
  AttendeeAvailability, attendee_availability
@@ -32,3 +33,6 @@ class MeetingTimeSuggestion(ClientValue):
32
33
  self.confidence = confidence
33
34
  self.locations = ClientValueCollection(Location, locations)
34
35
  self.meetingTimeSlot = meeting_timeslot
36
+
37
+ def __repr__(self):
38
+ return repr(self.meetingTimeSlot)
@@ -14,3 +14,6 @@ class TimeSlot(ClientValue):
14
14
  super(TimeSlot, self).__init__()
15
15
  self.start = start
16
16
  self.end = end
17
+
18
+ def __repr__(self):
19
+ return "({0} - {1})".format(self.start, self.end)
@@ -3,7 +3,7 @@ from office365.outlook.calendar.email_address import EmailAddress
3
3
  from office365.outlook.calendar.permissions.permission import CalendarPermission
4
4
 
5
5
 
6
- class CalendarPermissionCollection(EntityCollection):
6
+ class CalendarPermissionCollection(EntityCollection[CalendarPermission]):
7
7
  def __init__(self, context, resource_path=None):
8
8
  super(CalendarPermissionCollection, self).__init__(
9
9
  context, CalendarPermission, resource_path
File without changes
@@ -0,0 +1,27 @@
1
+ from typing import Optional
2
+
3
+ from office365.entity_collection import EntityCollection
4
+ from office365.outlook.calendar.place import Place
5
+ from office365.outlook.calendar.rooms.room import Room
6
+ from office365.runtime.paths.resource_path import ResourcePath
7
+
8
+
9
+ class RoomList(Place):
10
+ """Represents a group of room objects defined in the tenant."""
11
+
12
+ @property
13
+ def email_address(self):
14
+ # type: () -> Optional[str]
15
+ """The email address of the room list"""
16
+ return self.properties.get("emailAddress", None)
17
+
18
+ @property
19
+ def calendars(self):
20
+ # type: () -> EntityCollection[Room]
21
+ """The calendars in the calendar group. Navigation property. Read-only. Nullable."""
22
+ return self.properties.get(
23
+ "rooms",
24
+ EntityCollection(
25
+ self.context, Room, ResourcePath("rooms", self.resource_path)
26
+ ),
27
+ )
@@ -0,0 +1,8 @@
1
+ from office365.outlook.calendar.place import Place
2
+
3
+
4
+ class Room(Place):
5
+ """
6
+ Represents a room in a tenant.
7
+ In Exchange Online, each room is associated with a room mailbox. Derived from place.
8
+ """
@@ -17,7 +17,6 @@ class ScheduleInformation(ClientValue):
17
17
  working_hours=WorkingHours(),
18
18
  ):
19
19
  """
20
-
21
20
  :param WorkingHours working_hours: The days of the week and hours in a specific time zone that the user works.
22
21
  These are set as part of the user's mailboxSettings.
23
22
  :param str error: Error information from attempting to get the availability of the user, distribution list,
@@ -18,7 +18,6 @@ class ContactCollection(DeltaCollection[Contact]):
18
18
  :param str surname: The contact's surname.
19
19
  :param str email_address: Default email address
20
20
  :param str business_phone: Default contact's business phone number.
21
- :rtype: Contact
22
21
  """
23
22
 
24
23
  def _create_email_address(address):
@@ -33,10 +32,3 @@ class ContactCollection(DeltaCollection[Contact]):
33
32
  if business_phone:
34
33
  kwargs["businessPhones"] = StringCollection([business_phone])
35
34
  return super(ContactCollection, self).add(**kwargs)
36
-
37
- def __getitem__(self, key):
38
- """
39
- :param int or str key: Contact identifier or index
40
- :rtype: Contact
41
- """
42
- return super(ContactCollection, 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,
@@ -23,45 +25,39 @@ class Contact(OutlookItem):
23
25
 
24
26
  @property
25
27
  def display_name(self):
28
+ # type: () -> Optional[str]
26
29
  """
27
30
  The contact's display name. You can specify the display name in a create or update operation.
28
31
  Note that later updates to other properties may cause an automatically generated value to overwrite the
29
32
  displayName value you have specified. To preserve a pre-existing value, always include it as displayName
30
33
  in an update operation.
31
- :rtype: str or None
32
34
  """
33
35
  return self.properties.get("displayName", None)
34
36
 
35
37
  @property
36
38
  def manager(self):
39
+ # type: () -> Optional[str]
37
40
  """
38
41
  The name of the contact's manager.
39
- :rtype: str or None
40
42
  """
41
43
  return self.properties.get("manager", None)
42
44
 
43
45
  @manager.setter
44
46
  def manager(self, value):
45
- """
46
- Sets name of the contact's manager.
47
- :type value: str
48
- """
47
+ # type: (str) -> None
48
+ """Sets name of the contact's manager."""
49
49
  self.set_property("manager", value)
50
50
 
51
51
  @property
52
52
  def mobile_phone(self):
53
- """
54
- The contact's mobile phone number.
55
- :rtype: str or None
56
- """
53
+ # type: () -> Optional[str]
54
+ """The contact's mobile phone number."""
57
55
  return self.properties.get("mobilePhone", None)
58
56
 
59
57
  @mobile_phone.setter
60
58
  def mobile_phone(self, value):
61
- """
62
- Sets contact's mobile phone number.
63
- :type value: str
64
- """
59
+ # type: (str) -> None
60
+ """Sets contact's mobile phone number."""
65
61
  self.set_property("mobilePhone", value)
66
62
 
67
63
  @property
@@ -71,6 +67,7 @@ class Contact(OutlookItem):
71
67
 
72
68
  @property
73
69
  def email_addresses(self):
70
+ # type: () -> ClientValueCollection[EmailAddress]
74
71
  """The contact's email addresses."""
75
72
  return self.properties.setdefault(
76
73
  "emailAddresses", ClientValueCollection(EmailAddress)
@@ -78,6 +75,7 @@ class Contact(OutlookItem):
78
75
 
79
76
  @property
80
77
  def extensions(self):
78
+ # type: () -> EntityCollection[Extension]
81
79
  """The collection of open extensions defined for the contact. Nullable."""
82
80
  return self.properties.get(
83
81
  "extensions",
@@ -96,6 +94,7 @@ class Contact(OutlookItem):
96
94
 
97
95
  @property
98
96
  def multi_value_extended_properties(self):
97
+ # type: () -> EntityCollection[MultiValueLegacyExtendedProperty]
99
98
  """The collection of multi-value extended properties defined for the Contact."""
100
99
  return self.properties.get(
101
100
  "multiValueExtendedProperties",
@@ -108,6 +107,7 @@ class Contact(OutlookItem):
108
107
 
109
108
  @property
110
109
  def single_value_extended_properties(self):
110
+ # type: () -> EntityCollection[SingleValueLegacyExtendedProperty]
111
111
  """The collection of single-value extended properties defined for the Contact."""
112
112
  return self.properties.get(
113
113
  "singleValueExtendedProperties",
@@ -24,6 +24,7 @@ class ContactFolder(Entity):
24
24
 
25
25
  @property
26
26
  def child_folders(self):
27
+ # type: () -> EntityCollection["ContactFolder"]
27
28
  """The collection of child folders in the folder. Navigation property. Read-only. Nullable."""
28
29
  return self.properties.get(
29
30
  "childFolders",
@@ -36,6 +37,7 @@ class ContactFolder(Entity):
36
37
 
37
38
  @property
38
39
  def multi_value_extended_properties(self):
40
+ # type: () -> EntityCollection[MultiValueLegacyExtendedProperty]
39
41
  """The collection of multi-value extended properties defined for the Contact folder."""
40
42
  return self.properties.get(
41
43
  "multiValueExtendedProperties",
@@ -48,6 +50,7 @@ class ContactFolder(Entity):
48
50
 
49
51
  @property
50
52
  def single_value_extended_properties(self):
53
+ # type: () -> EntityCollection[SingleValueLegacyExtendedProperty]
51
54
  """The collection of single-value extended properties defined for the Contact folder."""
52
55
  return self.properties.get(
53
56
  "singleValueExtendedProperties",
@@ -1,3 +1,8 @@
1
+ import datetime
2
+ from typing import IO, AnyStr, Optional
3
+
4
+ from typing_extensions import Self
5
+
1
6
  from office365.entity import Entity
2
7
  from office365.runtime.client_result import ClientResult
3
8
  from office365.runtime.queries.function import FunctionQuery
@@ -6,22 +11,23 @@ from office365.runtime.queries.function import FunctionQuery
6
11
  class Attachment(Entity):
7
12
  """A file or item (contact, event or message) attached to an event or message."""
8
13
 
9
- def download(self, file_object):
10
- """Downloads raw contents of a file or item attachment
14
+ def __repr__(self):
15
+ return self.name or self.id
11
16
 
12
- :type file_object: typing.IO
13
- """
17
+ def download(self, file_object):
18
+ # type: (IO) -> Self
19
+ """Downloads raw contents of a file or item attachment"""
14
20
 
15
21
  def _save_content(return_type):
22
+ # type: (ClientResult[AnyStr]) -> None
16
23
  file_object.write(return_type.value)
17
24
 
18
25
  self.get_content().after_execute(_save_content)
19
26
  return self
20
27
 
21
28
  def get_content(self):
22
- """
23
- Gets the raw contents of a file or item attachment
24
- """
29
+ # type: () -> ClientResult[AnyStr]
30
+ """Gets the raw contents of a file or item attachment"""
25
31
  return_type = ClientResult(self.context)
26
32
  qry = FunctionQuery(self, "$value", None, return_type)
27
33
  self.context.add_query(qry)
@@ -29,47 +35,41 @@ class Attachment(Entity):
29
35
 
30
36
  @property
31
37
  def name(self):
32
- """
33
- The attachment's file name.
34
- :rtype: str or None
35
- """
38
+ # type: () -> Optional[str]
39
+ """The attachment's file name."""
36
40
  return self.properties.get("name", None)
37
41
 
38
42
  @name.setter
39
43
  def name(self, value):
40
- """
41
- Sets the attachment's file name.
42
- :type: value: str
43
- """
44
+ # type: (str) -> None
45
+ """Sets the attachment's file name."""
44
46
  self.set_property("name", value)
45
47
 
46
48
  @property
47
49
  def content_type(self):
48
- """
49
- :rtype: str or None
50
- """
50
+ # type: () -> Optional[str]
51
51
  return self.properties.get("contentType", None)
52
52
 
53
53
  @content_type.setter
54
54
  def content_type(self, value):
55
- """
56
- :type: value: str
57
- """
55
+ # type: (str) -> None
58
56
  self.set_property("contentType", value)
59
57
 
60
58
  @property
61
59
  def size(self):
62
- """
63
-
64
- :rtype: int or None
65
- """
60
+ # type: () -> Optional[int]
66
61
  return self.properties.get("size", None)
67
62
 
68
63
  @property
69
- def last_modified_date_time(self):
70
- """
71
- The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time.
64
+ def last_modified_datetime(self):
65
+ # type: () -> Optional[datetime.datetime]
66
+ """The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time."""
67
+ return self.properties.get("lastModifiedDateTime", datetime.datetime.min)
72
68
 
73
- :rtype: int or None
74
- """
75
- return self.properties.get("lastModifiedDateTime", None)
69
+ def get_property(self, name, default_value=None):
70
+ if default_value is None:
71
+ property_mapping = {
72
+ "lastModifiedDateTime": self.last_modified_datetime,
73
+ }
74
+ default_value = property_mapping.get(name, None)
75
+ return super(Attachment, self).get_property(name, default_value)
@@ -1,10 +1,11 @@
1
1
  import base64
2
2
 
3
+ import requests
4
+
3
5
  from office365.entity_collection import EntityCollection
4
- from office365.outlook.internal.queries.attachment_upload import (
5
- create_attachment_upload_query,
6
- )
7
6
  from office365.outlook.mail.attachments.attachment import Attachment
7
+ from office365.runtime.compat import parse_query_string
8
+ from office365.runtime.odata.v4.upload_session_request import UploadSessionRequest
8
9
  from office365.runtime.queries.upload_session import UploadSessionQuery
9
10
 
10
11
 
@@ -49,14 +50,41 @@ class AttachmentCollection(EntityCollection[Attachment]):
49
50
  :param int chunk_size: File chunk size
50
51
  :param (int)->None chunk_uploaded: Upload action
51
52
  """
53
+ from office365.outlook.mail.attachments.attachment_item import AttachmentItem
52
54
  from office365.outlook.mail.attachments.file import FileAttachment
53
55
 
54
56
  return_type = FileAttachment(self.context)
55
57
  self.add_child(return_type)
56
- qry = create_attachment_upload_query(
57
- self, return_type, source_path, chunk_size, chunk_uploaded
58
+
59
+ qry = UploadSessionQuery(
60
+ self, {"AttachmentItem": AttachmentItem.create_file(source_path)}
61
+ )
62
+
63
+ def _start_upload():
64
+ with open(source_path, "rb") as local_file:
65
+ session_request = UploadSessionRequest(
66
+ local_file, chunk_size, chunk_uploaded
67
+ )
68
+
69
+ def _construct_request(request):
70
+ auth_token = parse_query_string(request.url, "authtoken")
71
+ request.set_header("Authorization", "Bearer {0}".format(auth_token))
72
+
73
+ def _process_response(response):
74
+ # type: (requests.Response) -> None
75
+ location = response.headers.get("Location", None)
76
+ if location is None:
77
+ return
78
+ attachment_id = location[location.find("Attachments(") + 13 : -2]
79
+ return_type.set_property("id", attachment_id)
80
+
81
+ session_request.beforeExecute += _construct_request
82
+ session_request.afterExecute += _process_response
83
+ session_request.execute_query(qry)
84
+
85
+ self.context.add_query(qry).after_query_execute(
86
+ _start_upload, execute_first=True
58
87
  )
59
- self.context.add_query(qry)
60
88
  return self
61
89
 
62
90
  def create_upload_session(self, attachment_item):