class SocialActor
SocialActor is a data model class representing an actor entity retrieved from a server, where an actor can be a user, document, site, or tag in a social context.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/social/actor.py
4 - 8
simple
Purpose
This class serves as a data transfer object (DTO) for social actor information in the Office365 API. It inherits from ClientValue to provide serialization/deserialization capabilities for server communication. The class is designed to encapsulate information about various types of social entities (users, documents, sites, tags) in a unified interface, allowing consistent handling of different actor types in social features like following, mentions, or activity feeds.
Source Code
class SocialActor(ClientValue):
"""The SocialActor type contains information about an actor retrieved from server. An actor is a user, document,
site, or tag."""
pass
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 and from server responses. This inheritance enables the class to work with Office365 REST API data structures.
Return Value
Instantiation returns a SocialActor object that represents an actor entity. The object can hold properties related to users, documents, sites, or tags as defined by the Office365 social API. Specific properties are inherited from ClientValue and would be populated during deserialization from server responses.
Class Interface
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
ActorType |
int | Inherited property indicating the type of actor (User=0, Document=1, Site=2, Tag=3) | instance |
AccountName |
str | Inherited property containing the account name or identifier of the actor | instance |
Name |
str | Inherited property containing the display name of the actor | instance |
ImageUri |
str | Inherited property containing the URI to the actor's image/avatar | instance |
Uri |
str | Inherited property containing the URI to the actor's profile or resource | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.social.social_actor import SocialActor
Usage Example
from office365.sharepoint.social.social_actor import SocialActor
from office365.runtime.client_value import ClientValue
# Typically instantiated through deserialization from server response
# or created programmatically
actor = SocialActor()
# The class would typically be populated with data from Office365 API
# Example of receiving actor data in a social feed context:
# social_feed = context.web.social_feed
# actors = social_feed.get_actors() # Returns list of SocialActor objects
# Access actor properties (inherited from ClientValue)
# Properties would include: ActorType, AccountName, Name, ImageUri, etc.
# actor.AccountName
# actor.Name
# actor.ActorType # Could be 'User', 'Document', 'Site', or 'Tag'
Best Practices
- This class is typically not instantiated directly by users but rather created through deserialization when retrieving social data from Office365 APIs
- The class acts as a pass-through container, with actual properties defined by the ClientValue base class and populated from server responses
- When working with SocialActor objects, check the ActorType property to determine what kind of entity it represents (user, document, site, or tag)
- This class is immutable in practice - properties are set during deserialization and should not be modified directly
- Use within the context of Office365 SharePoint client library for proper authentication and API access
- The empty class body (pass statement) indicates this is a marker class that relies entirely on inherited functionality from ClientValue
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SocialActorInfo 84.0% similar
-
class SocialRestActor 79.6% similar
-
class SocialPostActorInfo 74.6% similar
-
class SocialAttachmentAction 68.1% similar
-
class SocialAttachment 64.1% similar