Office365-REST-Python-Client 2.5.8__py3-none-any.whl → 2.5.10__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 (65) hide show
  1. {Office365_REST_Python_Client-2.5.8.dist-info → Office365_REST_Python_Client-2.5.10.dist-info}/METADATA +1 -1
  2. {Office365_REST_Python_Client-2.5.8.dist-info → Office365_REST_Python_Client-2.5.10.dist-info}/RECORD +65 -48
  3. office365/onedrive/driveitems/driveItem.py +40 -6
  4. office365/onedrive/internal/paths/url.py +14 -0
  5. office365/onedrive/sitepages/horizontal_section_column.py +1 -1
  6. office365/onedrive/sitepages/site_page.py +1 -1
  7. office365/onedrive/sitepages/vertical_section.py +1 -1
  8. office365/onedrive/sitepages/webparts/__init__.py +0 -0
  9. office365/onedrive/sitepages/webparts/standard.py +5 -0
  10. office365/onedrive/sitepages/webparts/text.py +5 -0
  11. office365/runtime/client_object.py +4 -3
  12. office365/runtime/client_request.py +1 -1
  13. office365/runtime/client_runtime_context.py +3 -3
  14. office365/runtime/paths/resource_path.py +3 -0
  15. office365/sharepoint/alerts/collection.py +12 -0
  16. office365/sharepoint/attachments/collection.py +1 -1
  17. office365/sharepoint/businessdata/infrastructure/securestore/connection_settings.py +23 -1
  18. office365/sharepoint/directory/membership_result.py +5 -0
  19. office365/sharepoint/entity.py +5 -0
  20. office365/sharepoint/fields/date_time.py +18 -0
  21. office365/sharepoint/fields/lookup.py +20 -0
  22. office365/sharepoint/fields/multi_line_text.py +25 -0
  23. office365/sharepoint/fields/rating_scale.py +2 -5
  24. office365/sharepoint/files/collection.py +6 -5
  25. office365/sharepoint/files/versions/version.py +7 -0
  26. office365/sharepoint/lists/list.py +3 -2
  27. office365/sharepoint/migrationcenter/service/performance/dashboard_data.py +12 -0
  28. office365/sharepoint/migrationcenter/service/performance/data.py +38 -0
  29. office365/sharepoint/migrationcenter/service/performance/throughput_data.py +9 -0
  30. office365/sharepoint/migrationcenter/service/services.py +22 -0
  31. office365/sharepoint/multigeo/api_versions.py +28 -0
  32. office365/sharepoint/multigeo/services.py +39 -0
  33. office365/sharepoint/multigeo/tenant_information.py +9 -0
  34. office365/sharepoint/publishing/portal_health_details.py +10 -0
  35. office365/sharepoint/publishing/portal_health_status.py +8 -1
  36. office365/sharepoint/search/service.py +5 -3
  37. office365/sharepoint/sharing/permission_collection.py +8 -1
  38. office365/sharepoint/sharing/shared_document_info.py +19 -0
  39. office365/sharepoint/sitehealth/summary.py +20 -0
  40. office365/sharepoint/sites/site.py +12 -0
  41. office365/sharepoint/tenant/administration/container_properties.py +17 -0
  42. office365/sharepoint/tenant/administration/group.py +17 -0
  43. office365/sharepoint/tenant/administration/powerapps/environment.py +31 -0
  44. office365/sharepoint/tenant/administration/recent_admin_action_report.py +14 -0
  45. office365/sharepoint/tenant/administration/recent_admin_action_report_payload.py +10 -0
  46. office365/sharepoint/tenant/administration/siteinfo_for_site_picker.py +5 -1
  47. office365/sharepoint/tenant/administration/sites/creation_default_storage_quota.py +5 -0
  48. office365/sharepoint/tenant/administration/sites/creation_source.py +16 -1
  49. office365/sharepoint/tenant/administration/sites/properties_collection.py +2 -0
  50. office365/sharepoint/tenant/administration/sites/state_properties.py +14 -0
  51. office365/sharepoint/tenant/administration/tenant.py +42 -1
  52. office365/sharepoint/tenant/management/office365_tenant.py +18 -0
  53. office365/sharepoint/types/resource_path.py +1 -1
  54. office365/sharepoint/userprofiles/profile_loader.py +1 -3
  55. office365/sharepoint/userprofiles/user_profile.py +80 -6
  56. office365/sharepoint/views/view.py +1 -1
  57. office365/sharepoint/views/visualization/__init__.py +0 -0
  58. office365/sharepoint/views/visualization/field.py +14 -0
  59. office365/sharepoint/views/visualization/style_set.py +5 -0
  60. office365/sharepoint/workflow/manager.py +5 -0
  61. {Office365_REST_Python_Client-2.5.8.dist-info → Office365_REST_Python_Client-2.5.10.dist-info}/LICENSE +0 -0
  62. {Office365_REST_Python_Client-2.5.8.dist-info → Office365_REST_Python_Client-2.5.10.dist-info}/WHEEL +0 -0
  63. {Office365_REST_Python_Client-2.5.8.dist-info → Office365_REST_Python_Client-2.5.10.dist-info}/top_level.txt +0 -0
  64. /office365/onedrive/sitepages/{web_part.py → webparts/web_part.py} +0 -0
  65. /office365/sharepoint/views/{visualization.py → visualization/visualization.py} +0 -0
@@ -39,6 +39,18 @@ class AlertCollection(EntityCollection[Alert]):
39
39
  self.context.add_query(qry)
40
40
  return return_type
41
41
 
42
+ def delete_alert_at_index(self, index):
43
+ """Deletes the alert based on the given index.
44
+
45
+ :param int index: A 32-bit integer that is greater than or equal to 0 and less than the count of the
46
+ alert in the collection. Specifies the index of the alert in the collection.
47
+ """
48
+ qry = ServiceOperationQuery(
49
+ self, "DeleteAlertAtIndex", {"index": index}, None, None, None
50
+ )
51
+ self.context.add_query(qry)
52
+ return self
53
+
42
54
  def get_by_id(self, id_alert):
43
55
  """
44
56
  Gets an alert based on the Id.
@@ -19,7 +19,7 @@ class AttachmentCollection(EntityCollection[Attachment]):
19
19
  )
20
20
 
21
21
  def add(self, attachment_file_information):
22
- # type: (AttachmentCreationInformation) -> Attachment
22
+ # type: (AttachmentCreationInformation|dict) -> Attachment
23
23
  """
24
24
  Adds the attachment represented by the file name and stream in the specified parameter to the list item.
25
25
 
@@ -1,8 +1,30 @@
1
+ from typing import Optional
2
+
3
+ from office365.runtime.paths.resource_path import ResourcePath
1
4
  from office365.sharepoint.entity import Entity
2
5
 
3
6
 
4
7
  class ConnectionSettings(Entity):
5
- """"""
8
+ """The ConnectionSettings contains information about an endpoint (4) that can be used to connect to it."""
9
+
10
+ def __init__(self, context, resource_path=None):
11
+ if resource_path is None:
12
+ resource_path = ResourcePath(
13
+ "Microsoft.BusinessData.Infrastructure.SecureStore.ConnectionSettings"
14
+ )
15
+ super(ConnectionSettings, self).__init__(context, resource_path)
16
+
17
+ @property
18
+ def authentication_mode(self):
19
+ # type: () -> Optional[str]
20
+ """The authentication mode used by the endpoint"""
21
+ return self.properties.get("AuthenticationMode", None)
22
+
23
+ @property
24
+ def parent_name(self):
25
+ # type: () -> Optional[str]
26
+ """The unique name used to identify the parent of the endpoint"""
27
+ return self.properties.get("parentName", None)
6
28
 
7
29
  @property
8
30
  def entity_type_name(self):
@@ -1,7 +1,12 @@
1
+ from office365.runtime.types.collections import StringCollection
1
2
  from office365.sharepoint.entity import Entity
2
3
 
3
4
 
4
5
  class MembershipResult(Entity):
6
+ @property
7
+ def groups_list(self):
8
+ return self.properties.get("GroupsList", StringCollection())
9
+
5
10
  @property
6
11
  def entity_type_name(self):
7
12
  return "SP.Directory.MembershipResult"
@@ -16,6 +16,11 @@ if TYPE_CHECKING:
16
16
  class Entity(ClientObject):
17
17
  """SharePoint specific entity"""
18
18
 
19
+ def execute_query_with_incremental_retry(self, max_retry=5):
20
+ """Handles throttling requests."""
21
+ self.context.execute_query_with_incremental_retry(max_retry)
22
+ return self
23
+
19
24
  def execute_batch(self, items_per_batch=100, success_callback=None):
20
25
  # type: (int, Callable[[int], None]) -> Self
21
26
  """Construct and submit to a server a batch request"""
@@ -24,3 +24,21 @@ class FieldDateTime(Field):
24
24
  # type: () -> Optional[str]
25
25
  """ """
26
26
  return self.properties.get("DateFormat", None)
27
+
28
+ @property
29
+ def display_format(self):
30
+ # type: () -> Optional[int]
31
+ """Specifies the type of date and time format that is used in the field"""
32
+ return self.properties.get("DisplayFormat", None)
33
+
34
+ @property
35
+ def friendly_display_format(self):
36
+ # type: () -> Optional[int]
37
+ """Gets the type of friendly display format that is used in the field"""
38
+ return self.properties.get("FriendlyDisplayFormat", None)
39
+
40
+ @property
41
+ def time_format(self):
42
+ # type: () -> Optional[str]
43
+ """Gets the time format that is used in the field"""
44
+ return self.properties.get("TimeFormat", None)
@@ -43,3 +43,23 @@ class FieldLookup(Field):
43
43
  """Sets a value that specifies the list identifier of the list that contains the field to use as
44
44
  the lookup values."""
45
45
  self.set_property("LookupList", val, True)
46
+
47
+ @property
48
+ def primary_field_id(self):
49
+ # type: () -> Optional[str]
50
+ """Specifies the primary lookup field identifier if this is a dependent lookup field.
51
+ Otherwise, it is an empty string."""
52
+ return self.properties.get("PrimaryFieldId", None)
53
+
54
+ @property
55
+ def relationship_delete_behavior(self):
56
+ # type: () -> Optional[int]
57
+ """Gets a value that specifies the relationship delete behavior of the lookup field."""
58
+ return self.properties.get("RelationshipDeleteBehavior", None)
59
+
60
+ @property
61
+ def unlimited_length_in_document_library(self):
62
+ # type: () -> Optional[bool]
63
+ """Gets or sets a Boolean value that specifies whether to allow values with unlimited text
64
+ in the lookup field."""
65
+ return self.properties.get("UnlimitedLengthInDocumentLibrary", None)
@@ -31,3 +31,28 @@ class FieldMultiLineText(Field):
31
31
  # type: (int) -> None
32
32
  """Set the number of lines to display in the field."""
33
33
  self.set_property("NumberOfLines", val)
34
+
35
+ @property
36
+ def restricted_mode(self):
37
+ # type: () -> Optional[bool]
38
+ """Specifies whether the field supports a subset of rich text formatting."""
39
+ return self.properties.get("RestrictedMode", None)
40
+
41
+ @property
42
+ def rich_text(self):
43
+ # type: () -> Optional[bool]
44
+ """Specifies whether the field supports rich text formatting."""
45
+ return self.properties.get("RichText", None)
46
+
47
+ @property
48
+ def unlimited_length_in_document_library(self):
49
+ # type: () -> Optional[bool]
50
+ """Gets a Boolean value that specifies whether to allow unlimited field length in document libraries."""
51
+ return self.properties.get("UnlimitedLengthInDocumentLibrary", None)
52
+
53
+ @property
54
+ def wiki_linking(self):
55
+ # type: () -> Optional[bool]
56
+ """Specifies whether an implementation-specific mechanism for linking wiki pages is supported.
57
+ It MUST be "false" if RichText is "false"."""
58
+ return self.properties.get("WikiLinking", None)
@@ -15,11 +15,8 @@ class FieldRatingScale(FieldMultiChoice):
15
15
 
16
16
  @grid_start_number.setter
17
17
  def grid_start_number(self, value):
18
- """
19
- Gets the start number for the rating scale.
20
-
21
- :type value: int
22
- """
18
+ # type: (int) -> None
19
+ """Gets the start number for the rating scale."""
23
20
  self.set_property("GridStartNumber", value)
24
21
 
25
22
  @property
@@ -24,22 +24,23 @@ class FileCollection(EntityCollection[File]):
24
24
  # type: (ClientContext, ResourcePath, Folder) -> None
25
25
  super(FileCollection, self).__init__(context, File, resource_path, parent)
26
26
 
27
- def upload(self, path_or_file):
28
- # type: (str|IO) -> File
27
+ def upload(self, path_or_file, file_name=None):
28
+ # type: (str|IO, str) -> File
29
29
  """Uploads a file into folder.
30
30
 
31
31
  Note: This method only supports files up to 4MB in size!
32
32
  Consider create_upload_session method instead for larger files
33
- :param str or typing.IO path_or_file: path where file to upload resides or file handle
33
+ :param str or typing.IO path_or_file: Path where file to upload resides or file handle
34
+ :param str file_name: New file name
34
35
  """
35
36
  if hasattr(path_or_file, "read"):
37
+ name = file_name or os.path.basename(path_or_file.name)
36
38
  content = path_or_file.read()
37
- name = os.path.basename(path_or_file.name)
38
39
  return self.add(name, content, True)
39
40
  else:
40
41
  with open(path_or_file, "rb") as f:
41
42
  content = f.read()
42
- name = os.path.basename(path_or_file)
43
+ name = file_name or os.path.basename(path_or_file)
43
44
  return self.add(name, content, True)
44
45
 
45
46
  def upload_with_checksum(self, file_object, chunk_size=1024):
@@ -1,3 +1,4 @@
1
+ from datetime import datetime
1
2
  from typing import IO, AnyStr, Optional
2
3
 
3
4
  from typing_extensions import Self
@@ -54,6 +55,12 @@ class FileVersion(Entity):
54
55
  self.context.add_query(qry)
55
56
  return return_type
56
57
 
58
+ @property
59
+ def created(self):
60
+ # type: () -> Optional[datetime]
61
+ """Specifies the creation date and time for the file version."""
62
+ return self.properties.get("Created", datetime.min)
63
+
57
64
  @property
58
65
  def created_by(self):
59
66
  """Gets the user that created the file version."""
@@ -1,6 +1,6 @@
1
1
  import os
2
2
  from datetime import datetime
3
- from typing import TYPE_CHECKING, AnyStr, Optional
3
+ from typing import TYPE_CHECKING, AnyStr, Dict, Optional
4
4
 
5
5
  from office365.runtime.client_result import ClientResult
6
6
  from office365.runtime.client_value_collection import ClientValueCollection
@@ -182,11 +182,12 @@ class List(SecurableObject):
182
182
  return return_type
183
183
 
184
184
  def get_site_script(self, options=None):
185
+ # type: (Dict) -> ClientResult[str]
185
186
  """Creates site script syntax
186
187
 
187
188
  :param dict or None options:
188
189
  """
189
- return_type = ClientResult(self.context) # type: ClientResult[str]
190
+ return_type = ClientResult(self.context)
190
191
 
191
192
  def _list_loaded():
192
193
  list_abs_path = SPResPath.create_absolute(
@@ -1,9 +1,21 @@
1
1
  from office365.runtime.client_value import ClientValue
2
+ from office365.runtime.client_value_collection import ClientValueCollection
3
+ from office365.runtime.types.collections import StringCollection
4
+ from office365.sharepoint.migrationcenter.service.performance.throughput_data import (
5
+ ThroughputData,
6
+ )
2
7
 
3
8
 
4
9
  class PerformanceDashboardData(ClientValue):
5
10
  """"""
6
11
 
12
+ def __init__(
13
+ self, bottleneck_list=None, recommendation_list=None, throughput_trend=None
14
+ ):
15
+ self.BottleneckList = StringCollection(bottleneck_list)
16
+ self.RecommendationList = StringCollection(recommendation_list)
17
+ self.ThroughputTrend = ClientValueCollection(ThroughputData, throughput_trend)
18
+
7
19
  @property
8
20
  def entity_type_name(self):
9
21
  return "Microsoft.Online.SharePoint.MigrationCenter.Service.PerformanceDashboardData"
@@ -1,3 +1,10 @@
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.entity_collection import EntityCollection
5
+ from office365.sharepoint.migrationcenter.service.performance.dashboard_data import (
6
+ PerformanceDashboardData,
7
+ )
1
8
  from office365.sharepoint.migrationcenter.service.performance.entity_data import (
2
9
  MigrationPerformanceEntityData,
3
10
  )
@@ -5,3 +12,34 @@ from office365.sharepoint.migrationcenter.service.performance.entity_data import
5
12
 
6
13
  class PerformanceData(MigrationPerformanceEntityData):
7
14
  """"""
15
+
16
+ def __init__(self, context, resource_path=None):
17
+ if resource_path is None:
18
+ resource_path = ResourcePath(
19
+ "Microsoft.Online.SharePoint.MigrationCenter.Service.PerformanceData"
20
+ )
21
+ super(PerformanceData, self).__init__(context, resource_path)
22
+
23
+ @property
24
+ def entity_type_name(self):
25
+ return "Microsoft.Online.SharePoint.MigrationCenter.Service.PerformanceData"
26
+
27
+
28
+ class PerformanceDataCollection(EntityCollection[PerformanceData]):
29
+ def __init__(self, context, resource_path=None):
30
+ super(PerformanceDataCollection, self).__init__(
31
+ context, PerformanceData, resource_path
32
+ )
33
+
34
+ def get_data(self, StartTime=None, EndTime=None, AgentId=None, TimeUnit=None):
35
+ """ """
36
+ return_type = ClientResult(self.context, PerformanceDashboardData())
37
+ payload = {
38
+ "StartTime": StartTime,
39
+ "EndTime": EndTime,
40
+ "AgentId": AgentId,
41
+ "TimeUnit": TimeUnit,
42
+ }
43
+ qry = ServiceOperationQuery(self, "GetData", None, payload, None, return_type)
44
+ self.context.add_query(qry)
45
+ return return_type
@@ -0,0 +1,9 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class ThroughputData(ClientValue):
5
+ """"""
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.Online.SharePoint.MigrationCenter.Service.ThroughputData"
@@ -1,7 +1,29 @@
1
+ from office365.runtime.paths.resource_path import ResourcePath
1
2
  from office365.sharepoint.entity import Entity
3
+ from office365.sharepoint.migrationcenter.service.performance.data import (
4
+ PerformanceDataCollection,
5
+ )
2
6
 
3
7
 
4
8
  class MigrationCenterServices(Entity):
9
+ def __init__(self, context, resource_path=None):
10
+ if resource_path is None:
11
+ resource_path = ResourcePath(
12
+ "Microsoft.Online.SharePoint.MigrationCenter.Service.MigrationCenterServices"
13
+ )
14
+ super(MigrationCenterServices, self).__init__(context, resource_path)
15
+
16
+ @property
17
+ def performance_data(self):
18
+ # type: () -> PerformanceDataCollection
19
+ """Get root web"""
20
+ return self.properties.get(
21
+ "PerformanceData",
22
+ PerformanceDataCollection(
23
+ self.context, ResourcePath("PerformanceData", self.resource_path)
24
+ ),
25
+ )
26
+
5
27
  @property
6
28
  def entity_type_name(self):
7
29
  return "Microsoft.Online.SharePoint.MigrationCenter.Service.MigrationCenterServices"
@@ -0,0 +1,28 @@
1
+ from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.runtime.types.collections import StringCollection
3
+ from office365.sharepoint.entity import Entity
4
+
5
+
6
+ class MultiGeoApiVersions(Entity):
7
+ """"""
8
+
9
+ def __init__(self, context, resource_path=None):
10
+ if resource_path is None:
11
+ resource_path = ResourcePath(
12
+ "Microsoft.Online.SharePoint.MultiGeo.Service.MultiGeoApiVersions"
13
+ )
14
+ super(MultiGeoApiVersions, self).__init__(context, resource_path)
15
+
16
+ @property
17
+ def supported_versions(self):
18
+ return self.properties.get("SupportedVersions", StringCollection())
19
+
20
+ @property
21
+ def entity_type_name(self):
22
+ return "Microsoft.Online.SharePoint.MultiGeo.Service.MultiGeoApiVersions"
23
+
24
+ def get_property(self, name, default_value=None):
25
+ if default_value is None:
26
+ property_mapping = {"SupportedVersions": self.supported_versions}
27
+ default_value = property_mapping.get(name, None)
28
+ return super(MultiGeoApiVersions, self).get_property(name, default_value)
@@ -0,0 +1,39 @@
1
+ from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.sharepoint.entity import Entity
3
+ from office365.sharepoint.entity_collection import EntityCollection
4
+ from office365.sharepoint.multigeo.unified_group import UnifiedGroup
5
+
6
+
7
+ class MultiGeoServices(Entity):
8
+ """
9
+ Multi-Geo capabilities in OneDrive and SharePoint enable control of shared resources like SharePoint team sites
10
+ and Microsoft 365 Group mailboxes stored at rest in a specified geo location.
11
+
12
+ Each user, Group mailbox, and SharePoint site have a Preferred Data Location (PDL) which denotes the geo location
13
+ where related data is to be stored. Users' personal data (Exchange mailbox and OneDrive) along with any
14
+ Microsoft 365 Groups or SharePoint sites that they create can be stored in the specified geo location to meet
15
+ data residency requirements.
16
+ """
17
+
18
+ @property
19
+ def unified_groups(self):
20
+ # type: () -> EntityCollection[UnifiedGroup]
21
+ """ """
22
+ return self.properties.get(
23
+ "UnifiedGroups",
24
+ EntityCollection(
25
+ self.context,
26
+ UnifiedGroup,
27
+ ResourcePath("UnifiedGroups", self.resource_path),
28
+ ),
29
+ )
30
+
31
+ @property
32
+ def entity_type_name(self):
33
+ return "Microsoft.Online.SharePoint.MultiGeo.Service.MultiGeoServicesBeta"
34
+
35
+ def get_property(self, name, default_value=None):
36
+ if default_value is None:
37
+ property_mapping = {"UnifiedGroups": self.unified_groups}
38
+ default_value = property_mapping.get(name, None)
39
+ return super(MultiGeoServices, self).get_property(name, default_value)
@@ -0,0 +1,9 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class TenantInformation(Entity):
5
+ """ """
6
+
7
+ @property
8
+ def entity_type_name(self):
9
+ return "Microsoft.Online.SharePoint.MultiGeo.Service.TenantInformation"
@@ -0,0 +1,10 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class PortalHealthDetails(ClientValue):
5
+ def __init__(self):
6
+ """ """
7
+
8
+ @property
9
+ def entity_type_name(self):
10
+ return "SP.Publishing.PortalHealthStatusDetails"
@@ -1,9 +1,16 @@
1
1
  from office365.runtime.client_value import ClientValue
2
+ from office365.runtime.client_value_collection import ClientValueCollection
3
+ from office365.sharepoint.publishing.portal_health_details import PortalHealthDetails
2
4
 
3
5
 
4
6
  class PortalHealthStatus(ClientValue):
5
- def __init__(self, status=None):
7
+ def __init__(self, details=None, status=None):
6
8
  """
7
9
  :param int status:
8
10
  """
11
+ self.Details = ClientValueCollection(PortalHealthDetails, details)
9
12
  self.Status = status
13
+
14
+ @property
15
+ def entity_type_name(self):
16
+ return "SP.Publishing.PortalHealthStatus"
@@ -1,3 +1,5 @@
1
+ from typing import Any, List
2
+
1
3
  from office365.runtime.client_result import ClientResult
2
4
  from office365.runtime.client_value_collection import ClientValueCollection
3
5
  from office365.runtime.paths.resource_path import ResourcePath
@@ -162,6 +164,7 @@ class SearchService(Entity):
162
164
  row_limit=None,
163
165
  **kwargs
164
166
  ):
167
+ # type: (str, List[str], bool, int, Any) -> ClientResult[SearchResult]
165
168
  """The operation is used to retrieve search results through the use of the HTTP protocol
166
169
  with method type POST.
167
170
 
@@ -172,9 +175,7 @@ class SearchService(Entity):
172
175
  :param int row_limit: The number of search results the protocol client wants to receive, starting at the index
173
176
  specified in the StartRow element. The RowLimit value MUST be greater than or equal to zero.
174
177
  """
175
- return_type = ClientResult(
176
- self.context, SearchResult()
177
- ) # type: ClientResult[SearchResult]
178
+ return_type = ClientResult(self.context, SearchResult())
178
179
  request = SearchRequest(
179
180
  query_text=query_text,
180
181
  select_properties=select_properties,
@@ -211,6 +212,7 @@ class SearchService(Entity):
211
212
  return self
212
213
 
213
214
  def search_center_url(self):
215
+ # type: () -> ClientResult[str]
214
216
  """The operation is used to get the URI address of the search center by using the HTTP protocol
215
217
  with the GET method. The operation returns the URI of the of the search center.
216
218
  """
@@ -13,7 +13,12 @@ class PermissionCollection(ClientValue):
13
13
  """
14
14
 
15
15
  def __init__(
16
- self, hasInheritedLinks=None, links=None, principals=None, siteAdmins=None
16
+ self,
17
+ hasInheritedLinks=None,
18
+ links=None,
19
+ principals=None,
20
+ siteAdmins=None,
21
+ totalNumberOfPrincipals=None,
17
22
  ):
18
23
  """
19
24
  :param bool hasInheritedLinks:
@@ -21,11 +26,13 @@ class PermissionCollection(ClientValue):
21
26
  :param list[PrincipalInfo] principals: The List of Principals with their roles on this list item.
22
27
  :param list[PrincipalInfo] siteAdmins: The List of Principals who are Site Admins. This property is returned
23
28
  only if the caller is an Auditor.
29
+ :param int totalNumberOfPrincipals:
24
30
  """
25
31
  self.hasInheritedLinks = hasInheritedLinks
26
32
  self.links = ClientValueCollection(LinkInfo, links)
27
33
  self.principals = ClientValueCollection(PrincipalInfo, principals)
28
34
  self.siteAdmins = ClientValueCollection(PrincipalInfo, siteAdmins)
35
+ self.totalNumberOfPrincipals = totalNumberOfPrincipals
29
36
 
30
37
  @property
31
38
  def entity_type_name(self):
@@ -1,5 +1,6 @@
1
1
  from typing import Optional
2
2
 
3
+ from office365.sharepoint.contenttypes.content_type_id import ContentTypeId
3
4
  from office365.sharepoint.entity import Entity
4
5
  from office365.sharepoint.sharing.principal import Principal
5
6
 
@@ -24,6 +25,24 @@ class SharedDocumentInfo(Entity):
24
25
  """"""
25
26
  return self.properties.get("CallerStack", None)
26
27
 
28
+ @property
29
+ def color_hex(self):
30
+ # type: () -> Optional[str]
31
+ """"""
32
+ return self.properties.get("ColorHex", None)
33
+
34
+ @property
35
+ def color_tag(self):
36
+ # type: () -> Optional[str]
37
+ """"""
38
+ return self.properties.get("ColorTag", None)
39
+
40
+ @property
41
+ def content_type_id(self):
42
+ # type: () -> Optional[str]
43
+ """"""
44
+ return self.properties.get("ContentTypeId", ContentTypeId())
45
+
27
46
  @property
28
47
  def entity_type_name(self):
29
48
  return "SP.Sharing.SharedDocumentInfo"
@@ -1,3 +1,5 @@
1
+ from typing import Optional
2
+
1
3
  from office365.runtime.client_value_collection import ClientValueCollection
2
4
  from office365.sharepoint.entity import Entity
3
5
  from office365.sharepoint.sitehealth.result import SiteHealthResult
@@ -6,6 +8,24 @@ from office365.sharepoint.sitehealth.result import SiteHealthResult
6
8
  class SiteHealthSummary(Entity):
7
9
  """Specifies a summary of the results of running a set of site collection health rules."""
8
10
 
11
+ @property
12
+ def failed_error_count(self):
13
+ # type: () -> Optional[int]
14
+ """Specifies the number of site collection health rules that failed with an error."""
15
+ return self.properties.get("FailedErrorCount", None)
16
+
17
+ @property
18
+ def failed_warning_count(self):
19
+ # type: () -> Optional[int]
20
+ """Specifies the number of site collection health rules that failed with a warning."""
21
+ return self.properties.get("FailedWarningCount", None)
22
+
23
+ @property
24
+ def passed_count(self):
25
+ # type: () -> Optional[int]
26
+ """Specifies the number of site collection health rules that passed."""
27
+ return self.properties.get("PassedCount", None)
28
+
9
29
  @property
10
30
  def results(self):
11
31
  """Specifies a list of site collection health rule results, one for each site collection health rule that
@@ -88,6 +88,18 @@ class Site(Entity):
88
88
  self.ensure_properties(["Url", "GroupId", "Id"], _site_resolved)
89
89
  return self
90
90
 
91
+ def check_is_deletable(self):
92
+ """Check Site Is Deletable"""
93
+ return_type = ClientResult(self.context, bool())
94
+
95
+ def _check_is_deletable():
96
+ SPPolicyStoreProxy.check_site_is_deletable_by_id(
97
+ self.context, self.id, return_type
98
+ )
99
+
100
+ self.ensure_property("Id", _check_is_deletable)
101
+ return return_type
102
+
91
103
  def extend_upgrade_reminder_date(self):
92
104
  """
93
105
  Extend the upgrade reminder date for this site collection, so that site collection administrators will
@@ -0,0 +1,17 @@
1
+ from office365.runtime.client_value import ClientValue
2
+
3
+
4
+ class SPContainerProperties(ClientValue):
5
+ """"""
6
+
7
+ def __init__(self, AllowEditing=None, AuthenticationContextName=None):
8
+ """
9
+ :param bool AllowEditing:
10
+ :param str AuthenticationContextName:
11
+ """
12
+ self.AllowEditing = AllowEditing
13
+ self.AuthenticationContextName = AuthenticationContextName
14
+
15
+ @property
16
+ def entity_type_name(self):
17
+ return "Microsoft.Online.SharePoint.TenantAdministration.SPContainerProperties"
@@ -0,0 +1,17 @@
1
+ from office365.runtime.paths.resource_path import ResourcePath
2
+ from office365.sharepoint.entity import Entity
3
+
4
+
5
+ class SPOGroup(Entity):
6
+ """ """
7
+
8
+ def __init__(self, context, resource_path=None):
9
+ if resource_path is None:
10
+ resource_path = ResourcePath(
11
+ "Microsoft.Online.SharePoint.TenantAdministration.SPOGroup"
12
+ )
13
+ super(SPOGroup, self).__init__(context, resource_path)
14
+
15
+ @property
16
+ def entity_type_name(self):
17
+ return "Microsoft.Online.SharePoint.TenantAdministration.SPOGroup"