class SharePointHomePageContext
A client value class representing the context for a SharePoint home page, used for serialization and communication with SharePoint Portal Home services.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/portal/home/page_context.py
4 - 7
simple
Purpose
This class serves as a data transfer object (DTO) for SharePoint home page context information. It inherits from ClientValue, which provides serialization capabilities for communication with SharePoint REST APIs. The class identifies itself with the entity type name 'Microsoft.SharePoint.Portal.Home.SharePointHomePageContext' for proper type resolution in SharePoint service calls.
Source Code
class SharePointHomePageContext(ClientValue):
@property
def entity_type_name(self):
return "Microsoft.SharePoint.Portal.Home.SharePointHomePageContext"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
bases: Inherits from ClientValue, which provides base functionality for client-side value objects that can be serialized to/from JSON for SharePoint API communication
Return Value
Instantiation returns a SharePointHomePageContext object that can be used as a parameter or return value in SharePoint Portal Home API operations. The entity_type_name property returns a string identifying the SharePoint entity type.
Class Interface
Methods
@property entity_type_name(self) -> str
property
Purpose: Returns the SharePoint entity type name used for type resolution in API calls
Returns: String 'Microsoft.SharePoint.Portal.Home.SharePointHomePageContext' identifying the SharePoint entity type
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
entity_type_name |
str | Read-only property that returns the SharePoint entity type identifier for this context object | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.portal.home.sharepoint_home_page_context import SharePointHomePageContext
Usage Example
from office365.sharepoint.portal.home.sharepoint_home_page_context import SharePointHomePageContext
from office365.sharepoint.client_context import ClientContext
from office365.runtime.auth.user_credential import UserCredential
# Authenticate to SharePoint
ctx = ClientContext('https://yourtenant.sharepoint.com')
ctx.with_credentials(UserCredential('username', 'password'))
# Create a SharePoint home page context instance
home_context = SharePointHomePageContext()
# The entity_type_name property is used internally for serialization
entity_type = home_context.entity_type_name
print(entity_type) # Output: Microsoft.SharePoint.Portal.Home.SharePointHomePageContext
# This object would typically be used as part of larger SharePoint Portal Home API calls
# The ClientValue base class handles serialization automatically
Best Practices
- This class is primarily used internally by the Office365-REST-Python-Client library for type identification during API calls
- Do not modify the entity_type_name property as it must match the exact SharePoint service entity type
- Instances of this class are typically created and managed by higher-level SharePoint Portal Home API methods
- The class follows the ClientValue pattern for SharePoint API communication, ensuring proper serialization
- This is a lightweight DTO class with no complex state management or lifecycle concerns
- Additional properties and methods may be added to this class to represent specific SharePoint home page context data
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class GroupCreationContext 74.4% similar
-
class SharePointHomeServiceContext 72.0% similar
-
class ClientContext 70.3% similar
-
class SharePointHomeServiceContextBuilder 69.5% similar
-
class OrgLabelsContext 68.7% similar