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
office365/base_item.py CHANGED
@@ -25,9 +25,7 @@ class BaseItem(Entity):
25
25
 
26
26
  @property
27
27
  def created_by_user(self):
28
- """
29
- Identity of the user who created the item
30
- """
28
+ """Identity of the user who created the item"""
31
29
  from office365.directory.users.user import User
32
30
 
33
31
  return self.properties.get(
@@ -37,14 +35,13 @@ class BaseItem(Entity):
37
35
 
38
36
  @property
39
37
  def last_modified_by(self):
38
+ # type: () -> IdentitySet
40
39
  """Identity of the user, device, and application which last modified the item."""
41
40
  return self.properties.get("lastModifiedBy", IdentitySet())
42
41
 
43
42
  @property
44
43
  def last_modified_by_user(self):
45
- """
46
- Identity of the user who last modified the item.
47
- """
44
+ """Identity of the user who last modified the item."""
48
45
  from office365.directory.users.user import User
49
46
 
50
47
  return self.properties.get(
@@ -54,11 +51,13 @@ class BaseItem(Entity):
54
51
 
55
52
  @property
56
53
  def created_datetime(self):
54
+ # type: () -> Optional[datetime]
57
55
  """Gets date and time of item creation."""
58
56
  return self.properties.get("createdDateTime", datetime.min)
59
57
 
60
58
  @property
61
59
  def last_modified_datetime(self):
60
+ # type: () -> Optional[datetime]
62
61
  """Gets date and time the item was last modified."""
63
62
  return self.properties.get("lastModifiedDateTime", datetime.min)
64
63
 
@@ -70,39 +69,32 @@ class BaseItem(Entity):
70
69
 
71
70
  @name.setter
72
71
  def name(self, value):
73
- """
74
- Sets the name of the item.
75
- """
72
+ # type: (str) -> None
73
+ """Sets the name of the item."""
76
74
  self.set_property("name", value)
77
75
 
78
76
  @property
79
77
  def description(self):
80
78
  # type: () -> Optional[str]
81
- """
82
- Provides a user-visible description of the item.
83
- """
79
+ """Provides a user-visible description of the item."""
84
80
  return self.properties.get("description", None)
85
81
 
86
82
  @description.setter
87
83
  def description(self, value):
84
+ # type: (str) -> None
88
85
  self.set_property("description", value)
89
86
 
90
87
  @property
91
88
  def web_url(self):
92
89
  # type: () -> Optional[str]
93
- """
94
- URL that displays the resource in the browser
95
- """
90
+ """URL that displays the resource in the browser"""
96
91
  return self.properties.get("webUrl", None)
97
92
 
98
93
  @property
99
94
  def parent_reference(self):
95
+ # type: () -> ItemReference
100
96
  """Parent information, if the item has a parent."""
101
- return self.properties.get("parentReference", ItemReference())
102
-
103
- @parent_reference.setter
104
- def parent_reference(self, value):
105
- self.set_property("parentReference", value, False)
97
+ return self.properties.setdefault("parentReference", ItemReference())
106
98
 
107
99
  def get_property(self, name, default_value=None):
108
100
  if default_value is None:
@@ -4,7 +4,7 @@ from office365.runtime.queries.create_entity import CreateEntityQuery
4
4
  from office365.runtime.queries.service_operation import ServiceOperationQuery
5
5
 
6
6
 
7
- class OnlineMeetingCollection(EntityCollection):
7
+ class OnlineMeetingCollection(EntityCollection[OnlineMeeting]):
8
8
  def __init__(self, context, resource_path=None):
9
9
  super(OnlineMeetingCollection, self).__init__(
10
10
  context, OnlineMeeting, resource_path
@@ -1,4 +1,5 @@
1
1
  from datetime import datetime
2
+ from typing import AnyStr, Optional
2
3
 
3
4
  from office365.communications.onlinemeetings.participants import MeetingParticipants
4
5
  from office365.entity import Entity
@@ -14,49 +15,37 @@ class OnlineMeeting(Entity):
14
15
 
15
16
  @property
16
17
  def allow_attendee_to_enable_camera(self):
17
- """
18
- Indicates whether attendees can turn on their camera.
19
- :rtype: str
20
- """
18
+ # type: () -> Optional[bool]
19
+ """Indicates whether attendees can turn on their camera."""
21
20
  return self.properties.get("allowAttendeeToEnableCamera", None)
22
21
 
23
22
  @property
24
23
  def allow_attendee_to_enable_mic(self):
25
- """
26
- Indicates whether attendees can turn on their microphone.
27
- :rtype: str
28
- """
24
+ # type: () -> Optional[bool]
25
+ """Indicates whether attendees can turn on their microphone."""
29
26
  return self.properties.get("allowAttendeeToEnableMic", None)
30
27
 
31
28
  @property
32
29
  def allowed_presenters(self):
33
- """
34
- Specifies who can be a presenter in a meeting. Possible values are listed in the following table.
35
- """
30
+ """Specifies who can be a presenter in a meeting. Possible values are listed in the following table."""
36
31
  return self.properties.get("allowedPresenters", StringCollection())
37
32
 
38
33
  @property
39
34
  def allow_meeting_chat(self):
40
- """
41
- Specifies the mode of meeting chat.
42
- :rtype: str or None
43
- """
35
+ # type: () -> Optional[bool]
36
+ """Specifies the mode of meeting chat."""
44
37
  return self.properties.get("allowMeetingChat", None)
45
38
 
46
39
  @property
47
40
  def allow_participants_to_change_name(self):
48
- """
49
- Specifies if participants are allowed to rename themselves in an instance of the meeting.
50
- :rtype: bool or None
51
- """
41
+ # type: () -> Optional[bool]
42
+ """Specifies if participants are allowed to rename themselves in an instance of the meeting."""
52
43
  return self.properties.get("allowParticipantsToChangeName", None)
53
44
 
54
45
  @property
55
46
  def attendee_report(self):
56
- """
57
- The content stream of the attendee report of a Microsoft Teams live event.
58
- :rtype: bytes or None
59
- """
47
+ # type: () -> Optional[AnyStr]
48
+ """The content stream of the attendee report of a Microsoft Teams live event."""
60
49
  return self.properties.get("attendeeReport", None)
61
50
 
62
51
  @property
@@ -68,17 +57,13 @@ class OnlineMeeting(Entity):
68
57
 
69
58
  @property
70
59
  def subject(self):
71
- """
72
- The subject of the online meeting.
73
- :rtype: str or None
74
- """
60
+ # type: () -> Optional[str]
61
+ """The subject of the online meeting."""
75
62
  return self.properties.get("subject", None)
76
63
 
77
64
  @subject.setter
78
65
  def subject(self, value):
79
- """
80
- :type value: str
81
- """
66
+ # type: (str) -> None
82
67
  self.set_property("subject", value)
83
68
 
84
69
  @property
@@ -88,9 +73,9 @@ class OnlineMeeting(Entity):
88
73
 
89
74
  @start_datetime.setter
90
75
  def start_datetime(self, value):
76
+ # type: (datetime) -> None
91
77
  """
92
78
  Sets the meeting start time in UTC.
93
- :type value: datetime.datetime
94
79
  """
95
80
  self.set_property("startDateTime", value.isoformat())
96
81
 
@@ -101,10 +86,8 @@ class OnlineMeeting(Entity):
101
86
 
102
87
  @end_datetime.setter
103
88
  def end_datetime(self, value):
104
- """
105
- Sets the meeting end time in UTC.
106
- :type value: datetime.datetime
107
- """
89
+ # type: (datetime) -> None
90
+ """Sets the meeting end time in UTC."""
108
91
  self.set_property("endDateTime", value.isoformat())
109
92
 
110
93
  @property
@@ -114,11 +97,13 @@ class OnlineMeeting(Entity):
114
97
 
115
98
  @property
116
99
  def join_web_url(self):
100
+ # type: () -> Optional[str]
117
101
  """The join URL of the online meeting. Read-only."""
118
102
  return self.properties.get("joinWebUrl", None)
119
103
 
120
104
  @property
121
105
  def video_teleconference_id(self):
106
+ # type: () -> Optional[str]
122
107
  """The video teleconferencing ID."""
123
108
  return self.properties.get("videoTeleconferenceId", None)
124
109
 
@@ -1,5 +1,8 @@
1
+ from typing import Optional
2
+
1
3
  from office365.communications.presences.status_message import PresenceStatusMessage
2
4
  from office365.entity import Entity
5
+ from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
3
6
  from office365.outlook.mail.item_body import ItemBody
4
7
  from office365.runtime.queries.service_operation import ServiceOperationQuery
5
8
 
@@ -50,12 +53,22 @@ class Presence(Entity):
50
53
  self.context.add_query(qry)
51
54
  return self
52
55
 
53
- def set_status_message(self, message):
56
+ def set_status_message(self, message, expiry=None):
54
57
  """
55
58
  Set a presence status message for a user. An optional expiration date and time can be supplied.
56
- :param str message: Status message item.
59
+ :param str or ItemBody message: Status message item.
60
+ :param datetime.datetime expiry: Time in which the status message expires. If not provided, the status message
61
+ doesn't expire.
57
62
  """
58
- payload = {"statusMessage": PresenceStatusMessage(message=ItemBody(message))}
63
+ if not isinstance(message, ItemBody):
64
+ message = ItemBody(message)
65
+ if expiry:
66
+ expiry = DateTimeTimeZone.parse(expiry)
67
+ payload = {
68
+ "statusMessage": PresenceStatusMessage(
69
+ message=message, expiry_datetime=expiry
70
+ )
71
+ }
59
72
  qry = ServiceOperationQuery(self, "setStatusMessage", None, payload)
60
73
  self.context.add_query(qry)
61
74
  return self
@@ -88,22 +101,20 @@ class Presence(Entity):
88
101
 
89
102
  @property
90
103
  def activity(self):
104
+ # type: () -> Optional[str]
91
105
  """
92
106
  The supplemental information to a user's availability.
93
107
  Possible values are Available, Away, BeRightBack, Busy, DoNotDisturb, InACall, InAConferenceCall, Inactive,
94
108
  InAMeeting, Offline, OffWork, OutOfOffice, PresenceUnknown, Presenting, UrgentInterruptionsOnly.
95
-
96
- :rtype: str or None
97
109
  """
98
110
  return self.properties.get("activity", None)
99
111
 
100
112
  @property
101
113
  def availability(self):
114
+ # type: () -> Optional[str]
102
115
  """
103
116
  The base presence information for a user.
104
117
  Possible values are Available, AvailableIdle, Away, BeRightBack, Busy, BusyIdle, DoNotDisturb, Offline,
105
118
  PresenceUnknown
106
-
107
- :rtype: str or None
108
119
  """
109
120
  return self.properties.get("availability", None)
@@ -1,12 +1,21 @@
1
- from typing import TypeVar
1
+ from typing import TYPE_CHECKING, Optional, Type, TypeVar
2
2
 
3
3
  from office365.delta_path import DeltaPath
4
+ from office365.entity import Entity
4
5
  from office365.entity_collection import EntityCollection
6
+ from office365.runtime.paths.resource_path import ResourcePath
5
7
 
6
8
  T = TypeVar("T")
7
9
 
10
+ if TYPE_CHECKING:
11
+ from office365.graph_client import GraphClient
12
+
8
13
 
9
14
  class DeltaCollection(EntityCollection[T]):
15
+ def __init__(self, context, item_type, resource_path=None, parent=None):
16
+ # type: (GraphClient, Type[T], Optional[ResourcePath], Optional[Entity]) -> None
17
+ super(DeltaCollection, self).__init__(context, item_type, resource_path, parent)
18
+
10
19
  def change_type(self, type_name):
11
20
  """
12
21
  Specifies a custom query option to filter the delta response based on the type of change.
office365/delta_path.py CHANGED
@@ -1,4 +1,4 @@
1
- from office365.runtime.paths.entity import EntityPath
1
+ from office365.runtime.paths.v4.entity import EntityPath
2
2
 
3
3
 
4
4
  class DeltaPath(EntityPath):
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.extensions.extension import Extension
2
4
  from office365.directory.object import DirectoryObject
3
5
  from office365.entity_collection import EntityCollection
@@ -14,10 +16,8 @@ class AdministrativeUnit(DirectoryObject):
14
16
 
15
17
  @property
16
18
  def display_name(self):
17
- """
18
- Display name for the administrative unit
19
- :rtype: str or None
20
- """
19
+ # type: () -> Optional[str]
20
+ """Display name for the administrative unit"""
21
21
  return self.properties.get("displayName", None)
22
22
 
23
23
  @property
@@ -36,9 +36,8 @@ class AdministrativeUnit(DirectoryObject):
36
36
 
37
37
  @property
38
38
  def extensions(self):
39
- """
40
- The collection of open extensions defined for this administrative unit.
41
- """
39
+ # type: () -> EntityCollection[Extension]
40
+ """The collection of open extensions defined for this administrative unit."""
42
41
  return self.properties.get(
43
42
  "extensions",
44
43
  EntityCollection(
@@ -30,6 +30,17 @@ class Application(DirectoryObject):
30
30
  an Application in Azure AD
31
31
  """
32
32
 
33
+ def __repr__(self):
34
+ return self.id or self.app_id or self.entity_type_name
35
+
36
+ def __str__(self):
37
+ if self.display_name:
38
+ return "Name: {0}".format(self.display_name)
39
+ elif self.app_id:
40
+ return "App Id: {0}".format(self.app_id)
41
+ else:
42
+ return self.entity_type_name
43
+
33
44
  def add_certificate(
34
45
  self, cert_data, display_name, start_datetime=None, end_datetime=None
35
46
  ):
@@ -62,7 +73,7 @@ class Application(DirectoryObject):
62
73
  Remove a certificate from an application.
63
74
  :param str thumbprint: The unique identifier for the password.
64
75
  """
65
- raise NotImplementedError("")
76
+ raise NotImplementedError("remove_certificate")
66
77
 
67
78
  def add_password(self, display_name):
68
79
  """Adds a strong password to an application.
@@ -166,20 +177,19 @@ class Application(DirectoryObject):
166
177
 
167
178
  @property
168
179
  def app_id(self):
169
- """The unique identifier for the application that is assigned to an application by Azure AD. Not nullable.
170
- :rtype: str
171
- """
180
+ # type: () -> Optional[str]
181
+ """The unique identifier for the application that is assigned to an application by Azure AD. Not nullable."""
172
182
  return self.properties.get("appId", None)
173
183
 
174
184
  @property
175
185
  def application_template_id(self):
176
- """Unique identifier of the applicationTemplate
177
- :rtype: str
178
- """
186
+ # type: () -> Optional[str]
187
+ """Unique identifier of the applicationTemplate"""
179
188
  return self.properties.get("applicationTemplateId", None)
180
189
 
181
190
  @property
182
191
  def app_roles(self):
192
+ # type: () -> ClientValueCollection[AppRole]
183
193
  """
184
194
  The collection of roles defined for the application. With app role assignments, these roles can be assigned to
185
195
  users, groups, or service principals associated with other applications
@@ -193,23 +203,18 @@ class Application(DirectoryObject):
193
203
 
194
204
  @property
195
205
  def certification(self):
196
- """
197
- Specifies the certification status of the application.
198
- """
206
+ """Specifies the certification status of the application."""
199
207
  return self.properties.get("certification", Certification())
200
208
 
201
209
  @property
202
210
  def created_datetime(self):
203
- """
204
- The date and time the application was registered.
205
- """
211
+ """The date and time the application was registered."""
206
212
  return self.properties.get("createdDateTime", datetime.datetime.min)
207
213
 
208
214
  @property
209
215
  def default_redirect_uri(self):
210
- """
211
- :rtype: str
212
- """
216
+ # type: () -> Optional[str]
217
+ """ """
213
218
  return self.properties.get("defaultRedirectUri", None)
214
219
 
215
220
  @property
@@ -254,12 +259,11 @@ class Application(DirectoryObject):
254
259
 
255
260
  @property
256
261
  def signin_audience(self):
262
+ # type: () -> Optional[str]
257
263
  """
258
264
  Specifies the Microsoft accounts that are supported for the current application.
259
265
  Supported values are: AzureADMyOrg, AzureADMultipleOrgs, AzureADandPersonalMicrosoftAccount,
260
266
  PersonalMicrosoftAccount
261
-
262
- :rtype: str or None
263
267
  """
264
268
  return self.properties.get("signInAudience", None)
265
269
 
@@ -285,6 +289,7 @@ class Application(DirectoryObject):
285
289
 
286
290
  @property
287
291
  def extension_properties(self):
292
+ # type: () -> EntityCollection[ExtensionProperty]
288
293
  """List extension properties on an application object."""
289
294
  return self.properties.get(
290
295
  "extensionProperties",
@@ -297,6 +302,7 @@ class Application(DirectoryObject):
297
302
 
298
303
  @property
299
304
  def token_issuance_policies(self):
305
+ # type: () -> EntityCollection[TokenIssuancePolicy]
300
306
  """Get all tokenIssuancePolicies assigned to this object."""
301
307
  return self.properties.get(
302
308
  "tokenIssuancePolicies",
@@ -1,4 +1,5 @@
1
1
  from datetime import datetime
2
+ from typing import Optional
2
3
 
3
4
  from office365.directory.object import DirectoryObject
4
5
 
@@ -11,46 +12,57 @@ class AppRoleAssignment(DirectoryObject):
11
12
  a resource application (the app's service principal) and an app role defined on the resource application.
12
13
  """
13
14
 
15
+ def __str__(self):
16
+ return "Principal: {0}, AppRole: {1}".format(
17
+ self.principal_display_name, self.app_role_id
18
+ )
19
+
14
20
  @property
15
21
  def app_role_id(self):
22
+ # type: () -> Optional[str]
16
23
  """
17
24
  The identifier (id) for the app role which is assigned to the principal.
18
25
  This app role must be exposed in the appRoles property on
19
26
  the resource application's service principal (resourceId). If the resource application has not declared
20
27
  any app roles, a default app role ID of 00000000-0000-0000-0000-000000000000 can be specified to signal
21
28
  that the principal is assigned to the resource app without any specific app roles. Required on create.
22
- :rtype: str
23
29
  """
24
30
  return self.properties.get("appRoleId", None)
25
31
 
26
32
  @property
27
33
  def created_datetime(self):
34
+ # type: () -> datetime
28
35
  """The time when the app role assignment was created."""
29
36
  return self.properties.get("createdDateTime", datetime.min)
30
37
 
31
38
  @property
32
39
  def principal_display_name(self):
40
+ # type: () -> Optional[str]
33
41
  """The display name of the user, group, or service principal that was granted the app role assignment."""
34
42
  return self.properties.get("principalDisplayName", None)
35
43
 
36
44
  @property
37
45
  def principal_id(self):
46
+ # type: () -> Optional[str]
38
47
  """The unique identifier (id) for the user, security group, or service principal being granted the app role.
39
48
  Security groups with dynamic memberships are supported. Required on create."""
40
49
  return self.properties.get("principalId", None)
41
50
 
42
51
  @property
43
52
  def principal_type(self):
53
+ # type: () -> Optional[str]
44
54
  """The type of the assigned principal. This can either be User, Group, or ServicePrincipal."""
45
55
  return self.properties.get("principalType", None)
46
56
 
47
57
  @property
48
58
  def resource_display_name(self):
59
+ # type: () -> Optional[str]
49
60
  """The display name of the resource app's service principal to which the assignment is made."""
50
61
  return self.properties.get("resourceDisplayName", None)
51
62
 
52
63
  @property
53
64
  def resource_id(self):
65
+ # type: () -> Optional[str]
54
66
  """The unique identifier (id) for the resource service principal for which the assignment is made.
55
67
  Required on create."""
56
68
  return self.properties.get("resourceId", None)
@@ -0,0 +1,13 @@
1
+ from office365.directory.applications.roles.role import AppRole
2
+ from office365.runtime.client_value_collection import ClientValueCollection
3
+
4
+
5
+ class AppRoleCollection(ClientValueCollection[AppRole]):
6
+ """"""
7
+
8
+ def __init__(self, initial_values=None):
9
+ super(AppRoleCollection, self).__init__(AppRole, initial_values)
10
+
11
+ def __getitem__(self, name):
12
+ # type: (str) -> AppRole
13
+ return next(iter([item for item in self._data if item.value == name]), None)
@@ -10,6 +10,7 @@ class AppRole(ClientValue):
10
10
 
11
11
  def __init__(
12
12
  self,
13
+ id_=None,
13
14
  allowed_member_types=None,
14
15
  description=None,
15
16
  display_name=None,
@@ -25,6 +26,7 @@ class AppRole(ClientValue):
25
26
  on application entities.
26
27
  :param str value:
27
28
  """
29
+ self.id = id_
28
30
  self.allowedMemberTypes = StringCollection(allowed_member_types)
29
31
  self.description = description
30
32
  self.displayName = display_name
@@ -32,5 +34,8 @@ class AppRole(ClientValue):
32
34
  self.origin = origin
33
35
  self.value = value
34
36
 
37
+ def __str__(self):
38
+ return "{0} {1}".format(self.allowedMemberTypes, self.value)
39
+
35
40
  def __repr__(self):
36
- return self.value
41
+ return "{0}".format(self.id)
@@ -1,4 +1,5 @@
1
1
  import datetime
2
+ from typing import Optional
2
3
 
3
4
  from office365.directory.audit.activity_initiator import AuditActivityInitiator
4
5
  from office365.entity import Entity
@@ -8,7 +9,7 @@ class DirectoryAudit(Entity):
8
9
  """Represents the directory audit items and its collection."""
9
10
 
10
11
  def __repr__(self):
11
- return self.activity_display_name
12
+ return self.activity_display_name or self.entity_type_name
12
13
 
13
14
  @property
14
15
  def activity_datetime(self):
@@ -17,28 +18,28 @@ class DirectoryAudit(Entity):
17
18
 
18
19
  @property
19
20
  def activity_display_name(self):
21
+ # type: () -> Optional[str]
20
22
  """
21
23
  Indicates the activity name or the operation name (examples: "Create User" and "Add member to group").
22
24
  For a list of activities logged, refer to Azure AD audit log categories and activities.
23
- :rtype: str
24
25
  """
25
26
  return self.properties.get("activityDisplayName", None)
26
27
 
27
28
  @property
28
29
  def category(self):
30
+ # type: () -> Optional[str]
29
31
  """
30
32
  Indicates which resource category that's targeted by the activity.
31
33
  For example: UserManagement, GroupManagement, ApplicationManagement, RoleManagement.
32
- :rtype: str
33
34
  """
34
35
  return self.properties.get("category", None)
35
36
 
36
37
  @property
37
38
  def correlation_id(self):
39
+ # type: () -> Optional[str]
38
40
  """
39
41
  Indicates a unique ID that helps correlate activities that span across various services.
40
42
  Can be used to trace logs across services.
41
- :rtype: str
42
43
  """
43
44
  return self.properties.get("correlationId", None)
44
45
 
@@ -51,28 +52,28 @@ class DirectoryAudit(Entity):
51
52
 
52
53
  @property
53
54
  def operation_type(self):
55
+ # type: () -> Optional[str]
54
56
  """
55
57
  Indicates the type of operation that was performed. The possible values include but are not limited
56
58
  to the following: Add, Assign, Update, Unassign, and Delete.
57
- :rtype: str
58
59
  """
59
60
  return self.properties.get("operationType", None)
60
61
 
61
62
  @property
62
63
  def logged_by_service(self):
64
+ # type: () -> Optional[str]
63
65
  """
64
66
  Indicates information on which service initiated the activity. For example:
65
67
  Self-service Password Management, Core Directory, B2C, Invited Users, Microsoft Identity Manager,
66
68
  Privileged Identity Management.
67
- :rtype: str
68
69
  """
69
70
  return self.properties.get("loggedByService", None)
70
71
 
71
72
  @property
72
73
  def result_reason(self):
74
+ # type: () -> Optional[str]
73
75
  """
74
76
  Indicates the reason for failure if the result is failure or timeout.
75
- :rtype: str
76
77
  """
77
78
  return self.properties.get("resultReason", None)
78
79
 
@@ -15,6 +15,7 @@ class AuditLogRoot(Entity):
15
15
 
16
16
  @property
17
17
  def directory_audits(self):
18
+ # type: () -> EntityCollection[DirectoryAudit]
18
19
  """
19
20
  Get the list of audit logs generated by Azure Active Directory. This includes audit logs generated
20
21
  by various services within Azure AD, including user, app, device and group Management,
@@ -32,6 +33,7 @@ class AuditLogRoot(Entity):
32
33
 
33
34
  @property
34
35
  def signins(self):
36
+ # type: () -> EntityCollection[SignIn]
35
37
  """
36
38
  Retrieve the Azure AD user sign-ins for your tenant. Sign-ins that are interactive in nature
37
39
  (where a username/password is passed as part of auth token) and successful federated sign-ins are currently
@@ -47,6 +49,7 @@ class AuditLogRoot(Entity):
47
49
 
48
50
  @property
49
51
  def provisioning(self):
52
+ # type: () -> EntityCollection[ProvisioningObjectSummary]
50
53
  """
51
54
  Get all provisioning events that occurred in your tenant, such as the deletion of a group in
52
55
  a target application or the creation of a user when provisioning user accounts from your HR system.