@azure-rest/ai-translation-document package
接口
类型别名
| CancelTranslationParameters | |
| DocumentTranslateContent |
文档翻译请求内容 |
| DocumentTranslateParameters | |
| DocumentTranslationClient | |
| FileFormatType |
FileFormatType 的别名 |
| GetArrayType |
用于提取数组类型的帮助程序类型 |
| GetDocumentStatusParameters | |
| GetDocumentsStatusParameters | |
| GetPage |
自定义函数的类型,用于定义如何获取页面和指向下一个页面的链接(如果有)。 |
| GetSupportedFormatsParameters | |
| GetTranslationStatusParameters | |
| GetTranslationsStatusParameters | |
| PaginateReturn |
用于推断响应类型中分页元素的帮助程序类型。此类型基于特定于 itemName 属性的 x-ms-pageable 的 swagger 信息生成,该属性指示在其中找到页面项的响应的属性。 默认值为 |
| StartTranslationParameters | |
| StatusOutput |
StatusOutput 的别名 |
| StorageInputType |
StorageInputType 的别名 |
| StorageSource |
StorageSource 的别名 |
| TranslationErrorCodeOutput |
TranslationErrorCodeOutput 的别名 |
函数
函数详细信息
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
唯一标识客户端凭据
- 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
用于发送请求以获取其他页面的客户端。
- initialResponse
-
StartTranslationDefaultResponse | StartTranslation202Response
初始响应。
- 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<PaginateReturn<TResponse>>
- PagedAsyncIterableIterator 循环访问元素