Office365-REST-Python-Client 2.5.2__py3-none-any.whl → 2.5.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/METADATA +4 -4
  2. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/RECORD +122 -119
  3. office365/base_item.py +12 -20
  4. office365/communications/presences/presence.py +18 -7
  5. office365/delta_path.py +1 -1
  6. office365/directory/administrative_unit.py +6 -7
  7. office365/directory/applications/application.py +15 -13
  8. office365/directory/audit/signins/signin.py +8 -12
  9. office365/directory/authentication/methods/details.py +8 -6
  10. office365/directory/groups/lifecycle_policy.py +8 -7
  11. office365/directory/identities/provider.py +5 -6
  12. office365/directory/internal/paths/me.py +1 -1
  13. office365/directory/permissions/email_identity.py +7 -0
  14. office365/directory/rolemanagement/role.py +5 -4
  15. office365/directory/rolemanagement/template.py +2 -6
  16. office365/directory/rolemanagement/unified_role_assignment.py +5 -4
  17. office365/directory/rolemanagement/unified_role_definition.py +6 -4
  18. office365/directory/serviceprincipals/service_principal.py +11 -6
  19. office365/directory/users/user.py +8 -11
  20. office365/entity.py +2 -2
  21. office365/entity_collection.py +11 -4
  22. office365/intune/devices/enrollment/configuration.py +6 -4
  23. office365/intune/devices/managed.py +9 -12
  24. office365/onedrive/analytics/item_activity_stat.py +4 -3
  25. office365/onedrive/columns/definition.py +9 -9
  26. office365/onedrive/documentsets/version.py +1 -3
  27. office365/onedrive/driveitems/driveItem.py +30 -29
  28. office365/onedrive/internal/paths/children.py +2 -2
  29. office365/onedrive/internal/paths/root.py +1 -1
  30. office365/onedrive/internal/paths/shared.py +1 -1
  31. office365/onedrive/internal/paths/site.py +3 -3
  32. office365/onedrive/internal/paths/url.py +2 -2
  33. office365/onedrive/listitems/list_item.py +2 -0
  34. office365/onedrive/lists/list.py +7 -4
  35. office365/onedrive/permissions/collection.py +26 -6
  36. office365/onedrive/sharepoint.py +1 -0
  37. office365/onedrive/shares/collection.py +2 -5
  38. office365/onedrive/shares/drive_item.py +3 -0
  39. office365/onedrive/termstore/groups/collection.py +3 -8
  40. office365/onedrive/termstore/groups/group.py +8 -0
  41. office365/onedrive/termstore/sets/collection.py +2 -6
  42. office365/onedrive/termstore/sets/name.py +5 -0
  43. office365/onedrive/termstore/sets/set.py +7 -0
  44. office365/onedrive/termstore/store.py +10 -13
  45. office365/onedrive/versions/drive_item.py +3 -1
  46. office365/onedrive/workbooks/ranges/range.py +9 -13
  47. office365/onedrive/workbooks/ranges/view.py +1 -0
  48. office365/onedrive/workbooks/tables/table.py +1 -3
  49. office365/onedrive/workbooks/worksheets/worksheet.py +5 -3
  50. office365/onenote/pages/collection.py +3 -2
  51. office365/onenote/resources/resource.py +5 -4
  52. office365/onenote/sectiongroups/section_group.py +10 -7
  53. office365/outlook/calendar/calendar.py +1 -1
  54. office365/outlook/calendar/schedule/information.py +0 -1
  55. office365/outlook/contacts/contact.py +3 -9
  56. office365/outlook/contacts/folder.py +3 -0
  57. office365/outlook/mail/messages/message.py +25 -18
  58. office365/outlook/mail/recipient.py +3 -1
  59. office365/runtime/auth/authentication_context.py +2 -2
  60. office365/runtime/auth/providers/acs_token_provider.py +7 -9
  61. office365/runtime/client_object.py +3 -11
  62. office365/runtime/client_object_collection.py +22 -20
  63. office365/runtime/client_result.py +1 -3
  64. office365/runtime/client_value_collection.py +2 -6
  65. office365/runtime/odata/query_options.py +1 -3
  66. office365/runtime/odata/type.py +2 -0
  67. office365/runtime/paths/appid.py +1 -1
  68. office365/runtime/{odata/url_builder.py → paths/builder.py} +24 -9
  69. office365/runtime/paths/item.py +1 -1
  70. office365/runtime/paths/resource_path.py +12 -16
  71. office365/runtime/paths/service_operation.py +8 -7
  72. office365/runtime/paths/v3/__init__.py +0 -0
  73. office365/runtime/paths/{key.py → v3/entity.py} +5 -5
  74. office365/runtime/paths/v4/__init__.py +0 -0
  75. office365/runtime/paths/{entity.py → v4/entity.py} +13 -11
  76. office365/sharepoint/contenttypes/content_type.py +6 -0
  77. office365/sharepoint/documentmanagement/document_set.py +4 -6
  78. office365/sharepoint/entity_collection.py +9 -0
  79. office365/sharepoint/features/feature.py +6 -8
  80. office365/sharepoint/files/checked_out_file.py +4 -2
  81. office365/sharepoint/files/checked_out_file_collection.py +1 -1
  82. office365/sharepoint/files/collection.py +35 -3
  83. office365/sharepoint/files/file.py +35 -11
  84. office365/sharepoint/files/versions/collection.py +4 -0
  85. office365/sharepoint/files/versions/event.py +6 -3
  86. office365/sharepoint/files/versions/version.py +6 -4
  87. office365/sharepoint/folders/collection.py +2 -2
  88. office365/sharepoint/folders/folder.py +5 -11
  89. office365/sharepoint/internal/paths/static_operation.py +9 -0
  90. office365/sharepoint/internal/paths/web.py +20 -0
  91. office365/sharepoint/listitems/collection.py +4 -0
  92. office365/sharepoint/listitems/listitem.py +19 -30
  93. office365/sharepoint/lists/list.py +44 -60
  94. office365/sharepoint/portal/groups/service.py +12 -16
  95. office365/sharepoint/portal/groups/site_manager.py +0 -1
  96. office365/sharepoint/publishing/pages/metadata.py +7 -2
  97. office365/sharepoint/publishing/pages/metadata_collection.py +0 -1
  98. office365/sharepoint/publishing/pages/page.py +3 -6
  99. office365/sharepoint/publishing/pages/reposts/repost.py +5 -9
  100. office365/sharepoint/recyclebin/item.py +11 -9
  101. office365/sharepoint/sharing/links/share_response.py +3 -0
  102. office365/sharepoint/sharing/result.py +18 -41
  103. office365/sharepoint/sites/site.py +46 -68
  104. office365/sharepoint/taxonomy/item.py +4 -2
  105. office365/sharepoint/taxonomy/stores/store.py +2 -6
  106. office365/sharepoint/tenant/administration/internal/permission_grant.py +7 -0
  107. office365/sharepoint/tenant/administration/sites/properties.py +55 -44
  108. office365/sharepoint/tenant/administration/tenant.py +25 -40
  109. office365/sharepoint/usercustomactions/collection.py +0 -1
  110. office365/sharepoint/webs/collection.py +8 -0
  111. office365/sharepoint/webs/template_collection.py +2 -4
  112. office365/sharepoint/webs/web.py +27 -24
  113. office365/teams/apps/app.py +1 -0
  114. office365/teams/collection.py +12 -16
  115. office365/teams/members/conversation_collection.py +1 -3
  116. office365/teams/operations/async_operation.py +3 -5
  117. office365/teams/schedule/groups/group.py +3 -0
  118. office365/teams/team.py +1 -1
  119. office365/todo/attachments/base.py +7 -9
  120. office365/runtime/odata/path_builder.py +0 -23
  121. office365/sharepoint/internal/key_value.py +0 -28
  122. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/LICENSE +0 -0
  123. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/WHEEL +0 -0
  124. {Office365_REST_Python_Client-2.5.2.dist-info → Office365_REST_Python_Client-2.5.3.dist-info}/top_level.txt +0 -0
@@ -109,7 +109,7 @@ class Site(Entity):
109
109
  return ClientContext(url).site
110
110
 
111
111
  def get_available_tags(self):
112
- """"""
112
+ """ """
113
113
  return_type = ClientResult(self.context, ClientValueCollection(ComplianceTag))
114
114
 
115
115
  def _site_loaded():
@@ -130,9 +130,7 @@ class Site(Entity):
130
130
  return return_type
131
131
 
132
132
  def get_site_logo(self):
133
- """
134
- Downloads a site logo
135
- """
133
+ """Downloads a site logo"""
136
134
  return_type = ClientResult(self.context)
137
135
 
138
136
  def _site_loaded():
@@ -143,6 +141,18 @@ class Site(Entity):
143
141
  self.ensure_property("Url", _site_loaded)
144
142
  return return_type
145
143
 
144
+ def get_site_logo_ex(self):
145
+ """Gets site logo image"""
146
+ return_type = ClientResult(self.context)
147
+
148
+ def _site_loaded():
149
+ self.context.group_service.get_group_image(
150
+ group_id=self.group_id, return_type=return_type
151
+ )
152
+
153
+ self.ensure_property("GroupId", _site_loaded)
154
+ return return_type
155
+
146
156
  def set_site_logo(self, relative_logo_url):
147
157
  """Uploads a site logo
148
158
 
@@ -153,9 +163,7 @@ class Site(Entity):
153
163
  return self
154
164
 
155
165
  def is_comm_site(self):
156
- """
157
- Determines whether a site is communication site
158
- """
166
+ """Determines whether a site is communication site"""
159
167
  return_type = ClientResult(self.context) # type: ClientResult[bool]
160
168
 
161
169
  def _site_loaded():
@@ -165,9 +173,7 @@ class Site(Entity):
165
173
  return return_type
166
174
 
167
175
  def is_valid_home_site(self):
168
- """
169
- Determines whether a site is landing site for your intranet.
170
- """
176
+ """Determines whether a site is landing site for your intranet."""
171
177
  return_type = ClientResult(self.context) # type: ClientResult[bool]
172
178
 
173
179
  def _site_loaded():
@@ -177,9 +183,7 @@ class Site(Entity):
177
183
  return return_type
178
184
 
179
185
  def set_as_home_site(self):
180
- """
181
- Sets a site as a landing site for your intranet.
182
- """
186
+ """Sets a site as a landing site for your intranet."""
183
187
  return_type = ClientResult(self.context)
184
188
 
185
189
  def _site_loaded():
@@ -438,9 +442,7 @@ class Site(Entity):
438
442
  return return_type
439
443
 
440
444
  def unregister_hub_site(self):
441
- """
442
- Disables the hub site feature on a site.
443
- """
445
+ """Disables the hub site feature on a site."""
444
446
  qry = ServiceOperationQuery(self, "UnRegisterHubSite")
445
447
  self.context.add_query(qry)
446
448
  return self
@@ -464,93 +466,80 @@ class Site(Entity):
464
466
 
465
467
  @property
466
468
  def allow_create_declarative_workflow(self):
467
- """
468
- Specifies whether a designer can be used to create declarative workflows on this site collection
469
- :rtype: bool or None
470
- """
469
+ # type: () -> Optional[bool]
470
+ """Specifies whether a designer can be used to create declarative workflows on this site collection"""
471
471
  return self.properties.get("AllowCreateDeclarativeWorkflow", None)
472
472
 
473
473
  @property
474
474
  def allow_designer(self):
475
+ # type: () -> Optional[bool]
475
476
  """
476
477
  Specifies whether a designer can be used on this site collection.
477
478
  See Microsoft.SharePoint.Client.Web.AllowDesignerForCurrentUser, which is the scalar property used
478
479
  to determine the behavior for the current user. The default, if not disabled on the Web application, is "true".
479
- :rtype: bool or None
480
480
  """
481
481
  return self.properties.get("AllowDesigner", None)
482
482
 
483
483
  @property
484
484
  def allowed_external_domains(self):
485
- """
486
- :rtype: bool or None
487
- """
485
+ # type: () -> Optional[bool]
488
486
  return self.properties.get("AllowedExternalDomains", None)
489
487
 
490
488
  @property
491
489
  def allow_master_page_editing(self):
490
+ # type: () -> Optional[bool]
492
491
  """
493
492
  Specifies whether master page editing is allowed on this site collection.
494
493
  See Web.AllowMasterPageEditingForCurrentUser, which is the scalar property used to
495
494
  determine the behavior for the current user. The default, if not disabled on the Web application, is "false".
496
- :rtype: bool or None
497
495
  """
498
496
  return self.properties.get("AllowMasterPageEditing", None)
499
497
 
500
498
  @property
501
499
  def allow_revert_from_template(self):
500
+ # type: () -> Optional[bool]
502
501
  """
503
502
  Specifies whether this site collection can be reverted to its base template.
504
503
  See Web.AllowRevertFromTemplateForCurrentUser, which is the scalar property used to determine the behavior
505
504
  for the current user. The default, if not disabled on the Web application, is "false".
506
- :rtype: bool or None
507
505
  """
508
506
  return self.properties.get("AllowRevertFromTemplate", None)
509
507
 
510
508
  @property
511
509
  def audit(self):
512
- """
513
- Enables auditing of how site collection is accessed, changed, and used.
514
- """
510
+ """Enables auditing of how site collection is accessed, changed, and used."""
515
511
  return self.properties.get(
516
512
  "Audit", Audit(self.context, ResourcePath("Audit", self.resource_path))
517
513
  )
518
514
 
519
515
  @property
520
516
  def can_upgrade(self):
517
+ # type: () -> Optional[bool]
521
518
  """
522
519
  Specifies whether this site collection is in an implementation-specific valid state for site collection upgrade,
523
520
  "true" if it is; otherwise, "false".
524
-
525
- :rtype: bool
526
521
  """
527
522
  return self.properties.get("CanUpgrade", None)
528
523
 
529
524
  @property
530
525
  def classification(self):
531
- """
532
- Gets the classification of this site.
533
-
534
- :rtype: str or None
535
- """
526
+ # type: () -> Optional[str]
527
+ """Gets the classification of this site."""
536
528
  return self.properties.get("Classification", None)
537
529
 
538
530
  @property
539
531
  def compatibility_level(self):
532
+ # type: () -> Optional[str]
540
533
  """
541
534
  Specifies the compatibility level of the site collection for the purpose of major version level compatibility
542
535
  checks
543
-
544
- :rtype: str
545
536
  """
546
537
  return self.properties.get("CompatibilityLevel", None)
547
538
 
548
539
  @property
549
540
  def comments_on_site_pages_disabled(self):
550
- """
551
- Indicates whether comments on site pages are disabled or not.
552
- :rtype: bool
553
- """
541
+ # type: () -> Optional[bool]
542
+ """Indicates whether comments on site pages are disabled or not."""
554
543
  return self.properties.get("CommentsOnSitePagesDisabled", None)
555
544
 
556
545
  @property
@@ -560,17 +549,14 @@ class Site(Entity):
560
549
 
561
550
  @property
562
551
  def group_id(self):
563
- """
564
- :rtype: str or None
565
- """
552
+ # type: () -> Optional[str]
553
+ """Group identifier"""
566
554
  return self.properties.get("GroupId", None)
567
555
 
568
556
  @property
569
557
  def lock_issue(self):
570
- """
571
- Specifies the comment that is used when a site collection is locked
572
- :rtype: str or None
573
- """
558
+ # type: () -> Optional[str]
559
+ """Specifies the comment that is used when a site collection is locked"""
574
560
  return self.properties.get("LockIssue", None)
575
561
 
576
562
  @property
@@ -583,6 +569,7 @@ class Site(Entity):
583
569
 
584
570
  @property
585
571
  def owner(self):
572
+ # type: () -> User
586
573
  """Gets or sets the owner of the site collection. (Read-only in sandboxed solutions.)"""
587
574
  return self.properties.get(
588
575
  "Owner", User(self.context, ResourcePath("Owner", self.resource_path))
@@ -590,54 +577,46 @@ class Site(Entity):
590
577
 
591
578
  @property
592
579
  def read_only(self):
580
+ # type: () -> Optional[bool]
593
581
  """
594
582
  Gets a Boolean value that specifies whether the site collection is read-only,
595
583
  locked, and unavailable for write access.
596
-
597
- :rtype: bool
598
584
  """
599
585
  return self.properties.get("ReadOnly", None)
600
586
 
601
587
  @property
602
588
  def required_designer_version(self):
589
+ # type: () -> Optional[str]
603
590
  """
604
591
  Specifies the required minimum version of the designer that can be used on this site collection.
605
592
  The default, if not disabled on the Web application, is "15.0.0.0".
606
-
607
- :rtype: str
608
593
  """
609
594
  return self.properties.get("RequiredDesignerVersion", None)
610
595
 
611
596
  @property
612
597
  def url(self):
613
598
  # type: () -> Optional[str]
614
- """
615
- Specifies the full URL of the site (2), including host name, port number and path
616
- """
599
+ """Specifies the full URL of the site (2), including host name, port number and path"""
617
600
  return self.properties.get("Url", None)
618
601
 
619
602
  @property
620
603
  def server_relative_url(self):
621
- """
622
- Specifies the server-relative URL of the top-level site in the site collection.
623
- :rtype: str
624
- """
604
+ # type: () -> Optional[str]
605
+ """Specifies the server-relative URL of the top-level site in the site collection."""
625
606
  return self.properties.get("ServerRelativeUrl", None)
626
607
 
627
608
  @property
628
609
  def share_by_email_enabled(self):
610
+ # type: () -> Optional[bool]
629
611
  """
630
612
  When true, users will be able to grant permissions to guests for resources within the site collection.
631
- :rtype: bool or none
632
613
  """
633
614
  return self.properties.get("ShareByEmailEnabled", None)
634
615
 
635
616
  @property
636
617
  def status_bar_text(self):
637
- """
638
- Gets or sets the status bar message text for this site.
639
- :rtype: str or none
640
- """
618
+ # type: () -> Optional[str]
619
+ """Gets or sets the status bar message text for this site."""
641
620
  return self.properties.get("StatusBarText", None)
642
621
 
643
622
  @property
@@ -711,6 +690,7 @@ class Site(Entity):
711
690
 
712
691
  @property
713
692
  def features(self):
693
+ # type: () -> FeatureCollection
714
694
  """Get features"""
715
695
  return self.properties.get(
716
696
  "Features",
@@ -731,9 +711,7 @@ class Site(Entity):
731
711
  @property
732
712
  def needs_b2b_upgrade(self):
733
713
  # type: () -> Optional[bool]
734
- """
735
- Specifies whether the site needs a Build-to-Build upgrade.
736
- """
714
+ """Specifies whether the site needs a Build-to-Build upgrade."""
737
715
  return self.properties.get("NeedsB2BUpgrade", None)
738
716
 
739
717
  @property
@@ -28,9 +28,11 @@ class TaxonomyItem(ClientObject):
28
28
 
29
29
  def set_property(self, name, value, persist_changes=True):
30
30
  super(TaxonomyItem, self).set_property(name, value, persist_changes)
31
- if self._resource_path is None:
32
- if name == self.property_ref_name:
31
+ if name == self.property_ref_name:
32
+ if self._resource_path is None:
33
33
  self._resource_path = ResourcePath(
34
34
  value, self.parent_collection.resource_path
35
35
  )
36
+ else:
37
+ self._resource_path.patch(value)
36
38
  return self
@@ -57,16 +57,12 @@ class TermStore(TaxonomyItem):
57
57
  @property
58
58
  def default_language_tag(self):
59
59
  # type: () -> Optional[str]
60
- """
61
- Gets or sets the LCID of the default working language.
62
- """
60
+ """Gets or sets the LCID of the default working language."""
63
61
  return self.properties.get("defaultLanguageTag", None)
64
62
 
65
63
  @property
66
64
  def language_tags(self):
67
- """
68
- Gets an integer collection of LCIDs.
69
- """
65
+ """Gets an integer collection of LCIDs."""
70
66
  return self.properties.get("languageTags", StringCollection())
71
67
 
72
68
  @property
@@ -0,0 +1,7 @@
1
+ from office365.sharepoint.entity import Entity
2
+
3
+
4
+ class SPO3rdPartyAADPermissionGrant(Entity):
5
+ @property
6
+ def entity_type_name(self):
7
+ return "Microsoft.Online.SharePoint.TenantAdministration.Internal.SPO3rdPartyAADPermissionGrant"
@@ -1,24 +1,27 @@
1
1
  from typing import Optional
2
2
 
3
- from office365.runtime.paths.key import KeyPath
3
+ from office365.onedrive.listitems.list_item import ListItem
4
4
  from office365.runtime.paths.service_operation import ServiceOperationPath
5
+ from office365.runtime.paths.v3.entity import EntityPath
5
6
  from office365.runtime.queries.service_operation import ServiceOperationQuery
7
+ from office365.sharepoint.client_context import ClientContext
6
8
  from office365.sharepoint.entity import Entity
7
- from office365.sharepoint.sites.site import Site
9
+ from office365.sharepoint.internal.paths.static_operation import StaticOperationPath
8
10
  from office365.sharepoint.tenant.administration.deny_add_and_customize_pages_status import (
9
11
  DenyAddAndCustomizePagesStatus,
10
12
  )
13
+ from office365.sharepoint.tenant.administration.spo_operation import SpoOperation
11
14
 
12
15
 
13
16
  class SiteProperties(Entity):
14
17
  """Contains a property bag of information about a site."""
15
18
 
19
+ def __repr__(self):
20
+ return self.url or self.entity_type_name
21
+
16
22
  @staticmethod
17
23
  def clear_sharing_lock_down(context, site_url):
18
- """
19
- :param office365.sharepoint.client_context.ClientContext context: SharePoint client service
20
- :param str site_url:
21
- """
24
+ # type: (ClientContext, str) -> SiteProperties
22
25
  payload = {"siteUrl": site_url}
23
26
  binding_type = SiteProperties(context)
24
27
  qry = ServiceOperationQuery(
@@ -30,75 +33,71 @@ class SiteProperties(Entity):
30
33
  def update(self):
31
34
  """Updates the site collection properties with the new properties specified in the SiteProperties object."""
32
35
 
33
- site = Site(self.context)
34
- site.set_property("__siteUrl", self.url)
35
-
36
- def _site_loaded(return_type):
37
- self._resource_path = KeyPath(site.id, self.parent_collection.resource_path)
36
+ def _update():
38
37
  super(SiteProperties, self).update()
39
38
 
40
- self.context.load(site, after_loaded=_site_loaded)
39
+ self._ensure_site_path(_update)
41
40
  return self
42
41
 
42
+ def update_ex(self):
43
+ """Updates the site collection properties with the new properties specified in the SiteProperties object."""
44
+ return_type = SpoOperation(self.context)
45
+
46
+ def _update_ex():
47
+ qry = ServiceOperationQuery(
48
+ self, "Update", parameters_type=self, return_type=return_type
49
+ )
50
+ self.context.add_query(qry)
51
+
52
+ self._ensure_site_path(_update_ex)
53
+ return return_type
54
+
43
55
  @property
44
56
  def deny_add_and_customize_pages(self):
45
- """
46
- Represents the status of the [DenyAddAndCustomizePages] feature on a site collection.
47
- """
57
+ # type: () -> Optional[int]
58
+ """Represents the status of the [DenyAddAndCustomizePages] feature on a site collection."""
48
59
  return self.properties.get(
49
60
  "DenyAddAndCustomizePages", DenyAddAndCustomizePagesStatus.Unknown
50
61
  )
51
62
 
52
63
  @deny_add_and_customize_pages.setter
53
64
  def deny_add_and_customize_pages(self, value):
54
- """
55
- Sets the status of the [DenyAddAndCustomizePages] feature on a site collection.
56
-
57
- :param int value:
58
- """
65
+ # type: (int) -> None
66
+ """Sets the status of the [DenyAddAndCustomizePages] feature on a site collection."""
59
67
  self.set_property("DenyAddAndCustomizePages", value)
60
68
 
61
69
  @property
62
70
  def owner_login_name(self):
63
- """
64
- :rtype: str
65
- """
71
+ # type: () -> Optional[str]
66
72
  return self.properties.get("OwnerLoginName", None)
67
73
 
68
74
  @property
69
75
  def webs_count(self):
70
- """
71
- Gets the number of Web objects in the site.
72
- :rtype: int
73
- """
76
+ # type: () -> Optional[str]
77
+ """Gets the number of Web objects in the site."""
74
78
  return self.properties.get("WebsCount", None)
75
79
 
76
80
  @property
77
81
  def url(self):
78
82
  # type: () -> Optional[str]
79
- """
80
- Gets the URL of the site.
81
- """
83
+ """Gets the URL of the site."""
82
84
  return self.properties.get("Url", None)
83
85
 
84
86
  @property
85
87
  def compatibility_level(self):
86
88
  # type: () -> Optional[str]
87
- """
88
- Gets the compatibility level of the site.
89
- """
89
+ """Gets the compatibility level of the site."""
90
90
  return self.properties.get("CompatibilityLevel", None)
91
91
 
92
92
  @property
93
93
  def lock_state(self):
94
94
  # type: () -> Optional[str]
95
- """
96
- Gets or sets the lock state of the site.
97
- """
95
+ """Gets or sets the lock state of the site."""
98
96
  return self.properties.get("LockState", None)
99
97
 
100
98
  @property
101
99
  def sharing_capability(self):
100
+ # type: () -> Optional[int]
102
101
  """
103
102
  Determines what level of sharing is available for the site.
104
103
 
@@ -115,29 +114,41 @@ class SiteProperties(Entity):
115
114
 
116
115
  @sharing_capability.setter
117
116
  def sharing_capability(self, value):
118
- """
119
- Sets the level of sharing for the site.
120
- :type value: int
121
- """
117
+ # type: (int) -> None
118
+ """Sets the level of sharing for the site."""
122
119
  self.set_property("SharingCapability", value)
123
120
 
124
121
  @property
125
122
  def time_zone_id(self):
126
123
  # type: () -> Optional[str]
127
- """
128
- Gets the time zone ID of the site.
129
- """
124
+ """Gets the time zone ID of the site."""
130
125
  return self.properties.get("TimeZoneId", None)
131
126
 
132
127
  @property
133
128
  def entity_type_name(self):
129
+ # type: () -> str
134
130
  return "Microsoft.Online.SharePoint.TenantAdministration.SiteProperties"
135
131
 
136
132
  def set_property(self, name, value, persist_changes=True):
137
133
  super(SiteProperties, self).set_property(name, value, persist_changes)
138
134
  # fallback: create a new resource path
139
135
  if name == "Url" and self._resource_path is None:
140
- self._resource_path = ServiceOperationPath(
136
+ self._resource_path = StaticOperationPath(
141
137
  self.entity_type_name, {"Url": value}
142
138
  )
143
139
  return self
140
+
141
+ def _ensure_site_path(self, action):
142
+ if isinstance(self.resource_path, ServiceOperationPath):
143
+
144
+ def _loaded(return_type):
145
+ # type: (ListItem) -> None
146
+ site_id = return_type.get_property("SiteId")
147
+ self._resource_path = EntityPath(
148
+ site_id, self.parent_collection.resource_path
149
+ )
150
+ action()
151
+
152
+ self.context.tenant.get_site(self.url).after_execute(_loaded)
153
+ else:
154
+ action()