Office365-REST-Python-Client 2.5.2__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 (124) hide show
  1. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/METADATA +4 -4
  2. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/RECORD +122 -119
  3. office365/base_item.py +12 -20
  4. office365/communications/presences/presence.py +18 -7
  5. office365/delta_path.py +1 -1
  6. office365/directory/administrative_unit.py +6 -7
  7. office365/directory/applications/application.py +15 -13
  8. office365/directory/audit/signins/signin.py +8 -12
  9. office365/directory/authentication/methods/details.py +8 -6
  10. office365/directory/groups/lifecycle_policy.py +8 -7
  11. office365/directory/identities/provider.py +5 -6
  12. office365/directory/internal/paths/me.py +1 -1
  13. office365/directory/permissions/email_identity.py +7 -0
  14. office365/directory/rolemanagement/role.py +5 -4
  15. office365/directory/rolemanagement/template.py +2 -6
  16. office365/directory/rolemanagement/unified_role_assignment.py +5 -4
  17. office365/directory/rolemanagement/unified_role_definition.py +6 -4
  18. office365/directory/serviceprincipals/service_principal.py +11 -6
  19. office365/directory/users/user.py +8 -11
  20. office365/entity.py +2 -2
  21. office365/entity_collection.py +11 -4
  22. office365/intune/devices/enrollment/configuration.py +6 -4
  23. office365/intune/devices/managed.py +9 -12
  24. office365/onedrive/analytics/item_activity_stat.py +4 -3
  25. office365/onedrive/columns/definition.py +9 -9
  26. office365/onedrive/documentsets/version.py +1 -3
  27. office365/onedrive/driveitems/driveItem.py +30 -29
  28. office365/onedrive/internal/paths/children.py +2 -2
  29. office365/onedrive/internal/paths/root.py +1 -1
  30. office365/onedrive/internal/paths/shared.py +1 -1
  31. office365/onedrive/internal/paths/site.py +3 -3
  32. office365/onedrive/internal/paths/url.py +2 -2
  33. office365/onedrive/listitems/list_item.py +2 -0
  34. office365/onedrive/lists/list.py +7 -4
  35. office365/onedrive/permissions/collection.py +26 -6
  36. office365/onedrive/sharepoint.py +1 -0
  37. office365/onedrive/shares/collection.py +2 -5
  38. office365/onedrive/shares/drive_item.py +3 -0
  39. office365/onedrive/termstore/groups/collection.py +3 -8
  40. office365/onedrive/termstore/groups/group.py +8 -0
  41. office365/onedrive/termstore/sets/collection.py +2 -6
  42. office365/onedrive/termstore/sets/name.py +5 -0
  43. office365/onedrive/termstore/sets/set.py +7 -0
  44. office365/onedrive/termstore/store.py +10 -13
  45. office365/onedrive/versions/drive_item.py +3 -1
  46. office365/onedrive/workbooks/ranges/range.py +9 -13
  47. office365/onedrive/workbooks/ranges/view.py +1 -0
  48. office365/onedrive/workbooks/tables/table.py +1 -3
  49. office365/onedrive/workbooks/worksheets/worksheet.py +5 -3
  50. office365/onenote/pages/collection.py +3 -2
  51. office365/onenote/resources/resource.py +5 -4
  52. office365/onenote/sectiongroups/section_group.py +10 -7
  53. office365/outlook/calendar/calendar.py +1 -1
  54. office365/outlook/calendar/schedule/information.py +0 -1
  55. office365/outlook/contacts/contact.py +3 -9
  56. office365/outlook/contacts/folder.py +3 -0
  57. office365/outlook/mail/messages/message.py +25 -18
  58. office365/outlook/mail/recipient.py +3 -1
  59. office365/runtime/auth/authentication_context.py +2 -2
  60. office365/runtime/auth/providers/acs_token_provider.py +7 -9
  61. office365/runtime/client_object.py +3 -11
  62. office365/runtime/client_object_collection.py +22 -20
  63. office365/runtime/client_result.py +1 -3
  64. office365/runtime/client_value_collection.py +2 -6
  65. office365/runtime/odata/query_options.py +1 -3
  66. office365/runtime/odata/type.py +2 -0
  67. office365/runtime/paths/appid.py +1 -1
  68. office365/runtime/{odata/url_builder.py → paths/builder.py} +24 -9
  69. office365/runtime/paths/item.py +1 -1
  70. office365/runtime/paths/resource_path.py +12 -16
  71. office365/runtime/paths/service_operation.py +8 -7
  72. office365/runtime/paths/v3/__init__.py +0 -0
  73. office365/runtime/paths/{key.py → v3/entity.py} +5 -5
  74. office365/runtime/paths/v4/__init__.py +0 -0
  75. office365/runtime/paths/{entity.py → v4/entity.py} +13 -11
  76. office365/sharepoint/contenttypes/content_type.py +6 -0
  77. office365/sharepoint/documentmanagement/document_set.py +4 -6
  78. office365/sharepoint/entity_collection.py +9 -0
  79. office365/sharepoint/features/feature.py +6 -8
  80. office365/sharepoint/files/checked_out_file.py +4 -2
  81. office365/sharepoint/files/checked_out_file_collection.py +1 -1
  82. office365/sharepoint/files/collection.py +35 -3
  83. office365/sharepoint/files/file.py +35 -11
  84. office365/sharepoint/files/versions/collection.py +4 -0
  85. office365/sharepoint/files/versions/event.py +6 -3
  86. office365/sharepoint/files/versions/version.py +6 -4
  87. office365/sharepoint/folders/collection.py +2 -2
  88. office365/sharepoint/folders/folder.py +5 -11
  89. office365/sharepoint/internal/paths/static_operation.py +9 -0
  90. office365/sharepoint/internal/paths/web.py +20 -0
  91. office365/sharepoint/listitems/collection.py +4 -0
  92. office365/sharepoint/listitems/listitem.py +19 -30
  93. office365/sharepoint/lists/list.py +44 -60
  94. office365/sharepoint/portal/groups/service.py +12 -16
  95. office365/sharepoint/portal/groups/site_manager.py +0 -1
  96. office365/sharepoint/publishing/pages/metadata.py +7 -2
  97. office365/sharepoint/publishing/pages/metadata_collection.py +0 -1
  98. office365/sharepoint/publishing/pages/page.py +3 -6
  99. office365/sharepoint/publishing/pages/reposts/repost.py +5 -9
  100. office365/sharepoint/recyclebin/item.py +11 -9
  101. office365/sharepoint/sharing/links/share_response.py +3 -0
  102. office365/sharepoint/sharing/result.py +18 -41
  103. office365/sharepoint/sites/site.py +46 -68
  104. office365/sharepoint/taxonomy/item.py +4 -2
  105. office365/sharepoint/taxonomy/stores/store.py +2 -6
  106. office365/sharepoint/tenant/administration/internal/permission_grant.py +7 -0
  107. office365/sharepoint/tenant/administration/sites/properties.py +55 -44
  108. office365/sharepoint/tenant/administration/tenant.py +25 -40
  109. office365/sharepoint/usercustomactions/collection.py +0 -1
  110. office365/sharepoint/webs/collection.py +8 -0
  111. office365/sharepoint/webs/template_collection.py +2 -4
  112. office365/sharepoint/webs/web.py +27 -24
  113. office365/teams/apps/app.py +1 -0
  114. office365/teams/collection.py +12 -16
  115. office365/teams/members/conversation_collection.py +1 -3
  116. office365/teams/operations/async_operation.py +3 -5
  117. office365/teams/schedule/groups/group.py +3 -0
  118. office365/teams/team.py +1 -1
  119. office365/todo/attachments/base.py +7 -9
  120. office365/runtime/odata/path_builder.py +0 -23
  121. office365/sharepoint/internal/key_value.py +0 -28
  122. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/LICENSE +0 -0
  123. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/WHEEL +0 -0
  124. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/top_level.txt +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:
@@ -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)
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.
@@ -178,6 +189,7 @@ class Application(DirectoryObject):
178
189
 
179
190
  @property
180
191
  def app_roles(self):
192
+ # type: () -> ClientValueCollection[AppRole]
181
193
  """
182
194
  The collection of roles defined for the application. With app role assignments, these roles can be assigned to
183
195
  users, groups, or service principals associated with other applications
@@ -191,16 +203,12 @@ class Application(DirectoryObject):
191
203
 
192
204
  @property
193
205
  def certification(self):
194
- """
195
- Specifies the certification status of the application.
196
- """
206
+ """Specifies the certification status of the application."""
197
207
  return self.properties.get("certification", Certification())
198
208
 
199
209
  @property
200
210
  def created_datetime(self):
201
- """
202
- The date and time the application was registered.
203
- """
211
+ """The date and time the application was registered."""
204
212
  return self.properties.get("createdDateTime", datetime.datetime.min)
205
213
 
206
214
  @property
@@ -318,9 +326,3 @@ class Application(DirectoryObject):
318
326
  }
319
327
  default_value = property_mapping.get(name, None)
320
328
  return super(Application, self).get_property(name, default_value)
321
-
322
- def __repr__(self):
323
- return self.id
324
-
325
- def __str__(self):
326
- return self.display_name
@@ -14,18 +14,14 @@ class SignIn(Entity):
14
14
 
15
15
  @property
16
16
  def app_display_name(self):
17
- """
18
- App name displayed in the Azure Portal.
19
- :rtype: str
20
- """
17
+ # type: () -> Optional[str]
18
+ """App name displayed in the Azure Portal."""
21
19
  return self.properties.get("appDisplayName", None)
22
20
 
23
21
  @property
24
22
  def app_id(self):
25
- """
26
- Unique GUID representing the app ID in the Azure Active Directory.
27
- :rtype: str
28
- """
23
+ # type: () -> Optional[str]
24
+ """Unique GUID representing the app ID in the Azure Active Directory."""
29
25
  return self.properties.get("appId", None)
30
26
 
31
27
  @property
@@ -92,34 +88,34 @@ class SignIn(Entity):
92
88
 
93
89
  @property
94
90
  def risk_detail(self):
91
+ # type: () -> Optional[str]
95
92
  """
96
93
  Provides the 'reason' behind a specific state of a risky user, sign-in or a risk event.
97
- :rtype: str or None
98
94
  """
99
95
  return self.properties.get("riskDetail", None)
100
96
 
101
97
  @property
102
98
  def user_id(self):
99
+ # type: () -> Optional[str]
103
100
  """
104
101
  ID of the user that initiated the sign-in. Supports $filter (eq operator only).
105
- :rtype: str or None
106
102
  """
107
103
  return self.properties.get("userId", None)
108
104
 
109
105
  @property
110
106
  def user_principal_name(self):
107
+ # type: () -> Optional[str]
111
108
  """
112
109
  User principal name of the user that initiated the sign-in. Supports $filter (eq and startsWith operators only).
113
- :rtype: str or None
114
110
  """
115
111
  return self.properties.get("userPrincipalName", None)
116
112
 
117
113
  @property
118
114
  def status(self):
115
+ # type: () -> Optional[SignInStatus]
119
116
  """
120
117
  Sign-in status. Includes the error code and description of the error (in case of a sign-in failure).
121
118
  Supports $filter (eq operator only) on errorCode property.
122
- :rtype: str or None
123
119
  """
124
120
  return self.properties.get("status", SignInStatus())
125
121
 
@@ -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)
@@ -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,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,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
@@ -8,7 +8,10 @@ class DirectoryRole(DirectoryObject):
8
8
  """Represents an Azure AD directory role. Azure AD directory roles are also known as administrator roles"""
9
9
 
10
10
  def __repr__(self):
11
- return self.display_name
11
+ return self.id or self.entity_type_name
12
+
13
+ def __str__(self):
14
+ return "Name: {0}".format(self.display_name)
12
15
 
13
16
  @property
14
17
  def description(self):
@@ -24,9 +27,7 @@ class DirectoryRole(DirectoryObject):
24
27
 
25
28
  @property
26
29
  def members(self):
27
- """
28
- Users that are members of this directory role.
29
- """
30
+ """Users that are members of this directory role."""
30
31
  from office365.directory.object_collection import DirectoryObjectCollection
31
32
 
32
33
  return self.properties.get(
@@ -13,15 +13,11 @@ class DirectoryRoleTemplate(DirectoryObject):
13
13
  @property
14
14
  def display_name(self):
15
15
  # type: () -> Optional[str]
16
- """
17
- The display name to set for the directory role
18
- """
16
+ """The display name to set for the directory role"""
19
17
  return self.properties.get("displayName", None)
20
18
 
21
19
  @property
22
20
  def description(self):
23
21
  # type: () -> Optional[str]
24
- """
25
- The display name to set for the directory role
26
- """
22
+ """The display name to set for the directory role"""
27
23
  return self.properties.get("description", None)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.rolemanagement.unified_role_definition import (
2
4
  UnifiedRoleDefinition,
3
5
  )
@@ -13,20 +15,19 @@ class UnifiedRoleAssignment(Entity):
13
15
 
14
16
  @property
15
17
  def app_scope_id(self):
18
+ # type: () -> Optional[str]
16
19
  """
17
20
  Identifier of the app-specific scope when the assignment scope is app-specific. Either this property or
18
21
  directoryScopeId is required. App scopes are scopes that are defined and understood by this application only.
19
22
  Use / for tenant-wide app scopes. Use directoryScopeId to limit the scope to particular directory objects,
20
23
  for example, administrative units. Supports $filter (eq, in).
21
- :rtype: str
22
24
  """
23
25
  return self.properties.get("appScopeId", None)
24
26
 
25
27
  @property
26
28
  def condition(self):
27
- """
28
- :rtype: str
29
- """
29
+ # type: () -> Optional[str]
30
+ """ """
30
31
  return self.properties.get("condition", None)
31
32
 
32
33
  @property
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.directory.rolemanagement.unified_role_permission import (
2
4
  UnifiedRolePermission,
3
5
  )
@@ -13,16 +15,15 @@ class UnifiedRoleDefinition(Entity):
13
15
 
14
16
  @property
15
17
  def display_name(self):
16
- """The display name for the unifiedRoleDefinition.
17
- :rtype: str
18
- """
18
+ # type: () -> Optional[str]
19
+ """The display name for the unifiedRoleDefinition."""
19
20
  return self.properties.get("displayName", None)
20
21
 
21
22
  @property
22
23
  def is_built_in(self):
24
+ # type: () -> Optional[bool]
23
25
  """Flag indicating whether the role definition is part of the default set included in
24
26
  Azure Active Directory (Azure AD) or a custom definition.
25
- :rtype: bool
26
27
  """
27
28
  return self.properties.get("isBuiltIn", None)
28
29
 
@@ -37,6 +38,7 @@ class UnifiedRoleDefinition(Entity):
37
38
 
38
39
  @property
39
40
  def inherits_permissions_from(self):
41
+ # type: () -> EntityCollection[UnifiedRoleDefinition]
40
42
  """
41
43
  Read-only collection of role definitions that the given role definition inherits from. Only Azure AD built-in
42
44
  roles (isBuiltIn is true) support this attribute. Supports $expand.
@@ -28,6 +28,9 @@ from office365.runtime.types.collections import StringCollection
28
28
  class ServicePrincipal(DirectoryObject):
29
29
  """Represents an instance of an application in a directory."""
30
30
 
31
+ def __str__(self):
32
+ return self.display_name
33
+
31
34
  def add_key(self, key_credential, password_credential, proof):
32
35
  """
33
36
  Adds a key credential to a servicePrincipal. This method along with removeKey can be used by a servicePrincipal
@@ -185,9 +188,7 @@ class ServicePrincipal(DirectoryObject):
185
188
  @property
186
189
  def app_display_name(self):
187
190
  # type: () -> Optional[str]
188
- """
189
- The display name exposed by the associated application.
190
- """
191
+ """The display name exposed by the associated application."""
191
192
  return self.properties.get("appDisplayName", None)
192
193
 
193
194
  @property
@@ -209,12 +210,16 @@ class ServicePrincipal(DirectoryObject):
209
210
  """
210
211
  return self.properties.get("appRoles", AppRoleCollection())
211
212
 
213
+ @property
214
+ def display_name(self):
215
+ # type: () -> Optional[str]
216
+ """The display name."""
217
+ return self.properties.get("displayName", None)
218
+
212
219
  @property
213
220
  def homepage(self):
214
221
  # type: () -> Optional[str]
215
- """
216
- Home page or landing page of the application.
217
- """
222
+ """Home page or landing page of the application"""
218
223
  return self.properties.get("homepage", None)
219
224
 
220
225
  @property