Office365-REST-Python-Client 2.5.14__py3-none-any.whl → 2.6.0__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.
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/METADATA +2 -2
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/RECORD +210 -112
- office365/admin/__init__.py +0 -0
- office365/admin/admin.py +69 -0
- office365/admin/microsoft365_apps.py +5 -0
- office365/admin/people_settings.py +5 -0
- office365/admin/report_settings.py +5 -0
- office365/{onedrive → admin}/sharepoint.py +1 -1
- office365/azure_env.py +60 -0
- office365/directory/applications/app_ids.py +6 -0
- office365/directory/authentication/authentication.py +16 -0
- office365/directory/authentication/method_target.py +2 -1
- office365/directory/authentication/methods/microsoft_authenticator.py +6 -0
- office365/directory/authentication/methods/root.py +11 -0
- office365/directory/authentication/methods/sms.py +9 -0
- office365/directory/certificates/self_signed.py +31 -2
- office365/directory/identities/conditional_access_root.py +14 -0
- office365/directory/identitygovernance/privilegedaccess/approval.py +8 -0
- office365/directory/identitygovernance/privilegedaccess/group.py +30 -0
- office365/directory/identitygovernance/privilegedaccess/group_assignment_schedule_instance.py +7 -0
- office365/directory/identitygovernance/privilegedaccess/unified_role_assignment_schedule_request.py +7 -0
- office365/directory/identitygovernance/userconsent/request_collection.py +10 -0
- office365/directory/identitygovernance/workflow/__init__.py +0 -0
- office365/directory/identitygovernance/workflow/base.py +5 -0
- office365/directory/policies/cross_tenant_access.py +13 -0
- office365/directory/policies/feature_rollout.py +16 -0
- office365/directory/policies/root.py +39 -23
- office365/directory/policies/template.py +5 -0
- office365/directory/protection/threatassessment/email_file_request.py +20 -0
- office365/directory/protection/threatassessment/request.py +25 -0
- office365/directory/rolemanagement/application.py +15 -0
- office365/directory/rolemanagement/resource_action.py +8 -4
- office365/directory/rolemanagement/role_permission.py +3 -3
- office365/directory/security/alerts/collection.py +49 -0
- office365/directory/security/scorecontrol/__init__.py +0 -0
- office365/directory/security/scorecontrol/profile.py +6 -0
- office365/directory/security/security.py +17 -4
- office365/directory/serviceprincipals/service_principal.py +36 -28
- office365/directory/tenantinformation/__init__.py +0 -0
- office365/directory/tenantinformation/multi_organization.py +11 -0
- office365/directory/tenantinformation/relationship.py +61 -0
- office365/directory/users/insights_settings.py +5 -0
- office365/graph_client.py +52 -132
- office365/graph_request.py +78 -19
- office365/intune/servicecommunications/health/health.py +1 -1
- office365/intune/servicecommunications/issues/issue.py +2 -2
- office365/onedrive/columns/definition.py +1 -1
- office365/onedrive/contenttypes/content_type.py +1 -1
- office365/onedrive/driveitems/driveItem.py +13 -1
- office365/onedrive/drives/drive.py +1 -1
- office365/onedrive/filestorage/__init__.py +0 -0
- office365/onedrive/filestorage/container.py +7 -0
- office365/onedrive/filestorage/file_storage.py +20 -0
- office365/onedrive/listitems/field_value_set.py +1 -1
- office365/onedrive/listitems/list_item.py +1 -1
- office365/onedrive/lists/list.py +1 -1
- office365/onedrive/recyclebin/__init__.py +0 -0
- office365/onedrive/recyclebin/item.py +6 -0
- office365/onedrive/recyclebin/recyclebin.py +29 -0
- office365/onedrive/recyclebin/settings.py +13 -0
- office365/onedrive/shares/drive_item.py +1 -1
- office365/onedrive/sitepages/base.py +1 -1
- office365/onedrive/sitepages/canvas_layout.py +2 -2
- office365/onedrive/sitepages/sections/__init__.py +0 -0
- office365/onedrive/sitepages/{horizontal_section.py → sections/horizontal.py} +1 -1
- office365/onedrive/sitepages/webparts/data.py +5 -0
- office365/onedrive/sitepages/webparts/position.py +5 -0
- office365/onedrive/sitepages/webparts/standard.py +9 -0
- office365/onedrive/sitepages/webparts/web_part.py +12 -0
- office365/onedrive/sites/site.py +1 -1
- office365/onedrive/storage/storage.py +10 -0
- office365/onedrive/workbooks/charts/axes.py +41 -1
- office365/onedrive/workbooks/charts/axis.py +5 -0
- office365/onedrive/workbooks/charts/chart.py +64 -5
- office365/onedrive/workbooks/charts/fill.py +5 -0
- office365/onedrive/workbooks/charts/font.py +5 -0
- office365/onedrive/workbooks/charts/legend/__init__.py +0 -0
- office365/onedrive/workbooks/charts/legend/format.py +5 -0
- office365/onedrive/workbooks/charts/legend/legend.py +26 -0
- office365/onedrive/workbooks/charts/point.py +5 -0
- office365/onedrive/workbooks/charts/series/__init__.py +0 -0
- office365/onedrive/workbooks/charts/series/format.py +5 -0
- office365/onedrive/workbooks/charts/series/series.py +31 -0
- office365/onedrive/workbooks/charts/title.py +5 -0
- office365/onedrive/workbooks/filter.py +10 -0
- office365/onedrive/workbooks/filter_criteria.py +3 -3
- office365/onedrive/workbooks/ranges/fill.py +11 -1
- office365/onedrive/workbooks/ranges/range.py +26 -0
- office365/onedrive/workbooks/ranges/view.py +14 -0
- office365/onedrive/workbooks/sort_field.py +8 -3
- office365/onedrive/workbooks/tables/sort.py +20 -0
- office365/onedrive/workbooks/worksheets/worksheet.py +11 -0
- office365/partners/billing/azure_usage.py +17 -0
- office365/partners/billing/billed_usage.py +21 -0
- office365/partners/billing/billing.py +17 -0
- office365/partners/billing/operation.py +5 -0
- office365/partners/partners.py +17 -0
- office365/reports/root.py +9 -0
- office365/reports/userregistration/feature_summary.py +5 -0
- office365/runtime/auth/auth_cookies.py +48 -0
- office365/runtime/auth/authentication_context.py +36 -19
- office365/runtime/auth/entra/__init__.py +0 -0
- office365/runtime/auth/entra/authentication_context.py +165 -0
- office365/runtime/auth/providers/acs_token_provider.py +12 -27
- office365/runtime/auth/providers/saml_token_provider.py +41 -54
- office365/runtime/auth/sts_profile.py +8 -8
- office365/runtime/auth/token_response.py +4 -0
- office365/sharepoint/administration/custom_fonts_resource.py +5 -0
- office365/sharepoint/administration/sitemove/__init__.py +0 -0
- office365/sharepoint/administration/sitemove/service.py +68 -0
- office365/sharepoint/administration/sitemove/service_info.py +11 -0
- office365/sharepoint/changes/item.py +15 -0
- office365/sharepoint/client_context.py +61 -37
- office365/sharepoint/directory/group.py +2 -0
- office365/sharepoint/directory/helper.py +2 -0
- office365/sharepoint/directory/provider/provider.py +6 -0
- office365/sharepoint/directory/user.py +20 -0
- office365/sharepoint/files/publish/__init__.py +0 -0
- office365/sharepoint/files/publish/status.py +9 -0
- office365/sharepoint/flows/connector_result.py +17 -0
- office365/sharepoint/flows/permissions.py +11 -7
- office365/sharepoint/fontpackages/__init__.py +0 -0
- office365/sharepoint/fontpackages/collection.py +26 -0
- office365/sharepoint/fontpackages/creation_parameters.py +5 -0
- office365/sharepoint/fontpackages/font_package.py +5 -0
- office365/sharepoint/fontpackages/oob_settings.py +5 -0
- office365/sharepoint/forms/customization.py +26 -0
- office365/sharepoint/ir/__init__.py +0 -0
- office365/sharepoint/ir/migration.py +5 -0
- office365/sharepoint/lists/list.py +30 -0
- office365/sharepoint/marketplace/app_metadata.py +12 -1
- office365/sharepoint/marketplace/app_metadata_collection.py +8 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/instance_info.py +22 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/permission_failed_info.py +5 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/permission_info.py +12 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/permission_response.py +15 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/addins/principals_response.py +5 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/app_request_information.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/app_response_information.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/available_addins_response.py +4 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/card_design.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/card_designs.py +9 -0
- office365/sharepoint/marketplace/corporatecuratedgallery/teams_package_download.py +14 -0
- office365/sharepoint/marketplace/tenant/appcatalog/accessor.py +62 -3
- office365/sharepoint/multigeo/services.py +14 -0
- office365/sharepoint/multigeo/storage_quota.py +9 -0
- office365/sharepoint/policy/license_utilities.py +27 -0
- office365/sharepoint/principal/principal.py +6 -0
- office365/sharepoint/request.py +95 -10
- office365/sharepoint/search/administration/document_crawl_log.py +16 -2
- office365/sharepoint/search/administration/tenant_crawl_versions_info_provider.py +1 -1
- office365/sharepoint/search/reports/abandoned_queries.py +11 -1
- office365/sharepoint/search/reports/abandonedqueries/item.py +7 -1
- office365/sharepoint/sharing/domain_restriction_settings.py +5 -0
- office365/sharepoint/sharing/information.py +12 -0
- office365/sharepoint/sitehealth/result.py +4 -4
- office365/sharepoint/sitehealth/summary.py +5 -5
- office365/sharepoint/sites/copy_job_progress.py +5 -0
- office365/sharepoint/sites/copy_migration_iInfo.py +5 -0
- office365/sharepoint/sites/home/__init__.py +0 -0
- office365/sharepoint/sites/{sph_site.py → home/site.py} +1 -1
- office365/sharepoint/sites/site.py +26 -1
- office365/sharepoint/tenant/administration/app_service_principal_public.py +17 -0
- office365/sharepoint/tenant/administration/audit/data.py +12 -0
- office365/sharepoint/tenant/administration/audit/unified_record.py +18 -0
- office365/sharepoint/tenant/administration/coms/__init__.py +0 -0
- office365/sharepoint/tenant/administration/coms/messages_fields_data.py +5 -0
- office365/sharepoint/tenant/administration/coms/messages_service_proxy.py +16 -0
- office365/sharepoint/tenant/administration/copilot/__init__.py +0 -0
- office365/sharepoint/tenant/administration/copilot/adaptive_card_config.py +11 -0
- office365/sharepoint/tenant/administration/datagovernance/__init__.py +0 -0
- office365/sharepoint/tenant/administration/datagovernance/client_base.py +9 -0
- office365/sharepoint/tenant/administration/datagovernance/insight_client.py +82 -0
- office365/sharepoint/tenant/administration/datagovernance/insight_metadata.py +5 -0
- office365/sharepoint/tenant/administration/default_time_zone_id.py +11 -0
- office365/sharepoint/tenant/administration/endpoints.py +53 -2
- office365/sharepoint/tenant/administration/insights/onedrive_site_sharing.py +4 -0
- office365/sharepoint/tenant/administration/internal/appservice/permission_request.py +4 -0
- office365/sharepoint/tenant/administration/malware/__init__.py +0 -0
- office365/sharepoint/tenant/administration/malware/file.py +18 -0
- office365/sharepoint/tenant/administration/modified_property.py +5 -0
- office365/sharepoint/tenant/administration/policies/content_security_configuration.py +9 -0
- office365/sharepoint/tenant/administration/recent_action.py +9 -0
- office365/sharepoint/tenant/administration/reports/__init__.py +0 -0
- office365/sharepoint/tenant/administration/settings_service.py +38 -5
- office365/sharepoint/tenant/administration/sites/properties.py +78 -0
- office365/sharepoint/tenant/administration/sites/properties_collection.py +19 -0
- office365/sharepoint/tenant/administration/tenant.py +134 -7
- office365/sharepoint/tenant/administration/types.py +76 -1
- office365/sharepoint/tenant/insights/report_manager.py +29 -0
- office365/sharepoint/tenant/management/office365_tenant.py +7 -4
- office365/sharepoint/translation/job_status.py +22 -0
- office365/sharepoint/userprofiles/user_profile.py +6 -0
- office365/sharepoint/webparts/tile_data.py +21 -0
- office365/sharepoint/webs/dataleakage_prevention_status_info.py +5 -0
- office365/sharepoint/webs/web.py +80 -1
- office365/teams/chats/event_message_detail.py +8 -0
- office365/teams/deleted.py +24 -0
- office365/teams/work.py +35 -0
- office365/directory/tenant_relationship.py +0 -23
- office365/onedrive/admin.py +0 -32
- office365/onedrive/workbooks/charts/legend.py +0 -7
- office365/onedrive/workbooks/charts/series.py +0 -5
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/LICENSE +0 -0
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/WHEEL +0 -0
- {Office365_REST_Python_Client-2.5.14.dist-info → Office365_REST_Python_Client-2.6.0.dist-info}/top_level.txt +0 -0
- /office365/{onedrive → admin}/sharepoint_settings.py +0 -0
- /office365/directory/{tenant_information.py → tenantinformation/information.py} +0 -0
- /office365/{base_item.py → onedrive/base_item.py} +0 -0
- /office365/onedrive/sitepages/{horizontal_section_column.py → sections/horizontal_column.py} +0 -0
- /office365/onedrive/sitepages/{vertical_section.py → sections/vertical.py} +0 -0
- /office365/sharepoint/sites/{home_sites_details.py → home/details.py} +0 -0
- /office365/sharepoint/sites/{home_site_reference.py → home/reference.py} +0 -0
- /office365/sharepoint/tenant/administration/{app_billing_properties.py → policies/app_billing_properties.py} +0 -0
|
@@ -41,8 +41,15 @@ from office365.sharepoint.webs.web import Web
|
|
|
41
41
|
class ClientContext(ClientRuntimeContext):
|
|
42
42
|
"""SharePoint client context (SharePoint v1 API)"""
|
|
43
43
|
|
|
44
|
-
def __init__(
|
|
45
|
-
|
|
44
|
+
def __init__(
|
|
45
|
+
self,
|
|
46
|
+
base_url,
|
|
47
|
+
auth_context=None,
|
|
48
|
+
environment=None,
|
|
49
|
+
allow_ntlm=False,
|
|
50
|
+
browser_mode=False,
|
|
51
|
+
):
|
|
52
|
+
# type: (str, Optional[AuthenticationContext], str, bool, bool) -> None
|
|
46
53
|
"""
|
|
47
54
|
Instantiates a SharePoint client context
|
|
48
55
|
|
|
@@ -51,7 +58,12 @@ class ClientContext(ClientRuntimeContext):
|
|
|
51
58
|
"""
|
|
52
59
|
super(ClientContext, self).__init__()
|
|
53
60
|
if auth_context is None:
|
|
54
|
-
auth_context = AuthenticationContext(
|
|
61
|
+
auth_context = AuthenticationContext(
|
|
62
|
+
url=base_url,
|
|
63
|
+
environment=environment,
|
|
64
|
+
allow_ntlm=allow_ntlm,
|
|
65
|
+
browser_mode=browser_mode,
|
|
66
|
+
)
|
|
55
67
|
self._auth_context = auth_context
|
|
56
68
|
self._web = None
|
|
57
69
|
self._site = None
|
|
@@ -138,36 +150,18 @@ class ClientContext(ClientRuntimeContext):
|
|
|
138
150
|
self.authentication_context.with_access_token(token_func)
|
|
139
151
|
return self
|
|
140
152
|
|
|
141
|
-
def with_user_credentials(
|
|
142
|
-
|
|
143
|
-
username,
|
|
144
|
-
password,
|
|
145
|
-
allow_ntlm=False,
|
|
146
|
-
browser_mode=False,
|
|
147
|
-
environment="commercial",
|
|
148
|
-
):
|
|
149
|
-
# type: (str, str, bool, bool, Optional[str]) -> Self
|
|
153
|
+
def with_user_credentials(self, username, password):
|
|
154
|
+
# type: (str, str) -> Self
|
|
150
155
|
"""
|
|
151
156
|
Initializes a client to acquire a token via user credentials.
|
|
152
157
|
:param str username: Typically, a UPN in the form of an email address
|
|
153
158
|
:param str password: The password
|
|
154
|
-
:param bool allow_ntlm: Flag indicates whether NTLM scheme is enabled. Disabled by default
|
|
155
|
-
:param bool browser_mode:
|
|
156
|
-
:param str environment: The Office 365 Cloud Environment endpoint used for authentication
|
|
157
|
-
defaults to 'commercial'.
|
|
158
159
|
"""
|
|
159
|
-
self.authentication_context.with_credentials(
|
|
160
|
-
UserCredential(username, password),
|
|
161
|
-
allow_ntlm=allow_ntlm,
|
|
162
|
-
browser_mode=browser_mode,
|
|
163
|
-
environment=environment,
|
|
164
|
-
)
|
|
160
|
+
self.authentication_context.with_credentials(UserCredential(username, password))
|
|
165
161
|
return self
|
|
166
162
|
|
|
167
|
-
def with_client_credentials(
|
|
168
|
-
|
|
169
|
-
):
|
|
170
|
-
# type: (str, str, Optional[str]) -> Self
|
|
163
|
+
def with_client_credentials(self, client_id, client_secret):
|
|
164
|
+
# type: (str, str) -> Self
|
|
171
165
|
"""
|
|
172
166
|
Initializes a client to acquire a token via client credentials (SharePoint App-Only)
|
|
173
167
|
|
|
@@ -176,25 +170,19 @@ class ClientContext(ClientRuntimeContext):
|
|
|
176
170
|
|
|
177
171
|
:param str client_id: The OAuth client id of the calling application
|
|
178
172
|
:param str client_secret: Secret string that the application uses to prove its identity when requesting a token
|
|
179
|
-
:param str environment: The Office 365 Cloud Environment endpoint used for authentication
|
|
180
|
-
defaults to 'commercial'.
|
|
181
173
|
"""
|
|
182
174
|
self.authentication_context.with_credentials(
|
|
183
|
-
ClientCredential(client_id, client_secret)
|
|
175
|
+
ClientCredential(client_id, client_secret)
|
|
184
176
|
)
|
|
185
177
|
return self
|
|
186
178
|
|
|
187
|
-
def with_credentials(self, credentials
|
|
188
|
-
# type: (UserCredential|ClientCredential
|
|
179
|
+
def with_credentials(self, credentials):
|
|
180
|
+
# type: (UserCredential|ClientCredential) -> Self
|
|
189
181
|
"""
|
|
190
182
|
Initializes a client to acquire a token via user or client credentials
|
|
191
183
|
:type credentials: UserCredential or ClientCredential
|
|
192
|
-
:param str environment: The Office 365 Cloud Environment endpoint used for authentication
|
|
193
|
-
defaults to 'commercial'.
|
|
194
184
|
"""
|
|
195
|
-
self.authentication_context.with_credentials(
|
|
196
|
-
credentials, environment=environment
|
|
197
|
-
)
|
|
185
|
+
self.authentication_context.with_credentials(credentials)
|
|
198
186
|
return self
|
|
199
187
|
|
|
200
188
|
def execute_batch(self, items_per_batch=100, success_callback=None):
|
|
@@ -498,6 +486,22 @@ class ClientContext(ClientRuntimeContext):
|
|
|
498
486
|
|
|
499
487
|
return FolderColoring(self, ResourcePath("foldercoloring"))
|
|
500
488
|
|
|
489
|
+
@property
|
|
490
|
+
def font_packages(self):
|
|
491
|
+
"""Alias to FontPackageCollection"""
|
|
492
|
+
|
|
493
|
+
from office365.sharepoint.fontpackages.collection import FontPackageCollection
|
|
494
|
+
|
|
495
|
+
return FontPackageCollection(self, ResourcePath("fontpackages"))
|
|
496
|
+
|
|
497
|
+
@property
|
|
498
|
+
def site_font_packages(self):
|
|
499
|
+
"""Alias to FontPackageCollection"""
|
|
500
|
+
|
|
501
|
+
from office365.sharepoint.fontpackages.collection import FontPackageCollection
|
|
502
|
+
|
|
503
|
+
return FontPackageCollection(self, ResourcePath("sitefontpackages"))
|
|
504
|
+
|
|
501
505
|
@property
|
|
502
506
|
def group_site_manager(self):
|
|
503
507
|
"""Alias to GroupSiteManager"""
|
|
@@ -542,6 +546,16 @@ class ClientContext(ClientRuntimeContext):
|
|
|
542
546
|
|
|
543
547
|
return ProfileLoader(self)
|
|
544
548
|
|
|
549
|
+
@property
|
|
550
|
+
def document_crawl_log(self):
|
|
551
|
+
"""Alias to DocumentCrawlLog"""
|
|
552
|
+
|
|
553
|
+
from office365.sharepoint.search.administration.document_crawl_log import (
|
|
554
|
+
DocumentCrawlLog,
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
return DocumentCrawlLog(self)
|
|
558
|
+
|
|
545
559
|
@property
|
|
546
560
|
def lists(self):
|
|
547
561
|
"""Alias to ListCollection. Gets information about all lists that the current user can access."""
|
|
@@ -636,7 +650,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
636
650
|
@property
|
|
637
651
|
def home_site(self):
|
|
638
652
|
"""Alias to SPHSite."""
|
|
639
|
-
from office365.sharepoint.sites.
|
|
653
|
+
from office365.sharepoint.sites.home.site import SPHSite
|
|
640
654
|
|
|
641
655
|
return SPHSite(self, ResourcePath("SPHSite"))
|
|
642
656
|
|
|
@@ -661,8 +675,17 @@ class ClientContext(ClientRuntimeContext):
|
|
|
661
675
|
self, SPMachineLearningPublication, ResourcePath("publications")
|
|
662
676
|
)
|
|
663
677
|
|
|
678
|
+
@property
|
|
679
|
+
def server_settings(self):
|
|
680
|
+
"""Provides methods for obtaining server properties"""
|
|
681
|
+
|
|
682
|
+
from office365.sharepoint.server_settings import ServerSettings
|
|
683
|
+
|
|
684
|
+
return ServerSettings(self)
|
|
685
|
+
|
|
664
686
|
@property
|
|
665
687
|
def social_following_manager(self):
|
|
688
|
+
""" """
|
|
666
689
|
from office365.sharepoint.social.following.manager import SocialFollowingManager
|
|
667
690
|
|
|
668
691
|
return SocialFollowingManager(self)
|
|
@@ -697,6 +720,7 @@ class ClientContext(ClientRuntimeContext):
|
|
|
697
720
|
|
|
698
721
|
@property
|
|
699
722
|
def viva_site_manager(self):
|
|
723
|
+
""""""
|
|
700
724
|
from office365.sharepoint.viva.site_manager import VivaSiteManager
|
|
701
725
|
|
|
702
726
|
return VivaSiteManager(self)
|
|
@@ -88,6 +88,8 @@ class SPHelper(Entity):
|
|
|
88
88
|
@staticmethod
|
|
89
89
|
def get_my_groups(context, logon_name, offset, length, return_type=None):
|
|
90
90
|
"""
|
|
91
|
+
Retrieves information about groups that a user belongs to.
|
|
92
|
+
|
|
91
93
|
:param office365.sharepoint.client_context.ClientContext context: SharePoint context
|
|
92
94
|
:param str logon_name: User's login
|
|
93
95
|
:param int offset: Result offset
|
|
@@ -13,6 +13,12 @@ class SharePointDirectoryProvider(Entity):
|
|
|
13
13
|
)
|
|
14
14
|
super(SharePointDirectoryProvider, self).__init__(context, resource_path)
|
|
15
15
|
|
|
16
|
+
def check_site_availability(self, site_url):
|
|
17
|
+
""""""
|
|
18
|
+
from office365.sharepoint.directory.helper import SPHelper
|
|
19
|
+
|
|
20
|
+
return SPHelper.check_site_availability(self.context, site_url)
|
|
21
|
+
|
|
16
22
|
def read_directory_object(self, data):
|
|
17
23
|
# type: (DirectoryObjectData) -> ClientResult[DirectoryObjectData]
|
|
18
24
|
""""""
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
1
3
|
from office365.runtime.client_result import ClientResult
|
|
2
4
|
from office365.sharepoint.directory.my_groups_result import MyGroupsResult
|
|
3
5
|
from office365.sharepoint.entity import Entity
|
|
4
6
|
|
|
5
7
|
|
|
6
8
|
class User(Entity):
|
|
9
|
+
"""Represents a user in the SharePoint Directory"""
|
|
10
|
+
|
|
11
|
+
@property
|
|
12
|
+
def about_me(self):
|
|
13
|
+
# type: () -> Optional[str]
|
|
14
|
+
"""Stores a short description or bio of the user."""
|
|
15
|
+
return self.properties.get("aboutMe", None)
|
|
16
|
+
|
|
17
|
+
@property
|
|
18
|
+
def account_enabled(self):
|
|
19
|
+
# type: () -> Optional[bool]
|
|
20
|
+
"""Gets weather the account is active (user can log in and access services) or not"""
|
|
21
|
+
return self.properties.get("accountEnabled", None)
|
|
22
|
+
|
|
7
23
|
def is_member_of(self, group_id):
|
|
24
|
+
# type: (str) -> ClientResult[bool]
|
|
8
25
|
return_type = ClientResult(self.context)
|
|
9
26
|
|
|
10
27
|
def _user_loaded():
|
|
@@ -18,6 +35,9 @@ class User(Entity):
|
|
|
18
35
|
return return_type
|
|
19
36
|
|
|
20
37
|
def get_my_groups(self):
|
|
38
|
+
"""
|
|
39
|
+
Retrieves information about groups that a user belongs to.
|
|
40
|
+
"""
|
|
21
41
|
return_type = MyGroupsResult(self.context)
|
|
22
42
|
|
|
23
43
|
def _user_loaded():
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from typing import Optional
|
|
2
|
+
|
|
3
|
+
from office365.sharepoint.entity import Entity
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ConnectorResult(Entity):
|
|
7
|
+
""" """
|
|
8
|
+
|
|
9
|
+
@property
|
|
10
|
+
def context_data(self):
|
|
11
|
+
# type: () -> Optional[str]
|
|
12
|
+
return self.properties.get("ContextData", None)
|
|
13
|
+
|
|
14
|
+
@property
|
|
15
|
+
def value(self):
|
|
16
|
+
# type: () -> Optional[str]
|
|
17
|
+
return self.properties.get("Value", None)
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
from
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
2
3
|
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
3
4
|
from office365.sharepoint.entity import Entity
|
|
5
|
+
from office365.sharepoint.flows.connector_result import ConnectorResult
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from office365.sharepoint.client_context import ClientContext
|
|
4
9
|
|
|
5
10
|
|
|
6
11
|
class FlowPermissions(Entity):
|
|
7
12
|
|
|
8
13
|
@staticmethod
|
|
9
|
-
def get_flow_permission_level_on_list(context, list_name):
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return_type = ClientResult(context)
|
|
14
|
+
def get_flow_permission_level_on_list(context, list_name, return_type=None):
|
|
15
|
+
# type: (ClientContext, str, Optional[ConnectorResult]) -> ConnectorResult
|
|
16
|
+
""" """
|
|
17
|
+
if return_type is None:
|
|
18
|
+
return_type = ConnectorResult(context)
|
|
15
19
|
payload = {"listName": list_name}
|
|
16
20
|
qry = ServiceOperationQuery(
|
|
17
21
|
FlowPermissions(context),
|
|
File without changes
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from office365.runtime.paths.resource_path import ResourcePath
|
|
4
|
+
from office365.runtime.paths.service_operation import ServiceOperationPath
|
|
5
|
+
from office365.sharepoint.entity_collection import EntityCollection
|
|
6
|
+
from office365.sharepoint.fontpackages.font_package import FontPackage
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from office365.sharepoint.client_context import ClientContext
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class FontPackageCollection(EntityCollection):
|
|
13
|
+
"""Represents a collection of View resources."""
|
|
14
|
+
|
|
15
|
+
def __init__(self, context, resource_path=None):
|
|
16
|
+
# type: (ClientContext, Optional[ResourcePath]) -> None
|
|
17
|
+
super(FontPackageCollection, self).__init__(context, FontPackage, resource_path)
|
|
18
|
+
|
|
19
|
+
def get_by_title(self, title):
|
|
20
|
+
"""
|
|
21
|
+
:param str title: The title of the font package to return.
|
|
22
|
+
"""
|
|
23
|
+
return FontPackage(
|
|
24
|
+
self.context,
|
|
25
|
+
ServiceOperationPath("GetByTitle", [title], self.resource_path),
|
|
26
|
+
)
|
|
@@ -1,7 +1,33 @@
|
|
|
1
|
+
from typing import TYPE_CHECKING, Optional
|
|
2
|
+
|
|
3
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
1
4
|
from office365.sharepoint.entity import Entity
|
|
5
|
+
from office365.sharepoint.flows.connector_result import ConnectorResult
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from office365.sharepoint.client_context import ClientContext
|
|
2
9
|
|
|
3
10
|
|
|
4
11
|
class FormsCustomization(Entity):
|
|
12
|
+
|
|
13
|
+
@staticmethod
|
|
14
|
+
def can_customize_forms(context, list_name, return_type=None):
|
|
15
|
+
# type: (ClientContext, str, Optional[ConnectorResult]) -> ConnectorResult
|
|
16
|
+
""""""
|
|
17
|
+
if return_type is None:
|
|
18
|
+
return_type = ConnectorResult(context)
|
|
19
|
+
payload = {"listName": list_name}
|
|
20
|
+
qry = ServiceOperationQuery(
|
|
21
|
+
FormsCustomization(context),
|
|
22
|
+
"CanCustomizeForms",
|
|
23
|
+
None,
|
|
24
|
+
payload,
|
|
25
|
+
None,
|
|
26
|
+
return_type,
|
|
27
|
+
)
|
|
28
|
+
context.add_query(qry)
|
|
29
|
+
return return_type
|
|
30
|
+
|
|
5
31
|
@property
|
|
6
32
|
def entity_type_name(self):
|
|
7
33
|
return "SP.Internal.FormsCustomization"
|
|
File without changes
|
|
@@ -89,6 +89,21 @@ class List(SecurableObject):
|
|
|
89
89
|
|
|
90
90
|
return ListExporter.export(self, local_file, include_content, item_exported)
|
|
91
91
|
|
|
92
|
+
def can_customize_forms(self):
|
|
93
|
+
""""""
|
|
94
|
+
from office365.sharepoint.flows.connector_result import ConnectorResult
|
|
95
|
+
from office365.sharepoint.forms.customization import FormsCustomization
|
|
96
|
+
|
|
97
|
+
return_type = ConnectorResult(self.context)
|
|
98
|
+
|
|
99
|
+
def _can_customize_forms():
|
|
100
|
+
FormsCustomization.can_customize_forms(
|
|
101
|
+
self.context, self.title, return_type
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
self.ensure_property("Title", _can_customize_forms)
|
|
105
|
+
return return_type
|
|
106
|
+
|
|
92
107
|
def clear(self):
|
|
93
108
|
"""Clears the list."""
|
|
94
109
|
|
|
@@ -177,6 +192,21 @@ class List(SecurableObject):
|
|
|
177
192
|
self.root_folder.ensure_property("ServerRelativeUrl", _loaded)
|
|
178
193
|
return return_type
|
|
179
194
|
|
|
195
|
+
def get_flow_permission_level(self):
|
|
196
|
+
""""""
|
|
197
|
+
from office365.sharepoint.flows.connector_result import ConnectorResult
|
|
198
|
+
from office365.sharepoint.flows.permissions import FlowPermissions
|
|
199
|
+
|
|
200
|
+
return_type = ConnectorResult(self.context)
|
|
201
|
+
|
|
202
|
+
def _loaded():
|
|
203
|
+
FlowPermissions.get_flow_permission_level_on_list(
|
|
204
|
+
self.context, self.title, return_type
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
self.ensure_property("Title", _loaded)
|
|
208
|
+
return return_type
|
|
209
|
+
|
|
180
210
|
def get_sharing_settings(self):
|
|
181
211
|
"""Retrieves a sharing settings for a List"""
|
|
182
212
|
return_type = ObjectSharingSettings(self.context)
|
|
@@ -7,6 +7,9 @@ from office365.sharepoint.entity import Entity
|
|
|
7
7
|
class CorporateCatalogAppMetadata(Entity):
|
|
8
8
|
"""App metadata for apps stored in the corporate catalog."""
|
|
9
9
|
|
|
10
|
+
def __str__(self):
|
|
11
|
+
return self.title or self.entity_type_name
|
|
12
|
+
|
|
10
13
|
def deploy(self, skip_feature_deployment):
|
|
11
14
|
"""This method deploys an app on the app catalog. It MUST be called in the context of the tenant app
|
|
12
15
|
catalog web or it will fail.
|
|
@@ -18,6 +21,13 @@ class CorporateCatalogAppMetadata(Entity):
|
|
|
18
21
|
self.context.add_query(qry)
|
|
19
22
|
return self
|
|
20
23
|
|
|
24
|
+
def remove(self):
|
|
25
|
+
"""This is the inverse of the add step above. One removed from the app catalog,
|
|
26
|
+
the solution can't be deployed."""
|
|
27
|
+
qry = ServiceOperationQuery(self, "Remove")
|
|
28
|
+
self.context.add_query(qry)
|
|
29
|
+
return self
|
|
30
|
+
|
|
21
31
|
def install(self):
|
|
22
32
|
"""This method allows an app which is already deployed to be installed on a web."""
|
|
23
33
|
qry = ServiceOperationQuery(self, "Install")
|
|
@@ -68,7 +78,8 @@ class CorporateCatalogAppMetadata(Entity):
|
|
|
68
78
|
|
|
69
79
|
@property
|
|
70
80
|
def property_ref_name(self):
|
|
71
|
-
return "AadAppId"
|
|
81
|
+
# return "AadAppId"
|
|
82
|
+
return "ID"
|
|
72
83
|
|
|
73
84
|
@property
|
|
74
85
|
def entity_type_name(self):
|
|
@@ -22,3 +22,11 @@ class CorporateCatalogAppMetadataCollection(
|
|
|
22
22
|
return CorporateCatalogAppMetadata(
|
|
23
23
|
self.context, ServiceOperationPath("GetById", [app_id], self.resource_path)
|
|
24
24
|
)
|
|
25
|
+
|
|
26
|
+
def get_by_title(self, title):
|
|
27
|
+
"""
|
|
28
|
+
Get app metadata by title.
|
|
29
|
+
|
|
30
|
+
:param str title: The title of the app to retrieve.
|
|
31
|
+
"""
|
|
32
|
+
return self.first("title eq '{0}'".format(title))
|
|
@@ -2,6 +2,28 @@ from office365.runtime.client_value import ClientValue
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
class SPAddinInstanceInfo(ClientValue):
|
|
5
|
+
|
|
6
|
+
def __init__(
|
|
7
|
+
self,
|
|
8
|
+
app_identifier=None,
|
|
9
|
+
app_instance_id=None,
|
|
10
|
+
tenant_app_data=None,
|
|
11
|
+
tenant_app_data_update_time=None,
|
|
12
|
+
title=None,
|
|
13
|
+
):
|
|
14
|
+
"""
|
|
15
|
+
:param str app_identifier:
|
|
16
|
+
:param str app_instance_id:
|
|
17
|
+
:param str tenant_app_data:
|
|
18
|
+
:param datetime.datetime tenant_app_data_update_time:
|
|
19
|
+
:param str title:
|
|
20
|
+
"""
|
|
21
|
+
self.appIdentifier = app_identifier
|
|
22
|
+
self.appInstanceId = app_instance_id
|
|
23
|
+
self.tenantAppData = tenant_app_data
|
|
24
|
+
self.tenantAppDataUpdateTime = tenant_app_data_update_time
|
|
25
|
+
self.title = title
|
|
26
|
+
|
|
5
27
|
@property
|
|
6
28
|
def entity_type_name(self):
|
|
7
29
|
return "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.SPAddinInstanceInfo"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from office365.runtime.client_value import ClientValue
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class SPAddinPermissionInfo(ClientValue):
|
|
5
|
+
""""""
|
|
6
|
+
|
|
7
|
+
def __init__(self, absolute_url=None):
|
|
8
|
+
self.absoluteUrl = absolute_url
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def entity_type_name(self):
|
|
12
|
+
return "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.SPAddinPermissionInfo"
|
|
@@ -1,9 +1,24 @@
|
|
|
1
1
|
from office365.runtime.client_value import ClientValue
|
|
2
|
+
from office365.runtime.client_value_collection import ClientValueCollection
|
|
3
|
+
from office365.sharepoint.marketplace.corporatecuratedgallery.addins.permission_failed_info import (
|
|
4
|
+
SPAddinPermissionFailedInfo,
|
|
5
|
+
)
|
|
6
|
+
from office365.sharepoint.marketplace.corporatecuratedgallery.addins.permission_info import (
|
|
7
|
+
SPAddinPermissionInfo,
|
|
8
|
+
)
|
|
2
9
|
|
|
3
10
|
|
|
4
11
|
class SPAddinPermissionResponse(ClientValue):
|
|
5
12
|
""""""
|
|
6
13
|
|
|
14
|
+
def __init__(self, addin_permissions=None, failed_addins=None):
|
|
15
|
+
self.addinPermissions = ClientValueCollection(
|
|
16
|
+
SPAddinPermissionInfo, addin_permissions
|
|
17
|
+
)
|
|
18
|
+
self.failedAddins = ClientValueCollection(
|
|
19
|
+
SPAddinPermissionFailedInfo, failed_addins
|
|
20
|
+
)
|
|
21
|
+
|
|
7
22
|
@property
|
|
8
23
|
def entity_type_name(self):
|
|
9
24
|
return "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.SPAddinPermissionResponse"
|
|
@@ -8,3 +8,7 @@ from office365.sharepoint.marketplace.corporatecuratedgallery.addins.instance_in
|
|
|
8
8
|
class SPAvailableAddinsResponse(ClientValue):
|
|
9
9
|
def __init__(self, addins=None):
|
|
10
10
|
self.addins = ClientValueCollection(SPAddinInstanceInfo, addins)
|
|
11
|
+
|
|
12
|
+
@property
|
|
13
|
+
def entity_type_name(self):
|
|
14
|
+
return "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.SPAvailableAddinsResponse"
|
|
@@ -1,9 +1,23 @@
|
|
|
1
|
+
from typing import AnyStr
|
|
2
|
+
|
|
3
|
+
from office365.runtime.client_result import ClientResult
|
|
4
|
+
from office365.runtime.queries.service_operation import ServiceOperationQuery
|
|
1
5
|
from office365.sharepoint.entity import Entity
|
|
2
6
|
|
|
3
7
|
|
|
4
8
|
class TeamsPackageDownload(Entity):
|
|
5
9
|
""""""
|
|
6
10
|
|
|
11
|
+
def download_teams(self):
|
|
12
|
+
# type: () -> ClientResult[AnyStr]
|
|
13
|
+
""" """
|
|
14
|
+
return_type = ClientResult(self.context)
|
|
15
|
+
qry = ServiceOperationQuery(
|
|
16
|
+
self, "DownloadTeams", None, None, None, return_type
|
|
17
|
+
)
|
|
18
|
+
self.context.add_query(qry)
|
|
19
|
+
return return_type
|
|
20
|
+
|
|
7
21
|
@property
|
|
8
22
|
def entity_type_name(self):
|
|
9
23
|
return "Microsoft.SharePoint.Marketplace.CorporateCuratedGallery.TeamsPackageDownload"
|