通过


你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

@azure-rest/ai-translation-document package

接口

BatchRequest

输入批处理翻译请求的定义

CancelTranslation200Response

请求已成功。

CancelTranslationDefaultHeaders
CancelTranslationDefaultResponse
DocumentFilter

文档筛选器

DocumentStatusOutput

文档状态响应

DocumentTranslate
DocumentTranslate200Headers
DocumentTranslate200Response

请求已成功。

DocumentTranslateBodyParam
DocumentTranslateContentDocumentPartDescriptor
DocumentTranslateContentGlossaryPartDescriptor
DocumentTranslateDefaultHeaders
DocumentTranslateDefaultResponse
DocumentTranslateHeaderParam
DocumentTranslateHeaders
DocumentTranslateMediaTypesParam
DocumentTranslateQueryParam
DocumentTranslateQueryParamProperties
DocumentTranslationClientOptions

客户端的可选参数

DocumentsStatusOutput

文档状态响应

FileFormatOutput

文件格式

GetDocumentStatus
GetDocumentStatus200Response

请求已成功。

GetDocumentStatusDefaultHeaders
GetDocumentStatusDefaultResponse
GetDocumentsStatus
GetDocumentsStatus200Response

请求已成功。

GetDocumentsStatusDefaultHeaders
GetDocumentsStatusDefaultResponse
GetDocumentsStatusQueryParam
GetDocumentsStatusQueryParamProperties
GetSupportedFormats
GetSupportedFormats200Response

请求已成功。

GetSupportedFormatsDefaultHeaders
GetSupportedFormatsDefaultResponse
GetSupportedFormatsQueryParam
GetSupportedFormatsQueryParamProperties
GetTranslationStatus
GetTranslationStatus200Response

请求已成功。

GetTranslationStatusDefaultHeaders
GetTranslationStatusDefaultResponse
GetTranslationsStatus200Response

请求已成功。

GetTranslationsStatusDefaultHeaders
GetTranslationsStatusDefaultResponse
GetTranslationsStatusQueryParam
GetTranslationsStatusQueryParamProperties
Glossary

请求的术语表/翻译内存

InnerTranslationErrorOutput

符合认知服务 API 准则的新内部错误格式,可在 https://microsoft.sharepoint.com/%3Aw%3A/t/CognitiveServicesPMO/EUoytcrjuJdKpeOKIK_QRC8BPtUYQpKBi8JsWyeDMRsWlQ?e=CPq8ow获取。 这包括必需的属性 ErrorCode、消息和可选属性目标、详细信息(键值对)、内部错误(可嵌套)。

PagingOptions

分页帮助程序的选项

Routes
SimplePollerLike

可用于轮询长时间运行的操作的简单轮询程序。

SourceInput

输入文档的源

StartTranslation
StartTranslation202Headers
StartTranslation202Response

已接受请求进行处理,但尚未完成处理。

StartTranslationBodyParam
StartTranslationDefaultHeaders
StartTranslationDefaultResponse
StartTranslationDetails

翻译作业提交批处理请求

StartTranslationLogicalResponse

长时间运行的 startTranslation 操作的最终响应

StatusSummaryOutput

状态摘要

SupportedFileFormatsOutput

支持的文件格式列表

TargetInput

已完成翻译的文档的目标

TranslationErrorOutput

这包含一个外部错误,其中包含错误代码、消息、详细信息、目标和内部错误,其中包含更具描述性的详细信息。

TranslationStatusOutput

转换作业状态响应

TranslationsStatusOutput

转换作业状态响应

类型别名

CancelTranslationParameters
DocumentTranslateContent

文档翻译请求内容

DocumentTranslateParameters
DocumentTranslationClient
FileFormatType

FileFormatType 的别名

GetArrayType

用于提取数组类型的帮助程序类型

GetDocumentStatusParameters
GetDocumentsStatusParameters
GetPage

自定义函数的类型,用于定义如何获取页面和指向下一个页面的链接(如果有)。

GetSupportedFormatsParameters
GetTranslationStatusParameters
GetTranslationsStatusParameters
PaginateReturn

用于推断响应类型中分页元素的帮助程序类型。此类型基于特定于 itemName 属性的 x-ms-pageable 的 swagger 信息生成,该属性指示在其中找到页面项的响应的属性。 默认值为 value。 此类型将允许我们根据作为第二个参数获取的响应提供强类型迭代器

StartTranslationParameters
StatusOutput

StatusOutput 的别名

StorageInputType

StorageInputType 的别名

StorageSource

StorageSource 的别名

TranslationErrorCodeOutput

TranslationErrorCodeOutput 的别名

函数

default(string, TokenCredential | KeyCredential, DocumentTranslationClientOptions)

初始化 DocumentTranslationClient 的新实例

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

生成 Poller 对象的帮助程序函数,以帮助轮询长时间运行的操作。

isUnexpected(DocumentTranslate200Response | DocumentTranslateDefaultResponse)
isUnexpected(StartTranslationLogicalResponse | StartTranslationDefaultResponse | StartTranslation202Response)
isUnexpected(GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse)
isUnexpected(GetDocumentStatus200Response | GetDocumentStatusDefaultResponse)
isUnexpected(GetTranslationStatus200Response | GetTranslationStatusDefaultResponse)
isUnexpected(CancelTranslation200Response | CancelTranslationDefaultResponse)
isUnexpected(GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse)
isUnexpected(GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse)
paginate<TResponse>(Client, TResponse, PagingOptions<TResponse>)

帮助程序根据 Autorest x-ms-pageable 扩展规范对初始响应的结果进行分页

函数详细信息

default(string, TokenCredential | KeyCredential, DocumentTranslationClientOptions)

初始化 DocumentTranslationClient 的新实例

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

参数

endpointParam

string

支持的文档翻译终结点、协议和主机名,例如:https://{TranslatorResourceName}.cognitiveservices.azure.com/translator。

credentials

TokenCredential | KeyCredential

唯一标识客户端凭据

options
DocumentTranslationClientOptions

所有可选参数的参数

返回

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

生成 Poller 对象的帮助程序函数,以帮助轮询长时间运行的操作。

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

参数

client
Client

用于发送请求以获取其他页面的客户端。

options

CreateHttpPollerOptions<TResult, OperationState<TResult>>

设置恢复状态或自定义轮询间隔的选项。

返回

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

  • 用于轮询操作状态更新的轮询程序对象,并最终获取最终响应。

isUnexpected(DocumentTranslate200Response | DocumentTranslateDefaultResponse)

function isUnexpected(response: DocumentTranslate200Response | DocumentTranslateDefaultResponse): response

参数

返回

response

isUnexpected(StartTranslationLogicalResponse | StartTranslationDefaultResponse | StartTranslation202Response)

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

参数

返回

response

isUnexpected(GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse)

function isUnexpected(response: GetTranslationsStatus200Response | GetTranslationsStatusDefaultResponse): response

参数

返回

response

isUnexpected(GetDocumentStatus200Response | GetDocumentStatusDefaultResponse)

function isUnexpected(response: GetDocumentStatus200Response | GetDocumentStatusDefaultResponse): response

参数

返回

response

isUnexpected(GetTranslationStatus200Response | GetTranslationStatusDefaultResponse)

function isUnexpected(response: GetTranslationStatus200Response | GetTranslationStatusDefaultResponse): response

参数

返回

response

isUnexpected(CancelTranslation200Response | CancelTranslationDefaultResponse)

function isUnexpected(response: CancelTranslation200Response | CancelTranslationDefaultResponse): response

参数

返回

response

isUnexpected(GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse)

function isUnexpected(response: GetDocumentsStatus200Response | GetDocumentsStatusDefaultResponse): response

参数

返回

response

isUnexpected(GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse)

function isUnexpected(response: GetSupportedFormats200Response | GetSupportedFormatsDefaultResponse): response

参数

返回

response

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

帮助程序根据 Autorest x-ms-pageable 扩展规范对初始响应的结果进行分页

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

参数

client
Client

用于发送下一页请求的客户端

initialResponse

TResponse

包含 nextLink 和元素当前页的初始响应

options

PagingOptions<TResponse>

返回

  • PagedAsyncIterableIterator 循环访问元素