class TopFilesSharingInsights
A SharePoint entity class representing insights about the most shared files in a tenant, providing access to file sharing analytics data.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/insights/top_files_sharing.py
4 - 9
simple
Purpose
This class serves as a data model for SharePoint Online tenant administration, specifically for retrieving and representing insights about top shared files. It inherits from the Entity base class and provides the entity type identifier used by SharePoint's REST API to query file sharing statistics and analytics. This is typically used in tenant-level administrative operations to monitor and analyze file sharing patterns across a SharePoint tenant.
Source Code
class TopFilesSharingInsights(Entity):
@property
def entity_type_name(self):
return (
"Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights"
)
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
Entity | - |
Parameter Details
bases: Inherits from Entity class which provides the base functionality for SharePoint entities including property management, REST API communication, and entity lifecycle management
Return Value
Instantiation returns a TopFilesSharingInsights object that represents a SharePoint entity. The entity_type_name property returns a string identifying the SharePoint entity type: 'Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights'
Class Interface
Methods
@property entity_type_name(self) -> str
property
Purpose: Returns the fully qualified entity type name used by SharePoint REST API to identify this entity type
Returns: String containing 'Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights' which is the SharePoint entity type identifier
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
entity_type_name |
str | Read-only property that returns the SharePoint entity type identifier for top files sharing insights | instance |
Dependencies
office365
Required Imports
from office365.sharepoint.entity import Entity
from office365.sharepoint.tenant.administration.top_files_sharing_insights import TopFilesSharingInsights
Usage Example
from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.tenant.administration.top_files_sharing_insights import TopFilesSharingInsights
# Authenticate to SharePoint
site_url = 'https://yourtenant-admin.sharepoint.com'
credentials = UserCredential('admin@yourtenant.onmicrosoft.com', 'password')
ctx = ClientContext(site_url).with_credentials(credentials)
# Create or retrieve TopFilesSharingInsights entity
insights = TopFilesSharingInsights(ctx)
# Access entity type name
print(insights.entity_type_name)
# Output: Microsoft.Online.SharePoint.TenantAdministration.TopFilesSharingInsights
# Load and access properties (inherited from Entity)
insights.load()
ctx.execute_query()
Best Practices
- This class should be instantiated with a valid ClientContext that has tenant administrator permissions
- Always call load() and execute_query() to populate entity properties from SharePoint
- The entity_type_name property is primarily used internally by the Office365 REST client for API communication
- This is a read-only entity for retrieving insights; it does not support create/update/delete operations
- Ensure proper authentication with tenant admin rights before attempting to access sharing insights
- Handle exceptions that may occur during API calls to SharePoint
- The class follows the Entity pattern from office365-rest-python-client library, so familiarize yourself with Entity base class methods
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SharedInsight 78.1% similar
-
class ObjectSharingInformation 69.5% similar
-
class CollaborationInsightsData 67.9% similar
-
class UsedInsight 67.6% similar
-
class CollaborationInsightsOverview 66.4% similar