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
@@ -133,17 +133,19 @@ class SearchService(Entity):
133
133
  "rankingModelId": ranking_model_id,
134
134
  "startRow": start_row,
135
135
  "rowsPerPage": rows_per_page,
136
- "selectProperties": str(StringCollection(select_properties)),
137
- "refinementFilters": str(StringCollection(refinement_filters)),
138
- "refiners": str(StringCollection(refiners)),
139
- "sortList": str(StringCollection([str(s) for s in sort_list]))
140
- if sort_list
141
- else None,
142
136
  "trimDuplicates": trim_duplicates,
143
137
  "rowLimit": row_limit,
144
138
  "enableQueryRules": enable_query_rules,
145
139
  "enableSorting": enable_sorting,
146
140
  }
141
+ if refinement_filters:
142
+ params["refinementFilters"] = str(StringCollection(refinement_filters))
143
+ if sort_list:
144
+ params["sortList"] = str(StringCollection([str(s) for s in sort_list]))
145
+ if select_properties:
146
+ params["selectProperties"] = str(StringCollection(select_properties))
147
+ if refiners:
148
+ params["refiners"] = str(StringCollection(refiners))
147
149
  params.update(**kwargs)
148
150
  return_type = ClientResult(
149
151
  self.context, SearchResult()
@@ -17,6 +17,7 @@ class SharingLinkInfo(ClientValue):
17
17
  last_modified_by=Principal(),
18
18
  password_last_modified_by=Principal(),
19
19
  track_link_users=None,
20
+ share_token_string=None,
20
21
  url=None,
21
22
  ):
22
23
  """
@@ -36,6 +37,7 @@ class SharingLinkInfo(ClientValue):
36
37
  This value MUST be null if the last modified by value is not recorded.
37
38
  :param Principal password_last_modified_by:
38
39
  :param bool track_link_users:
40
+ :param str share_token_string:
39
41
  """
40
42
  super(SharingLinkInfo, self).__init__()
41
43
  self.AllowsAnonymousAccess = allows_anonymous_access
@@ -48,13 +50,14 @@ class SharingLinkInfo(ClientValue):
48
50
  self.LastModifiedBy = last_modified_by
49
51
  self.PasswordLastModifiedBy = password_last_modified_by
50
52
  self.TrackLinkUsers = track_link_users
53
+ self.ShareTokenString = share_token_string
51
54
  self.Url = url
52
55
 
53
56
  def __str__(self):
54
- return self.Url
57
+ return self.Url or ""
55
58
 
56
59
  def __repr__(self):
57
- return self.Url or ""
60
+ return self.Url or self.entity_type_name
58
61
 
59
62
  @property
60
63
  def entity_type_name(self):
@@ -13,6 +13,9 @@ class ShareLinkResponse(ClientValue):
13
13
  """
14
14
  self.sharingLinkInfo = sharing_link_info
15
15
 
16
+ def __str__(self):
17
+ return self.sharingLinkInfo.Url
18
+
16
19
  @property
17
20
  def entity_type_name(self):
18
21
  return "SP.Sharing.ShareLinkResponse"
@@ -15,6 +15,7 @@ class ShareLinkSettings(ClientValue):
15
15
  role=None,
16
16
  track_link_users=None,
17
17
  share_id=None,
18
+ update_password=None,
18
19
  ):
19
20
  """
20
21
  :param bool allow_anonymous_access: Indicates if the tokenized sharing link supports anonymous access.
@@ -33,6 +34,7 @@ class ShareLinkSettings(ClientValue):
33
34
  :param bool track_link_users:
34
35
  :param str share_id: The optional unique identifier of an existing section tokenized sharing link to be
35
36
  retrieved and updated if necessary.
37
+ :param bool update_password:
36
38
  """
37
39
  self.allowAnonymousAccess = allow_anonymous_access
38
40
  self.applicationLink = application_link
@@ -43,6 +45,7 @@ class ShareLinkSettings(ClientValue):
43
45
  self.role = role
44
46
  self.shareId = share_id
45
47
  self.trackLinkUsers = track_link_users
48
+ self.updatePassword = update_password
46
49
 
47
50
  @property
48
51
  def entity_type_name(self):
@@ -1,3 +1,5 @@
1
+ from typing import TYPE_CHECKING
2
+
1
3
  from office365.runtime.client_result import ClientResult
2
4
  from office365.runtime.client_value_collection import ClientValueCollection
3
5
  from office365.runtime.paths.resource_path import ResourcePath
@@ -9,6 +11,11 @@ from office365.sharepoint.sharing.object_sharing_information_user import (
9
11
  ObjectSharingInformationUser,
10
12
  )
11
13
 
14
+ if TYPE_CHECKING:
15
+ from typing import Optional # noqa
16
+
17
+ from office365.sharepoint.client_context import ClientContext # noqa
18
+
12
19
 
13
20
  class ObjectSharingInformation(Entity):
14
21
  """Provides information about the sharing state of a securable object."""
@@ -123,26 +130,27 @@ class ObjectSharingInformation(Entity):
123
130
  check_for_access_requests=False,
124
131
  return_type=None,
125
132
  ):
133
+ # type: (ClientContext, str, int, Optional[bool], Optional[bool], Optional[bool], Optional[bool], Optional[bool], Optional[bool], Optional[ObjectSharingInformation]) -> ObjectSharingInformation
126
134
  """
127
135
  Retrieves information about the sharing state for a given list.
128
136
 
129
- :param bool check_for_access_requests: Specifies whether the returned sharing state information will contain a URL
137
+ :param check_for_access_requests: Specifies whether the returned sharing state information will contain a URL
130
138
  to a location which describes any access requests present in the site (2), if such a URL is available.
131
- :param bool retrieve_user_info_details: Specifies whether the returned sharing state information will contain
139
+ :param retrieve_user_info_details: Specifies whether the returned sharing state information will contain
132
140
  basic or detailed information about the users with permissions to the list item.
133
- :param bool retrieve_anonymous_links: Specifies whether the returned sharing state information will contain
141
+ :param retrieve_anonymous_links: Specifies whether the returned sharing state information will contain
134
142
  information about a URL that allows an anonymous user to access the list item.
135
- :param bool exclude_security_groups: Specifies whether the returned sharing state information will exclude
143
+ :param exclude_security_groups: Specifies whether the returned sharing state information will exclude
136
144
  information about security groups which have permissions to the list item.
137
- :param bool exclude_site_admin: Specifies whether the returned sharing state information will exclude
145
+ :param exclude_site_admin: Specifies whether the returned sharing state information will exclude
138
146
  information about users who are site collection administrators of the site collection which contains the list.
139
- :param bool exclude_current_user: Specifies whether the returned sharing state information will exclude
147
+ :param exclude_current_user: Specifies whether the returned sharing state information will exclude
140
148
  information about the user making the request.
141
- :param int item_id: The list item identifier for the list item for which the sharing state is requested.
142
- :param str list_id: The list identifier for the list which contains the list item for which
149
+ :param item_id: The list item identifier for the list item for which the sharing state is requested.
150
+ :param list_id: The list identifier for the list which contains the list item for which
143
151
  the sharing state is requested.
144
- :param office365.sharepoint.client_context.ClientContext context: SharePoint client context
145
- :param ObjectSharingInformation return_type: Return type
152
+ :param context: SharePoint client context
153
+ :param return_type: Return type
146
154
  """
147
155
  binding_type = ObjectSharingInformation(context)
148
156
  payload = {
@@ -171,65 +179,63 @@ class ObjectSharingInformation(Entity):
171
179
 
172
180
  @property
173
181
  def anonymous_edit_link(self):
182
+ # type: () -> Optional[str]
174
183
  """
175
184
  Provides the URL that allows an anonymous user to edit the securable object.
176
185
  If such a URL is not available, this property will provide an empty string.
177
-
178
- :rtype: str
179
186
  """
180
187
  return self.properties.get("AnonymousEditLink", None)
181
188
 
182
189
  @property
183
190
  def anonymous_view_link(self):
191
+ # type: () -> Optional[str]
184
192
  """
185
193
  Provides the URL that allows an anonymous user to view the securable object.
186
194
  If such a URL is not available, this property will provide an empty string.
187
-
188
- :rtype: str
189
195
  """
190
196
  return self.properties.get("AnonymousViewLink", None)
191
197
 
192
198
  @property
193
199
  def can_be_shared(self):
200
+ # type: () -> Optional[bool]
194
201
  """
195
202
  Indicates whether the current securable object can be shared.
196
- :rtype: bool
197
203
  """
198
204
  return self.properties.get("CanBeShared", None)
199
205
 
200
206
  @property
201
207
  def can_be_unshared(self):
208
+ # type: () -> Optional[bool]
202
209
  """
203
210
  Indicates whether the current securable object can be unshared.
204
- :rtype: bool
205
211
  """
206
212
  return self.properties.get("CanBeUnshared", None)
207
213
 
208
214
  @property
209
215
  def can_manage_permissions(self):
216
+ # type: () -> Optional[bool]
210
217
  """
211
218
  Specifies whether the current user is allowed to change the permissions of the securable object.
212
- :rtype: bool
213
219
  """
214
220
  return self.properties.get("CanManagePermissions", None)
215
221
 
216
222
  @property
217
223
  def has_pending_access_requests(self):
224
+ # type: () -> Optional[bool]
218
225
  """
219
226
  Provides information about whether there are any pending access requests for the securable object.
220
227
 
221
228
  This information is only provided if the current user has sufficient permissions to view any pending
222
229
  access requests. If the current user does not have such permissions, this property will return false.
223
- :rtype: bool
224
230
  """
225
231
  return self.properties.get("HasPendingAccessRequests", None)
226
232
 
227
233
  @property
228
234
  def has_permission_levels(self):
235
+ # type: () -> Optional[bool]
229
236
  """
230
237
  Indicates whether the object sharing information contains permissions information in addition to the identities
231
238
  of the users who have access to the securable object.
232
- :rtype: bool
233
239
  """
234
240
  return self.properties.get("HasPermissionLevels", None)
235
241
 
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.runtime.paths.resource_path import ResourcePath
2
4
  from office365.sharepoint.entity import Entity
3
5
  from office365.sharepoint.principal.principal import Principal
@@ -9,42 +11,31 @@ class ObjectSharingInformationUser(Entity):
9
11
 
10
12
  @property
11
13
  def email(self):
12
- """
13
- Specifies the email address for the user.
14
-
15
- :rtype: str or None
16
- """
14
+ # type: () -> Optional[str]
15
+ """Specifies the email address for the user."""
17
16
  return self.properties.get("Email", None)
18
17
 
19
18
  @property
20
19
  def sip_address(self):
21
- """
22
- Specifies the SIP address of the user.
23
-
24
- :rtype: str or None
25
- """
20
+ # type: () -> Optional[str]
21
+ """Specifies the SIP address of the user."""
26
22
  return self.properties.get("SipAddress", None)
27
23
 
28
24
  @property
29
25
  def login_name(self):
30
- """
31
- Specifies the login name for the principal.
32
- """
26
+ # type: () -> Optional[str]
27
+ """Specifies the login name for the principal."""
33
28
  return self.properties.get("LoginName", None)
34
29
 
35
30
  def principal(self):
36
- """
37
- The principal with whom a securable object is shared. It is either a user or a group.
38
- """
31
+ """The principal with whom a securable object is shared. It is either a user or a group."""
39
32
  return self.properties.get(
40
33
  "Principal",
41
34
  Principal(self.context, ResourcePath("Principal", self.resource_path)),
42
35
  )
43
36
 
44
37
  def user(self):
45
- """
46
- Specifies the user with whom a securable object is shared.
47
- """
38
+ """Specifies the user with whom a securable object is shared."""
48
39
  return self.properties.get(
49
40
  "User", User(self.context, ResourcePath("User", self.resource_path))
50
41
  )
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.runtime.client_value_collection import ClientValueCollection
2
4
  from office365.runtime.paths.resource_path import ResourcePath
3
5
  from office365.sharepoint.entity import Entity
@@ -13,63 +15,48 @@ class SharingResult(Entity):
13
15
 
14
16
  @property
15
17
  def url(self):
16
- """Gets the URL of the securable object being shared.
17
-
18
- :rtype: str or None
19
- """
18
+ # type: () -> Optional[str]
19
+ """Gets the URL of the securable object being shared."""
20
20
  return self.properties.get("Url", None)
21
21
 
22
22
  @property
23
23
  def error_message(self):
24
- """Gets an error message about the failure if sharing was unsuccessful.
25
-
26
- :rtype: str or None
27
- """
24
+ # type: () -> Optional[str]
25
+ """Gets an error message about the failure if sharing was unsuccessful."""
28
26
  return self.properties.get("ErrorMessage", None)
29
27
 
30
28
  @property
31
29
  def name(self):
32
- """
33
- Gets the name of the securable object being shared.
34
-
35
- :rtype: str or None
36
- """
30
+ # type: () -> Optional[str]
31
+ """Gets the name of the securable object being shared."""
37
32
  return self.properties.get("Name", None)
38
33
 
39
34
  @property
40
35
  def icon_url(self):
41
- """
42
- Gets a URL to an icon that represents the securable object, if one exists.
43
-
44
- :rtype: str or None
45
- """
36
+ # type: () -> Optional[str]
37
+ """Gets a URL to an icon that represents the securable object, if one exists."""
46
38
  return self.properties.get("IconUrl", None)
47
39
 
48
40
  @property
49
41
  def status_code(self):
42
+ # type: () -> Optional[int]
50
43
  """
51
44
  Gets the enumeration value which summarizes the result of the sharing operation.
52
-
53
- :rtype: int or None
54
45
  """
55
46
  return self.properties.get("StatusCode", None)
56
47
 
57
48
  @property
58
49
  def permissions_page_relative_url(self):
59
- """
60
- Gets the relative URL of the page that shows permissions.
61
-
62
- :rtype: str or None
63
- """
50
+ # type: () -> Optional[str]
51
+ """Gets the relative URL of the page that shows permissions."""
64
52
  return self.properties.get("PermissionsPageRelativeUrl", None)
65
53
 
66
54
  @property
67
55
  def invited_users(self):
56
+ # type: () -> ClientValueCollection[SPInvitationCreationResult]
68
57
  """
69
58
  Gets a list of SPInvitationCreationResult (section 3.2.5.325) objects representing the external users being
70
59
  invited to have access.
71
-
72
- :rtype: ClientValueCollection
73
60
  """
74
61
  return self.properties.get(
75
62
  "InvitedUsers", ClientValueCollection(SPInvitationCreationResult)
@@ -77,20 +64,13 @@ class SharingResult(Entity):
77
64
 
78
65
  @property
79
66
  def uniquely_permissioned_users(self):
80
- """
81
-
82
- :rtype: ClientValueCollection
83
- """
67
+ # type: () -> ClientValueCollection[UserSharingResult]
84
68
  return self.properties.get(
85
69
  "UniquelyPermissionedUsers", ClientValueCollection(UserSharingResult)
86
70
  )
87
71
 
88
72
  @property
89
73
  def groups_shared_with(self):
90
- """
91
-
92
- :rtype: ClientValueCollection
93
- """
94
74
  return self.properties.get(
95
75
  "GroupsSharedWith",
96
76
  GroupCollection(
@@ -100,11 +80,8 @@ class SharingResult(Entity):
100
80
 
101
81
  @property
102
82
  def users_added_to_group(self):
103
- """
104
- Gets the list of users being added to the SharePoint permissions group.
105
-
106
- :rtype: ClientValueCollection
107
- """
83
+ # type: () -> ClientValueCollection[UserSharingResult]
84
+ """Gets the list of users being added to the SharePoint permissions group."""
108
85
  return self.properties.get(
109
86
  "UsersAddedToGroup", ClientValueCollection(UserSharingResult)
110
87
  )
@@ -124,5 +101,5 @@ class SharingResult(Entity):
124
101
  if self._resource_path is None:
125
102
  if name == "Name":
126
103
  pass
127
- # self._resource_path = ResourcePath(value, self._parent_collection.resource_path)
104
+ # self._resource_path = ResourcePath(value, self.parent_collection.resource_path)
128
105
  return self
@@ -0,0 +1,20 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class Role(ClientValue):
5
+ """
6
+ Specifies a set of abstract roles that a user can be assigned to share a securable object in a document library
7
+ """
8
+
9
+ View = 1
10
+ """The user can only read a securable object."""
11
+
12
+ Edit = 2
13
+ """The user can edit or read a securable object, but cannot delete it."""
14
+
15
+ Owner = 3
16
+ """The user is an owner of a securable object and can manage permissions, and edit, read or delete the object."""
17
+
18
+ @property
19
+ def entity_type_name(self):
20
+ return "SP.Sharing.Role"
@@ -55,6 +55,7 @@ class RoleType:
55
55
  the following: ViewPages, ViewListItems and ViewItemsRequiresOpen."""
56
56
 
57
57
  RestrictedReader = 8
58
+ """"""
58
59
 
59
60
  System = 255
60
61
  """For SharePoint internal use only. System roles can not be deleted, nor modified."""
@@ -1,5 +1,7 @@
1
1
  from office365.runtime.client_value import ClientValue
2
2
  from office365.runtime.client_value_collection import ClientValueCollection
3
+ from office365.runtime.odata.type import ODataType
4
+ from office365.sharepoint.sharing.role import Role
3
5
 
4
6
 
5
7
  class UserSharingResult(ClientValue):
@@ -42,6 +44,16 @@ class UserSharingResult(ClientValue):
42
44
  self.Status = status
43
45
  self.User = user
44
46
 
47
+ @property
48
+ def current_role_name(self):
49
+ return ODataType.resolve_enum_key(Role, self.CurrentRole)
50
+
45
51
  @property
46
52
  def entity_type_name(self):
47
53
  return "SP.Sharing"
54
+
55
+ def __str__(self):
56
+ return "{0}: {1}".format(self.User, self.current_role_name)
57
+
58
+ def __repr__(self):
59
+ return "{0}: {1}".format(self.User, self.current_role_name)
@@ -13,3 +13,9 @@ class Language(ClientValue):
13
13
  self.DisplayName = display_name
14
14
  self.LanguageTag = language_tag
15
15
  self.Lcid = lcid
16
+
17
+ def __str__(self):
18
+ return self.DisplayName
19
+
20
+ def __repr__(self):
21
+ return "{0}: {1}".format(self.DisplayName, self.LanguageTag)
@@ -15,6 +15,9 @@ class LanguageCollection(Entity):
15
15
  def items(self):
16
16
  return self.properties.get("Items", ClientValueCollection(Language))
17
17
 
18
+ def __len__(self):
19
+ return len(self.items)
20
+
18
21
  def __repr__(self):
19
22
  return repr(self.items)
20
23