Office365-REST-Python-Client 2.5.11__py3-none-any.whl → 2.5.13__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 (108) hide show
  1. {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/METADATA +6 -1
  2. {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/RECORD +108 -66
  3. office365/backuprestore/__init__.py +0 -0
  4. office365/backuprestore/root.py +39 -0
  5. office365/backuprestore/service_status.py +5 -0
  6. office365/booking/solutions/root.py +14 -1
  7. office365/directory/applications/application.py +17 -0
  8. office365/directory/applications/optional_claim.py +5 -0
  9. office365/directory/applications/optional_claims.py +16 -0
  10. office365/directory/authentication/conditions/__init__.py +0 -0
  11. office365/directory/authentication/conditions/application.py +5 -0
  12. office365/directory/authentication/conditions/applications.py +5 -0
  13. office365/directory/authentication/conditions/conditions.py +11 -0
  14. office365/directory/authentication/conditions/event_listener.py +9 -0
  15. office365/directory/device_local_credential_info.py +21 -0
  16. office365/directory/identities/container.py +18 -0
  17. office365/directory/policies/authentication_flows.py +8 -0
  18. office365/directory/policies/root.py +17 -0
  19. office365/directory/policies/unified_role_management.py +7 -0
  20. office365/directory/protection/policy/__init__.py +0 -0
  21. office365/directory/protection/policy/base.py +24 -0
  22. office365/directory/protection/policy/one_drive_for_business.py +10 -0
  23. office365/directory/security/attacksimulations/users/details.py +7 -0
  24. office365/directory/serviceprincipals/service_principal.py +65 -14
  25. office365/directory/users/user.py +23 -3
  26. office365/graph_client.py +6 -1
  27. office365/intune/devices/management/management.py +26 -0
  28. office365/intune/devices/management/terms_and_conditions.py +10 -0
  29. office365/intune/devices/management/virtual_endpoint.py +8 -0
  30. office365/onedrive/idle_session_signout.py +15 -0
  31. office365/onedrive/sharepoint_settings.py +13 -0
  32. office365/onedrive/sitepages/title_area.py +15 -5
  33. office365/outlook/calendar/sharing/__init__.py +0 -0
  34. office365/outlook/calendar/sharing/message_action.py +5 -0
  35. office365/outlook/calendar/sharing_message.py +19 -0
  36. office365/outlook/calendar/timezones/custom.py +9 -0
  37. office365/outlook/mail/automatic_replies_setting.py +7 -0
  38. office365/outlook/mail/messages/rules/predicates.py +5 -0
  39. office365/outlook/mail/messages/rules/rule.py +4 -3
  40. office365/runtime/client_object.py +9 -1
  41. office365/runtime/client_object_collection.py +2 -2
  42. office365/runtime/client_result.py +19 -2
  43. office365/runtime/odata/query_options.py +3 -0
  44. office365/runtime/odata/v4/batch_request.py +12 -15
  45. office365/runtime/queries/batch.py +4 -0
  46. office365/sharepoint/appprincipal/identity_provider.py +7 -1
  47. office365/sharepoint/apps/context_site.py +41 -0
  48. office365/sharepoint/authpolicy/events/collection.py +11 -0
  49. office365/sharepoint/authpolicy/events/{auth_event.py → event.py} +1 -0
  50. office365/sharepoint/authpolicy/events/role_assignment_resource_payload.py +5 -0
  51. office365/sharepoint/brandcenter/__init__.py +0 -0
  52. office365/sharepoint/brandcenter/brand_center.py +9 -0
  53. office365/sharepoint/brandcenter/configuration.py +5 -0
  54. office365/sharepoint/changes/change.py +1 -3
  55. office365/sharepoint/changes/collection.py +3 -0
  56. office365/sharepoint/changes/folder.py +6 -0
  57. office365/sharepoint/changes/group.py +3 -0
  58. office365/sharepoint/changes/list.py +13 -0
  59. office365/sharepoint/changes/view.py +25 -0
  60. office365/sharepoint/client_context.py +23 -4
  61. office365/sharepoint/contenttypes/fieldlinks/collection.py +3 -0
  62. office365/sharepoint/copilot/__init__.py +0 -0
  63. office365/sharepoint/copilot/file_collection.py +27 -0
  64. office365/sharepoint/copilot/file_collection_query_result.py +10 -0
  65. office365/sharepoint/copilot/list_item_extensions.py +5 -0
  66. office365/sharepoint/directory/group.py +9 -9
  67. office365/sharepoint/directory/helper.py +6 -4
  68. office365/sharepoint/directory/provider/alternate_id_data.py +5 -0
  69. office365/sharepoint/directory/provider/notification.py +8 -0
  70. office365/sharepoint/directory/provider/object_changes.py +5 -0
  71. office365/sharepoint/directory/provider/object_data.py +26 -3
  72. office365/sharepoint/directory/provider/provider.py +1 -0
  73. office365/sharepoint/directory/provider/session_data.py +9 -0
  74. office365/sharepoint/entity.py +4 -3
  75. office365/sharepoint/lists/list.py +64 -1
  76. office365/sharepoint/logger/log_export.py +2 -0
  77. office365/sharepoint/migrationcenter/service/performance/data.py +5 -5
  78. office365/sharepoint/multigeo/services.py +24 -0
  79. office365/sharepoint/navigation/menu_node.py +43 -1
  80. office365/sharepoint/navigation/node_collection.py +1 -1
  81. office365/sharepoint/oauth/token.py +22 -0
  82. office365/sharepoint/oauth/token_response.py +5 -0
  83. office365/sharepoint/publishing/pages/campaign_publication.py +10 -0
  84. office365/sharepoint/publishing/pages/collection.py +1 -1
  85. office365/sharepoint/securestore/target_application.py +2 -0
  86. office365/sharepoint/sharing/inherited_from.py +5 -0
  87. office365/sharepoint/sharing/internal/__init__.py +0 -0
  88. office365/sharepoint/sharing/internal/sharing_restrictions.py +22 -0
  89. office365/sharepoint/sharing/internal/types.py +17 -0
  90. office365/sharepoint/sharing/link_info.py +24 -0
  91. office365/sharepoint/sites/site.py +9 -0
  92. office365/sharepoint/sites/version_policy_manager.py +8 -0
  93. office365/sharepoint/tenant/administration/policies/__init__.py +0 -0
  94. office365/sharepoint/tenant/administration/policies/definition.py +5 -0
  95. office365/sharepoint/tenant/administration/recent_admin_action_report.py +2 -2
  96. office365/sharepoint/tenant/administration/settings_service.py +9 -1
  97. office365/sharepoint/tenant/administration/sites/properties.py +45 -0
  98. office365/sharepoint/tenant/administration/tenant.py +44 -6
  99. office365/sharepoint/tenant/administration/types.py +17 -1
  100. office365/sharepoint/utilities/wopi_host.py +45 -0
  101. office365/sharepoint/webs/regional_settings.py +6 -0
  102. office365/sharepoint/webs/web.py +56 -0
  103. office365/sharepoint/workflow/definition.py +5 -0
  104. office365/sharepoint/workflowservices/deployment_service.py +23 -0
  105. office365/teams/members/settings.py +2 -2
  106. {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/LICENSE +0 -0
  107. {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/WHEEL +0 -0
  108. {Office365_REST_Python_Client-2.5.11.dist-info → Office365_REST_Python_Client-2.5.13.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  from typing import Optional
2
2
 
3
3
  from office365.entity import Entity
4
+ from office365.onedrive.idle_session_signout import IdleSessionSignOut
4
5
  from office365.runtime.types.collections import StringCollection
5
6
 
6
7
 
@@ -26,6 +27,18 @@ class SharepointSettings(Entity):
26
27
  "excludedFileExtensionsForSyncApp", StringCollection()
27
28
  )
28
29
 
30
+ @property
31
+ def idle_session_sign_out(self):
32
+ # type: () -> IdleSessionSignOut
33
+ """Specifies the idle session sign-out policies for the tenant."""
34
+ return self.properties.get("idleSessionSignOut", IdleSessionSignOut())
35
+
36
+ @property
37
+ def is_commenting_on_site_pages_enabled(self):
38
+ # type: () -> Optional[bool]
39
+ """Indicates whether comments are allowed on modern site pages in SharePoint."""
40
+ return self.properties.get("isCommentingOnSitePagesEnabled", None)
41
+
29
42
  @property
30
43
  def site_creation_default_managed_path(self):
31
44
  # type: () -> Optional[str]
@@ -4,10 +4,20 @@ from office365.runtime.client_value import ClientValue
4
4
  class TitleArea(ClientValue):
5
5
  """Represents the title area of a given SharePoint page."""
6
6
 
7
- def __init__(self, alternativeText=None, enableGradientEffect=None):
7
+ def __init__(
8
+ self,
9
+ alternative_text=None,
10
+ enable_gradient_effect=None,
11
+ image_web_url=None,
12
+ show_author=None,
13
+ ):
8
14
  """
9
- :param str alternativeText: Alternative text on the title area.
10
- :param bool enableGradientEffect: Indicates whether the title area has a gradient effect enabled.
15
+ :param str alternative_text: Alternative text on the title area.
16
+ :param bool enable_gradient_effect: Indicates whether the title area has a gradient effect enabled.
17
+ :param str image_web_url:
18
+ :param bool show_author:
11
19
  """
12
- self.alternativeText = alternativeText
13
- self.enableGradientEffect = enableGradientEffect
20
+ self.alternativeText = alternative_text
21
+ self.enableGradientEffect = enable_gradient_effect
22
+ self.imageWebUrl = image_web_url
23
+ self.showAuthor = show_author
File without changes
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class CalendarSharingMessageAction(ClientValue):
5
+ """"""
@@ -1,5 +1,24 @@
1
+ from office365.outlook.calendar.sharing.message_action import (
2
+ CalendarSharingMessageAction,
3
+ )
1
4
  from office365.outlook.mail.messages.message import Message
2
5
 
3
6
 
4
7
  class CalendarSharingMessage(Message):
5
8
  """"""
9
+
10
+ @property
11
+ def sharing_message_action(self):
12
+ """"""
13
+ return self.properties.setdefault(
14
+ "sharingMessageAction", CalendarSharingMessageAction()
15
+ )
16
+
17
+ def get_property(self, name, default_value=None):
18
+ if default_value is None:
19
+ property_type_mapping = {
20
+ "sharingMessageAction": self.sharing_message_action,
21
+ }
22
+ default_value = property_type_mapping.get(name, None)
23
+
24
+ return super(CalendarSharingMessage, self).get_property(name, default_value)
@@ -5,3 +5,12 @@ class CustomTimeZone(TimeZoneBase):
5
5
  """
6
6
  Represents a time zone where the transition from standard to daylight saving time, or vice versa is not standard.
7
7
  """
8
+
9
+ def __init__(self, bias=None):
10
+ """
11
+ :param int bias: The time offset of the time zone from Coordinated Universal Time (UTC). This value is in
12
+ minutes. Time zones that are ahead of UTC have a positive offset; time zones that are behind UTC have
13
+ a negative offset.
14
+ """
15
+ super(CustomTimeZone, self).__init__()
16
+ self.bias = bias
@@ -1,3 +1,4 @@
1
+ from office365.outlook.calendar.dateTimeTimeZone import DateTimeTimeZone
1
2
  from office365.runtime.client_value import ClientValue
2
3
 
3
4
 
@@ -12,6 +13,9 @@ class AutomaticRepliesSetting(ClientValue):
12
13
  external_audience=None,
13
14
  external_reply_message=None,
14
15
  internal_reply_message=None,
16
+ scheduled_end_datetime=DateTimeTimeZone(),
17
+ scheduled_start_datetime=DateTimeTimeZone(),
18
+ status=None,
15
19
  ):
16
20
  """
17
21
  :param str external_audience: The set of audience external to the signed-in user's organization who will
@@ -25,3 +29,6 @@ class AutomaticRepliesSetting(ClientValue):
25
29
  self.externalAudience = external_audience
26
30
  self.externalReplyMessage = external_reply_message
27
31
  self.internalReplyMessage = internal_reply_message
32
+ self.scheduledEndDateTime = scheduled_end_datetime
33
+ self.scheduledStartDateTime = scheduled_start_datetime
34
+ self.status = status
@@ -15,6 +15,8 @@ class MessageRulePredicates(ClientValue):
15
15
  from_addresses=None,
16
16
  has_attachments=None,
17
17
  header_contains=None,
18
+ importance=None,
19
+ is_approval_request=None,
18
20
  ):
19
21
  """
20
22
  :param list[str] body_contains: Represents the strings that should appear in the body of an incoming message
@@ -28,6 +30,7 @@ class MessageRulePredicates(ClientValue):
28
30
  :param bool has_attachments: Indicates whether an incoming message must have attachments in order for the
29
31
  condition or exception to apply.
30
32
  :param list[str] header_contains:
33
+ :param bool is_approval_request:
31
34
  """
32
35
  self.bodyContains = StringCollection(body_contains)
33
36
  self.bodyOrSubjectContains = StringCollection(body_or_subject_contains)
@@ -35,3 +38,5 @@ class MessageRulePredicates(ClientValue):
35
38
  self.fromAddresses = ClientValueCollection(Recipient, from_addresses)
36
39
  self.hasAttachments = has_attachments
37
40
  self.headerContains = StringCollection(header_contains)
41
+ self.importance = importance
42
+ self.isApprovalRequest = is_approval_request
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.entity import Entity
2
4
  from office365.outlook.mail.messages.rules.actions import MessageRuleActions
3
5
  from office365.outlook.mail.messages.rules.predicates import MessageRulePredicates
@@ -26,7 +28,6 @@ class MessageRule(Entity):
26
28
 
27
29
  @property
28
30
  def is_read_only(self):
29
- """
30
- Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API.
31
- """
31
+ # type: () -> Optional[bool]
32
+ """Indicates if the rule is read-only and cannot be modified or deleted by the rules REST API."""
32
33
  return self.properties.get("isReadOnly", None)
@@ -6,6 +6,7 @@ from typing import TYPE_CHECKING, Any, Callable, Generic, List, Optional, TypeVa
6
6
  from requests import Response
7
7
  from typing_extensions import Self
8
8
 
9
+ from office365.runtime.client_request_exception import ClientRequestException
9
10
  from office365.runtime.client_runtime_context import ClientRuntimeContext
10
11
  from office365.runtime.client_value import ClientValue
11
12
  from office365.runtime.http.request_options import RequestOptions
@@ -55,7 +56,12 @@ class ClientObject(Generic[T]):
55
56
  return self
56
57
 
57
58
  def execute_query_retry(
58
- self, max_retry=5, timeout_secs=5, success_callback=None, failure_callback=None
59
+ self,
60
+ max_retry=5,
61
+ timeout_secs=5,
62
+ success_callback=None,
63
+ failure_callback=None,
64
+ exceptions=(ClientRequestException,),
59
65
  ):
60
66
  """
61
67
  Executes the current set of data retrieval queries and method invocations and retries it if needed.
@@ -66,12 +72,14 @@ class ClientObject(Generic[T]):
66
72
  if the request executes successfully.
67
73
  :param (int, requests.exceptions.RequestException)-> None failure_callback: A callback to call if the request
68
74
  fails to execute
75
+ :param exceptions: tuple of exceptions that we retry
69
76
  """
70
77
  self.context.execute_query_retry(
71
78
  max_retry=max_retry,
72
79
  timeout_secs=timeout_secs,
73
80
  success_callback=success_callback,
74
81
  failure_callback=failure_callback,
82
+ exceptions=exceptions,
75
83
  )
76
84
  return self
77
85
 
@@ -138,7 +138,7 @@ class ClientObjectCollection(ClientObject, Generic[T]):
138
138
  return self
139
139
 
140
140
  def paged(self, page_size=None, page_loaded=None):
141
- # type: (int, Callable[[Self], None]) -> Self
141
+ # type: (int, Callable[[Self], None] | None) -> Self
142
142
  """Retrieves via server-driven paging mode"""
143
143
  self._paged_mode = True
144
144
  if callable(page_loaded):
@@ -158,7 +158,7 @@ class ClientObjectCollection(ClientObject, Generic[T]):
158
158
  return self
159
159
 
160
160
  def get_all(self, page_size=None, page_loaded=None):
161
- # type: (int, Callable[[Self], None]) -> Self
161
+ # type: (int, Callable[[Self], None] | None) -> Self
162
162
  """Gets all the items in a collection, regardless of the size."""
163
163
 
164
164
  def _page_loaded(col):
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING, Callable, Generic, Optional, TypeVar
3
3
 
4
4
  from typing_extensions import Self
5
5
 
6
+ from office365.runtime.client_request_exception import ClientRequestException
6
7
  from office365.runtime.http.request_options import RequestOptions
7
8
 
8
9
  if TYPE_CHECKING:
@@ -54,13 +55,29 @@ class ClientResult(Generic[T]):
54
55
  return self
55
56
 
56
57
  def execute_query_retry(
57
- self, max_retry=5, timeout_secs=5, success_callback=None, failure_callback=None
58
+ self,
59
+ max_retry=5,
60
+ timeout_secs=5,
61
+ success_callback=None,
62
+ failure_callback=None,
63
+ exceptions=(ClientRequestException,),
58
64
  ):
59
- """Executes the current set of data retrieval queries and method invocations and retries it if needed."""
65
+ """
66
+ Executes the current set of data retrieval queries and method invocations and retries it if needed.
67
+
68
+ :param int max_retry: Number of times to retry the request
69
+ :param int timeout_secs: Seconds to wait before retrying the request.
70
+ :param (office365.runtime.client_object.ClientObject)-> None success_callback: A callback to call
71
+ if the request executes successfully.
72
+ :param (int, requests.exceptions.RequestException)-> None failure_callback: A callback to call if the request
73
+ fails to execute
74
+ :param exceptions: tuple of exceptions that we retry
75
+ """
60
76
  self._context.execute_query_retry(
61
77
  max_retry=max_retry,
62
78
  timeout_secs=timeout_secs,
63
79
  success_callback=success_callback,
64
80
  failure_callback=failure_callback,
81
+ exceptions=exceptions,
65
82
  )
66
83
  return self
@@ -59,6 +59,9 @@ class QueryOptions(object):
59
59
  ClientObjectCollection,
60
60
  )
61
61
 
62
+ if name in query_options.select:
63
+ continue
64
+
62
65
  if isinstance(client_object, ClientObjectCollection):
63
66
  prop = client_object.create_typed_object().get_property(name)
64
67
  else:
@@ -46,11 +46,8 @@ class ODataV4BatchRequest(ODataRequest):
46
46
  yield qry, resp
47
47
 
48
48
  def _prepare_payload(self, query):
49
- """
50
- Serializes a batch request body.
51
-
52
- :type query: office365.runtime.queries.batch.BatchQuery
53
- """
49
+ # type: (BatchQuery) -> Dict
50
+ """Serializes a batch request body."""
54
51
  requests_json = []
55
52
  for qry in query.queries:
56
53
  qry_id = str(len(requests_json))
@@ -63,16 +60,16 @@ class ODataV4BatchRequest(ODataRequest):
63
60
  # type: (ClientQuery, str, Optional[List[str]]) -> Dict[str, Any]
64
61
  """ """
65
62
  request = query.build_request()
66
- allowed_props = ["id", "method", "headers", "url", "body"]
67
- request_json = dict(
68
- (k, v)
69
- for k, v in vars(request).items()
70
- if v is not None and k in allowed_props
71
- )
72
- request_json["id"] = query_id
63
+
64
+ request_json = {
65
+ "id": query_id,
66
+ "url": request.url.replace(query.context.service_root_url(), ""),
67
+ "method": request.method,
68
+ "headers": request.headers,
69
+ }
70
+ if request.data:
71
+ request_json["body"] = request.data
72
+
73
73
  if depends_on is not None:
74
74
  request_json["dependsOn"] = depends_on
75
- request_json["url"] = request_json["url"].replace(
76
- query.context.service_root_url(), ""
77
- )
78
75
  return request_json
@@ -61,3 +61,7 @@ class BatchQuery(ClientQuery):
61
61
  @property
62
62
  def url(self):
63
63
  return "{0}/$batch".format(self.context.service_root_url())
64
+
65
+ @property
66
+ def return_type(self):
67
+ return [q.return_type for q in self._queries]
@@ -1,3 +1,4 @@
1
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
1
2
  from office365.sharepoint.entity import Entity
2
3
 
3
4
 
@@ -6,4 +7,9 @@ class AppPrincipalIdentityProvider(Entity):
6
7
 
7
8
  @staticmethod
8
9
  def external(context):
9
- pass
10
+ return_type = AppPrincipalIdentityProvider(context)
11
+ qry = ServiceOperationQuery(
12
+ return_type, "External", None, None, None, return_type, True
13
+ )
14
+ context.add_query(qry)
15
+ return return_type
@@ -0,0 +1,41 @@
1
+ from office365.onedrive.sites.site import Site
2
+ from office365.runtime.paths.resource_path import ResourcePath
3
+ from office365.runtime.paths.service_operation import ServiceOperationPath
4
+ from office365.sharepoint.client_context import ClientContext
5
+ from office365.sharepoint.entity import Entity
6
+ from office365.sharepoint.webs.web import Web
7
+
8
+
9
+ class AppContextSite(Entity):
10
+ """ """
11
+
12
+ def __init__(self, context, site_url):
13
+ # type: (ClientContext, str) -> None
14
+ """"""
15
+ static_path = ServiceOperationPath(
16
+ "SP.AppContextSite",
17
+ {"siteUrl": site_url},
18
+ )
19
+ super(AppContextSite, self).__init__(context, static_path)
20
+
21
+ @property
22
+ def site(self):
23
+ """"""
24
+ return self.properties.get(
25
+ "Site",
26
+ Site(
27
+ self.context,
28
+ ResourcePath("Site", self.resource_path),
29
+ ),
30
+ )
31
+
32
+ @property
33
+ def web(self):
34
+ """"""
35
+ return self.properties.get(
36
+ "Web",
37
+ Web(
38
+ self.context,
39
+ ResourcePath("Web", self.resource_path),
40
+ ),
41
+ )
@@ -0,0 +1,11 @@
1
+ from office365.sharepoint.authpolicy.events.event import SPAuthEvent
2
+ from office365.sharepoint.entity_collection import EntityCollection
3
+
4
+
5
+ class SPAuthEventCollection(EntityCollection[SPAuthEvent]):
6
+ """Represents a collection of Field resource."""
7
+
8
+ def __init__(self, context, resource_path=None, parent=None):
9
+ super(SPAuthEventCollection, self).__init__(
10
+ context, SPAuthEvent, resource_path, parent
11
+ )
@@ -2,6 +2,7 @@ from office365.sharepoint.entity import Entity
2
2
 
3
3
 
4
4
  class SPAuthEvent(Entity):
5
+
5
6
  @property
6
7
  def entity_type_name(self):
7
8
  return "Microsoft.SharePoint.AuthPolicy.Events.SPAuthEvent"
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class RoleAssignmentResourcePayload(ClientValue):
5
+ """ """
File without changes
@@ -0,0 +1,9 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class BrandCenter(Entity):
5
+ """
6
+ The SharePoint brand center API offers a centralized branding management application
7
+ that empowers your brand managers or designated brand owners to help your organization to customize
8
+ the look and feel of their experiences.
9
+ """
@@ -0,0 +1,5 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class BrandCenterConfiguration(ClientValue):
5
+ """ """
@@ -16,9 +16,7 @@ class Change(Entity):
16
16
 
17
17
  @property
18
18
  def change_token(self):
19
- """
20
- Returns an ChangeToken that represents the change.
21
- """
19
+ """Returns an ChangeToken that represents the change."""
22
20
  return self.properties.get("ChangeToken", ChangeToken())
23
21
 
24
22
  @property
@@ -22,6 +22,7 @@ class ChangeCollection(EntityCollection[Change]):
22
22
  from office365.sharepoint.changes.item import ChangeItem
23
23
  from office365.sharepoint.changes.list import ChangeList
24
24
  from office365.sharepoint.changes.user import ChangeUser
25
+ from office365.sharepoint.changes.view import ChangeView
25
26
  from office365.sharepoint.changes.web import ChangeWeb
26
27
 
27
28
  if "ItemId" in properties and "ListId" in properties:
@@ -40,3 +41,5 @@ class ChangeCollection(EntityCollection[Change]):
40
41
  self._item_type = ChangeAlert
41
42
  elif "FieldId" in properties:
42
43
  self._item_type = ChangeField
44
+ elif "ViewId" in properties:
45
+ self._item_type = ChangeView
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.changes.change import Change
2
4
 
3
5
 
@@ -6,8 +8,12 @@ class ChangeFolder(Change):
6
8
 
7
9
  @property
8
10
  def unique_id(self):
11
+ # type: () -> Optional[str]
12
+ """Identifies the folder that has changed."""
9
13
  return self.properties.get("UniqueId", None)
10
14
 
11
15
  @property
12
16
  def web_id(self):
17
+ # type: () -> Optional[str]
18
+ """Identifies the site that contains the changed folder."""
13
19
  return self.properties.get("WebId", None)
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.sharepoint.changes.change import Change
2
4
 
3
5
 
@@ -6,5 +8,6 @@ class ChangeGroup(Change):
6
8
 
7
9
  @property
8
10
  def group_id(self):
11
+ # type: () -> Optional[int]
9
12
  """Identifies the changed group."""
10
13
  return self.properties.get("GroupId", None)
@@ -16,9 +16,22 @@ class ChangeList(Change):
16
16
 
17
17
  @property
18
18
  def base_template(self):
19
+ # type: () -> Optional[int]
19
20
  """An SP.ListTemplateType object that returns the list template type of the list."""
20
21
  return self.properties.get("BaseTemplate", None)
21
22
 
23
+ @property
24
+ def editor(self):
25
+ # type: () -> Optional[str]
26
+ """A string that returns the name of the user who modified the list."""
27
+ return self.properties.get("Editor", None)
28
+
29
+ @property
30
+ def hidden(self):
31
+ # type: () -> Optional[bool]
32
+ """Returns a Boolean value that indicates whether a list is a hidden list."""
33
+ return self.properties.get("Hidden", None)
34
+
22
35
  @property
23
36
  def list_id(self):
24
37
  # type: () -> Optional[str]
@@ -0,0 +1,25 @@
1
+ from typing import Optional
2
+
3
+ from office365.sharepoint.changes.change import Change
4
+
5
+
6
+ class ChangeView(Change):
7
+ """Specifies a change on a view."""
8
+
9
+ @property
10
+ def view_id(self):
11
+ # type: () -> Optional[str]
12
+ """Identifies the changed view."""
13
+ return self.properties.get("ViewId", None)
14
+
15
+ @property
16
+ def list_id(self):
17
+ # type: () -> Optional[str]
18
+ """Identifies the list that contains the changed view."""
19
+ return self.properties.get("ListId", None)
20
+
21
+ @property
22
+ def web_id(self):
23
+ # type: () -> Optional[str]
24
+ """Identifies the site that contains the changed view."""
25
+ return self.properties.get("WebId", None)
@@ -8,6 +8,7 @@ from office365.runtime.auth.authentication_context import AuthenticationContext
8
8
  from office365.runtime.auth.client_credential import ClientCredential
9
9
  from office365.runtime.auth.token_response import TokenResponse
10
10
  from office365.runtime.auth.user_credential import UserCredential
11
+ from office365.runtime.client_object import ClientObject
11
12
  from office365.runtime.client_result import ClientResult
12
13
  from office365.runtime.client_runtime_context import ClientRuntimeContext
13
14
  from office365.runtime.compat import get_absolute_url, urlparse
@@ -41,7 +42,7 @@ class ClientContext(ClientRuntimeContext):
41
42
  """SharePoint client context (SharePoint v1 API)"""
42
43
 
43
44
  def __init__(self, base_url, auth_context=None):
44
- # type: (str, AuthenticationContext) -> None
45
+ # type: (str, AuthenticationContext | None) -> None
45
46
  """
46
47
  Instantiates a SharePoint client context
47
48
 
@@ -197,11 +198,11 @@ class ClientContext(ClientRuntimeContext):
197
198
  return self
198
199
 
199
200
  def execute_batch(self, items_per_batch=100, success_callback=None):
200
- # type: (int, Callable[[int], None]) -> Self
201
+ # type: (int, Callable[[List[ClientObject|ClientResult]], None]) -> Self
201
202
  """
202
203
  Construct and submit to a server a batch request
203
204
  :param int items_per_batch: Maximum to be selected for bulk operation
204
- :param (int)-> None success_callback: A callback
205
+ :param (List[ClientObject|ClientResult])-> None success_callback: A success callback
205
206
  """
206
207
  batch_request = ODataBatchV3Request(JsonLightFormat())
207
208
  batch_request.beforeExecute += self._authenticate_request
@@ -210,7 +211,7 @@ class ClientContext(ClientRuntimeContext):
210
211
  qry = self._get_next_query(items_per_batch)
211
212
  batch_request.execute_query(qry)
212
213
  if callable(success_callback):
213
- success_callback(items_per_batch)
214
+ success_callback(qry.return_type)
214
215
  return self
215
216
 
216
217
  def pending_request(self):
@@ -410,6 +411,14 @@ class ClientContext(ClientRuntimeContext):
410
411
 
411
412
  return AnnouncementsController(self, ResourcePath("Announcements"))
412
413
 
414
+ @property
415
+ def brand_center(self):
416
+ """Alias to BrandCenter"""
417
+
418
+ from office365.sharepoint.brandcenter.brand_center import BrandCenter
419
+
420
+ return BrandCenter(self, ResourcePath("BrandCenter"))
421
+
413
422
  @property
414
423
  def client_people_picker(self):
415
424
  """Query principals service alias"""
@@ -701,6 +710,16 @@ class ClientContext(ClientRuntimeContext):
701
710
 
702
711
  return WorkflowServicesManager.current(self)
703
712
 
713
+ @property
714
+ def workflow_deployment_service(self):
715
+ """Alias to WorkflowServicesManager"""
716
+
717
+ from office365.sharepoint.workflowservices.deployment_service import (
718
+ WorkflowDeploymentService,
719
+ )
720
+
721
+ return WorkflowDeploymentService(self)
722
+
704
723
  @property
705
724
  def work_items(self):
706
725
  """"""
@@ -1,3 +1,5 @@
1
+ from typing_extensions import Self
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
@@ -52,6 +54,7 @@ class FieldLinkCollection(EntityCollection[FieldLink]):
52
54
  )
53
55
 
54
56
  def reorder(self, internal_names):
57
+ # type: (list[str]) -> Self
55
58
  """
56
59
  Rearranges the collection of field links in the order in which field internal names are specified.
57
60
 
File without changes
@@ -0,0 +1,27 @@
1
+ from office365.runtime.client_result import ClientResult
2
+ from office365.runtime.queries.service_operation import ServiceOperationQuery
3
+ from office365.sharepoint.copilot.file_collection_query_result import (
4
+ CopilotFileCollectionQueryResult,
5
+ )
6
+ from office365.sharepoint.entity import Entity
7
+
8
+
9
+ class CopilotFileCollection(Entity):
10
+ """ """
11
+
12
+ @staticmethod
13
+ def get_working_set_files(context, top=None, order_by=None, skip_token=None):
14
+ """ """
15
+ payload = {"top": top, "orderBy": order_by, "skipToken": skip_token}
16
+ return_type = ClientResult(context, CopilotFileCollectionQueryResult())
17
+ qry = ServiceOperationQuery(
18
+ CopilotFileCollection(context),
19
+ "GetWorkingSetFiles",
20
+ None,
21
+ payload,
22
+ None,
23
+ return_type,
24
+ True,
25
+ )
26
+ context.add_query(qry)
27
+ return return_type