class SocialDataOverlay
SocialDataOverlay represents a substring overlay in a social media post that identifies users, documents, sites, tags, or links within the post content.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/social/data_overlay.py
4 - 9
simple
Purpose
This class serves as a data model for representing overlays in social media posts within the Office 365 SharePoint social features. An overlay is a marked-up substring that provides metadata about mentions, links, or other entities within post text. It inherits from ClientValue, making it part of the Office 365 REST API client value object hierarchy. The class is used in conjunction with SocialPost objects to provide rich metadata about post content, enabling features like user mentions, document references, and clickable links.
Source Code
class SocialDataOverlay(ClientValue):
"""
The SocialDataOverlay class provides information about an overlay. An overlay is a substring in a post that
represents a user, document, site, tag, or link. The SocialPost class (see section 3.1.5.26) contains an array of
SocialDataOverlay objects. Each of the SocialDataOverlay objects specifies a link or one or more actors.
"""
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
bases: Inherits from ClientValue, which is the base class for Office 365 client-side value objects that can be serialized/deserialized for API communication
Return Value
Instantiation returns a SocialDataOverlay object that can store and represent overlay information for social posts. The object can be serialized to JSON for API requests and deserialized from API responses.
Class Interface
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.social.data_overlay import SocialDataOverlay
Usage Example
from office365.sharepoint.social.data_overlay import SocialDataOverlay
from office365.runtime.client_value import ClientValue
# Instantiate a SocialDataOverlay object
overlay = SocialDataOverlay()
# Typically used as part of a SocialPost object
# The overlay would contain properties like:
# - ActorIndexes: indices of actors mentioned
# - Index: starting position of overlay in post text
# - Length: length of overlay substring
# - LinkUri: URI if overlay represents a link
# - OverlayType: type of overlay (user, document, site, tag, link)
# Example in context of a social post:
# post = SocialPost()
# post.Overlays = [overlay]
# The overlay properties would be set based on the post content
Best Practices
- This class is typically instantiated and populated by the Office 365 API client when retrieving social post data, rather than manually created by developers
- SocialDataOverlay objects are usually part of a collection within a SocialPost object, not used standalone
- The class inherits from ClientValue, which provides serialization/deserialization capabilities for API communication
- When working with overlays, ensure the Index and Length properties correctly correspond to the post text substring
- Overlay types should match the actual content being referenced (user mention, document link, etc.)
- This is a data transfer object (DTO) pattern - it primarily holds data rather than business logic
- The class definition shown is minimal; actual properties are likely defined in the parent ClientValue class or added dynamically based on API responses
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SocialPost 74.6% similar
-
class SocialAttachment 66.2% similar
-
class SocialPostCreationData 66.1% similar
-
class SocialPostDefinitionData 65.8% similar
-
class SocialLink 64.9% similar