🔍 Code Extractor

class TranslationNotificationRecipient

Maturity: 24

A data class representing a recipient for translation notifications in Office 365, storing the login name of the user who should receive notifications.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient.py
Lines:
5 - 7
Complexity:
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

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class TranslationNotificationRecipientCollection 84.3% similar

    A data container class that represents a collection of translation notification recipients grouped by language code.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient.py
  • class TranslationNotificationRecipientUsers 82.1% similar

    A SharePoint entity class that represents translation notification recipient users, providing access to language code and recipient user collection properties.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient_users.py
  • class TranslationNotificationRecipientSetRequest 81.0% similar

    A request class that encapsulates a collection of translation notification recipients for SharePoint translation operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient_set_request.py
  • class Recipient 68.8% similar

    A class representing information about a user in the sending or receiving end of an event, message or group post in Microsoft Office 365 Outlook.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/outlook/mail/recipient.py
  • class RequestedTranslation 67.2% similar

    RequestedTranslation is a simple data class that inherits from ClientValue, representing a translation request in the Office365 API context.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/requested_translation.py
← Back to Browse