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.directory.audit.signins.location import SignInLocation
4
5
  from office365.directory.audit.signins.status import SignInStatus
@@ -13,34 +14,30 @@ class SignIn(Entity):
13
14
 
14
15
  @property
15
16
  def app_display_name(self):
16
- """
17
- App name displayed in the Azure Portal.
18
- :rtype: str
19
- """
17
+ # type: () -> Optional[str]
18
+ """App name displayed in the Azure Portal."""
20
19
  return self.properties.get("appDisplayName", None)
21
20
 
22
21
  @property
23
22
  def app_id(self):
24
- """
25
- Unique GUID representing the app ID in the Azure Active Directory.
26
- :rtype: str
27
- """
23
+ # type: () -> Optional[str]
24
+ """Unique GUID representing the app ID in the Azure Active Directory."""
28
25
  return self.properties.get("appId", None)
29
26
 
30
27
  @property
31
28
  def client_app_used(self):
29
+ # type: () -> Optional[str]
32
30
  """
33
31
  Identifies the client used for the sign-in activity. Modern authentication clients include Browser, modern
34
32
  clients. Legacy authentication clients include Exchange ActiveSync, IMAP, MAPI, SMTP, POP, and other clients.
35
- :rtype: str
36
33
  """
37
34
  return self.properties.get("clientAppUsed", None)
38
35
 
39
36
  @property
40
37
  def correlation_id(self):
38
+ # type: () -> Optional[str]
41
39
  """
42
40
  The request ID sent from the client when the sign-in is initiated; used to troubleshoot sign-in activity.
43
- :rtype: str
44
41
  """
45
42
  return self.properties.get("correlationId", None)
46
43
 
@@ -58,18 +55,14 @@ class SignIn(Entity):
58
55
 
59
56
  @property
60
57
  def ip_address(self):
61
- """
62
- IP address of the client used to sign in.
63
- :rtype: str
64
- """
58
+ # type: () -> Optional[str]
59
+ """IP address of the client used to sign in."""
65
60
  return self.properties.get("ipAddress", None)
66
61
 
67
62
  @property
68
63
  def is_interactive(self):
69
- """
70
- Indicates if a sign-in is interactive or not.
71
- :rtype: bool or None
72
- """
64
+ # type: () -> Optional[bool]
65
+ """Indicates if a sign-in is interactive or not."""
73
66
  return self.properties.get("isInteractive", None)
74
67
 
75
68
  @property
@@ -82,50 +75,47 @@ class SignIn(Entity):
82
75
 
83
76
  @property
84
77
  def resource_display_name(self):
85
- """
86
- Name of the resource the user signed into.
87
- :rtype: str or None
88
- """
78
+ # type: () -> Optional[str]
79
+ """Name of the resource the user signed into."""
89
80
  return self.properties.get("resourceDisplayName", None)
90
81
 
91
82
  @property
92
83
  def resource_id(self):
84
+ # type: () -> Optional[str]
93
85
  """
94
- ID of the resource that the user signed into.
95
- :rtype: str or None
96
- """
86
+ ID of the resource that the user signed into."""
97
87
  return self.properties.get("resourceId", None)
98
88
 
99
89
  @property
100
90
  def risk_detail(self):
91
+ # type: () -> Optional[str]
101
92
  """
102
93
  Provides the 'reason' behind a specific state of a risky user, sign-in or a risk event.
103
- :rtype: str or None
104
94
  """
105
95
  return self.properties.get("riskDetail", None)
106
96
 
107
97
  @property
108
98
  def user_id(self):
99
+ # type: () -> Optional[str]
109
100
  """
110
101
  ID of the user that initiated the sign-in. Supports $filter (eq operator only).
111
- :rtype: str or None
112
102
  """
113
103
  return self.properties.get("userId", None)
114
104
 
115
105
  @property
116
106
  def user_principal_name(self):
107
+ # type: () -> Optional[str]
117
108
  """
118
109
  User principal name of the user that initiated the sign-in. Supports $filter (eq and startsWith operators only).
119
- :rtype: str or None
120
110
  """
121
111
  return self.properties.get("userPrincipalName", None)
122
112
 
123
113
  @property
124
114
  def status(self):
115
+ # type: () -> Optional[SignInStatus]
125
116
  """
126
117
  Sign-in status. Includes the error code and description of the error (in case of a sign-in failure).
127
118
  Supports $filter (eq operator only) on errorCode property.
128
- :rtype: str or None
129
119
  """
130
120
  return self.properties.get("status", SignInStatus())
131
121
 
@@ -78,6 +78,7 @@ class Authentication(Entity):
78
78
 
79
79
  @property
80
80
  def methods(self):
81
+ # type: () -> EntityCollection[AuthenticationMethod]
81
82
  """Represents all authentication methods registered to a user."""
82
83
  return self.properties.get(
83
84
  "methods",
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
 
3
5
 
@@ -8,55 +10,55 @@ class UserRegistrationDetails(Entity):
8
10
 
9
11
  @property
10
12
  def is_admin(self):
13
+ # type: () -> Optional[bool]
11
14
  """
12
15
  Indicates whether the user has an admin role in the tenant. This value can be used to check the authentication
13
16
  methods that privileged accounts are registered for and capable of.
14
- :rtype: bool
15
17
  """
16
18
  return self.properties.get("isAdmin", None)
17
19
 
18
20
  @property
19
21
  def is_mfa_registered(self):
22
+ # type: () -> Optional[bool]
20
23
  """
21
24
  Indicates whether the user has registered a strong authentication method for multi-factor authentication.
22
25
  The method may not necessarily be allowed by the authentication methods policy.
23
- :rtype: bool
24
26
  """
25
27
  return self.properties.get("isMfaRegistered", None)
26
28
 
27
29
  @property
28
30
  def is_passwordless_capable(self):
31
+ # type: () -> Optional[bool]
29
32
  """
30
33
  Indicates whether the user has registered a passwordless strong authentication method (including FIDO2,
31
34
  Windows Hello for Business, and Microsoft Authenticator (Passwordless)) that is allowed by the authentication
32
35
  methods policy.
33
- :rtype: bool
34
36
  """
35
37
  return self.properties.get("isPasswordlessCapable", None)
36
38
 
37
39
  @property
38
40
  def is_sspr_capable(self):
41
+ # type: () -> Optional[bool]
39
42
  """
40
43
  Indicates whether the user has registered the required number of authentication methods for self-service
41
44
  password reset and the user is allowed to perform self-service password reset by policy.
42
- :rtype: bool
43
45
  """
44
46
  return self.properties.get("isSsprCapable", None)
45
47
 
46
48
  @property
47
49
  def is_sspr_enabled(self):
50
+ # type: () -> Optional[bool]
48
51
  """
49
52
  Indicates whether the user is allowed to perform self-service password reset by policy. The user may not
50
53
  necessarily have registered the required number of authentication methods for self-service password reset.
51
- :rtype: bool
52
54
  """
53
55
  return self.properties.get("isSsprEnabled", None)
54
56
 
55
57
  @property
56
58
  def user_type(self):
59
+ # type: () -> Optional[str]
57
60
  """
58
61
  Identifies whether the user is a member or guest in the tenant.
59
62
  The possible values are: member, guest, unknownFutureValue.
60
- :rtype: str or None
61
63
  """
62
64
  return self.properties.get("userType", None)
@@ -8,7 +8,9 @@ class PhoneAuthenticationMethod(AuthenticationMethod):
8
8
  to sign in via SMS.
9
9
 
10
10
  A phone has one of three types: mobile, alternate mobile, or office. A user can have one number registered
11
- for each type, and must have a mobile phone before an alternate mobile phone is added. When using a phone for multi-factor authentication (MFA) or self-service password reset (SSPR), the mobile phone is the default and the alternate mobile phone is the backup.
11
+ for each type, and must have a mobile phone before an alternate mobile phone is added. When using a phone for
12
+ multi-factor authentication (MFA) or self-service password reset (SSPR), the mobile phone is the default and the
13
+ alternate mobile phone is the backup.
12
14
 
13
15
  Mobile phones can be used for both SMS and voice calls, depending on the tenant settings.
14
16
 
@@ -1,4 +1,6 @@
1
1
  # coding=utf-8
2
+ from typing import Optional
3
+
2
4
  from office365.directory.object import DirectoryObject
3
5
  from office365.runtime.types.collections import StringCollection
4
6
 
@@ -13,22 +15,19 @@ class ExtensionProperty(DirectoryObject):
13
15
 
14
16
  @property
15
17
  def name(self):
16
- """
17
- Name of the extension property.
18
- :rtype: str
19
- """
18
+ # type: () -> Optional[str]
19
+ """Name of the extension property"""
20
20
  return self.properties.get("name", None)
21
21
 
22
22
  @property
23
23
  def app_display_name(self):
24
- """
25
- Display name of the application object on which this extension property is defined. Read-only.
26
- :rtype: str
27
- """
24
+ # type: () -> Optional[str]
25
+ """Display name of the application object on which this extension property is defined. Read-only"""
28
26
  return self.properties.get("appDisplayName", None)
29
27
 
30
28
  @property
31
29
  def data_type(self):
30
+ # type: () -> Optional[str]
32
31
  """
33
32
  Specifies the data type of the value the extension property can hold. Following values are supported.
34
33
  Binary - 256 bytes maximum
@@ -37,7 +36,6 @@ class ExtensionProperty(DirectoryObject):
37
36
  Integer - 32-bit value.
38
37
  LargeInteger - 64-bit value.
39
38
  String - 256 characters maximum
40
- :rtype: str
41
39
  """
42
40
  return self.properties.get("dataType", None)
43
41
 
@@ -25,17 +25,18 @@ class GroupCollection(DeltaCollection[Group]):
25
25
  self.context.add_query(qry)
26
26
  return return_type
27
27
 
28
- def create_m365_group(self, name, description=None):
28
+ def create_m365(self, name, description=None, owner=None):
29
29
  """
30
30
  Creates a Microsoft 365 group.
31
31
  If the owners have not been specified, the calling user is automatically added as the owner of the group.
32
32
  :param str name: The display name for the group
33
33
  :param str description: An optional description for the group
34
+ :param str owner: The group owner
34
35
  """
35
36
  params = GroupProfile(name, description, True, False, ["Unified"])
36
37
  return self.add(params)
37
38
 
38
- def create_security_group(self, name, description=None):
39
+ def create_security(self, name, description=None):
39
40
  """
40
41
  Creates a Security group
41
42
  :param str name: The display name for the group
@@ -56,6 +57,12 @@ class GroupCollection(DeltaCollection[Group]):
56
57
  """
57
58
 
58
59
  def _after_group_created(return_type):
60
+ # type: (Group) -> None
59
61
  return_type.add_team()
60
62
 
61
- return self.create_m365_group(group_name).after_execute(_after_group_created)
63
+ return self.create_m365(group_name).after_execute(_after_group_created)
64
+
65
+ def get_by_name(self, name):
66
+ # type: (str) -> Group
67
+ """Retrieves group by displayName"""
68
+ return self.single("displayName eq '{0}'".format(name))
@@ -24,6 +24,7 @@ from office365.outlook.mail.conversation_thread import ConversationThread
24
24
  from office365.planner.group import PlannerGroup
25
25
  from office365.runtime.client_value_collection import ClientValueCollection
26
26
  from office365.runtime.http.http_method import HttpMethod
27
+ from office365.runtime.http.request_options import RequestOptions
27
28
  from office365.runtime.paths.resource_path import ResourcePath
28
29
  from office365.runtime.queries.service_operation import ServiceOperationQuery
29
30
  from office365.runtime.types.collections import StringCollection
@@ -34,7 +35,7 @@ class Group(DirectoryObject):
34
35
  """Represents an Azure Active Directory (Azure AD) group, which can be an Office 365 group, or a security group."""
35
36
 
36
37
  def __repr__(self):
37
- return self.display_name
38
+ return self.display_name or self.id or self.entity_type_name
38
39
 
39
40
  def renew(self):
40
41
  """
@@ -98,9 +99,7 @@ class Group(DirectoryObject):
98
99
  qry = ServiceOperationQuery(self, "team", None, self.team, None, self.team)
99
100
 
100
101
  def _construct_request(request):
101
- """
102
- :type request: office365.runtime.http.request_options.RequestOptions
103
- """
102
+ # type: (RequestOptions) -> None
104
103
  request.method = HttpMethod.Put
105
104
  request.set_header("Content-Type", "application/json")
106
105
  request.data = json.dumps(request.data)
@@ -122,18 +121,17 @@ class Group(DirectoryObject):
122
121
 
123
122
  @property
124
123
  def assigned_labels(self):
125
- """
126
- The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group.
127
- """
124
+ # type: () -> ClientValueCollection[AssignedLabel]
125
+ """The list of sensitivity label pairs (label ID, label name) associated with a Microsoft 365 group."""
128
126
  return self.properties.get(
129
127
  "assignedLabels", ClientValueCollection(AssignedLabel)
130
128
  )
131
129
 
132
130
  @property
133
131
  def classification(self):
132
+ # type: () -> Optional[str]
134
133
  """Describes a classification for the group (such as low, medium or high business impact). Valid values for
135
134
  this property are defined by creating a ClassificationList setting value, based on the template definition.
136
- :rtype: str or None
137
135
  """
138
136
  return self.properties.get("classification", None)
139
137
 
@@ -165,18 +163,19 @@ class Group(DirectoryObject):
165
163
 
166
164
  @property
167
165
  def has_members_with_license_errors(self):
166
+ # type: () -> Optional[bool]
168
167
  """
169
168
  Indicates whether there are members in this group that have license errors from its group-based license
170
169
  assignment.
171
170
 
172
171
  This property is never returned on a GET operation. You can use it as a $filter argument to get groups that
173
172
  have members with license errors (that is, filter for this property being true)
174
- :rtype: bool or None
175
173
  """
176
174
  return self.properties.get("hasMembersWithLicenseErrors", None)
177
175
 
178
176
  @property
179
177
  def is_assignable_to_role(self):
178
+ # type: () -> Optional[bool]
180
179
  """
181
180
  Indicates whether this group can be assigned to an Azure Active Directory role or not. Optional.
182
181
 
@@ -187,7 +186,6 @@ class Group(DirectoryObject):
187
186
  Only callers in Global Administrator and Privileged Role Administrator roles can set this property.
188
187
  The caller must also be assigned the RoleManagement.ReadWrite.Directory permission to set this property or
189
188
  update the membership of such groups. For more, see Using a group to manage Azure AD role assignments
190
- :rtype: bool or None
191
189
  """
192
190
  return self.properties.get("isAssignableToRole", None)
193
191
 
@@ -200,38 +198,37 @@ class Group(DirectoryObject):
200
198
 
201
199
  @property
202
200
  def mail(self):
201
+ # type: () -> Optional[str]
203
202
  """
204
203
  The SMTP address for the group, for example, "serviceadmins@contoso.onmicrosoft.com".
205
- :rtype: str or None
206
204
  """
207
205
  return self.properties.get("mail", None)
208
206
 
209
207
  @property
210
208
  def mail_enabled(self):
209
+ # type: () -> Optional[bool]
211
210
  """
212
211
  Specifies whether the group is mail-enabled. Required.
213
- :rtype: bool or None
214
212
  """
215
213
  return self.properties.get("mailEnabled", None)
216
214
 
217
215
  @property
218
216
  def mail_nickname(self):
217
+ # type: () -> Optional[str]
219
218
  """
220
219
  The mail alias for the group, unique for Microsoft 365 groups in the organization. Maximum length is 64
221
220
  characters.
222
- :rtype: str or None
223
221
  """
224
222
  return self.properties.get("mailNickname", None)
225
223
 
226
224
  @property
227
225
  def on_premises_domain_name(self):
228
- """
229
- :rtype: str or None
230
- """
226
+ # type: () -> Optional[str]
231
227
  return self.properties.get("onPremisesDomainName", None)
232
228
 
233
229
  @property
234
230
  def conversations(self):
231
+ # type: () -> EntityCollection[Conversation]
235
232
  """The group's conversations."""
236
233
  return self.properties.get(
237
234
  "conversations",
@@ -249,6 +246,7 @@ class Group(DirectoryObject):
249
246
 
250
247
  @property
251
248
  def extensions(self):
249
+ # type: () -> EntityCollection[Extension]
252
250
  """
253
251
  The collection of open extensions defined for the group
254
252
  """
@@ -261,9 +259,7 @@ class Group(DirectoryObject):
261
259
 
262
260
  @property
263
261
  def members(self):
264
- """
265
- Users and groups that are members of this group.
266
- """
262
+ """Users and groups that are members of this group."""
267
263
  return self.properties.get(
268
264
  "members",
269
265
  DirectoryObjectCollection(
@@ -300,6 +296,7 @@ class Group(DirectoryObject):
300
296
 
301
297
  @property
302
298
  def threads(self):
299
+ # type: () -> EntityCollection[ConversationThread]
303
300
  """The group's conversation threads"""
304
301
  return self.properties.get(
305
302
  "threads",
@@ -322,6 +319,7 @@ class Group(DirectoryObject):
322
319
 
323
320
  @property
324
321
  def drives(self):
322
+ # type: () -> EntityCollection[Drive]
325
323
  """
326
324
  The group's drives. Read-only.
327
325
  """
@@ -346,6 +344,7 @@ class Group(DirectoryObject):
346
344
 
347
345
  @property
348
346
  def events(self):
347
+ # type: () -> EventCollection
349
348
  """Get an event collection or an event."""
350
349
  return self.properties.get(
351
350
  "events",
@@ -380,6 +379,7 @@ class Group(DirectoryObject):
380
379
 
381
380
  @property
382
381
  def permission_grants(self):
382
+ # type: () -> EntityCollection[ResourceSpecificPermissionGrant]
383
383
  """
384
384
  List permissions that have been granted to apps to access the group.
385
385
  """
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
  from office365.runtime.client_result import ClientResult
3
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -28,12 +30,12 @@ class GroupLifecyclePolicy(Entity):
28
30
  return return_type
29
31
 
30
32
  def remove_group(self, group_id):
33
+ # type: (str) -> ClientResult[bool]
31
34
  """
32
35
  Removes a group from a lifecycle policy.
33
-
34
36
  :param str group_id: The identifier of the group to add to the policy.
35
37
  """
36
- return_type = ClientResult[bool](self.context)
38
+ return_type = ClientResult(self.context)
37
39
  payload = {"groupId": group_id}
38
40
  qry = ServiceOperationQuery(
39
41
  self, "removeGroup", None, payload, None, return_type
@@ -43,25 +45,24 @@ class GroupLifecyclePolicy(Entity):
43
45
 
44
46
  @property
45
47
  def alternate_notification_emails(self):
48
+ # type: () -> Optional[str]
46
49
  """
47
50
  List of email address to send notifications for groups without owners.
48
51
  Multiple email address can be defined by separating email address with a semicolon.
49
- :rtype: str or None
50
52
  """
51
53
  return self.properties.get("alternateNotificationEmails", None)
52
54
 
53
55
  @property
54
56
  def group_lifetime_in_days(self):
57
+ # type: () -> Optional[int]
55
58
  """
56
59
  Number of days before a group expires and needs to be renewed. Once renewed, the group expiration is extended
57
60
  by the number of days defined.
58
- :rtype: int or None
59
61
  """
60
62
  return self.properties.get("groupLifetimeInDays", None)
61
63
 
62
64
  @property
63
65
  def managed_group_types(self):
64
- """The group type for which the expiration policy applies. Possible values are All, Selected or None.
65
- :rtype: str or None
66
- """
66
+ # type: () -> Optional[str]
67
+ """The group type for which the expiration policy applies. Possible values are All, Selected or None."""
67
68
  return self.properties.get("managedGroupTypes", None)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
 
3
5
 
@@ -11,20 +13,17 @@ class IdentityProvider(Entity):
11
13
 
12
14
  @property
13
15
  def client_id(self):
16
+ # type: () -> Optional[str]
14
17
  """
15
18
  The client ID for the application. This is the client ID obtained when registering the application
16
- with the identity provider.
17
-
18
- :rtype: str or None
19
- """
19
+ with the identity provider."""
20
20
  return self.properties.get("clientId", None)
21
21
 
22
22
  @property
23
23
  def client_secret(self):
24
+ # type: () -> Optional[str]
24
25
  """
25
26
  The client secret for the application. This is the client secret obtained when registering the application
26
27
  with the identity provider. This is write-only. A read operation will return ****
27
-
28
- :rtype: str or None
29
28
  """
30
29
  return self.properties.get("clientSecret", None)
@@ -1,16 +1,21 @@
1
- from datetime import datetime
1
+ from typing import TYPE_CHECKING
2
2
 
3
3
  from office365.runtime.client_value import ClientValue
4
4
 
5
+ if TYPE_CHECKING:
6
+ from datetime import datetime
7
+ from typing import Optional
8
+
5
9
 
6
10
  class UsageDetails(ClientValue):
7
11
  """Complex type containing properties of Used items. Information on when the resource was last accessed (viewed)
8
12
  or modified (edited) by the user."""
9
13
 
10
14
  def __init__(self, last_accessed_datetime=None, last_modified_datetime=None):
15
+ # type: (Optional[datetime], Optional[datetime]) -> None
11
16
  """
12
- :param datetime.datetime last_accessed_datetime: The date and time the resource was last accessed by the user.
13
- :param datetime.datetime last_modified_datetime: The date and time the resource was last modified by the user.
17
+ :param last_accessed_datetime: The date and time the resource was last accessed by the user.
18
+ :param last_modified_datetime: The date and time the resource was last modified by the user.
14
19
  """
15
20
  self.lastAccessedDateTime = last_accessed_datetime
16
21
  self.lastModifiedDateTime = last_modified_datetime
@@ -1,5 +1,5 @@
1
- from office365.runtime.paths.entity import EntityPath
2
1
  from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.runtime.paths.v4.entity import EntityPath
3
3
 
4
4
 
5
5
  class MePath(EntityPath):
@@ -3,7 +3,7 @@ from office365.entity_collection import EntityCollection
3
3
  from office365.runtime.queries.create_entity import CreateEntityQuery
4
4
 
5
5
 
6
- class InvitationCollection(EntityCollection):
6
+ class InvitationCollection(EntityCollection[Invitation]):
7
7
  """Invitation's collection"""
8
8
 
9
9
  def __init__(self, context, resource_path=None):
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.invitations.message_info import InvitedUserMessageInfo
2
4
  from office365.directory.users.user import User
3
5
  from office365.entity import Entity
@@ -27,16 +29,14 @@ class Invitation(Entity):
27
29
 
28
30
  @property
29
31
  def invited_user_display_name(self):
30
- """The display name of the user being invited.
31
- :rtype: str
32
- """
32
+ # type: () -> Optional[str]
33
+ """The display name of the user being invited."""
33
34
  return self.properties.get("invitedUserDisplayName", None)
34
35
 
35
36
  @property
36
37
  def invited_user_email_address(self):
37
- """The email address of the user being invited.
38
- :rtype: str
39
- """
38
+ # type: () -> Optional[str]
39
+ """The email address of the user being invited."""
40
40
  return self.properties.get("invitedUserEmailAddress", None)
41
41
 
42
42
  @property
@@ -3,6 +3,7 @@ from office365.directory.object import DirectoryObject
3
3
  from office365.entity_collection import EntityCollection
4
4
  from office365.runtime.client_result import ClientResult
5
5
  from office365.runtime.http.http_method import HttpMethod
6
+ from office365.runtime.http.request_options import RequestOptions
6
7
  from office365.runtime.queries.service_operation import ServiceOperationQuery
7
8
 
8
9
 
@@ -68,9 +69,7 @@ class DirectoryObjectCollection(DeltaCollection[DirectoryObject]):
68
69
  qry = ServiceOperationQuery(self, "{0}/$ref".format(user_id))
69
70
 
70
71
  def _construct_request(request):
71
- """
72
- :type request: RequestOptions
73
- """
72
+ # type: (RequestOptions) -> None
74
73
  request.method = HttpMethod.Delete
75
74
 
76
75
  self.context.add_query(qry).before_query_execute(_construct_request)
@@ -3,3 +3,10 @@ from office365.directory.permissions.identity import Identity
3
3
 
4
4
  class EmailIdentity(Identity):
5
5
  """Represents the email identity of a user."""
6
+
7
+ def __init__(self, id_=None, email=None, display_name=None):
8
+ """
9
+ :param str email:
10
+ """
11
+ super(EmailIdentity, self).__init__(display_name, id_)
12
+ self.email = email