Office365-REST-Python-Client 2.6.0__py3-none-any.whl → 2.6.2__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 (234) hide show
  1. {Office365_REST_Python_Client-2.6.0.dist-info → Office365_REST_Python_Client-2.6.2.dist-info}/METADATA +20 -29
  2. {Office365_REST_Python_Client-2.6.0.dist-info → Office365_REST_Python_Client-2.6.2.dist-info}/RECORD +233 -156
  3. office365/admin/people_settings.py +16 -0
  4. office365/admin/sharepoint_settings.py +50 -1
  5. office365/admin/sharing_capabilities.py +2 -0
  6. office365/communications/calls/participant.py +6 -0
  7. office365/communications/onlinemeetings/broadcast_settings.py +5 -0
  8. office365/communications/onlinemeetings/collection.py +29 -0
  9. office365/communications/onlinemeetings/online_meeting.py +1 -1
  10. office365/communications/onlinemeetings/recordings/call.py +5 -0
  11. office365/communications/onlinemeetings/restricted.py +5 -0
  12. office365/directory/applications/collection.py +11 -0
  13. office365/directory/audit/directory.py +31 -0
  14. office365/directory/audit/signins/signin.py +14 -0
  15. office365/directory/audit/target_resource.py +5 -0
  16. office365/directory/authentication/conditions/conditions.py +5 -1
  17. office365/directory/datapolicy/operation.py +39 -0
  18. office365/directory/directory.py +13 -0
  19. office365/directory/identitygovernance/accessreview/instance.py +29 -0
  20. office365/directory/identitygovernance/accessreview/stage.py +13 -0
  21. office365/directory/identitygovernance/accessreview/stages.py +11 -0
  22. office365/directory/identitygovernance/appconsent/request.py +9 -0
  23. office365/directory/identitygovernance/privilegedaccess/group.py +1 -1
  24. office365/directory/identitygovernance/privilegedaccess/schedule/__init__.py +0 -0
  25. office365/directory/identitygovernance/privilegedaccess/{group_assignment_schedule_instance.py → schedule/group_assignment_instance.py} +1 -1
  26. office365/directory/identitygovernance/privilegedaccess/schedule/schedule.py +6 -0
  27. office365/directory/insights/trending.py +25 -0
  28. office365/directory/licenses/assignment_state.py +5 -5
  29. office365/directory/licenses/details.py +6 -0
  30. office365/directory/permissions/scoped_role_membership.py +8 -0
  31. office365/directory/policies/applied_conditional_access.py +31 -0
  32. office365/directory/policies/feature_rollout.py +24 -0
  33. office365/directory/protection/information.py +73 -2
  34. office365/directory/protection/riskyusers/collection.py +1 -1
  35. office365/directory/protection/threatassessment/requests/__init__.py +0 -0
  36. office365/directory/protection/threatassessment/{email_file_request.py → requests/email_file.py} +9 -1
  37. office365/directory/protection/threatassessment/requests/file.py +10 -0
  38. office365/directory/protection/threatassessment/{mail_request.py → requests/mail.py} +1 -1
  39. office365/directory/protection/threatassessment/requests/url.py +9 -0
  40. office365/directory/rolemanagement/app_scope.py +14 -0
  41. office365/directory/rolemanagement/application.py +3 -2
  42. office365/directory/rolemanagement/role.py +15 -0
  43. office365/directory/rolemanagement/unifiedrole/__init__.py +0 -0
  44. office365/directory/rolemanagement/{unified_role_assignment.py → unifiedrole/assignment.py} +37 -1
  45. office365/directory/rolemanagement/{unified_role_definition.py → unifiedrole/definition.py} +6 -1
  46. office365/directory/security/alerts/file_security_state.py +5 -0
  47. office365/directory/security/attacksimulations/automation.py +8 -0
  48. office365/directory/security/attacksimulations/automation_run.py +8 -0
  49. office365/directory/security/attacksimulations/repeat_offender.py +7 -0
  50. office365/directory/security/attacksimulations/report.py +2 -2
  51. office365/directory/security/attacksimulations/user.py +5 -0
  52. office365/directory/security/incidents/incident.py +6 -1
  53. office365/directory/security/security.py +5 -0
  54. office365/directory/subscriptions/__init__.py +0 -0
  55. office365/directory/subscriptions/company.py +7 -0
  56. office365/directory/synchronization/progress.py +12 -0
  57. office365/directory/users/activities/activity.py +10 -1
  58. office365/directory/users/settings.py +51 -1
  59. office365/directory/users/storage.py +5 -0
  60. office365/directory/users/user.py +114 -3
  61. office365/entity_collection.py +21 -0
  62. office365/onedrive/contenttypes/collection.py +2 -0
  63. office365/onedrive/driveitems/driveItem.py +3 -2
  64. office365/onedrive/driveitems/publication_facet.py +6 -1
  65. office365/onedrive/filestorage/container.py +22 -0
  66. office365/onedrive/filestorage/container_collection.py +37 -0
  67. office365/onedrive/filestorage/file_storage.py +4 -4
  68. office365/onedrive/listitems/collection.py +38 -0
  69. office365/onedrive/lists/list.py +3 -5
  70. office365/onedrive/sitepages/base.py +8 -0
  71. office365/onedrive/sitepages/collection.py +8 -2
  72. office365/onedrive/sitepages/site_page.py +13 -2
  73. office365/onedrive/sites/site.py +1 -1
  74. office365/onedrive/workbooks/charts/title.py +12 -0
  75. office365/onedrive/workbooks/charts/title_format.py +5 -0
  76. office365/onedrive/workbooks/functions/functions.py +16 -0
  77. office365/onedrive/workbooks/ranges/border.py +30 -0
  78. office365/onedrive/workbooks/ranges/font.py +39 -0
  79. office365/onedrive/workbooks/ranges/range.py +6 -0
  80. office365/onedrive/workbooks/worksheets/protection_options.py +34 -5
  81. office365/outlook/calendar/events/event.py +57 -0
  82. office365/outlook/mail/automatic_replies_mailtips.py +20 -0
  83. office365/outlook/mail/folders/folder.py +3 -4
  84. office365/outlook/mail/messages/message.py +21 -4
  85. office365/outlook/mail/messages/rules/collection.py +26 -0
  86. office365/outlook/mail/tips/__init__.py +0 -0
  87. office365/outlook/mail/tips/error.py +5 -0
  88. office365/outlook/mail/tips/tips.py +41 -0
  89. office365/outlook/people/__init__.py +0 -0
  90. office365/outlook/people/profile_card_property.py +15 -0
  91. office365/outlook/person.py +7 -0
  92. office365/planner/category_descriptions.py +6 -0
  93. office365/planner/external_references.py +7 -0
  94. office365/planner/planner.py +4 -4
  95. office365/planner/plans/container.py +12 -0
  96. office365/planner/plans/details.py +31 -0
  97. office365/planner/tasks/collection.py +37 -0
  98. office365/planner/tasks/task.py +24 -0
  99. office365/planner/tasks/task_details.py +34 -1
  100. office365/planner/user_ids.py +8 -0
  101. office365/reports/internal/queries/create_report_query.py +12 -3
  102. office365/reports/root.py +61 -2
  103. office365/runtime/auth/authentication_context.py +10 -1
  104. office365/runtime/auth/providers/saml_token_provider.py +5 -13
  105. office365/runtime/auth/sts_profile.py +35 -18
  106. office365/runtime/client_object.py +1 -1
  107. office365/runtime/client_object_collection.py +3 -5
  108. office365/runtime/client_result.py +3 -3
  109. office365/runtime/client_runtime_context.py +2 -2
  110. office365/runtime/odata/json_format.py +14 -3
  111. office365/runtime/odata/request.py +1 -3
  112. office365/runtime/odata/v3/json_light_format.py +18 -0
  113. office365/runtime/odata/v4/json_format.py +19 -0
  114. office365/runtime/queries/client_query.py +13 -8
  115. office365/runtime/queries/create_entity.py +7 -5
  116. office365/runtime/queries/delete_entity.py +6 -2
  117. office365/runtime/queries/function.py +3 -4
  118. office365/runtime/queries/read_entity.py +3 -5
  119. office365/runtime/queries/service_operation.py +2 -7
  120. office365/search/acronyms/__init__.py +0 -0
  121. office365/search/answer.py +35 -0
  122. office365/search/bookmarks/__init__.py +0 -0
  123. office365/search/bookmarks/bookmark.py +7 -0
  124. office365/search/entity.py +81 -2
  125. office365/search/entity_type.py +6 -1
  126. office365/search/external/item.py +5 -0
  127. office365/search/identity_set.py +11 -0
  128. office365/search/qnas/__init__.py +0 -0
  129. office365/search/qnas/qna.py +9 -0
  130. office365/sharepoint/activities/client_response.py +2 -2
  131. office365/sharepoint/apps/launcher.py +9 -0
  132. office365/sharepoint/brandcenter/brand_center.py +26 -0
  133. office365/sharepoint/client_context.py +19 -1
  134. office365/sharepoint/compliance/preserve_document_submitter.py +5 -0
  135. office365/sharepoint/compliance/store_proxy.py +75 -0
  136. office365/sharepoint/convergence/migration_complete_state_api.py +9 -0
  137. office365/sharepoint/copilot/file_metadata.py +5 -0
  138. office365/sharepoint/fields/builtin_field_id.py +8 -0
  139. office365/sharepoint/files/collection.py +10 -0
  140. office365/sharepoint/files/file.py +24 -3
  141. office365/sharepoint/listitems/listitem.py +61 -3
  142. office365/sharepoint/lists/exporter.py +1 -0
  143. office365/sharepoint/lists/list.py +37 -3
  144. office365/sharepoint/migrationcenter/common/results/batch_creation.py +24 -0
  145. office365/sharepoint/migrationcenter/common/task.py +8 -0
  146. office365/sharepoint/migrationcenter/common/task_definition.py +7 -1
  147. office365/sharepoint/migrationcenter/common/teams/__init__.py +0 -0
  148. office365/sharepoint/migrationcenter/common/teams/channel_resource.py +5 -0
  149. office365/sharepoint/migrationcenter/common/teams/team_resource.py +5 -0
  150. office365/sharepoint/migrationcenter/common/url_parser.py +39 -0
  151. office365/sharepoint/migrationcenter/service/services.py +13 -1
  152. office365/sharepoint/migrationcenter/service/teams.py +11 -0
  153. office365/sharepoint/navigation/node.py +7 -16
  154. office365/sharepoint/policy/license_utilities.py +1 -0
  155. office365/sharepoint/portal/groups/creation_context.py +11 -0
  156. office365/sharepoint/portal/groups/service.py +1 -1
  157. office365/sharepoint/portal/groups/site_manager.py +1 -1
  158. office365/sharepoint/publishing/pages/3d/__init__.py +0 -0
  159. office365/sharepoint/publishing/pages/3d/types.py +5 -0
  160. office365/sharepoint/publishing/pages/campaign/__init__.py +0 -0
  161. office365/sharepoint/publishing/pages/{campaign_publication.py → campaign/publication.py} +2 -0
  162. office365/sharepoint/publishing/pages/campaign/types.py +18 -0
  163. office365/sharepoint/publishing/pages/coauth_state.py +20 -0
  164. office365/sharepoint/publishing/pages/dependency_metadata.py +9 -0
  165. office365/sharepoint/publishing/pages/metadata.py +0 -10
  166. office365/sharepoint/publishing/pages/page.py +29 -0
  167. office365/sharepoint/publishing/pages/service.py +27 -6
  168. office365/sharepoint/publishing/pages/topics/collection.py +1 -1
  169. office365/sharepoint/request.py +6 -2
  170. office365/sharepoint/search/administration/tenant_crawl_versions_info_provider.py +16 -0
  171. office365/sharepoint/sharing/access_request_settings.py +18 -0
  172. office365/sharepoint/sharing/address_bar_link_settings.py +5 -0
  173. office365/sharepoint/sharing/information.py +2 -0
  174. office365/sharepoint/sharing/links/partial_success_response.py +4 -0
  175. office365/sharepoint/sites/azure_container_Info.py +4 -1
  176. office365/sharepoint/sites/brand_center_configuration.py +5 -0
  177. office365/sharepoint/sites/manager/__init__.py +0 -0
  178. office365/sharepoint/sites/manager/service.py +34 -0
  179. office365/sharepoint/sites/manager/types.py +5 -0
  180. office365/sharepoint/sites/site.py +54 -0
  181. office365/sharepoint/sites/themes.py +5 -0
  182. office365/sharepoint/storagemetrics/storage_metrics.py +18 -0
  183. office365/sharepoint/tenant/administration/copilot/agentinsights/__init__.py +0 -0
  184. office365/sharepoint/tenant/administration/copilot/agentinsights/client.py +42 -0
  185. office365/sharepoint/tenant/administration/copilot/agentinsights/report_metadata.py +5 -0
  186. office365/sharepoint/tenant/administration/group.py +34 -0
  187. office365/sharepoint/tenant/administration/policies/file_version_types.py +17 -0
  188. office365/sharepoint/tenant/administration/policies/list_parameters.py +9 -0
  189. office365/sharepoint/tenant/administration/policies/resource_storage.py +9 -0
  190. office365/sharepoint/tenant/administration/sites/properties_enumerable_filter.py +6 -0
  191. office365/sharepoint/tenant/administration/tenant.py +182 -5
  192. office365/sharepoint/userprofiles/people_manager.py +3 -1
  193. office365/sharepoint/utilities/utility.py +16 -0
  194. office365/sharepoint/webparts/definition.py +26 -0
  195. office365/sharepoint/webparts/limited_manager.py +53 -0
  196. office365/sharepoint/webparts/webpart.py +47 -0
  197. office365/sharepoint/webs/regional_settings.py +27 -0
  198. office365/sharepoint/webs/web.py +20 -1
  199. office365/teams/apps/app.py +17 -0
  200. office365/teams/apps/authorization.py +16 -0
  201. office365/teams/apps/permission_set.py +14 -0
  202. office365/teams/apps/resource_specific_permission.py +5 -0
  203. office365/teams/chats/chat.py +60 -0
  204. office365/teams/chats/messages/message.py +17 -0
  205. office365/teams/chats/type.py +13 -0
  206. office365/teams/chats/viewpoint.py +5 -0
  207. office365/teams/fun_settings.py +14 -2
  208. office365/teams/info.py +1 -1
  209. office365/teams/schedule/entity.py +3 -0
  210. office365/teams/schedule/shifts/item.py +1 -0
  211. office365/teams/schedule/shifts/offer/request.py +41 -1
  212. office365/teams/teamwork/activity_topic.py +5 -0
  213. office365/teams/teamwork/online_meeting_info.py +21 -0
  214. office365/teams/teamwork/shiftmanagement/__init__.py +0 -0
  215. office365/teams/teamwork/shiftmanagement/user_solution_root.py +5 -0
  216. office365/teams/teamwork/user.py +48 -1
  217. office365/teams/teamwork/user_identity.py +5 -0
  218. office365/teams/viva/community.py +13 -0
  219. office365/teams/viva/employee_experience.py +27 -0
  220. office365/teams/viva/employee_experience_user.py +16 -0
  221. office365/teams/viva/learning/courses/self_initiated.py +5 -0
  222. office365/todo/attachments/task_file.py +3 -0
  223. office365/todo/checklist_item.py +11 -0
  224. office365/todo/tasks/list.py +11 -0
  225. office365/todo/tasks/task.py +31 -0
  226. office365/outlook/mail/tips.py +0 -17
  227. {Office365_REST_Python_Client-2.6.0.dist-info → Office365_REST_Python_Client-2.6.2.dist-info}/LICENSE +0 -0
  228. {Office365_REST_Python_Client-2.6.0.dist-info → Office365_REST_Python_Client-2.6.2.dist-info}/WHEEL +0 -0
  229. {Office365_REST_Python_Client-2.6.0.dist-info → Office365_REST_Python_Client-2.6.2.dist-info}/top_level.txt +0 -0
  230. /office365/directory/identitygovernance/privilegedaccess/{schedule_instance.py → schedule/instance.py} +0 -0
  231. /office365/directory/protection/threatassessment/{request.py → requests/request.py} +0 -0
  232. /office365/directory/rolemanagement/{unified_role_permission.py → unifiedrole/permission.py} +0 -0
  233. /office365/search/{acronym.py → acronyms/acronym.py} +0 -0
  234. /office365/sharepoint/publishing/pages/{page_3d.py → 3d/page.py} +0 -0
@@ -7,9 +7,11 @@ from office365.runtime.client_value_collection import ClientValueCollection
7
7
  from office365.runtime.paths.resource_path import ResourcePath
8
8
  from office365.runtime.paths.v4.entity import EntityPath
9
9
  from office365.runtime.queries.service_operation import ServiceOperationQuery
10
- from office365.search.acronym import Acronym
10
+ from office365.search.acronyms.acronym import Acronym
11
+ from office365.search.bookmarks.bookmark import Bookmark
11
12
  from office365.search.entity_type import EntityType
12
13
  from office365.search.hit import SearchHit
14
+ from office365.search.qnas.qna import Qna
13
15
  from office365.search.query import SearchQuery
14
16
  from office365.search.request import SearchRequest
15
17
  from office365.search.response import SearchResponse
@@ -28,8 +30,9 @@ class SearchEntity(Entity):
28
30
  page_from=None,
29
31
  size=None,
30
32
  enable_top_results=None,
33
+ region=None,
31
34
  ):
32
- # type: (str, Optional[List[str]], Optional[int], Optional[int], Optional[bool]) -> ClientResult[ClientValueCollection[SearchResponse]]
35
+ # type: (str, Optional[List[str]], Optional[int], Optional[int], Optional[bool], Optional[str]) -> ClientResult[ClientValueCollection[SearchResponse]]
33
36
  """
34
37
  Runs the query specified in the request body. Search results are provided in the response.
35
38
 
@@ -39,6 +42,8 @@ class SearchEntity(Entity):
39
42
  :param int page_from: Specifies the offset for the search results. Offset 0 returns the very first result.
40
43
  :param int size: The size of the page to be retrieved. The maximum value is 500. Optional.
41
44
  :param bool enable_top_results: This triggers hybrid sort for messages
45
+ :param str region: The geographic location for the search. Required for searches that use application
46
+ permissions. For details, see Get the region value.
42
47
  """
43
48
  search_request = SearchRequest(
44
49
  query=SearchQuery(query_string),
@@ -46,6 +51,7 @@ class SearchEntity(Entity):
46
51
  page_from=page_from,
47
52
  size=size,
48
53
  enable_top_results=enable_top_results,
54
+ region=region,
49
55
  )
50
56
 
51
57
  def _patch_hit(search_hit):
@@ -106,6 +112,54 @@ class SearchEntity(Entity):
106
112
  size=size,
107
113
  )
108
114
 
115
+ def query_list_items(self, query_string, page_from=None, size=None, region=None):
116
+ """Searches list items. Alias to query method
117
+
118
+ :param str query_string: Contains the query terms.
119
+ :param int page_from: Specifies the offset for the search results. Offset 0 returns the very first result.
120
+ :param int size: The size of the page to be retrieved. The maximum value is 500.
121
+ :param str region: The geographic location for the search. Required for searches that use application
122
+ """
123
+ return self.query(
124
+ query_string,
125
+ entity_types=[EntityType.listItem],
126
+ page_from=page_from,
127
+ size=size,
128
+ region=region,
129
+ )
130
+
131
+ def query_peoples(self, query_string, page_from=None, size=None, region=None):
132
+ """Searches peoples. Alias to query method
133
+
134
+ :param str query_string: Contains the query terms.
135
+ :param int page_from: Specifies the offset for the search results. Offset 0 returns the very first result.
136
+ :param int size: The size of the page to be retrieved. The maximum value is 500.
137
+ :param str region: The geographic location for the search. Required for searches that use application
138
+ """
139
+ return self.query(
140
+ query_string,
141
+ entity_types=[EntityType.person],
142
+ page_from=page_from,
143
+ size=size,
144
+ region=region,
145
+ )
146
+
147
+ def query_sites(self, query_string, page_from=None, size=None, region=None):
148
+ """Searches sites. Alias to query method
149
+
150
+ :param str query_string: Contains the query terms.
151
+ :param int page_from: Specifies the offset for the search results. Offset 0 returns the very first result.
152
+ :param int size: The size of the page to be retrieved. The maximum value is 500.
153
+ :param str region: The geographic location for the search. Required for searches that use application
154
+ """
155
+ return self.query(
156
+ query_string,
157
+ entity_types=[EntityType.site],
158
+ page_from=page_from,
159
+ size=size,
160
+ region=region,
161
+ )
162
+
109
163
  @property
110
164
  def acronyms(self):
111
165
  """Administrative answer in Microsoft Search results to define common acronyms in an organization."""
@@ -117,3 +171,28 @@ class SearchEntity(Entity):
117
171
  ResourcePath("acronyms", self.resource_path),
118
172
  ),
119
173
  )
174
+
175
+ @property
176
+ def bookmarks(self):
177
+ """Administrative answer in Microsoft Search results for common search queries in an organization."""
178
+ return self.properties.get(
179
+ "bookmarks",
180
+ EntityCollection(
181
+ self.context,
182
+ Bookmark,
183
+ ResourcePath("bookmarks", self.resource_path),
184
+ ),
185
+ )
186
+
187
+ @property
188
+ def qnas(self):
189
+ """Administrative answer in Microsoft Search results that provide answers for specific search keywords in
190
+ an organization."""
191
+ return self.properties.get(
192
+ "qnas",
193
+ EntityCollection(
194
+ self.context,
195
+ Qna,
196
+ ResourcePath("qnas", self.resource_path),
197
+ ),
198
+ )
@@ -7,6 +7,8 @@ from office365.onedrive.lists.list import List
7
7
  from office365.onedrive.sites.site import Site
8
8
  from office365.outlook.calendar.events.event import Event
9
9
  from office365.outlook.mail.messages.message import Message
10
+ from office365.outlook.person import Person
11
+ from office365.search.external.item import ExternalItem
10
12
 
11
13
 
12
14
  class EntityType:
@@ -20,7 +22,8 @@ class EntityType:
20
22
  "message": Message,
21
23
  "drive": Drive,
22
24
  "driveItem": DriveItem,
23
- # "externalItem": ExternalItem
25
+ "externalItem": ExternalItem,
26
+ "person": Person,
24
27
  }
25
28
 
26
29
  def __init__(self):
@@ -47,3 +50,5 @@ class EntityType:
47
50
  driveItem = "driveItem"
48
51
 
49
52
  externalItem = "externalItem"
53
+
54
+ person = "person"
@@ -0,0 +1,5 @@
1
+ from office365.entity import Entity
2
+
3
+
4
+ class ExternalItem(Entity):
5
+ """An item added to a Microsoft Graph connection."""
@@ -0,0 +1,11 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class IdentitySet(ClientValue):
5
+ """Represents a keyed collection of identity resources. It is used to represent a set of
6
+ identities associated with various events for an item, such as created by or last modified by.
7
+ """
8
+
9
+ @property
10
+ def entity_type_name(self):
11
+ return "microsoft.graph.search.identitySet"
File without changes
@@ -0,0 +1,9 @@
1
+ from office365.search.answer import SearchAnswer
2
+
3
+
4
+ class Qna(SearchAnswer):
5
+ """Represents a question and answer (Q&A) in Microsoft Search. Q&As are administrative answer results in the
6
+ search results page that provide answers for specific search keywords. Q&As allow administrators
7
+ to answer the user's questions directly in search instead of providing a link to a webpage.
8
+ A Q&A has many properties that allow administrators to make common resources more accessible in their organization.
9
+ """
@@ -4,12 +4,12 @@ from office365.runtime.client_value import ClientValue
4
4
  class ActivityClientResponse(ClientValue):
5
5
  """"""
6
6
 
7
- def __init__(self, id_, message=None, serverId=None, status=None):
7
+ def __init__(self, id_, message=None, server_id=None, status=None):
8
8
  # type: (str, str, str, int) -> None
9
9
  """ """
10
10
  self.id = id_
11
11
  self.message = message
12
- self.serverId = serverId
12
+ self.serverId = server_id
13
13
  self.status = status
14
14
 
15
15
  @property
@@ -0,0 +1,9 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class AppLauncher(Entity):
5
+ """"""
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.Online.SharePoint.AppLauncher.AppLauncher"
@@ -1,4 +1,9 @@
1
+ from office365.runtime.client_result import ClientResult
2
+ from office365.runtime.paths.resource_path import ResourcePath
3
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
4
+ from office365.sharepoint.brandcenter.configuration import BrandCenterConfiguration
1
5
  from office365.sharepoint.entity import Entity
6
+ from office365.sharepoint.sites.themes import SiteThemes
2
7
 
3
8
 
4
9
  class BrandCenter(Entity):
@@ -7,3 +12,24 @@ class BrandCenter(Entity):
7
12
  that empowers your brand managers or designated brand owners to help your organization to customize
8
13
  the look and feel of their experiences.
9
14
  """
15
+
16
+ def __init__(self, context):
17
+ super(BrandCenter, self).__init__(context, ResourcePath("SP.BrandCenter"))
18
+
19
+ def configuration(self):
20
+ """ """
21
+ return_type = ClientResult(self.context, BrandCenterConfiguration())
22
+ qry = ServiceOperationQuery(
23
+ self, "Configuration", None, None, None, return_type
24
+ )
25
+ self.context.add_query(qry)
26
+ return return_type
27
+
28
+ def get_site_themes(self):
29
+ """ """
30
+ return_type = ClientResult(self.context, SiteThemes())
31
+ qry = ServiceOperationQuery(
32
+ self, "GetSiteThemes", None, None, None, return_type
33
+ )
34
+ self.context.add_query(qry)
35
+ return return_type
@@ -405,7 +405,7 @@ class ClientContext(ClientRuntimeContext):
405
405
 
406
406
  from office365.sharepoint.brandcenter.brand_center import BrandCenter
407
407
 
408
- return BrandCenter(self, ResourcePath("BrandCenter"))
408
+ return BrandCenter(self)
409
409
 
410
410
  @property
411
411
  def client_people_picker(self):
@@ -417,6 +417,16 @@ class ClientContext(ClientRuntimeContext):
417
417
 
418
418
  return ClientPeoplePickerWebServiceInterface(self)
419
419
 
420
+ @property
421
+ def component_context_info(self):
422
+ """ComponentContextInfo alias"""
423
+
424
+ from office365.sharepoint.clientsidecomponent.component_context_info import (
425
+ ComponentContextInfo,
426
+ )
427
+
428
+ return ComponentContextInfo(self, ResourcePath("ComponentContextInfo"))
429
+
420
430
  @property
421
431
  def consumer_permissions(self):
422
432
  """Consumer permissions alias"""
@@ -631,6 +641,14 @@ class ClientContext(ClientRuntimeContext):
631
641
 
632
642
  return SPSiteManager(self, ResourcePath("spSiteManager"))
633
643
 
644
+ @property
645
+ def site_manager_svc(self):
646
+ """Alias to SiteManagerService."""
647
+
648
+ from office365.sharepoint.sites.manager.service import SiteManagerService
649
+
650
+ return SiteManagerService(self)
651
+
634
652
  @property
635
653
  def social_feed_manager(self):
636
654
  """Alias to SocialFeedManager."""
@@ -0,0 +1,5 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class PreserveDocumentSubmitter(Entity):
5
+ """ """
@@ -12,6 +12,8 @@ if TYPE_CHECKING:
12
12
 
13
13
 
14
14
  class SPPolicyStoreProxy(Entity):
15
+ """ """
16
+
15
17
  @staticmethod
16
18
  def check_site_is_deletable_by_id(context, site_id, return_type=None):
17
19
  # type: (ClientContext, str, Optional[ClientResult[bool]]) -> ClientResult[bool]
@@ -84,6 +86,79 @@ class SPPolicyStoreProxy(Entity):
84
86
  self.context.add_query(qry)
85
87
  return return_type
86
88
 
89
+ @staticmethod
90
+ def get_list_compliance_tag(context, list_url, return_type=None):
91
+ """ """
92
+ if return_type is None:
93
+ return_type = ClientResult(context, ComplianceTag())
94
+ payload = {"listUrl": list_url}
95
+ qry = ServiceOperationQuery(
96
+ SPPolicyStoreProxy(context),
97
+ "GetListComplianceTag",
98
+ None,
99
+ payload,
100
+ None,
101
+ return_type,
102
+ True,
103
+ )
104
+ context.add_query(qry)
105
+ return return_type
106
+
107
+ @staticmethod
108
+ def set_list_compliance_tag(
109
+ context,
110
+ list_url,
111
+ compliance_tag_value,
112
+ block_delete=None,
113
+ block_edit=None,
114
+ sync_to_items=None,
115
+ ):
116
+ """ """
117
+ payload = {
118
+ "listUrl": list_url,
119
+ "complianceTagValue": compliance_tag_value,
120
+ "blockDelete": block_delete,
121
+ "blockEdit": block_edit,
122
+ "syncToItems": sync_to_items,
123
+ }
124
+ binding_type = SPPolicyStoreProxy(context)
125
+ qry = ServiceOperationQuery(
126
+ binding_type,
127
+ "SetListComplianceTag",
128
+ None,
129
+ payload,
130
+ None,
131
+ None,
132
+ True,
133
+ )
134
+ context.add_query(qry)
135
+ return binding_type
136
+
137
+ @staticmethod
138
+ def lock_record_item(
139
+ context, list_url, item_id, refresh_labeled_time, return_type=None
140
+ ):
141
+ """ """
142
+ if return_type is None:
143
+ return_type = ClientResult(context, int())
144
+ payload = {
145
+ "listUrl": list_url,
146
+ "itemId": item_id,
147
+ "refreshLabeledTime": refresh_labeled_time,
148
+ }
149
+
150
+ qry = ServiceOperationQuery(
151
+ SPPolicyStoreProxy(context),
152
+ "LockRecordItem",
153
+ None,
154
+ payload,
155
+ None,
156
+ return_type,
157
+ True,
158
+ )
159
+ context.add_query(qry)
160
+ return return_type
161
+
87
162
  @property
88
163
  def entity_type_name(self):
89
164
  return "SP.CompliancePolicy.SPPolicyStoreProxy"
@@ -0,0 +1,9 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class MigrationCompleteStateApi(Entity):
5
+ """"""
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.SharePoint.Convergence.MigrationCompleteStateApi"
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class CopilotFileMetadata(ClientValue):
5
+ """ """
@@ -10,6 +10,14 @@ class SPBuiltInFieldId:
10
10
  FSObjType = "FSObjType"
11
11
  """Identifies a field that contains information about the file system type"""
12
12
 
13
+ FileDirRef = "FileDirRef"
14
+ """Identifies a field that contains information about the file directory for the specified
15
+ SharePoint Foundation object."""
16
+
17
+ FileLeafRef = "FileLeafRef"
18
+ """Identifies a field that contains information about the server-relative URL for the file node that is
19
+ associated with the specified SharePoint Foundation object."""
20
+
13
21
  FileType = "FileType"
14
22
  """Identifies a field that contains information about the file type for version history of the specified
15
23
  SharePoint Foundation library picture object."""
@@ -11,6 +11,7 @@ from office365.sharepoint.client_context import ClientContext
11
11
  from office365.sharepoint.entity_collection import EntityCollection
12
12
  from office365.sharepoint.files.creation_information import FileCreationInformation
13
13
  from office365.sharepoint.files.file import File
14
+ from office365.sharepoint.files.publish.status import FileStatus
14
15
  from office365.sharepoint.types.resource_path import ResourcePath as SPResPath
15
16
 
16
17
  if TYPE_CHECKING:
@@ -24,6 +25,15 @@ class FileCollection(EntityCollection[File]):
24
25
  # type: (ClientContext, ResourcePath, Folder) -> None
25
26
  super(FileCollection, self).__init__(context, File, resource_path, parent)
26
27
 
28
+ def get_published_file(self, base_file_path):
29
+ """ """
30
+ return_type = FileStatus(self.context)
31
+ qry = ServiceOperationQuery(
32
+ self, "GetPublishedFile", [base_file_path], None, None, return_type
33
+ )
34
+ self.context.add_query(qry)
35
+ return return_type
36
+
27
37
  def upload(self, path_or_file, file_name=None):
28
38
  # type: (str|IO, str) -> File
29
39
  """Uploads a file into folder.
@@ -1,6 +1,6 @@
1
1
  import datetime
2
2
  from typing import TYPE_CHECKING, AnyStr
3
- from urllib.parse import quote
3
+ from urllib.parse import quote, unquote
4
4
 
5
5
  import requests
6
6
 
@@ -608,9 +608,13 @@ class File(AbstractFile):
608
608
  :type server_relative_url: str
609
609
  :type content: str
610
610
  """
611
+ try:
612
+ decoded_server_relative_url = unquote(server_relative_url)
613
+ except (ValueError, AttributeError, TypeError):
614
+ decoded_server_relative_url = server_relative_url
611
615
  url = quote(
612
616
  r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
613
- context.service_root_url(), server_relative_url
617
+ context.service_root_url(), decoded_server_relative_url
614
618
  ),
615
619
  safe=":/",
616
620
  )
@@ -630,9 +634,13 @@ class File(AbstractFile):
630
634
  :type server_relative_url: str
631
635
  :return Response
632
636
  """
637
+ try:
638
+ decoded_server_relative_url = unquote(server_relative_url)
639
+ except (ValueError, AttributeError, TypeError):
640
+ decoded_server_relative_url = server_relative_url
633
641
  url = quote(
634
642
  r"{0}/web/getFileByServerRelativePath(DecodedUrl='{1}')/\$value".format(
635
- context.service_root_url(), server_relative_url
643
+ context.service_root_url(), decoded_server_relative_url
636
644
  ),
637
645
  safe=":/",
638
646
  )
@@ -717,6 +725,19 @@ class File(AbstractFile):
717
725
  """"""
718
726
  return self.properties.get("ActivityCapabilities", ActivityCapabilities())
719
727
 
728
+ @property
729
+ def checkin_comment(self):
730
+ # type: () -> Optional[str]
731
+ """Specifies the comment used when a document is checked into a document library.
732
+ Its length MUST be equal to or less than 1023."""
733
+ return self.properties.get("CheckInComment", None)
734
+
735
+ @property
736
+ def content_tag(self):
737
+ # type: () -> Optional[str]
738
+ """Returns internal version of content, used to validate document equality for read purposes."""
739
+ return self.properties.get("ContentTag", None)
740
+
720
741
  @property
721
742
  def author(self):
722
743
  """Specifies the user who added the file."""
@@ -3,7 +3,10 @@ from typing import TYPE_CHECKING
3
3
 
4
4
  from office365.runtime.client_result import ClientResult
5
5
  from office365.runtime.client_value_collection import ClientValueCollection
6
+ from office365.runtime.http.http_method import HttpMethod
7
+ from office365.runtime.http.request_options import RequestOptions
6
8
  from office365.runtime.paths.resource_path import ResourcePath
9
+ from office365.runtime.paths.service_operation import ServiceOperationPath
7
10
  from office365.runtime.paths.v3.entity import EntityPath
8
11
  from office365.runtime.queries.service_operation import ServiceOperationQuery
9
12
  from office365.sharepoint.attachments.collection import AttachmentCollection
@@ -56,6 +59,13 @@ class ListItem(SecurableObject):
56
59
  if parent_list is not None:
57
60
  self.set_property("ParentList", parent_list, False)
58
61
 
62
+ def archive(self):
63
+ """Archives the list item."""
64
+ return_type = ClientResult(self.context, str())
65
+ qry = ServiceOperationQuery(self, "Archive", None, None, None, return_type)
66
+ self.context.add_query(qry)
67
+ return return_type
68
+
59
69
  def share_link(self, link_kind, expiration=None, role=None, password=None):
60
70
  # type: (int, Optional[datetime.datetime], Optional[int], Optional[str]) -> ClientResult[ShareLinkResponse]
61
71
  """Creates a tokenized sharing link for a list item based on the specified parameters and optionally
@@ -334,7 +344,7 @@ class ListItem(SecurableObject):
334
344
 
335
345
  def _after_system_update(result):
336
346
  # type: (ClientResult[ClientValueCollection[ListItemFormUpdateValue]]) -> None
337
- has_any_error = any([item.HasException for item in result.value])
347
+ has_any_error = any(item.HasException for item in result.value)
338
348
  if has_any_error:
339
349
  raise ValueError("Update ListItem failed")
340
350
 
@@ -396,9 +406,16 @@ class ListItem(SecurableObject):
396
406
 
397
407
  def get_comments(self):
398
408
  """Retrieve ListItem comments"""
399
- return_type = CommentCollection(self.context)
409
+ return_type = CommentCollection(
410
+ self.context, ServiceOperationPath("GetComments", [], self.resource_path)
411
+ )
400
412
  qry = ServiceOperationQuery(self, "GetComments", [], None, None, return_type)
401
- self.context.add_query(qry)
413
+
414
+ def _create_request(request):
415
+ # type: (RequestOptions) -> None
416
+ request.method = HttpMethod.Get
417
+
418
+ self.context.add_query(qry).before_query_execute(_create_request)
402
419
  return return_type
403
420
 
404
421
  def override_policy_tip(self, user_action, justification):
@@ -495,6 +512,17 @@ class ListItem(SecurableObject):
495
512
 
496
513
  return self.properties.get("EffectiveBasePermissions", BasePermissions())
497
514
 
515
+ @property
516
+ def effective_base_permissions_for_ui(self):
517
+ """Specifies the effective base permissions for the current user, as they SHOULD be displayed in the user
518
+ interface (UI). If the list is not in read-only UI mode, the value of EffectiveBasePermissionsForUI
519
+ MUST be the same as the value of EffectiveBasePermissions (section 3.2.5.87.1.1.2).
520
+ If the list is in read-only UI mode, the value of EffectiveBasePermissionsForUI MUST be a subset of the
521
+ value of EffectiveBasePermissions."""
522
+ from office365.sharepoint.permissions.base_permissions import BasePermissions
523
+
524
+ return self.properties.get("EffectiveBasePermissionsForUI", BasePermissions())
525
+
498
526
  @property
499
527
  def field_values(self):
500
528
  # type: () -> Optional[dict]
@@ -513,12 +541,41 @@ class ListItem(SecurableObject):
513
541
  """Gets a value that specifies whether the list item is a file or a list folder"""
514
542
  return self.properties.get("FileSystemObjectType", None)
515
543
 
544
+ @property
545
+ def icon_overlay(self):
546
+ # type: () -> Optional[str]
547
+ """This is an overlay icon for the item. If the parent list of the item does not already have the IconOverlay
548
+ field and The user setting the property does not have rights to add the field to the list then the property
549
+ will not be set for the item."""
550
+ return self.properties.get("IconOverlay", None)
551
+
516
552
  @property
517
553
  def id(self):
518
554
  # type: () -> Optional[int]
519
555
  """Gets a value that specifies the list item identifier."""
520
556
  return self.properties.get("Id", None)
521
557
 
558
+ @property
559
+ def server_redirected_embed_uri(self):
560
+ # type: () -> Optional[str]
561
+ """Returns the path for previewing a document in the browser, often in an interactive way, if
562
+ that feature exists."""
563
+ return self.properties.get("ServerRedirectedEmbedUri", None)
564
+
565
+ @property
566
+ def server_redirected_embed_url(self):
567
+ # type: () -> Optional[str]
568
+ """Returns the URL for previewing a document in the browser, often in an interactive way, if that feature
569
+ exists. This is currently used in the hovering panel of search results and document library.
570
+ """
571
+ return self.properties.get("ServerRedirectedEmbedUri", None)
572
+
573
+ @property
574
+ def client_title(self):
575
+ # type: () -> Optional[str]
576
+ """ """
577
+ return self.properties.get("Client_Title", None)
578
+
522
579
  @property
523
580
  def compliance_info(self):
524
581
  return self.properties.get("ComplianceInfo", ListItemComplianceInfo())
@@ -589,6 +646,7 @@ class ListItem(SecurableObject):
589
646
  "ComplianceInfo": self.compliance_info,
590
647
  "OData__dlc_DocIdUrl": self.doc_id_url,
591
648
  "EffectiveBasePermissions": self.effective_base_permissions,
649
+ "EffectiveBasePermissionsForUI": self.effective_base_permissions_for_ui,
592
650
  "GetDlpPolicyTip": self.get_dlp_policy_tip,
593
651
  "FieldValuesAsHtml": self.field_values_as_html,
594
652
  "LikedByInformation": self.liked_by_information,
@@ -11,6 +11,7 @@ from office365.sharepoint.lists.list import List
11
11
 
12
12
 
13
13
  class ListExporter(object):
14
+ """ """
14
15
 
15
16
  @staticmethod
16
17
  def export(