Constructor
new TranslationServiceClient(optionsopt, gaxInstanceopt)
Construct an instance of TranslationServiceClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. The options accepted by the constructor are described in detail in this document. The common options are: Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||
gaxInstance |
gax |
<optional> |
loaded instance of |
Members
apiEndpoint
The DNS address for this API service.
apiEndpoint
The DNS address for this API service - same as servicePath.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
Methods
adaptiveMtDatasetPath(project, location, dataset) → {string}
Return a fully-qualified adaptiveMtDataset resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
dataset |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
adaptiveMtFilePath(project, location, dataset, file) → {string}
Return a fully-qualified adaptiveMtFile resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
dataset |
string | |
file |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
adaptiveMtSentencePath(project, location, dataset, file, sentence) → {string}
Return a fully-qualified adaptiveMtSentence resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
dataset |
string | |
file |
string | |
sentence |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
cancelOperation(request, optionsopt, callbackopt) → {Promise}
Starts asynchronous cancellation on a long-running operation. The server
makes a best effort to cancel the operation, but success is not
guaranteed. If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
. Clients can use
Operations.GetOperation or
other methods to check whether the cancellation succeeded or whether the
operation completed despite cancellation. On successful cancellation,
the operation is not deleted; instead, it becomes an operation with
an Operation.error value with a google.rpc.Status.code of
1, corresponding to Code.CANCELLED
.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
```
const client = longrunning.operationsClient();
await client.cancelOperation({name: ''});
```
(async) checkBatchTranslateDocumentProgress(name) → {Promise}
Check the status of the long running operation returned by batchTranslateDocument()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Location to make a regional call.
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
* The `global` location is not supported for batch translation.
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*/
// const parent = 'abc123'
/**
* Required. The ISO-639 language code of the input document if known, for
* example, "en-US" or "sr-Latn". Supported language codes are listed in
* Language Support (https://cloud.google.com/translate/docs/languages).
*/
// const sourceLanguageCode = 'abc123'
/**
* Required. The ISO-639 language code to use for translation of the input
* document. Specify up to 10 language codes here.
*/
// const targetLanguageCodes = ['abc','def']
/**
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size to translate should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*/
// const inputConfigs = [1,2,3,4]
/**
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*/
// const outputConfig = {}
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is the model name. Value can be a built-in general model,
* or an AutoML Translation model.
* The value format depends on model type:
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
* If the map is empty or a specific model is
* not requested for a language pair, then default google model (nmt) is used.
*/
// const models = [1,2,3,4]
/**
* Optional. Glossaries to be applied. It's keyed by target language code.
*/
// const glossaries = [1,2,3,4]
/**
* Optional. The file format conversion map that is applied to all input
* files. The map key is the original mime_type. The map value is the target
* mime_type of translated documents.
* Supported file format conversion includes:
* - `application/pdf` to
* `application/vnd.openxmlformats-officedocument.wordprocessingml.document`
* If nothing specified, output files will be in the same format as the
* original file.
*/
// const formatConversions = [1,2,3,4]
/**
* Optional. This flag is to support user customized attribution.
* If not provided, the default is `Machine Translated by Google`.
* Customized attribution should follow rules in
* https://cloud.google.com/translate/attribution#attribution_and_logos
*/
// const customizedAttribution = 'abc123'
/**
* Optional. If true, use the text removal server to remove the shadow text on
* background image for native pdf translation.
* Shadow removal feature can only be enabled when
* is_translate_native_pdf_only: false && pdf_native_only: false
*/
// const enableShadowRemovalNativePdf = true
/**
* Optional. If true, enable auto rotation correction in DVS.
*/
// const enableRotationCorrection = true
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callBatchTranslateDocument() {
// Construct request
const request = {
parent,
sourceLanguageCode,
targetLanguageCodes,
inputConfigs,
outputConfig,
};
// Run request
const [operation] = await translationClient.batchTranslateDocument(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchTranslateDocument();
(async) checkBatchTranslateTextProgress(name) → {Promise}
Check the status of the long running operation returned by batchTranslateText()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Location to make a call. Must refer to a caller's project.
* Format: `projects/{project-number-or-id}/locations/{location-id}`.
* The `global` location is not supported for batch translation.
* Only AutoML Translation models or glossaries within the same region (have
* the same location-id) can be used, otherwise an INVALID_ARGUMENT (400)
* error is returned.
*/
// const parent = 'abc123'
/**
* Required. Source language code.
*/
// const sourceLanguageCode = 'abc123'
/**
* Required. Specify up to 10 language codes here.
*/
// const targetLanguageCodes = ['abc','def']
/**
* Optional. The models to use for translation. Map's key is target language
* code. Map's value is model name. Value can be a built-in general model,
* or an AutoML Translation model.
* The value format depends on model type:
* - AutoML Translation models:
* `projects/{project-number-or-id}/locations/{location-id}/models/{model-id}`
* - General (built-in) models:
* `projects/{project-number-or-id}/locations/{location-id}/models/general/nmt`,
* If the map is empty or a specific model is
* not requested for a language pair, then default google model (nmt) is used.
*/
// const models = [1,2,3,4]
/**
* Required. Input configurations.
* The total number of files matched should be <= 100.
* The total content size should be <= 100M Unicode codepoints.
* The files must use UTF-8 encoding.
*/
// const inputConfigs = [1,2,3,4]
/**
* Required. Output configuration.
* If 2 input configs match to the same file (that is, same input path),
* we don't generate output for duplicate inputs.
*/
// const outputConfig = {}
/**
* Optional. Glossaries to be applied for translation.
* It's keyed by target language code.
*/
// const glossaries = [1,2,3,4]
/**
* Optional. The labels with user-defined metadata for the request.
* Label keys and values can be no longer than 63 characters
* (Unicode codepoints), can only contain lowercase letters, numeric
* characters, underscores and dashes. International characters are allowed.
* Label values are optional. Label keys must start with a letter.
* See https://cloud.google.com/translate/docs/advanced/labels for more
* information.
*/
// const labels = [1,2,3,4]
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callBatchTranslateText() {
// Construct request
const request = {
parent,
sourceLanguageCode,
targetLanguageCodes,
inputConfigs,
outputConfig,
};
// Run request
const [operation] = await translationClient.batchTranslateText(request);
const [response] = await operation.promise();
console.log(response);
}
callBatchTranslateText();
(async) checkCreateDatasetProgress(name) → {Promise}
Check the status of the long running operation returned by createDataset()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project name.
*/
// const parent = 'abc123'
/**
* Required. The Dataset to create.
*/
// const dataset = {}
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callCreateDataset() {
// Construct request
const request = {
parent,
dataset,
};
// Run request
const [operation] = await translationClient.createDataset(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateDataset();
(async) checkCreateGlossaryProgress(name) → {Promise}
Check the status of the long running operation returned by createGlossary()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project name.
*/
// const parent = 'abc123'
/**
* Required. The glossary to create.
*/
// const glossary = {}
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callCreateGlossary() {
// Construct request
const request = {
parent,
glossary,
};
// Run request
const [operation] = await translationClient.createGlossary(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateGlossary();
(async) checkCreateModelProgress(name) → {Promise}
Check the status of the long running operation returned by createModel()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The project name, in form of
* `projects/{project}/locations/{location}`
*/
// const parent = 'abc123'
/**
* Required. The Model to create.
*/
// const model = {}
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callCreateModel() {
// Construct request
const request = {
parent,
model,
};
// Run request
const [operation] = await translationClient.createModel(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateModel();
(async) checkDeleteDatasetProgress(name) → {Promise}
Check the status of the long running operation returned by deleteDataset()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the dataset to delete.
*/
// const name = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callDeleteDataset() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await translationClient.deleteDataset(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteDataset();
(async) checkDeleteGlossaryProgress(name) → {Promise}
Check the status of the long running operation returned by deleteGlossary()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the glossary to delete.
*/
// const name = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callDeleteGlossary() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await translationClient.deleteGlossary(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteGlossary();
(async) checkDeleteModelProgress(name) → {Promise}
Check the status of the long running operation returned by deleteModel()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the model to delete.
*/
// const name = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callDeleteModel() {
// Construct request
const request = {
name,
};
// Run request
const [operation] = await translationClient.deleteModel(request);
const [response] = await operation.promise();
console.log(response);
}
callDeleteModel();
(async) checkExportDataProgress(name) → {Promise}
Check the status of the long running operation returned by exportData()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the dataset. In form of
* `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`
*/
// const dataset = 'abc123'
/**
* Required. The config for the output content.
*/
// const outputConfig = {}
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callExportData() {
// Construct request
const request = {
dataset,
outputConfig,
};
// Run request
const [operation] = await translationClient.exportData(request);
const [response] = await operation.promise();
console.log(response);
}
callExportData();
(async) checkImportDataProgress(name) → {Promise}
Check the status of the long running operation returned by importData()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the dataset. In form of
* `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`
*/
// const dataset = 'abc123'
/**
* Required. The config for the input content.
*/
// const inputConfig = {}
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callImportData() {
// Construct request
const request = {
dataset,
inputConfig,
};
// Run request
const [operation] = await translationClient.importData(request);
const [response] = await operation.promise();
console.log(response);
}
callImportData();
(async) checkUpdateGlossaryProgress(name) → {Promise}
Check the status of the long running operation returned by updateGlossary()
.
Parameters:
Name | Type | Description |
---|---|---|
name |
String |
The operation name that will be passed. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The glossary entry to update.
*/
// const glossary = {}
/**
* The list of fields to be updated. Currently only `display_name` and
* 'input_config'
*/
// const updateMask = {}
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callUpdateGlossary() {
// Construct request
const request = {
glossary,
};
// Run request
const [operation] = await translationClient.updateGlossary(request);
const [response] = await operation.promise();
console.log(response);
}
callUpdateGlossary();
close() → {Promise}
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves when the client is closed. |
datasetPath(project, location, dataset) → {string}
Return a fully-qualified dataset resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
dataset |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
deleteOperation(request, optionsopt, callbackopt) → {Promise}
Deletes a long-running operation. This method indicates that the client is
no longer interested in the operation result. It does not cancel the
operation. If the server doesn't support this method, it returns
google.rpc.Code.UNIMPLEMENTED
.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
```
const client = longrunning.operationsClient();
await client.deleteOperation({name: ''});
```
examplePath(project, location, dataset, example) → {string}
Return a fully-qualified example resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
dataset |
string | |
example |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
getIamPolicy(request, optionsopt, callbackopt) → {Promise}
Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing Policy. |
Returns:
Type | Description |
---|---|
Promise |
|
getLocation(request, optionsopt) → {Promise}
Gets information about a location.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Promise |
|
getOperation(request, optionsopt, callbackopt) → {Promise}
Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing google.longrunning.Operation. |
Returns:
Type | Description |
---|---|
Promise |
|
Example
```
const client = longrunning.operationsClient();
const name = '';
const [response] = await client.getOperation({name});
// doThingsWith(response)
```
getProjectId() → {Promise}
Return the project ID used by this class.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to string containing the project ID. |
glossaryEntryPath(project, location, glossary, glossary_entry) → {string}
Return a fully-qualified glossaryEntry resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
glossary |
string | |
glossary_entry |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
glossaryPath(project, location, glossary) → {string}
Return a fully-qualified glossary resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
glossary |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
initialize() → {Promise}
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to an authenticated service stub. |
listAdaptiveMtDatasetsAsync(request, optionsopt) → {Object}
Equivalent to listAdaptiveMtDatasets
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AdaptiveMtDataset. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the project from which to list the Adaptive
* MT datasets. `projects/{project-number-or-id}/locations/{location-id}`
*/
// const parent = 'abc123'
/**
* Optional. Requested page size. The server may return fewer results than
* requested. If unspecified, the server picks an appropriate default.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Typically, this is the value of
* ListAdaptiveMtDatasetsResponse.next_page_token returned from the
* previous call to `ListAdaptiveMtDatasets` method. The first page is
* returned if `page_token`is empty or missing.
*/
// const pageToken = 'abc123'
/**
* Optional. An expression for filtering the results of the request.
* Filter is not supported yet.
*/
// const filter = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListAdaptiveMtDatasets() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listAdaptiveMtDatasetsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAdaptiveMtDatasets();
listAdaptiveMtDatasetsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing AdaptiveMtDataset on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listAdaptiveMtFilesAsync(request, optionsopt) → {Object}
Equivalent to listAdaptiveMtFiles
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AdaptiveMtFile. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the project from which to list the Adaptive
* MT files.
* `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
*/
// const parent = 'abc123'
/**
* Optional.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Typically, this is the value of
* ListAdaptiveMtFilesResponse.next_page_token returned from the
* previous call to `ListAdaptiveMtFiles` method. The first page is
* returned if `page_token`is empty or missing.
*/
// const pageToken = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListAdaptiveMtFiles() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listAdaptiveMtFilesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAdaptiveMtFiles();
listAdaptiveMtFilesStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing AdaptiveMtFile on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listAdaptiveMtSentencesAsync(request, optionsopt) → {Object}
Equivalent to listAdaptiveMtSentences
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing AdaptiveMtSentence. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the project from which to list the Adaptive
* MT files. The following format lists all sentences under a file.
* `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}`
* The following format lists all sentences within a dataset.
* `projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}`
*/
// const parent = 'abc123'
/**
*/
// const pageSize = 1234
/**
* A token identifying a page of results the server should return.
* Typically, this is the value of
* ListAdaptiveMtSentencesRequest.next_page_token returned from the
* previous call to `ListTranslationMemories` method. The first page is
* returned if `page_token` is empty or missing.
*/
// const pageToken = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListAdaptiveMtSentences() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listAdaptiveMtSentencesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAdaptiveMtSentences();
listAdaptiveMtSentencesStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing AdaptiveMtSentence on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listDatasetsAsync(request, optionsopt) → {Object}
Equivalent to listDatasets
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Dataset. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the parent project. In form of
* `projects/{project-number-or-id}/locations/{location-id}`
*/
// const parent = 'abc123'
/**
* Optional. Requested page size. The server can return fewer results than
* requested.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results for the server to return.
* Typically obtained from next_page_token field in the response of a
* ListDatasets call.
*/
// const pageToken = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListDatasets() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listDatasetsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListDatasets();
listDatasetsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing Dataset on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listExamplesAsync(request, optionsopt) → {Object}
Equivalent to listExamples
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Example. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the parent dataset. In form of
* `projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}`
*/
// const parent = 'abc123'
/**
* Optional. An expression for filtering the examples that will be returned.
* Example filter:
* * `usage=TRAIN`
*/
// const filter = 'abc123'
/**
* Optional. Requested page size. The server can return fewer results than
* requested.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results for the server to return.
* Typically obtained from next_page_token field in the response of a
* ListExamples call.
*/
// const pageToken = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListExamples() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listExamplesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListExamples();
listExamplesStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing Example on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listGlossariesAsync(request, optionsopt) → {Object}
Equivalent to listGlossaries
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Glossary. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The name of the project from which to list all of the glossaries.
*/
// const parent = 'abc123'
/**
* Optional. Requested page size. The server may return fewer glossaries than
* requested. If unspecified, the server picks an appropriate default.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Typically, this is the value of ListGlossariesResponse.next_page_token
* returned from the previous call to `ListGlossaries` method.
* The first page is returned if `page_token`is empty or missing.
*/
// const pageToken = 'abc123'
/**
* Optional. Filter specifying constraints of a list operation.
* Specify the constraint by the format of "key=value", where key must be
* "src" or "tgt", and the value must be a valid language code.
* For multiple restrictions, concatenate them by "AND" (uppercase only),
* such as: "src=en-US AND tgt=zh-CN". Notice that the exact match is used
* here, which means using 'en-US' and 'en' can lead to different results,
* which depends on the language code you used when you create the glossary.
* For the unidirectional glossaries, the "src" and "tgt" add restrictions
* on the source and target language code separately.
* For the equivalent term set glossaries, the "src" and/or "tgt" add
* restrictions on the term set.
* For example: "src=en-US AND tgt=zh-CN" will only pick the unidirectional
* glossaries which exactly match the source language code as "en-US" and the
* target language code "zh-CN", but all equivalent term set glossaries which
* contain "en-US" and "zh-CN" in their language set will be picked.
* If missing, no filtering is performed.
*/
// const filter = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListGlossaries() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listGlossariesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListGlossaries();
listGlossariesStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing Glossary on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listGlossaryEntriesAsync(request, optionsopt) → {Object}
Equivalent to listGlossaryEntries
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing GlossaryEntry. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent glossary resource name for listing the glossary's
* entries.
*/
// const parent = 'abc123'
/**
* Optional. Requested page size. The server may return fewer glossary entries
* than requested. If unspecified, the server picks an appropriate default.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results the server should return.
* Typically, this is the value of
* ListGlossaryEntriesResponse.next_page_token returned from the previous
* call. The first page is returned if `page_token`is empty or missing.
*/
// const pageToken = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListGlossaryEntries() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listGlossaryEntriesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListGlossaryEntries();
listGlossaryEntriesStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing GlossaryEntry on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listLocationsAsync(request, optionsopt) → {Object}
Lists information about the supported locations for this service. Returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Location. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
```
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
```
listModelsAsync(request, optionsopt) → {Object}
Equivalent to listModels
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. When you iterate the returned iterable, each element will be an object representing Model. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the documentation for more details and examples. |
Example
/**
* This snippet has been automatically generated and should be regarded as a code template only.
* It will require modifications to work.
* It may require correct/in-range values for request initialization.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the parent project. In form of
* `projects/{project-number-or-id}/locations/{location-id}`
*/
// const parent = 'abc123'
/**
* Optional. An expression for filtering the models that will be returned.
* Supported filter:
* `dataset_id=${dataset_id}`
*/
// const filter = 'abc123'
/**
* Optional. Requested page size. The server can return fewer results than
* requested.
*/
// const pageSize = 1234
/**
* Optional. A token identifying a page of results for the server to return.
* Typically obtained from next_page_token field in the response of a
* ListModels call.
*/
// const pageToken = 'abc123'
// Imports the Translation library
const {TranslationServiceClient} = require('@google-cloud/translate').v3;
// Instantiates a client
const translationClient = new TranslationServiceClient();
async function callListModels() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = translationClient.listModelsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListModels();
listModelsStream(request, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Stream |
An object stream which emits an object representing Model on 'data' event.
The client library will perform auto-pagination by default: it will call the API as many
times as needed. Note that it can affect your quota.
We recommend using |
listOperationsAsync(request, optionsopt) → {Object}
Lists operations that match the specified filter in the request. If the
server doesn't support this method, it returns UNIMPLEMENTED
. Returns an iterable object.
For-await-of syntax is used with the iterable to recursively get response element on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that conforms to iteration protocols. |
Example
```
const client = longrunning.operationsClient();
for await (const response of client.listOperationsAsync(request));
// doThingsWith(response)
```
locationPath(project, location) → {string}
Return a fully-qualified location resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
matchDatasetFromAdaptiveMtDatasetName(adaptiveMtDatasetName) → {string}
Parse the dataset from AdaptiveMtDataset resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtDatasetName |
string |
A fully-qualified path representing AdaptiveMtDataset resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the dataset. |
matchDatasetFromAdaptiveMtFileName(adaptiveMtFileName) → {string}
Parse the dataset from AdaptiveMtFile resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtFileName |
string |
A fully-qualified path representing AdaptiveMtFile resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the dataset. |
matchDatasetFromAdaptiveMtSentenceName(adaptiveMtSentenceName) → {string}
Parse the dataset from AdaptiveMtSentence resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtSentenceName |
string |
A fully-qualified path representing AdaptiveMtSentence resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the dataset. |
matchDatasetFromDatasetName(datasetName) → {string}
Parse the dataset from Dataset resource.
Parameters:
Name | Type | Description |
---|---|---|
datasetName |
string |
A fully-qualified path representing Dataset resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the dataset. |
matchDatasetFromExampleName(exampleName) → {string}
Parse the dataset from Example resource.
Parameters:
Name | Type | Description |
---|---|---|
exampleName |
string |
A fully-qualified path representing Example resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the dataset. |
matchExampleFromExampleName(exampleName) → {string}
Parse the example from Example resource.
Parameters:
Name | Type | Description |
---|---|---|
exampleName |
string |
A fully-qualified path representing Example resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the example. |
matchFileFromAdaptiveMtFileName(adaptiveMtFileName) → {string}
Parse the file from AdaptiveMtFile resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtFileName |
string |
A fully-qualified path representing AdaptiveMtFile resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the file. |
matchFileFromAdaptiveMtSentenceName(adaptiveMtSentenceName) → {string}
Parse the file from AdaptiveMtSentence resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtSentenceName |
string |
A fully-qualified path representing AdaptiveMtSentence resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the file. |
matchGlossaryEntryFromGlossaryEntryName(glossaryEntryName) → {string}
Parse the glossary_entry from GlossaryEntry resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryEntryName |
string |
A fully-qualified path representing GlossaryEntry resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the glossary_entry. |
matchGlossaryFromGlossaryEntryName(glossaryEntryName) → {string}
Parse the glossary from GlossaryEntry resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryEntryName |
string |
A fully-qualified path representing GlossaryEntry resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the glossary. |
matchGlossaryFromGlossaryName(glossaryName) → {string}
Parse the glossary from Glossary resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryName |
string |
A fully-qualified path representing Glossary resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the glossary. |
matchLocationFromAdaptiveMtDatasetName(adaptiveMtDatasetName) → {string}
Parse the location from AdaptiveMtDataset resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtDatasetName |
string |
A fully-qualified path representing AdaptiveMtDataset resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromAdaptiveMtFileName(adaptiveMtFileName) → {string}
Parse the location from AdaptiveMtFile resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtFileName |
string |
A fully-qualified path representing AdaptiveMtFile resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromAdaptiveMtSentenceName(adaptiveMtSentenceName) → {string}
Parse the location from AdaptiveMtSentence resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtSentenceName |
string |
A fully-qualified path representing AdaptiveMtSentence resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromDatasetName(datasetName) → {string}
Parse the location from Dataset resource.
Parameters:
Name | Type | Description |
---|---|---|
datasetName |
string |
A fully-qualified path representing Dataset resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromExampleName(exampleName) → {string}
Parse the location from Example resource.
Parameters:
Name | Type | Description |
---|---|---|
exampleName |
string |
A fully-qualified path representing Example resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromGlossaryEntryName(glossaryEntryName) → {string}
Parse the location from GlossaryEntry resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryEntryName |
string |
A fully-qualified path representing GlossaryEntry resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromGlossaryName(glossaryName) → {string}
Parse the location from Glossary resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryName |
string |
A fully-qualified path representing Glossary resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromLocationName(locationName) → {string}
Parse the location from Location resource.
Parameters:
Name | Type | Description |
---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromModelName(modelName) → {string}
Parse the location from Model resource.
Parameters:
Name | Type | Description |
---|---|---|
modelName |
string |
A fully-qualified path representing Model resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchModelFromModelName(modelName) → {string}
Parse the model from Model resource.
Parameters:
Name | Type | Description |
---|---|---|
modelName |
string |
A fully-qualified path representing Model resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the model. |
matchProjectFromAdaptiveMtDatasetName(adaptiveMtDatasetName) → {string}
Parse the project from AdaptiveMtDataset resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtDatasetName |
string |
A fully-qualified path representing AdaptiveMtDataset resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromAdaptiveMtFileName(adaptiveMtFileName) → {string}
Parse the project from AdaptiveMtFile resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtFileName |
string |
A fully-qualified path representing AdaptiveMtFile resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromAdaptiveMtSentenceName(adaptiveMtSentenceName) → {string}
Parse the project from AdaptiveMtSentence resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtSentenceName |
string |
A fully-qualified path representing AdaptiveMtSentence resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromDatasetName(datasetName) → {string}
Parse the project from Dataset resource.
Parameters:
Name | Type | Description |
---|---|---|
datasetName |
string |
A fully-qualified path representing Dataset resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromExampleName(exampleName) → {string}
Parse the project from Example resource.
Parameters:
Name | Type | Description |
---|---|---|
exampleName |
string |
A fully-qualified path representing Example resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromGlossaryEntryName(glossaryEntryName) → {string}
Parse the project from GlossaryEntry resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryEntryName |
string |
A fully-qualified path representing GlossaryEntry resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromGlossaryName(glossaryName) → {string}
Parse the project from Glossary resource.
Parameters:
Name | Type | Description |
---|---|---|
glossaryName |
string |
A fully-qualified path representing Glossary resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromLocationName(locationName) → {string}
Parse the project from Location resource.
Parameters:
Name | Type | Description |
---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromModelName(modelName) → {string}
Parse the project from Model resource.
Parameters:
Name | Type | Description |
---|---|---|
modelName |
string |
A fully-qualified path representing Model resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchSentenceFromAdaptiveMtSentenceName(adaptiveMtSentenceName) → {string}
Parse the sentence from AdaptiveMtSentence resource.
Parameters:
Name | Type | Description |
---|---|---|
adaptiveMtSentenceName |
string |
A fully-qualified path representing AdaptiveMtSentence resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the sentence. |
modelPath(project, location, model) → {string}
Return a fully-qualified model resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
model |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
setIamPolicy(request, optionsopt, callbackopt) → {Promise}
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing TestIamPermissionsResponse. |
Returns:
Type | Description |
---|---|
Promise |
|
testIamPermissions(request, optionsopt, callbackopt) → {Promise}
Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.
Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning.
Parameters:
Name | Type | Attributes | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||
options |
Object |
<optional> |
Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details. |
|||||||||
callback |
function |
<optional> |
The function which will be called with the result of the API call. The second parameter to the callback is an object representing TestIamPermissionsResponse. |
Returns:
Type | Description |
---|---|
Promise |
|