class SocialActorInfo
SocialActorInfo is a data class that represents an actor (user, document, site, or tag) in SharePoint's social features, used to identify and communicate actor information to the server.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/social/actor_info.py
4 - 16
simple
Purpose
This class serves as a data transfer object (DTO) for SharePoint's social API, encapsulating information about social actors. It inherits from ClientValue, making it serializable for communication with SharePoint servers. The class is primarily used to identify users, documents, sites, or tags in social operations like following, mentions, or activity feeds. It provides a standardized way to represent actor information that can be sent to and received from SharePoint's REST API endpoints.
Source Code
class SocialActorInfo(ClientValue):
"""e SocialActorInfo type identifies an actor to the server. An actor can be a user, document, site, or tag."""
def __init__(self, account_name=None):
"""
:param str account_name: The AccountName property specifies the user's account name. Users can be identified
by this property.
"""
self.AccountName = account_name
@property
def entity_type_name(self):
return "SP.Social.SocialActorInfo"
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
account_name: Optional string parameter that specifies the user's account name. This is the primary identifier for user actors in SharePoint. Expected format is typically 'domain\username' or 'i:0#.f|membership|user@domain.com' depending on the authentication provider. Can be None if the actor information will be populated later or represents a non-user actor type.
Return Value
Instantiation returns a SocialActorInfo object with the AccountName attribute set to the provided value (or None). The entity_type_name property returns the string 'SP.Social.SocialActorInfo', which is used for serialization and type identification in SharePoint API communications.
Class Interface
Methods
__init__(account_name: str = None) -> None
Purpose: Initializes a new SocialActorInfo instance with an optional account name
Parameters:
account_name: Optional string specifying the user's account name for identification
Returns: None (constructor)
@property entity_type_name() -> str
property
Purpose: Returns the SharePoint entity type name used for serialization and type identification
Returns: String 'SP.Social.SocialActorInfo' representing the SharePoint entity type
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
AccountName |
str or None | Stores the user's account name used to identify the actor. Can be None if not specified or if representing a non-user actor type. | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.sharepoint.social.social_actor_info import SocialActorInfo
Usage Example
from office365.sharepoint.social.social_actor_info import SocialActorInfo
# Create actor info for a user
actor = SocialActorInfo(account_name='i:0#.f|membership|user@contoso.com')
# Access the account name
print(actor.AccountName) # Output: i:0#.f|membership|user@contoso.com
# Get the entity type name for serialization
print(actor.entity_type_name) # Output: SP.Social.SocialActorInfo
# Create an empty actor info to be populated later
empty_actor = SocialActorInfo()
empty_actor.AccountName = 'domain\\username'
Best Practices
- Always use the correct account name format for your SharePoint authentication provider (claims-based, Windows, etc.)
- The AccountName should match the format expected by SharePoint's User Profile Service
- This class is typically used as part of larger social API operations, not in isolation
- The entity_type_name property should not be modified as it's used for proper serialization
- When creating actor info for users, ensure the account name corresponds to an existing user in SharePoint
- This class is immutable after creation except for the AccountName attribute, which can be modified if needed
- The class inherits from ClientValue, so it can be automatically serialized when passed to SharePoint API methods
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class SocialActor 84.0% similar
-
class SocialPostActorInfo 81.0% similar
-
class SocialRestActor 76.3% similar
-
class SiteUserGroupInfo 65.5% similar
-
class ChannelInfo 64.6% similar