Office365-REST-Python-Client 2.5.5__py3-none-any.whl → 2.5.7__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 (270) hide show
  1. {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.7.dist-info}/METADATA +6 -6
  2. {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.7.dist-info}/RECORD +269 -222
  3. office365/booking/virtualevents/__init__.py +0 -0
  4. office365/booking/virtualevents/root.py +5 -0
  5. office365/communications/calls/participant.py +4 -5
  6. office365/directory/administrative_unit.py +9 -2
  7. office365/directory/applications/application.py +3 -3
  8. office365/directory/applications/roles/assignment_collection.py +1 -1
  9. office365/directory/applications/roles/collection.py +6 -2
  10. office365/directory/applications/roles/role.py +1 -1
  11. office365/directory/audit/provisioning/object_summary.py +30 -1
  12. office365/directory/authentication/method_configuration.py +9 -0
  13. office365/directory/authentication/method_mode_detail.py +8 -0
  14. office365/directory/authentication/method_target.py +5 -0
  15. office365/directory/authentication/methods/fido.py +8 -0
  16. office365/directory/authentication/methods/password.py +23 -0
  17. office365/directory/authentication/strength_root.py +5 -0
  18. office365/directory/certificates/auth_configuration.py +1 -3
  19. office365/directory/custom_security_attribute_definition.py +7 -0
  20. office365/directory/device_local_credential_info.py +6 -0
  21. office365/directory/directory.py +40 -12
  22. office365/directory/groups/group.py +2 -6
  23. office365/directory/identities/conditional_access_root.py +10 -1
  24. office365/directory/identities/container.py +3 -9
  25. office365/directory/identities/providers/builtin_identity.py +3 -2
  26. office365/directory/identities/providers/saml_or_wsfed.py +4 -5
  27. office365/directory/identitygovernance/appconsent/request_collection.py +1 -1
  28. office365/directory/identitygovernance/governance.py +14 -3
  29. office365/directory/identitygovernance/privilegedaccess/__init__.py +0 -0
  30. office365/directory/identitygovernance/privilegedaccess/root.py +5 -0
  31. office365/directory/identitygovernance/termsofuse/agreement_acceptance.py +8 -0
  32. office365/directory/identitygovernance/userconsent/request_collection.py +1 -1
  33. office365/directory/insights/resource_reference.py +1 -1
  34. office365/directory/key_credential.py +3 -0
  35. office365/directory/licenses/assignment_state.py +26 -2
  36. office365/directory/licenses/details.py +4 -3
  37. office365/directory/licenses/subscribed_sku.py +8 -10
  38. office365/directory/object_collection.py +40 -25
  39. office365/directory/password_credential.py +3 -0
  40. office365/directory/permissions/default_user_role.py +5 -0
  41. office365/directory/permissions/grants/condition_set.py +4 -2
  42. office365/directory/permissions/grants/oauth2.py +7 -10
  43. office365/directory/policies/authorization.py +50 -3
  44. office365/directory/policies/device_registration.py +6 -0
  45. office365/directory/policies/permission_grant.py +2 -0
  46. office365/directory/policies/root.py +13 -0
  47. office365/directory/profile_photo.py +6 -6
  48. office365/directory/protection/riskyusers/risky_user.py +4 -4
  49. office365/directory/rolemanagement/resource_action.py +10 -0
  50. office365/directory/rolemanagement/role_permission.py +10 -0
  51. office365/directory/security/alerts/alert.py +5 -7
  52. office365/directory/security/attacksimulations/landing_page.py +5 -0
  53. office365/directory/security/attacksimulations/operation.py +5 -0
  54. office365/directory/security/attacksimulations/report.py +8 -1
  55. office365/directory/security/attacksimulations/root.py +33 -0
  56. office365/directory/security/attacksimulations/users/__init__.py +0 -0
  57. office365/directory/security/attacksimulations/users/details.py +5 -0
  58. office365/directory/security/hunting_query_results.py +5 -0
  59. office365/directory/security/incidents/incident.py +8 -13
  60. office365/directory/security/security.py +20 -3
  61. office365/directory/security/threatintelligence/article_indicator.py +7 -0
  62. office365/directory/serviceprincipals/service_principal.py +6 -12
  63. office365/directory/synchronization/schema.py +16 -0
  64. office365/directory/synchronization/synchronization.py +2 -0
  65. office365/directory/users/activities/history_item.py +3 -2
  66. office365/directory/users/user.py +60 -10
  67. office365/entity_collection.py +3 -2
  68. office365/graph_client.py +58 -30
  69. office365/intune/audit/event.py +1 -3
  70. office365/intune/audit/event_collection.py +1 -1
  71. office365/intune/devices/alternative_security_id.py +4 -0
  72. office365/intune/devices/collection.py +57 -0
  73. office365/intune/devices/device.py +38 -10
  74. office365/intune/devices/management/management.py +12 -0
  75. office365/intune/organizations/organization.py +1 -0
  76. office365/onedrive/analytics/item_activity_stat.py +9 -0
  77. office365/onedrive/analytics/item_analytics.py +1 -0
  78. office365/onedrive/contenttypes/content_type.py +4 -12
  79. office365/onedrive/driveitems/driveItem.py +76 -7
  80. office365/onedrive/files/hashes.py +5 -0
  81. office365/onedrive/lists/collection.py +2 -2
  82. office365/onedrive/lists/list.py +1 -1
  83. office365/onedrive/operations/long_running.py +6 -6
  84. office365/onedrive/operations/rich_long_running.py +4 -3
  85. office365/onedrive/permissions/collection.py +1 -14
  86. office365/onedrive/sharepoint_settings.py +6 -6
  87. office365/onedrive/sitepages/__init__.py +0 -0
  88. office365/onedrive/sitepages/base.py +29 -0
  89. office365/onedrive/sitepages/canvas_layout.py +43 -0
  90. office365/onedrive/sitepages/collection.py +32 -0
  91. office365/onedrive/sitepages/horizontal_section.py +23 -0
  92. office365/onedrive/sitepages/horizontal_section_column.py +27 -0
  93. office365/onedrive/sitepages/site_page.py +116 -0
  94. office365/onedrive/sitepages/title_area.py +13 -0
  95. office365/onedrive/sitepages/vertical_section.py +27 -0
  96. office365/onedrive/sitepages/web_part.py +5 -0
  97. office365/onedrive/sites/site.py +10 -0
  98. office365/onedrive/sites/sites_with_root.py +1 -3
  99. office365/onedrive/termstore/store.py +2 -4
  100. office365/onedrive/termstore/terms/collection.py +1 -2
  101. office365/onedrive/workbooks/charts/data_labels.py +13 -1
  102. office365/onedrive/workbooks/filter.py +9 -0
  103. office365/onedrive/workbooks/filter_criteria.py +5 -0
  104. office365/onedrive/workbooks/functions/functions.py +6 -3
  105. office365/onedrive/workbooks/functions/result.py +2 -0
  106. office365/onedrive/workbooks/operations/workbook.py +7 -10
  107. office365/onedrive/workbooks/tables/pivot_table.py +9 -9
  108. office365/onedrive/workbooks/tables/sort.py +5 -0
  109. office365/onedrive/workbooks/tables/table.py +57 -0
  110. office365/onedrive/workbooks/worksheets/collection.py +0 -6
  111. office365/onedrive/workbooks/worksheets/protection.py +22 -1
  112. office365/onedrive/workbooks/worksheets/protection_options.py +7 -0
  113. office365/outlook/calendar/calendar.py +1 -3
  114. office365/outlook/calendar/events/event.py +45 -0
  115. office365/outlook/calendar/permissions/permission.py +7 -7
  116. office365/outlook/calendar/place.py +5 -3
  117. office365/outlook/calendar/response_status.py +11 -0
  118. office365/outlook/calendar/rooms/room.py +14 -0
  119. office365/outlook/mail/attachments/collection.py +6 -1
  120. office365/outlook/mail/automatic_replies_mailtips.py +5 -0
  121. office365/outlook/mail/conversation.py +1 -3
  122. office365/outlook/mail/folders/folder.py +1 -3
  123. office365/outlook/mail/messages/message.py +1 -1
  124. office365/outlook/mail/tips.py +17 -0
  125. office365/planner/plans/plan.py +11 -1
  126. office365/reports/root.py +83 -4
  127. office365/runtime/auth/authentication_context.py +12 -2
  128. office365/runtime/auth/providers/acs_token_provider.py +10 -7
  129. office365/runtime/auth/sts_profile.py +0 -1
  130. office365/runtime/client_object.py +18 -14
  131. office365/runtime/client_object_collection.py +8 -23
  132. office365/runtime/client_request_exception.py +1 -3
  133. office365/runtime/client_result.py +11 -14
  134. office365/runtime/client_runtime_context.py +11 -21
  135. office365/runtime/odata/json_format.py +7 -9
  136. office365/runtime/odata/request.py +12 -2
  137. office365/runtime/odata/v3/batch_request.py +7 -15
  138. office365/runtime/odata/v4/batch_request.py +13 -21
  139. office365/runtime/queries/upload_session.py +5 -0
  140. office365/runtime/types/event_handler.py +1 -1
  141. office365/search/entity.py +3 -2
  142. office365/sharepoint/activities/facets/delete.py +1 -1
  143. office365/sharepoint/activities/tracked_item_service.py +2 -3
  144. office365/sharepoint/administration/web_application.py +8 -7
  145. office365/sharepoint/alerts/collection.py +2 -1
  146. office365/sharepoint/attachments/attachment.py +3 -9
  147. office365/sharepoint/audit/audit.py +3 -2
  148. office365/sharepoint/changes/alert.py +4 -3
  149. office365/sharepoint/changes/collection.py +7 -10
  150. office365/sharepoint/changes/content_type.py +4 -4
  151. office365/sharepoint/changes/field.py +4 -5
  152. office365/sharepoint/changes/item.py +34 -7
  153. office365/sharepoint/changes/list.py +4 -4
  154. office365/sharepoint/changes/user.py +5 -6
  155. office365/sharepoint/client_context.py +4 -2
  156. office365/sharepoint/clientsidecomponent/component_context_info.py +4 -3
  157. office365/sharepoint/contentcenter/machinelearning/enabled.py +4 -3
  158. office365/sharepoint/contentcenter/machinelearning/hub.py +6 -6
  159. office365/sharepoint/contentcenter/machinelearning/models/collection.py +1 -1
  160. office365/sharepoint/contenttypes/content_type.py +13 -1
  161. office365/sharepoint/contenttypes/fieldlinks/collection.py +5 -7
  162. office365/sharepoint/contenttypes/fieldlinks/field_link.py +14 -22
  163. office365/sharepoint/directory/helper.py +2 -0
  164. office365/sharepoint/entity.py +12 -5
  165. office365/sharepoint/entity_collection.py +1 -3
  166. office365/sharepoint/eventreceivers/definition.py +8 -12
  167. office365/sharepoint/features/collection.py +1 -2
  168. office365/sharepoint/features/definitions/definition.py +6 -3
  169. office365/sharepoint/fields/calculated.py +8 -14
  170. office365/sharepoint/fields/collection.py +46 -13
  171. office365/sharepoint/fields/computed.py +4 -5
  172. office365/sharepoint/fields/currency.py +7 -11
  173. office365/sharepoint/fields/date_time.py +4 -8
  174. office365/sharepoint/fields/field.py +6 -16
  175. office365/sharepoint/fields/lookup.py +11 -9
  176. office365/sharepoint/fields/multi_choice.py +8 -12
  177. office365/sharepoint/fields/multi_line_text.py +10 -14
  178. office365/sharepoint/fields/number.py +13 -26
  179. office365/sharepoint/fields/rating_scale.py +6 -10
  180. office365/sharepoint/fields/related_field.py +10 -17
  181. office365/sharepoint/fields/url.py +4 -5
  182. office365/sharepoint/fields/user.py +10 -9
  183. office365/sharepoint/files/collection.py +17 -15
  184. office365/sharepoint/files/file.py +30 -23
  185. office365/sharepoint/folders/collection.py +22 -5
  186. office365/sharepoint/folders/coloring.py +11 -9
  187. office365/sharepoint/folders/coloring_information.py +38 -0
  188. office365/sharepoint/folders/folder.py +23 -25
  189. office365/sharepoint/likes/liked_by_information.py +7 -10
  190. office365/sharepoint/likes/user_entity.py +6 -8
  191. office365/sharepoint/listitems/form_update_value.py +17 -1
  192. office365/sharepoint/listitems/listitem.py +2 -2
  193. office365/sharepoint/lists/bloom_filter.py +5 -7
  194. office365/sharepoint/lists/creatables_info.py +5 -6
  195. office365/sharepoint/lists/list.py +24 -9
  196. office365/sharepoint/lists/template.py +7 -4
  197. office365/sharepoint/lists/template_collection.py +2 -4
  198. office365/sharepoint/marketplace/app_metadata.py +14 -23
  199. office365/sharepoint/marketplace/sitecollection/appcatalog/allowed_item.py +6 -8
  200. office365/sharepoint/migrationcenter/deploy_status.py +5 -0
  201. office365/sharepoint/migrationcenter/service/performance/__init__.py +0 -0
  202. office365/sharepoint/migrationcenter/service/performance/dashboard_data.py +9 -0
  203. office365/sharepoint/migrationcenter/service/performance/data.py +7 -0
  204. office365/sharepoint/migrationcenter/service/performance/entity_data.py +5 -0
  205. office365/sharepoint/navigation/node.py +5 -8
  206. office365/sharepoint/permissions/irm/effective_settings.py +6 -8
  207. office365/sharepoint/permissions/irm/file_settings.py +8 -6
  208. office365/sharepoint/permissions/irm/settings.py +25 -43
  209. office365/sharepoint/portal/groups/site_manager.py +6 -7
  210. office365/sharepoint/principal/principal.py +2 -4
  211. office365/sharepoint/publishing/embed_data_v1.py +8 -15
  212. office365/sharepoint/publishing/pages/campaign_publication.py +4 -3
  213. office365/sharepoint/publishing/primary_city_time.py +8 -9
  214. office365/sharepoint/publishing/video/service_discoverer.py +4 -3
  215. office365/sharepoint/pushnotifications/subscriber.py +11 -15
  216. office365/sharepoint/recyclebin/item.py +107 -7
  217. office365/sharepoint/sharing/information.py +9 -0
  218. office365/sharepoint/sharing/link_info.py +6 -0
  219. office365/sharepoint/sharing/object_sharing_settings.py +24 -46
  220. office365/sharepoint/sharing/permission_collection.py +18 -0
  221. office365/sharepoint/sharing/permission_information.py +5 -5
  222. office365/sharepoint/sharing/result.py +1 -0
  223. office365/sharepoint/sitedesigns/run.py +4 -3
  224. office365/sharepoint/sites/script_safe_domain.py +5 -0
  225. office365/sharepoint/sites/site.py +17 -20
  226. office365/sharepoint/taxonomy/field.py +32 -21
  227. office365/sharepoint/taxonomy/field_value.py +1 -1
  228. office365/sharepoint/taxonomy/groups/group.py +12 -1
  229. office365/sharepoint/taxonomy/sets/set.py +6 -0
  230. office365/sharepoint/taxonomy/stores/store.py +4 -2
  231. office365/sharepoint/teams/channel.py +6 -6
  232. office365/sharepoint/tenant/administration/endpoints.py +4 -3
  233. office365/sharepoint/tenant/administration/hubsites/properties.py +4 -5
  234. office365/sharepoint/tenant/administration/powerapps/__init__.py +0 -0
  235. office365/sharepoint/tenant/administration/powerapps/environment_context.py +8 -0
  236. office365/sharepoint/tenant/administration/sites/properties.py +0 -1
  237. office365/sharepoint/tenant/administration/spo_operation.py +4 -4
  238. office365/sharepoint/tenant/administration/tenant.py +1 -0
  239. office365/sharepoint/tenant/insights/report.py +11 -0
  240. office365/sharepoint/tenant/insights/report_manager.py +5 -0
  241. office365/sharepoint/tenant/insights/report_metadata.py +5 -0
  242. office365/sharepoint/tenant/settings.py +4 -3
  243. office365/sharepoint/translation/sync_translator.py +3 -2
  244. office365/sharepoint/ui/applicationpages/peoplepicker/entity_information.py +4 -4
  245. office365/sharepoint/usercustomactions/action.py +12 -20
  246. office365/sharepoint/userprofiles/followed_content.py +6 -10
  247. office365/sharepoint/userprofiles/people_manager.py +0 -1
  248. office365/sharepoint/userprofiles/person_properties.py +14 -30
  249. office365/sharepoint/userprofiles/personal_cache.py +4 -3
  250. office365/sharepoint/userprofiles/properties_for_user.py +4 -5
  251. office365/sharepoint/userprofiles/sharedwithme/document.py +12 -21
  252. office365/sharepoint/utilities/move_copy_util.py +19 -19
  253. office365/sharepoint/utilities/upload_status.py +7 -10
  254. office365/sharepoint/views/field_collection.py +9 -14
  255. office365/sharepoint/views/view.py +43 -64
  256. office365/sharepoint/webhooks/subscription.py +11 -19
  257. office365/sharepoint/webparts/webpart.py +3 -1
  258. office365/sharepoint/webs/information_collection.py +1 -1
  259. office365/sharepoint/webs/modernize_homepage_result.py +4 -3
  260. office365/sharepoint/webs/regional_settings.py +79 -16
  261. office365/sharepoint/webs/template.py +3 -5
  262. office365/sharepoint/webs/web.py +24 -25
  263. office365/teams/apps/catalog.py +1 -0
  264. office365/teams/chats/chat.py +4 -0
  265. office365/teams/operations/async_operation.py +5 -7
  266. office365/teams/schedule/schedule.py +6 -2
  267. office365/runtime/paths/item.py +0 -8
  268. {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.7.dist-info}/LICENSE +0 -0
  269. {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.7.dist-info}/WHEEL +0 -0
  270. {Office365_REST_Python_Client-2.5.5.dist-info → Office365_REST_Python_Client-2.5.7.dist-info}/top_level.txt +0 -0
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.entity import Entity
2
4
 
3
5
 
@@ -6,46 +8,36 @@ class FieldLink(Entity):
6
8
 
7
9
  @property
8
10
  def id(self):
9
- """
10
- Gets a value that specifies the GUID of the FieldLink.
11
- :rtype: str or None
12
- """
11
+ # type: () -> Optional[str]
12
+ """Gets a value that specifies the GUID of the FieldLink."""
13
13
  return self.properties.get("Id", None)
14
14
 
15
15
  @property
16
16
  def field_internal_name(self):
17
- """Gets a value that specifies field internal name
18
- :rtype: str or None
19
- """
17
+ # type: () -> Optional[str]
18
+ """Gets a value that specifies field internal name"""
20
19
  return self.properties.get("FieldInternalName", None)
21
20
 
22
21
  @property
23
22
  def read_only(self):
24
- """
25
- :rtype: bool or None
26
- """
23
+ # type: () -> Optional[bool]
24
+ """ """
27
25
  return self.properties.get("ReadOnly", None)
28
26
 
29
27
  @property
30
28
  def hidden(self):
31
- """
32
- Gets a value that specifies whether the field is displayed in forms that can be edited.
33
- :rtype: bool or None
34
- """
29
+ # type: () -> Optional[bool]
30
+ """Gets a value that specifies whether the field is displayed in forms that can be edited."""
35
31
  return self.properties.get("Hidden", None)
36
32
 
37
33
  @property
38
34
  def required(self):
39
- """
40
- Gets a value that specifies whether the field (2) requires a value.
41
- :rtype: bool or None
42
- """
35
+ # type: () -> Optional[bool]
36
+ """Gets a value that specifies whether the field (2) requires a value."""
43
37
  return self.properties.get("Required", None)
44
38
 
45
39
  @property
46
40
  def show_in_display_form(self):
47
- """
48
- A Boolean value that indicates whether this field is shown in the display form.
49
- :rtype: bool or None
50
- """
41
+ # type: () -> Optional[bool]
42
+ """A Boolean value that indicates whether this field is shown in the display form."""
51
43
  return self.properties.get("ShowInDisplayForm", None)
@@ -1,6 +1,7 @@
1
1
  from office365.runtime.client_result import ClientResult
2
2
  from office365.runtime.paths.resource_path import ResourcePath
3
3
  from office365.runtime.queries.service_operation import ServiceOperationQuery
4
+ from office365.sharepoint.client_context import ClientContext
4
5
  from office365.sharepoint.directory.members_info import MembersInfo
5
6
  from office365.sharepoint.directory.membership_result import MembershipResult
6
7
  from office365.sharepoint.directory.my_groups_result import MyGroupsResult
@@ -32,6 +33,7 @@ class SPHelper(Entity):
32
33
 
33
34
  @staticmethod
34
35
  def check_site_availability(context, site_url):
36
+ # type: (ClientContext, str) -> ClientResult[bool]
35
37
  """
36
38
  :param str site_url: Site Url
37
39
  :param office365.sharepoint.client_context.ClientContext context: SharePoint context
@@ -1,5 +1,9 @@
1
- from typing import TYPE_CHECKING
1
+ from typing import TYPE_CHECKING, Callable
2
2
 
3
+ from typing_extensions import Self
4
+
5
+ from office365.runtime.auth.client_credential import ClientCredential
6
+ from office365.runtime.auth.user_credential import UserCredential
3
7
  from office365.runtime.client_object import ClientObject
4
8
  from office365.runtime.queries.delete_entity import DeleteEntityQuery
5
9
  from office365.runtime.queries.update_entity import UpdateEntityQuery
@@ -11,11 +15,14 @@ if TYPE_CHECKING:
11
15
  class Entity(ClientObject):
12
16
  """SharePoint specific entity"""
13
17
 
18
+ def execute_batch(self, items_per_batch=100, success_callback=None):
19
+ # type: (int, Callable[[int], None]) -> Self
20
+ """Construct and submit to a server a batch request"""
21
+ return self.context.execute_batch(items_per_batch, success_callback)
22
+
14
23
  def with_credentials(self, credentials):
15
- """
16
- :type self: T
17
- :type credentials: UserCredential or ClientCredential
18
- """
24
+ # type: (UserCredential|ClientCredential) -> Self
25
+ """ """
19
26
  self.context.with_credentials(credentials)
20
27
  return self
21
28
 
@@ -12,9 +12,7 @@ T = TypeVar("T")
12
12
 
13
13
 
14
14
  class EntityCollection(ClientObjectCollection[T]):
15
- """
16
- SharePoint's entity set
17
- """
15
+ """SharePoint's entity set"""
18
16
 
19
17
  def __init__(self, context, item_type, resource_path=None, parent=None):
20
18
  # type: (ClientContext, Type[T], Optional[ResourcePath], Optional[Entity]) -> None
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.entity import Entity
2
4
 
3
5
 
@@ -7,24 +9,18 @@ class EventReceiverDefinition(Entity):
7
9
 
8
10
  @property
9
11
  def receiver_assembly(self):
10
- """Specifies the strong name of the assembly that is used for the event receiver.
11
-
12
- :rtype: str or None
13
- """
12
+ # type: () -> Optional[str]
13
+ """Specifies the strong name of the assembly that is used for the event receiver."""
14
14
  return self.properties.get("ReceiverAssembly", None)
15
15
 
16
16
  @property
17
17
  def receiver_class(self):
18
- """Specifies the strong name of the assembly that is used for the event receiver.
19
-
20
- :rtype: str or None
21
- """
18
+ # type: () -> Optional[str]
19
+ """Specifies the strong name of the assembly that is used for the event receiver."""
22
20
  return self.properties.get("ReceiverClass", None)
23
21
 
24
22
  @property
25
23
  def receiver_url(self):
26
- """Gets the URL of the receiver for the event.
27
-
28
- :rtype: str or None
29
- """
24
+ # type: () -> Optional[str]
25
+ """Gets the URL of the receiver for the event."""
30
26
  return self.properties.get("ReceiverUrl", None)
@@ -36,8 +36,7 @@ class FeatureCollection(EntityCollection[Feature]):
36
36
  self.context.add_query(_create_query())
37
37
 
38
38
  if verify_if_activated:
39
- feature = self.get_by_id(feature_id)
40
- self.context.load(feature, after_loaded=_create_if_not_activated)
39
+ self.get_by_id(feature_id).get().after_execute(_create_if_not_activated)
41
40
  else:
42
41
  self.context.add_query(_create_query())
43
42
 
@@ -1,12 +1,15 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.entity import Entity
2
4
 
3
5
 
4
6
  class FeatureDefinition(Entity):
5
7
  """Contains the base definition of a feature, including its name, ID, scope, and version."""
6
8
 
9
+ def __str__(self):
10
+ return self.display_name or self.entity_type_name
11
+
7
12
  @property
8
13
  def display_name(self):
9
- """
10
- :rtype: str or None
11
- """
14
+ # type: () -> Optional[str]
12
15
  return self.properties.get("DisplayName", None)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.fields.field import Field
2
4
 
3
5
 
@@ -11,26 +13,18 @@ class FieldCalculated(Field):
11
13
 
12
14
  @property
13
15
  def currency_locale_id(self):
14
- """
15
- Gets the locale ID that is used for currency on the Web site.
16
-
17
- :rtype: int or None
18
- """
16
+ # type: () -> Optional[int]
17
+ """Gets the locale ID that is used for currency on the Web site."""
19
18
  return self.properties.get("CurrencyLocaleId", None)
20
19
 
21
20
  @property
22
21
  def formula(self):
23
- """
24
- Specifies the formula for the field
25
-
26
- :rtype: str or None
27
- """
22
+ # type: () -> Optional[str]
23
+ """Specifies the formula for the field"""
28
24
  return self.properties.get("Formula", None)
29
25
 
30
26
  @formula.setter
31
27
  def formula(self, val):
32
- """Sets a value that specifies the Formula.
33
-
34
- :type val: str
35
- """
28
+ # type: (str) -> None
29
+ """Sets a value that specifies the Formula."""
36
30
  self.set_property("Formula", val)
@@ -1,3 +1,5 @@
1
+ from typing import TYPE_CHECKING, Optional
2
+
1
3
  from office365.runtime.paths.service_operation import ServiceOperationPath
2
4
  from office365.runtime.queries.create_entity import CreateEntityQuery
3
5
  from office365.runtime.queries.service_operation import ServiceOperationQuery
@@ -7,12 +9,21 @@ from office365.sharepoint.fields.creation_information import FieldCreationInform
7
9
  from office365.sharepoint.fields.date_time import FieldDateTime
8
10
  from office365.sharepoint.fields.field import Field
9
11
  from office365.sharepoint.fields.geolocation import FieldGeolocation
12
+ from office365.sharepoint.fields.number import FieldNumber
13
+ from office365.sharepoint.fields.text import FieldText
10
14
  from office365.sharepoint.fields.type import FieldType
15
+ from office365.sharepoint.fields.url import FieldUrl
16
+ from office365.sharepoint.fields.user import FieldUser
11
17
  from office365.sharepoint.fields.xmlSchemaFieldCreationInformation import (
12
18
  XmlSchemaFieldCreationInformation,
13
19
  )
14
20
  from office365.sharepoint.taxonomy.field import TaxonomyField
15
21
  from office365.sharepoint.taxonomy.sets.set import TermSet
22
+ from office365.sharepoint.taxonomy.stores.store import TermStore
23
+
24
+ if TYPE_CHECKING:
25
+ from office365.sharepoint.lists.list import List
26
+ from office365.sharepoint.webs.web import Web
16
27
 
17
28
 
18
29
  class FieldCollection(EntityCollection[Field]):
@@ -39,6 +50,7 @@ class FieldCollection(EntityCollection[Field]):
39
50
  return return_type
40
51
 
41
52
  def add_datetime(self, title, description=None):
53
+ # type: (str, Optional[str]) -> FieldDateTime
42
54
  """
43
55
  Creates DateTime field
44
56
  :param str title: Specifies the display name of the field
@@ -50,10 +62,11 @@ class FieldCollection(EntityCollection[Field]):
50
62
  description=description,
51
63
  field_type_kind=FieldType.DateTime,
52
64
  )
53
- ) # type: FieldDateTime
65
+ )
54
66
  return return_type
55
67
 
56
68
  def add_geolocation_field(self, title, description=None):
69
+ # type: (str, Optional[str]) -> FieldGeolocation
57
70
  """
58
71
  Creates Geolocation field
59
72
 
@@ -66,13 +79,29 @@ class FieldCollection(EntityCollection[Field]):
66
79
  description=description,
67
80
  field_type_kind=FieldType.Geolocation,
68
81
  )
69
- ) # type: FieldGeolocation
82
+ )
83
+ return return_type
84
+
85
+ def add_number(self, title, description=None):
86
+ # type: (str, Optional[str]) -> FieldNumber
87
+ """
88
+ Creates Number field
89
+ :param str title: Specifies the display name of the field
90
+ :param str or None description: Specifies the description of the field
91
+ """
92
+ return_type = self.add(
93
+ FieldCreationInformation(
94
+ title=title,
95
+ description=description,
96
+ field_type_kind=FieldType.Number,
97
+ )
98
+ )
70
99
  return return_type
71
100
 
72
101
  def add_url_field(self, title, description=None):
102
+ # type: (str, Optional[str]) -> FieldUrl
73
103
  """
74
104
  Creates Url field
75
-
76
105
  :param str title: Specifies the display name of the field
77
106
  :param str or None description:
78
107
  """
@@ -95,13 +124,12 @@ class FieldCollection(EntityCollection[Field]):
95
124
  :param str title: Specifies the display name of the field.
96
125
  """
97
126
  from office365.sharepoint.fields.lookup import FieldLookup
127
+ from office365.sharepoint.lists.list import List # noqa
98
128
 
99
129
  return_type = FieldLookup(self.context)
100
130
 
101
131
  def _add_lookup_field(lookup_list_id):
102
- """
103
- :type lookup_list_id: str
104
- """
132
+ # type: (str) -> None
105
133
  if allow_multiple_values:
106
134
  field_schema = """
107
135
  <Field Type="LookupMulti" Mult="TRUE" DisplayName="{title}" Required="FALSE" Hidden="TRUE" \
@@ -124,8 +152,6 @@ class FieldCollection(EntityCollection[Field]):
124
152
  return_type=return_type,
125
153
  )
126
154
 
127
- from office365.sharepoint.lists.list import List
128
-
129
155
  if isinstance(lookup_list, List):
130
156
 
131
157
  def _lookup_list_loaded():
@@ -150,6 +176,7 @@ class FieldCollection(EntityCollection[Field]):
150
176
  return self.add_field(create_field_info)
151
177
 
152
178
  def add_user_field(self, title):
179
+ # type: (str) -> FieldUser
153
180
  """
154
181
  Creates a User field
155
182
 
@@ -158,11 +185,10 @@ class FieldCollection(EntityCollection[Field]):
158
185
  return self.add_field(FieldCreationInformation(title, FieldType.User))
159
186
 
160
187
  def add_text_field(self, title):
188
+ # type: (str) -> FieldText
161
189
  """
162
190
  Creates a Text field
163
-
164
191
  :param str title: specifies the display name of the field
165
- :rtype: office365.sharepoint.fields.text.FieldText
166
192
  """
167
193
  return self.add_field(FieldCreationInformation(title, FieldType.Text))
168
194
 
@@ -245,6 +271,7 @@ class FieldCollection(EntityCollection[Field]):
245
271
  else:
246
272
 
247
273
  def _term_store_loaded(term_store):
274
+ # type: (TermStore) -> None
248
275
  TaxonomyField.create(
249
276
  self,
250
277
  name,
@@ -254,9 +281,10 @@ class FieldCollection(EntityCollection[Field]):
254
281
  return_type=return_type,
255
282
  )
256
283
 
257
- self.context.load(
258
- self.context.taxonomy.term_store, after_loaded=_term_store_loaded
284
+ self.context.load(self.context.taxonomy.term_store).after_query_execute(
285
+ _term_store_loaded
259
286
  )
287
+
260
288
  return return_type
261
289
 
262
290
  def create_field_as_xml(self, schema_xml, return_type=None):
@@ -287,7 +315,7 @@ class FieldCollection(EntityCollection[Field]):
287
315
  )
288
316
 
289
317
  def get_by_internal_name_or_title(self, value):
290
- """Returns the first field (2) in the collection based on the internal name or the title specified
318
+ """Returns the first field in the collection based on the internal name or the title specified
291
319
  by the parameter.
292
320
 
293
321
  :param str value: The title or internal name to look up the field (2) by.
@@ -309,3 +337,8 @@ class FieldCollection(EntityCollection[Field]):
309
337
  self.context,
310
338
  ServiceOperationPath("getByTitle", [title], self.resource_path),
311
339
  )
340
+
341
+ @property
342
+ def parent(self):
343
+ # type: () -> Web|List
344
+ return self._parent
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.fields.field import Field
2
4
 
3
5
 
@@ -10,9 +12,6 @@ class FieldComputed(Field):
10
12
 
11
13
  @property
12
14
  def enable_lookup(self):
13
- """
14
- Specifies whether a lookup field can reference the field (2).
15
-
16
- :rtype: bool or None
17
- """
15
+ # type: () -> Optional[bool]
16
+ """Specifies whether a lookup field can reference the field."""
18
17
  return self.properties.get("EnableLookup", None)
@@ -1,24 +1,20 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.fields.number import FieldNumber
2
4
 
3
5
 
4
6
  class FieldCurrency(FieldNumber):
5
- """Specifies a field (2) that contains currency values. To set properties, call the Update method
7
+ """Specifies a field that contains currency values. To set properties, call the Update method
6
8
  (section 3.2.5.43.2.1.5)."""
7
9
 
8
10
  @property
9
11
  def currency_locale_id(self):
10
- """
11
- Gets the language code identifier (LCID) used to format the value of the field.
12
-
13
- :rtype: int or None
14
- """
12
+ # type: () -> Optional[int]
13
+ """Gets the language code identifier (LCID) used to format the value of the field."""
15
14
  return self.properties.get("CurrencyLocaleId", None)
16
15
 
17
16
  @currency_locale_id.setter
18
17
  def currency_locale_id(self, value):
19
- """
20
- Sets the language code identifier (LCID) used to format the value of the field.
21
-
22
- :type value: int
23
- """
18
+ # type: (int) -> None
19
+ """Sets the language code identifier (LCID) used to format the value of the field."""
24
20
  self.set_property("CurrencyLocaleId", value)
@@ -9,18 +9,14 @@ class FieldDateTime(Field):
9
9
 
10
10
  @property
11
11
  def datetime_calendar_type(self):
12
- """
13
- Gets the calendar type of the field
14
- :rtype: int or None
15
- """
12
+ # type: () -> Optional[int]
13
+ """Gets the calendar type of the field"""
16
14
  return self.properties.get("DateTimeCalendarType", None)
17
15
 
18
16
  @datetime_calendar_type.setter
19
17
  def datetime_calendar_type(self, value):
20
- """
21
- Sets Gets the calendar type of the field
22
- :type value: int
23
- """
18
+ # type: (int) -> None
19
+ """Sets Gets the calendar type of the field"""
24
20
  self.set_property("DateTimeCalendarType", value)
25
21
 
26
22
  @property
@@ -69,7 +69,6 @@ class Field(Entity):
69
69
 
70
70
  :type context: office365.sharepoint.client_context.ClientContext
71
71
  :type field_parameters: office365.sharepoint.fields.creation_information.FieldCreationInformation
72
- :return: Field
73
72
  """
74
73
  field_type = Field.resolve_field_type(field_parameters.FieldTypeKind)
75
74
  field = field_type(context)
@@ -124,19 +123,14 @@ class Field(Entity):
124
123
 
125
124
  @property
126
125
  def id(self):
127
- """
128
- Gets a value that specifies the field identifier.
129
-
130
- :rtype: str or None
131
- """
126
+ # type: () -> Optional[str]
127
+ """Gets a value that specifies the field identifier."""
132
128
  return self.properties.get("Id", None)
133
129
 
134
130
  @property
135
131
  def auto_indexed(self):
136
- """
137
- Gets a Boolean value that specifies whether the field is auto-indexed.
138
- :rtype: str or None
139
- """
132
+ # type: () -> Optional[bool]
133
+ """Gets a Boolean value that specifies whether the field is auto-indexed."""
140
134
  return self.properties.get("AutoIndexed", None)
141
135
 
142
136
  @property
@@ -200,17 +194,13 @@ class Field(Entity):
200
194
  @property
201
195
  def internal_name(self):
202
196
  # type: () -> Optional[str]
203
- """
204
- Gets a value that specifies the field internal name.
205
- """
197
+ """Gets a value that specifies the field internal name."""
206
198
  return self.properties.get("InternalName", None)
207
199
 
208
200
  @property
209
201
  def can_be_deleted(self):
210
202
  # type: () -> Optional[bool]
211
- """
212
- Gets a value that specifies whether the field can be deleted
213
- """
203
+ """Gets a value that specifies whether the field can be deleted"""
214
204
  return self.properties.get("CanBeDeleted", None)
215
205
 
216
206
  @property
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.fields.field import Field
2
4
 
3
5
 
@@ -6,38 +8,38 @@ class FieldLookup(Field):
6
8
 
7
9
  @property
8
10
  def allow_multiple_values(self):
9
- """Gets a value that specifies whether the lookup field allows multiple values.
10
- :rtype: bool or None
11
- """
11
+ # type: () -> Optional[bool]
12
+ """Gets a value that specifies whether the lookup field allows multiple values."""
12
13
  return self.properties.get("AllowMultipleValues", None)
13
14
 
14
15
  @allow_multiple_values.setter
15
16
  def allow_multiple_values(self, value):
17
+ # type: (bool) -> None
16
18
  """Sets a value that specifies whether the lookup field allows multiple values."""
17
19
  self.set_property("AllowMultipleValues", value)
18
20
 
19
21
  @property
20
22
  def lookup_web_id(self):
21
- """Gets the ID of the Web site that contains the list that is the source of this field's value.
22
- :rtype: str or None
23
- """
23
+ # type: () -> Optional[str]
24
+ """Gets the ID of the Web site that contains the list that is the source of this field's value."""
24
25
  return self.properties.get("LookupWebId", None)
25
26
 
26
27
  @lookup_web_id.setter
27
28
  def lookup_web_id(self, val):
28
- """Sets the ID of the Web site that contains the list that is the source of this field's value.
29
- :rtype: str or None
30
- """
29
+ # type: (str) -> None
30
+ """Sets the ID of the Web site that contains the list that is the source of this field's value."""
31
31
  self.set_property("LookupWebId", val, True)
32
32
 
33
33
  @property
34
34
  def lookup_list(self):
35
+ # type: () -> Optional[str]
35
36
  """Gets value that specifies the list identifier of the list that contains the field to use as the lookup
36
37
  values."""
37
38
  return self.properties.get("LookupList", None)
38
39
 
39
40
  @lookup_list.setter
40
41
  def lookup_list(self, val):
42
+ # type: (str) -> None
41
43
  """Sets a value that specifies the list identifier of the list that contains the field to use as
42
44
  the lookup values."""
43
45
  self.set_property("LookupList", val, True)
@@ -1,32 +1,28 @@
1
+ from typing import Optional
2
+
1
3
  from office365.runtime.types.collections import StringCollection
2
4
  from office365.sharepoint.fields.field import Field
3
5
 
4
6
 
5
7
  class FieldMultiChoice(Field):
6
- """Specifies a field (2) that contains one or more values from a set of specified values."""
8
+ """Specifies a field that contains one or more values from a set of specified values."""
7
9
 
8
10
  @property
9
11
  def fill_in_choice(self):
12
+ # type: () -> Optional[bool]
10
13
  """
11
- Specifies whether the field (2) can accept values other than those specified in
14
+ Specifies whether the field can accept values other than those specified in
12
15
  Microsoft.Sharepoint.Client.FieldMultiChoice.Choices, as specified in section 3.2.5.51.1.1.2.
13
-
14
- :rtype: bool or None
15
16
  """
16
17
  return self.properties.get("FillInChoice", None)
17
18
 
18
19
  @property
19
20
  def mappings(self):
20
- """
21
- Specifies the internal values corresponding to Choices.
22
-
23
- :rtype: str or None
24
- """
21
+ # type: () -> Optional[str]
22
+ """Specifies the internal values corresponding to Choices."""
25
23
  return self.properties.get("Mappings", None)
26
24
 
27
25
  @property
28
26
  def choices(self):
29
- """
30
- Specifies values that are available for selection in the field
31
- """
27
+ """Specifies values that are available for selection in the field"""
32
28
  return self.properties.get("Choices", StringCollection())
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.fields.field import Field
2
4
 
3
5
 
@@ -8,30 +10,24 @@ class FieldMultiLineText(Field):
8
10
 
9
11
  @property
10
12
  def allow_hyperlink(self):
11
- """
12
- Gets a value that specifies whether a hyperlink is allowed as a value of the field.
13
- :rtype: bool or None
14
- """
13
+ # type: () -> Optional[bool]
14
+ """Gets a value that specifies whether a hyperlink is allowed as a value of the field."""
15
15
  return self.properties.get("AllowHyperlink", None)
16
16
 
17
17
  @allow_hyperlink.setter
18
18
  def allow_hyperlink(self, val):
19
- """
20
- Sets a value that specifies whether a hyperlink is allowed as a value of the field.
21
- """
19
+ # type: (bool) -> None
20
+ """Sets a value that specifies whether a hyperlink is allowed as a value of the field."""
22
21
  self.set_property("AllowHyperlink", val)
23
22
 
24
23
  @property
25
24
  def number_of_lines(self):
26
- """
27
- Gets the number of lines to display in the field.
28
- :return:
29
- """
25
+ # type: () -> Optional[int]
26
+ """Gets the number of lines to display in the field."""
30
27
  return self.properties.get("NumberOfLines", None)
31
28
 
32
29
  @number_of_lines.setter
33
30
  def number_of_lines(self, val):
34
- """
35
- Set the number of lines to display in the field.
36
- """
31
+ # type: (int) -> None
32
+ """Set the number of lines to display in the field."""
37
33
  self.set_property("NumberOfLines", val)