class TranslationStatusSetRequest
A client value class that represents a request to set translation status for multiple requested translations in SharePoint.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/status_set_request.py
6 - 11
simple
Purpose
This class serves as a data transfer object (DTO) for managing translation status requests in SharePoint. It encapsulates a collection of RequestedTranslation objects and inherits from ClientValue, making it suitable for serialization and transmission to SharePoint services. The class is used when you need to batch multiple translation status updates into a single request.
Source Code
class TranslationStatusSetRequest(ClientValue):
def __init__(self, values=None):
"""
:param list[RequestedTranslation] values:
"""
self.RequestedTranslations = ClientValueCollection(RequestedTranslation, values)
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
values: An optional list of RequestedTranslation objects to initialize the collection. Can be None (default) to create an empty collection, or a list of RequestedTranslation instances to pre-populate the request. This parameter allows bulk initialization of translation requests that need status updates.
Return Value
Instantiation returns a TranslationStatusSetRequest object with a RequestedTranslations attribute containing a ClientValueCollection of RequestedTranslation objects. The object itself doesn't have methods that return values, but serves as a container for translation request data.
Class Interface
Methods
__init__(self, values=None) -> None
Purpose: Initializes a new TranslationStatusSetRequest instance with an optional collection of RequestedTranslation objects
Parameters:
values: Optional list of RequestedTranslation objects to initialize the collection. Defaults to None for an empty collection.
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
RequestedTranslations |
ClientValueCollection[RequestedTranslation] | A collection of RequestedTranslation objects representing the translations whose status needs to be set. This collection can be iterated over and modified using standard collection operations provided by ClientValueCollection. | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.runtime.client_value_collection import ClientValueCollection
from office365.sharepoint.translation.requested_translation import RequestedTranslation
Usage Example
from office365.sharepoint.translation.status_set_request import TranslationStatusSetRequest
from office365.sharepoint.translation.requested_translation import RequestedTranslation
# Create individual translation requests
translation1 = RequestedTranslation()
translation2 = RequestedTranslation()
# Create a status set request with initial values
status_request = TranslationStatusSetRequest(values=[translation1, translation2])
# Or create an empty request and add translations later
status_request = TranslationStatusSetRequest()
status_request.RequestedTranslations.add(translation1)
status_request.RequestedTranslations.add(translation2)
# Access the collection
for translation in status_request.RequestedTranslations:
# Process each translation request
pass
Best Practices
- Initialize with a list of RequestedTranslation objects if you have them available at construction time for cleaner code
- Use the RequestedTranslations attribute to access and manipulate the collection of translation requests
- This class is immutable in structure (only one attribute) but the collection itself can be modified after instantiation
- Ensure all RequestedTranslation objects are properly configured before adding them to the collection
- This class inherits from ClientValue, which means it's designed for serialization to SharePoint services - don't add custom attributes that won't serialize properly
- The class follows the SharePoint client object model pattern and should be used within the context of a SharePoint client context
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class TranslationStatusCreationRequest 78.9% similar
-
class RequestedTranslation 76.9% similar
-
class TranslationStatus 76.7% similar
-
class TranslationNotificationRecipientSetRequest 76.0% similar
-
class TranslationStatusCollection 75.4% similar