class TranslationStatusCreationRequest
A data transfer object (DTO) class that represents a request to create translation status for specified language codes.
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/translation/status_creation_request.py
5 - 10
simple
Purpose
This class encapsulates the data needed to request translation status creation in the Office365 API. It inherits from ClientValue, which is a base class for client-side value objects that can be serialized and sent to the Office365 service. The class specifically handles a collection of language codes for which translation status should be created or tracked.
Source Code
class TranslationStatusCreationRequest(ClientValue):
def __init__(self, language_codes=None):
"""
:param list[str] language_codes:
"""
self.LanguageCodes = StringCollection(language_codes)
Parameters
| Name | Type | Default | Kind |
|---|---|---|---|
bases |
ClientValue | - |
Parameter Details
language_codes: An optional list of string language codes (e.g., ['en-US', 'fr-FR', 'de-DE']) for which translation status should be created. If None is provided, an empty StringCollection will be initialized. Language codes typically follow ISO 639-1 or BCP 47 standards.
Return Value
Instantiation returns a TranslationStatusCreationRequest object with a LanguageCodes attribute containing a StringCollection of the provided language codes. This object can be serialized and sent as part of Office365 API requests.
Class Interface
Methods
__init__(self, language_codes=None)
Purpose: Initializes a new TranslationStatusCreationRequest instance with the specified language codes
Parameters:
language_codes: Optional list of string language codes for which translation status should be created. Defaults to None, which creates an empty StringCollection.
Returns: None (constructor)
Attributes
| Name | Type | Description | Scope |
|---|---|---|---|
LanguageCodes |
StringCollection | A collection of language code strings representing the languages for which translation status should be created. This is a StringCollection object that wraps the provided list of language codes. | instance |
Dependencies
office365
Required Imports
from office365.runtime.client_value import ClientValue
from office365.runtime.types.collections import StringCollection
Usage Example
from office365.runtime.client_value import ClientValue
from office365.runtime.types.collections import StringCollection
class TranslationStatusCreationRequest(ClientValue):
def __init__(self, language_codes=None):
self.LanguageCodes = StringCollection(language_codes)
# Create a request with specific language codes
request = TranslationStatusCreationRequest(language_codes=['en-US', 'fr-FR', 'de-DE'])
# Create a request with no language codes (empty collection)
empty_request = TranslationStatusCreationRequest()
# Access the language codes collection
print(request.LanguageCodes) # StringCollection containing the language codes
# This object would typically be passed to an Office365 API method
# Example: translation_service.create_status(request)
Best Practices
- Always provide valid language codes following ISO 639-1 or BCP 47 standards when instantiating this class
- This class is designed to be immutable after creation - set language codes during initialization
- The class inherits from ClientValue, which means it's designed to be serialized for API communication - avoid adding non-serializable attributes
- Use None or an empty list if no language codes are needed initially, rather than omitting the parameter
- This object is typically used as a parameter to Office365 API service methods, not used standalone
- The LanguageCodes attribute is a StringCollection, which provides collection-specific functionality beyond a simple list
Tags
Similar Components
AI-powered semantic similarity - components with related functionality:
-
class RequestedTranslation 79.5% similar
-
class TranslationStatusSetRequest 78.9% similar
-
class TranslationStatus 77.1% similar
-
class TranslationNotificationRecipientSetRequest 64.6% similar
-
class GroupCreationInformation 64.0% similar