class TranslationNotificationRecipient
A data class representing a recipient for translation notifications in Office 365, storing the login name of the user who should receive notifications.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient.py
5 - 7
simple
Purpose
This class serves as a client-side value object for representing translation notification recipients in Office 365 SharePoint operations. It inherits from ClientValue, which is part of the Office 365 REST API client framework, and is used to serialize/deserialize recipient information when communicating with SharePoint translation services. The class encapsulates the login name identifier needed to specify who should receive notifications about translation job status or completion.
Source Code
class TranslationNotificationRecipient(ClientValue):
def __init__(self, login_name=None):
self.LoginName = login_name
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
login_name: The login name (user principal name or account identifier) of the user who should receive translation notifications. This is typically in the format 'user@domain.com' or 'domain\username'. Can be None if not specified at initialization, allowing for later assignment. This value is used by SharePoint to identify the recipient when sending translation-related notifications.
Return Value
Instantiation returns a TranslationNotificationRecipient object with the LoginName attribute set to the provided login_name parameter value (or None if not provided). This object can be used in Office 365 API calls related to translation services.
Class Interface
Methods
__init__(login_name=None)
Purpose: Initializes a new TranslationNotificationRecipient instance with an optional login name
Parameters:
login_name: Optional string representing the user's login name who will receive translation notifications. Defaults to None if not provided.
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
LoginName |
str or None | The login name (user principal name or account identifier) of the user who should receive translation notifications. This is the primary identifier used by SharePoint to route notifications. | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
Usage Example
from office365.runtime.client_value import ClientValue
from office365.sharepoint.translation.notification_recipient import TranslationNotificationRecipient
# Create a notification recipient with a login name
recipient = TranslationNotificationRecipient(login_name='user@contoso.com')
# Access the login name
print(recipient.LoginName) # Output: user@contoso.com
# Create an empty recipient and set login name later
recipient2 = TranslationNotificationRecipient()
recipient2.LoginName = 'admin@contoso.com'
# Typically used in translation job requests
# translation_job.NotificationRecipients.add(recipient)
Best Practices
- Always provide a valid login name in the correct format (user@domain.com or domain\username) that exists in the SharePoint environment
- This class is typically used as part of a collection (ClientValueCollection) when specifying multiple notification recipients for translation jobs
- The LoginName attribute should be set before using the object in API calls to ensure proper notification delivery
- As a ClientValue subclass, this object is designed for serialization to JSON for REST API communication - avoid storing complex objects or references in custom attributes
- Instantiate new objects for each recipient rather than reusing the same instance with modified LoginName values
- Verify that the specified user has appropriate permissions to receive translation notifications in the SharePoint site
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class TranslationNotificationRecipientCollection 84.3% similar
-
class TranslationNotificationRecipientUsers 82.1% similar
-
class TranslationNotificationRecipientSetRequest 81.0% similar
-
class Recipient 68.8% similar
-
class RequestedTranslation 67.2% similar