Skip to content

Commit d41c7ee

Browse files
feat(lt,stt): add and remove model constants
1 parent 67b169d commit d41c7ee

File tree

4 files changed

+385
-330
lines changed

4 files changed

+385
-330
lines changed

language-translator/v3.ts

Lines changed: 66 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* (C) Copyright IBM Corp. 2018, 2022.
2+
* (C) Copyright IBM Corp. 2018, 2023.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,7 +15,7 @@
1515
*/
1616

1717
/**
18-
* IBM OpenAPI SDK Code Generator Version: 3.53.0-9710cac3-20220713-193508
18+
* IBM OpenAPI SDK Code Generator Version: 3.64.1-cee95189-20230124-211647
1919
*/
2020

2121
import * as extend from 'extend';
@@ -606,8 +606,8 @@ class LanguageTranslatorV3 extends BaseService {
606606
/**
607607
* Get model details.
608608
*
609-
* Gets information about a translation model, including training status for custom models. Use this API call to poll
610-
* the status of your customization request. A successfully completed training has a status of `available`.
609+
* Gets information about a translation model, including training status for custom models. Use this method to poll
610+
* the status of your customization request. A successfully completed training request has a status of `available`.
611611
*
612612
* @param {Object} params - The parameters to send to the service.
613613
* @param {string} params.modelId - Model ID of the model to get.
@@ -718,18 +718,42 @@ class LanguageTranslatorV3 extends BaseService {
718718
/**
719719
* Translate document.
720720
*
721-
* Submit a document for translation. You can submit the document contents in the `file` parameter, or you can
722-
* reference a previously submitted document by document ID. The maximum file size for document translation is
723-
* * 20 MB for service instances on the Standard, Advanced, and Premium plans
724-
* * 2 MB for service instances on the Lite plan
721+
* Submit a document for translation. You can submit the document contents in the `file` parameter, or you can specify
722+
* a previously submitted document by document ID. The maximum file size for document translation is
723+
* * **2 MB** for service instances on the Lite plan
724+
* * **20 MB** for service instances on the Standard plan
725+
* * **50 MB** for service instances on the Advanced plan
726+
* * **150 MB** for service instances on the Premium plan
727+
*
728+
* You can specify the format of the file to be translated in one of two ways:
729+
* * By specifying the appropriate file extension for the format.
730+
* * By specifying the content type (MIME type) of the format as the `type` of the `file` parameter.
731+
*
732+
* In some cases, especially for subtitle file formats, you must use either the file extension or the content type.
733+
* For more information about all supported file formats, their file extensions and content types, and how and when to
734+
* specify the file extension or content type, see [Supported file
735+
* formats](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats).
736+
*
725737
*
726738
* **Note:** When translating a previously submitted document, the target language must be different from the target
727739
* language of the original request when the document was initially submitted.
728740
*
729741
* @param {Object} params - The parameters to send to the service.
730742
* @param {NodeJS.ReadableStream | Buffer} params.file - The contents of the source file to translate. The maximum
731-
* file size for document translation is 20 MB for service instances on the Standard, Advanced, and Premium plans, and
732-
* 2 MB for service instances on the Lite plan. For more information, see [Supported file
743+
* file size for document translation is
744+
* * **2 MB** for service instances on the Lite plan
745+
* * **20 MB** for service instances on the Standard plan
746+
* * **50 MB** for service instances on the Advanced plan
747+
* * **150 MB** for service instances on the Premium plan
748+
*
749+
* You can specify the format of the file to be translated in one of two ways:
750+
* * By specifying the appropriate file extension for the format.
751+
* * By specifying the content type (MIME type) of the format as the `type` of the `file` parameter.
752+
*
753+
* In some cases, especially for subtitle file formats, you must use either the file extension or the content type.
754+
*
755+
* For more information about all supported file formats, their file extensions and content types, and how and when to
756+
* specify the file extension or content type, see [Supported file
733757
* formats](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats).
734758
* @param {string} params.filename - The filename for file.
735759
* @param {string} [params.fileContentType] - The content type of file.
@@ -867,11 +891,11 @@ class LanguageTranslatorV3 extends BaseService {
867891
* @param {Object} params - The parameters to send to the service.
868892
* @param {string} params.documentId - Document ID of the document to delete.
869893
* @param {OutgoingHttpHeaders} [params.headers] - Custom request headers
870-
* @returns {Promise<LanguageTranslatorV3.Response<LanguageTranslatorV3.Empty>>}
894+
* @returns {Promise<LanguageTranslatorV3.Response<LanguageTranslatorV3.EmptyObject>>}
871895
*/
872896
public deleteDocument(
873897
params: LanguageTranslatorV3.DeleteDocumentParams
874-
): Promise<LanguageTranslatorV3.Response<LanguageTranslatorV3.Empty>> {
898+
): Promise<LanguageTranslatorV3.Response<LanguageTranslatorV3.EmptyObject>> {
875899
const _params = { ...params };
876900
const _requiredParams = ['documentId'];
877901
const _validParams = ['documentId', 'headers'];
@@ -1008,7 +1032,7 @@ namespace LanguageTranslatorV3 {
10081032
export type Callback<T> = (error: any, response?: Response<T>) => void;
10091033

10101034
/** The body of a service request that returns no response data. */
1011-
export interface Empty {}
1035+
export interface EmptyObject {}
10121036

10131037
/** A standard JS object, defined to avoid the limitations of `Object` and `object` */
10141038
export interface JsonObject {
@@ -1156,9 +1180,21 @@ namespace LanguageTranslatorV3 {
11561180

11571181
/** Parameters for the `translateDocument` operation. */
11581182
export interface TranslateDocumentParams {
1159-
/** The contents of the source file to translate. The maximum file size for document translation is 20 MB for
1160-
* service instances on the Standard, Advanced, and Premium plans, and 2 MB for service instances on the Lite plan.
1161-
* For more information, see [Supported file
1183+
/** The contents of the source file to translate. The maximum file size for document translation is
1184+
* * **2 MB** for service instances on the Lite plan
1185+
* * **20 MB** for service instances on the Standard plan
1186+
* * **50 MB** for service instances on the Advanced plan
1187+
* * **150 MB** for service instances on the Premium plan
1188+
*
1189+
* You can specify the format of the file to be translated in one of two ways:
1190+
* * By specifying the appropriate file extension for the format.
1191+
* * By specifying the content type (MIME type) of the format as the `type` of the `file` parameter.
1192+
*
1193+
* In some cases, especially for subtitle file formats, you must use either the file extension or the content type.
1194+
*
1195+
*
1196+
* For more information about all supported file formats, their file extensions and content types, and how and when
1197+
* to specify the file extension or content type, see [Supported file
11621198
* formats](https://cloud.ibm.com/docs/language-translator?topic=language-translator-document-translator-tutorial#supported-file-formats).
11631199
*/
11641200
file: NodeJS.ReadableStream | Buffer;
@@ -1189,30 +1225,32 @@ namespace LanguageTranslatorV3 {
11891225
export namespace TranslateDocumentConstants {
11901226
/** The content type of file. */
11911227
export enum FileContentType {
1192-
APPLICATION_POWERPOINT = 'application/powerpoint',
11931228
APPLICATION_MSPOWERPOINT = 'application/mspowerpoint',
1194-
APPLICATION_X_RTF = 'application/x-rtf',
1195-
APPLICATION_JSON = 'application/json',
1196-
APPLICATION_XML = 'application/xml',
1229+
APPLICATION_MSWORD = 'application/msword',
1230+
APPLICATION_OCTET_STREAM = 'application/octet-stream',
1231+
APPLICATION_PDF = 'application/pdf',
1232+
APPLICATION_POWERPOINT = 'application/powerpoint',
1233+
APPLICATION_RTF = 'application/rtf',
1234+
APPLICATION_TTAF_XML = 'application/ttaf+xml',
1235+
APPLICATION_TTML_XML = 'application/ttml+xml',
1236+
APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION = 'application/vnd.oasis.opendocument.presentation',
1237+
APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET = 'application/vnd.oasis.opendocument.spreadsheet',
1238+
APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT = 'application/vnd.oasis.opendocument.text',
11971239
APPLICATION_VND_MS_EXCEL = 'application/vnd.ms-excel',
1198-
APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
11991240
APPLICATION_VND_MS_POWERPOINT = 'application/vnd.ms-powerpoint',
12001241
APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_PRESENTATIONML_PRESENTATION = 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
1201-
APPLICATION_MSWORD = 'application/msword',
1242+
APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_SPREADSHEETML_SHEET = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
12021243
APPLICATION_VND_OPENXMLFORMATS_OFFICEDOCUMENT_WORDPROCESSINGML_DOCUMENT = 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
1203-
APPLICATION_VND_OASIS_OPENDOCUMENT_SPREADSHEET = 'application/vnd.oasis.opendocument.spreadsheet',
1204-
APPLICATION_VND_OASIS_OPENDOCUMENT_PRESENTATION = 'application/vnd.oasis.opendocument.presentation',
1205-
APPLICATION_VND_OASIS_OPENDOCUMENT_TEXT = 'application/vnd.oasis.opendocument.text',
1206-
APPLICATION_PDF = 'application/pdf',
1207-
APPLICATION_RTF = 'application/rtf',
1244+
APPLICATION_X_RTF = 'application/x-rtf',
1245+
APPLICATION_XHTML_XML = 'application/xhtml+xml',
1246+
APPLICATION_XML = 'application/xml',
12081247
TEXT_HTML = 'text/html',
12091248
TEXT_JSON = 'text/json',
12101249
TEXT_PLAIN = 'text/plain',
12111250
TEXT_RICHTEXT = 'text/richtext',
12121251
TEXT_RTF = 'text/rtf',
12131252
TEXT_SBV = 'text/sbv',
12141253
TEXT_SRT = 'text/srt',
1215-
TEXT_VTT = 'text/vtt',
12161254
TEXT_XML = 'text/xml',
12171255
}
12181256
}

0 commit comments

Comments
 (0)