Share via


@azure-rest/ai-translation-document package

Interfaces

BatchRequest

Definition for the input batch translation request

CancelTranslation200Response

The request has succeeded.

CancelTranslationDefaultHeaders
CancelTranslationDefaultResponse
DocumentFilter

Document filter

DocumentStatusOutput

Document Status Response

DocumentTranslate
DocumentTranslate200Headers
DocumentTranslate200Response

The request has succeeded.

DocumentTranslateBodyParam
DocumentTranslateContentDocumentPartDescriptor
DocumentTranslateContentGlossaryPartDescriptor
DocumentTranslateDefaultHeaders
DocumentTranslateDefaultResponse
DocumentTranslateHeaderParam
DocumentTranslateHeaders
DocumentTranslateMediaTypesParam
DocumentTranslateQueryParam
DocumentTranslateQueryParamProperties
DocumentTranslationClientOptions

The optional parameters for the client

DocumentsStatusOutput

Documents Status Response

FileFormatOutput

File Format

GetDocumentStatus
GetDocumentStatus200Response

The request has succeeded.

GetDocumentStatusDefaultHeaders
GetDocumentStatusDefaultResponse
GetDocumentsStatus
GetDocumentsStatus200Response

The request has succeeded.

GetDocumentsStatusDefaultHeaders
GetDocumentsStatusDefaultResponse
GetDocumentsStatusQueryParam
GetDocumentsStatusQueryParamProperties
GetSupportedFormats
GetSupportedFormats200Response

The request has succeeded.

GetSupportedFormatsDefaultHeaders
GetSupportedFormatsDefaultResponse
GetSupportedFormatsQueryParam
GetSupportedFormatsQueryParamProperties
GetTranslationStatus
GetTranslationStatus200Response

The request has succeeded.

GetTranslationStatusDefaultHeaders
GetTranslationStatusDefaultResponse
GetTranslationsStatus200Response

The request has succeeded.

GetTranslationsStatusDefaultHeaders
GetTranslationsStatusDefaultResponse
GetTranslationsStatusQueryParam
GetTranslationsStatusQueryParamProperties
Glossary

Glossary / translation memory for the request

InnerTranslationErrorOutput

New Inner Error format which conforms to Cognitive Services API Guidelines which is available at https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow. This contains required properties ErrorCode, message and optional properties target, details(key value pair), inner error(this can be nested).

PagingOptions

Options for the paging helper

Routes
SimplePollerLike

A simple poller that can be used to poll a long running operation.

SourceInput

Source of the input documents

StartTranslation
StartTranslation202Headers
StartTranslation202Response

The request has been accepted for processing, but processing has not yet completed.

StartTranslationBodyParam
StartTranslationDefaultHeaders
StartTranslationDefaultResponse
StartTranslationDetails

Translation job submission batch request

StartTranslationLogicalResponse

The final response for long-running startTranslation operation

StatusSummaryOutput

Status Summary

SupportedFileFormatsOutput

List of supported file formats

TargetInput

Destination for the finished translated documents

TranslationErrorOutput

This contains an outer error with error code, message, details, target and an inner error with more descriptive details.

TranslationStatusOutput

Translation job status response

TranslationsStatusOutput

Translation job Status Response

Type Aliases

CancelTranslationParameters
DocumentTranslateContent

Document Translate Request Content

DocumentTranslateParameters
DocumentTranslationClient
FileFormatType

Alias for FileFormatType

GetArrayType

Helper type to extract the type of an array

GetDocumentStatusParameters
GetDocumentsStatusParameters
GetPage

The type of a custom function that defines how to get a page and a link to the next one if any.

GetSupportedFormatsParameters
GetTranslationStatusParameters
GetTranslationsStatusParameters
PaginateReturn

Helper type to infer the Type of the paged elements from the response type This type is generated based on the swagger information for x-ms-pageable specifically on the itemName property which indicates the property of the response where the page items are found. The default value is value. This type will allow us to provide strongly typed Iterator based on the response we get as second parameter

StartTranslationParameters
StatusOutput

Alias for StatusOutput

StorageInputType

Alias for StorageInputType

StorageSource

Alias for StorageSource

TranslationErrorCodeOutput

Alias for TranslationErrorCodeOutput

Function Details

default(string, TokenCredential | KeyCredential, DocumentTranslationClientOptions)

Initialize a new instance of DocumentTranslationClient

function default(endpointParam: string, credentials: TokenCredential | KeyCredential, options?: DocumentTranslationClientOptions): DocumentTranslationClient

Parameters

endpointParam

string

Supported document Translation endpoint, protocol and hostname, for example: https://{TranslatorResourceName}.cognitiveservices.azure.com/translator.

credentials

TokenCredential | KeyCredential

uniquely identify client credential

options
DocumentTranslationClientOptions

the parameter for all optional parameters

Returns

getLongRunningPoller<TResult>(Client, StartTranslationDefaultResponse | StartTranslation202Response, CreateHttpPollerOptions<TResult, OperationState<TResult>>)

Helper function that builds a Poller object to help polling a long running operation.

function getLongRunningPoller<TResult>(client: Client, initialResponse: StartTranslationDefaultResponse | StartTranslation202Response, options?: CreateHttpPollerOptions<TResult, OperationState<TResult>>): Promise<SimplePollerLike<OperationState<TResult>, TResult>>

Parameters

client
Client

Client to use for sending the request to get additional pages.

initialResponse

StartTranslationDefaultResponse | StartTranslation202Response

The initial response.

options

CreateHttpPollerOptions<TResult, OperationState<TResult>>

Options to set a resume state or custom polling interval.

Returns

Promise<SimplePollerLike<OperationState<TResult>, TResult>>

  • A poller object to poll for operation state updates and eventually get the final response.

isUnexpected(DocumentTranslate200Response | DocumentTranslateDefaultResponse)

function isUnexpected(response: DocumentTranslate200Response | DocumentTranslateDefaultResponse): response

Parameters

Returns

response

isUnexpected(StartTranslationLogicalResponse | StartTranslationDefaultResponse | StartTranslation202Response)

function isUnexpected(response: StartTranslationLogicalResponse | StartTranslationDefaultResponse | StartTranslation202Response): response

Parameters

Returns

response

isUnexpected(GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse)

function isUnexpected(response: GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse): response

Parameters

Returns

response

isUnexpected(GetDocumentStatus200Response | GetDocumentStatusDefaultResponse)

function isUnexpected(response: GetDocumentStatus200Response | GetDocumentStatusDefaultResponse): response

Parameters

Returns

response

isUnexpected(GetTranslationStatus200Response | GetTranslationStatusDefaultResponse)

function isUnexpected(response: GetTranslationStatus200Response | GetTranslationStatusDefaultResponse): response

Parameters

Returns

response

isUnexpected(CancelTranslation200Response | CancelTranslationDefaultResponse)

function isUnexpected(response: CancelTranslation200Response | CancelTranslationDefaultResponse): response

Parameters

Returns

response

isUnexpected(GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse)

function isUnexpected(response: GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse): response

Parameters

Returns

response

isUnexpected(GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse)

function isUnexpected(response: GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse): response

Parameters

Returns

response

paginate<TResponse>(Client, TResponse, PagingOptions<TResponse>)

Helper to paginate results from an initial response that follows the specification of Autorest x-ms-pageable extension

function paginate<TResponse>(client: Client, initialResponse: TResponse, options?: PagingOptions<TResponse>): PagedAsyncIterableIterator<PaginateReturn<TResponse>>

Parameters

client
Client

Client to use for sending the next page requests

initialResponse

TResponse

Initial response containing the nextLink and current page of elements

options

PagingOptions<TResponse>

Returns

  • PagedAsyncIterableIterator to iterate the elements