🔍 Code Extractor

class TranslationNotificationRecipientSetRequest

Maturity: 24

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

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient_set_request.py
Lines:
8 - 12
Complexity:
simple

Purpose

This class serves as a data transfer object (DTO) for specifying notification recipients when requesting translation operations in SharePoint. It inherits from ClientValue, making it serializable for client-server communication. The class wraps a collection of TranslationNotificationRecipient objects, allowing multiple recipients to be specified for translation notifications.

Source Code

class TranslationNotificationRecipientSetRequest(ClientValue):
    def __init__(self, notification_recipients=None):
        self.NotificationRecipients = ClientValueCollection(
            TranslationNotificationRecipientCollection, notification_recipients
        )

Parameters

Name Type Default Kind
bases ClientValue -

Parameter Details

notification_recipients: Optional parameter that accepts an initial collection of notification recipients. Can be None (default), a list of TranslationNotificationRecipient objects, or another iterable containing recipient data. When provided, these recipients are wrapped in a ClientValueCollection for proper serialization and management.

Return Value

Instantiation returns a TranslationNotificationRecipientSetRequest object with a NotificationRecipients attribute containing a ClientValueCollection of TranslationNotificationRecipientCollection type. This object can be used in SharePoint translation API calls to specify who should receive notifications.

Class Interface

Attributes

Name Type Description Scope
NotificationRecipients ClientValueCollection[TranslationNotificationRecipientCollection] A collection that holds TranslationNotificationRecipient objects representing the users or email addresses that should receive notifications about translation operations. This collection can be modified after instantiation using standard collection methods. instance

Dependencies

  • office365

Required Imports

from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.translation.notification_recipient import TranslationNotificationRecipientCollection

Usage Example

from office365.sharepoint.translation.notification_recipient_set_request import TranslationNotificationRecipientSetRequest
from office365.sharepoint.translation.notification_recipient import TranslationNotificationRecipient

# Create individual recipients
recipient1 = TranslationNotificationRecipient(email='user1@example.com')
recipient2 = TranslationNotificationRecipient(email='user2@example.com')

# Create request with recipients
request = TranslationNotificationRecipientSetRequest(
    notification_recipients=[recipient1, recipient2]
)

# Or create empty and add later
request = TranslationNotificationRecipientSetRequest()
request.NotificationRecipients.add(recipient1)

# Use in SharePoint translation API call
# translation_job.set_notification_recipients(request)

Best Practices

  • Always ensure notification_recipients parameter contains valid TranslationNotificationRecipient objects if provided
  • The class is immutable after construction except for modifications to the NotificationRecipients collection
  • Use this class as part of SharePoint translation workflow, not as a standalone component
  • The NotificationRecipients attribute is a ClientValueCollection, which provides collection management methods like add(), remove(), and clear()
  • This class inherits from ClientValue, making it automatically serializable for SharePoint API calls
  • Pass None or an empty list to notification_recipients if no initial recipients are needed

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class TranslationNotificationRecipientCollection 83.5% 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 TranslationNotificationRecipient 81.0% similar

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

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/notification_recipient.py
  • class TranslationNotificationRecipientUsers 78.5% 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 TranslationStatusSetRequest 76.0% similar

    A client value class that represents a request to set translation status for multiple requested translations in SharePoint.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/status_set_request.py
  • class RequestedTranslation 70.6% 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