@googleapis/translate 4.0.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/v2.d.ts +280 -1
- package/build/v2.js +8 -1
- package/build/v2.js.map +1 -1
- package/build/v3.d.ts +2923 -1
- package/build/v3.js +26 -1
- package/build/v3.js.map +1 -1
- package/build/v3beta1.d.ts +1173 -1
- package/build/v3beta1.js +10 -1
- package/build/v3beta1.js.map +1 -1
- package/package.json +4 -4
- package/v2.ts +280 -0
- package/v3.ts +2923 -0
- package/v3beta1.ts +1173 -0
package/build/v3.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
2
|
import { Readable } from 'stream';
|
|
4
3
|
export declare namespace translate_v3 {
|
|
@@ -1303,6 +1302,66 @@ export declare namespace translate_v3 {
|
|
|
1303
1302
|
constructor(context: APIRequestContext);
|
|
1304
1303
|
/**
|
|
1305
1304
|
* Detects the language of text within a request.
|
|
1305
|
+
* @example
|
|
1306
|
+
* ```js
|
|
1307
|
+
* // Before running the sample:
|
|
1308
|
+
* // - Enable the API at:
|
|
1309
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1310
|
+
* // - Login into gcloud by running:
|
|
1311
|
+
* // ```sh
|
|
1312
|
+
* // $ gcloud auth application-default login
|
|
1313
|
+
* // ```
|
|
1314
|
+
* // - Install the npm module by running:
|
|
1315
|
+
* // ```sh
|
|
1316
|
+
* // $ npm install googleapis
|
|
1317
|
+
* // ```
|
|
1318
|
+
*
|
|
1319
|
+
* const {google} = require('googleapis');
|
|
1320
|
+
* const translate = google.translate('v3');
|
|
1321
|
+
*
|
|
1322
|
+
* async function main() {
|
|
1323
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1324
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1325
|
+
* scopes: [
|
|
1326
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1327
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1328
|
+
* ],
|
|
1329
|
+
* });
|
|
1330
|
+
*
|
|
1331
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1332
|
+
* const authClient = await auth.getClient();
|
|
1333
|
+
* google.options({auth: authClient});
|
|
1334
|
+
*
|
|
1335
|
+
* // Do the magic
|
|
1336
|
+
* const res = await translate.projects.detectLanguage({
|
|
1337
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}/locations/{location-id\}` or `projects/{project-number-or-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
1338
|
+
* parent: 'projects/my-project',
|
|
1339
|
+
*
|
|
1340
|
+
* // Request body metadata
|
|
1341
|
+
* requestBody: {
|
|
1342
|
+
* // request body parameters
|
|
1343
|
+
* // {
|
|
1344
|
+
* // "content": "my_content",
|
|
1345
|
+
* // "labels": {},
|
|
1346
|
+
* // "mimeType": "my_mimeType",
|
|
1347
|
+
* // "model": "my_model"
|
|
1348
|
+
* // }
|
|
1349
|
+
* },
|
|
1350
|
+
* });
|
|
1351
|
+
* console.log(res.data);
|
|
1352
|
+
*
|
|
1353
|
+
* // Example response
|
|
1354
|
+
* // {
|
|
1355
|
+
* // "languages": []
|
|
1356
|
+
* // }
|
|
1357
|
+
* }
|
|
1358
|
+
*
|
|
1359
|
+
* main().catch(e => {
|
|
1360
|
+
* console.error(e);
|
|
1361
|
+
* throw e;
|
|
1362
|
+
* });
|
|
1363
|
+
*
|
|
1364
|
+
* ```
|
|
1306
1365
|
*
|
|
1307
1366
|
* @param params - Parameters for request
|
|
1308
1367
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1317,6 +1376,59 @@ export declare namespace translate_v3 {
|
|
|
1317
1376
|
detectLanguage(callback: BodyResponseCallback<Schema$DetectLanguageResponse>): void;
|
|
1318
1377
|
/**
|
|
1319
1378
|
* Returns a list of supported languages for translation.
|
|
1379
|
+
* @example
|
|
1380
|
+
* ```js
|
|
1381
|
+
* // Before running the sample:
|
|
1382
|
+
* // - Enable the API at:
|
|
1383
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1384
|
+
* // - Login into gcloud by running:
|
|
1385
|
+
* // ```sh
|
|
1386
|
+
* // $ gcloud auth application-default login
|
|
1387
|
+
* // ```
|
|
1388
|
+
* // - Install the npm module by running:
|
|
1389
|
+
* // ```sh
|
|
1390
|
+
* // $ npm install googleapis
|
|
1391
|
+
* // ```
|
|
1392
|
+
*
|
|
1393
|
+
* const {google} = require('googleapis');
|
|
1394
|
+
* const translate = google.translate('v3');
|
|
1395
|
+
*
|
|
1396
|
+
* async function main() {
|
|
1397
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1398
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1399
|
+
* scopes: [
|
|
1400
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1401
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1402
|
+
* ],
|
|
1403
|
+
* });
|
|
1404
|
+
*
|
|
1405
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1406
|
+
* const authClient = await auth.getClient();
|
|
1407
|
+
* google.options({auth: authClient});
|
|
1408
|
+
*
|
|
1409
|
+
* // Do the magic
|
|
1410
|
+
* const res = await translate.projects.getSupportedLanguages({
|
|
1411
|
+
* // Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.
|
|
1412
|
+
* displayLanguageCode: 'placeholder-value',
|
|
1413
|
+
* // Optional. Get supported languages of this model. The 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`, Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.
|
|
1414
|
+
* model: 'placeholder-value',
|
|
1415
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}` or `projects/{project-number-or-id\}/locations/{location-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
1416
|
+
* parent: 'projects/my-project',
|
|
1417
|
+
* });
|
|
1418
|
+
* console.log(res.data);
|
|
1419
|
+
*
|
|
1420
|
+
* // Example response
|
|
1421
|
+
* // {
|
|
1422
|
+
* // "languages": []
|
|
1423
|
+
* // }
|
|
1424
|
+
* }
|
|
1425
|
+
*
|
|
1426
|
+
* main().catch(e => {
|
|
1427
|
+
* console.error(e);
|
|
1428
|
+
* throw e;
|
|
1429
|
+
* });
|
|
1430
|
+
*
|
|
1431
|
+
* ```
|
|
1320
1432
|
*
|
|
1321
1433
|
* @param params - Parameters for request
|
|
1322
1434
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1331,6 +1443,64 @@ export declare namespace translate_v3 {
|
|
|
1331
1443
|
getSupportedLanguages(callback: BodyResponseCallback<Schema$SupportedLanguages>): void;
|
|
1332
1444
|
/**
|
|
1333
1445
|
* Romanize input text written in non-Latin scripts to Latin text.
|
|
1446
|
+
* @example
|
|
1447
|
+
* ```js
|
|
1448
|
+
* // Before running the sample:
|
|
1449
|
+
* // - Enable the API at:
|
|
1450
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1451
|
+
* // - Login into gcloud by running:
|
|
1452
|
+
* // ```sh
|
|
1453
|
+
* // $ gcloud auth application-default login
|
|
1454
|
+
* // ```
|
|
1455
|
+
* // - Install the npm module by running:
|
|
1456
|
+
* // ```sh
|
|
1457
|
+
* // $ npm install googleapis
|
|
1458
|
+
* // ```
|
|
1459
|
+
*
|
|
1460
|
+
* const {google} = require('googleapis');
|
|
1461
|
+
* const translate = google.translate('v3');
|
|
1462
|
+
*
|
|
1463
|
+
* async function main() {
|
|
1464
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1465
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1466
|
+
* scopes: [
|
|
1467
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1468
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1469
|
+
* ],
|
|
1470
|
+
* });
|
|
1471
|
+
*
|
|
1472
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1473
|
+
* const authClient = await auth.getClient();
|
|
1474
|
+
* google.options({auth: authClient});
|
|
1475
|
+
*
|
|
1476
|
+
* // Do the magic
|
|
1477
|
+
* const res = await translate.projects.romanizeText({
|
|
1478
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}/locations/{location-id\}` or `projects/{project-number-or-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`.
|
|
1479
|
+
* parent: 'projects/my-project',
|
|
1480
|
+
*
|
|
1481
|
+
* // Request body metadata
|
|
1482
|
+
* requestBody: {
|
|
1483
|
+
* // request body parameters
|
|
1484
|
+
* // {
|
|
1485
|
+
* // "contents": [],
|
|
1486
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode"
|
|
1487
|
+
* // }
|
|
1488
|
+
* },
|
|
1489
|
+
* });
|
|
1490
|
+
* console.log(res.data);
|
|
1491
|
+
*
|
|
1492
|
+
* // Example response
|
|
1493
|
+
* // {
|
|
1494
|
+
* // "romanizations": []
|
|
1495
|
+
* // }
|
|
1496
|
+
* }
|
|
1497
|
+
*
|
|
1498
|
+
* main().catch(e => {
|
|
1499
|
+
* console.error(e);
|
|
1500
|
+
* throw e;
|
|
1501
|
+
* });
|
|
1502
|
+
*
|
|
1503
|
+
* ```
|
|
1334
1504
|
*
|
|
1335
1505
|
* @param params - Parameters for request
|
|
1336
1506
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1345,6 +1515,71 @@ export declare namespace translate_v3 {
|
|
|
1345
1515
|
romanizeText(callback: BodyResponseCallback<Schema$RomanizeTextResponse>): void;
|
|
1346
1516
|
/**
|
|
1347
1517
|
* Translates input text and returns translated text.
|
|
1518
|
+
* @example
|
|
1519
|
+
* ```js
|
|
1520
|
+
* // Before running the sample:
|
|
1521
|
+
* // - Enable the API at:
|
|
1522
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1523
|
+
* // - Login into gcloud by running:
|
|
1524
|
+
* // ```sh
|
|
1525
|
+
* // $ gcloud auth application-default login
|
|
1526
|
+
* // ```
|
|
1527
|
+
* // - Install the npm module by running:
|
|
1528
|
+
* // ```sh
|
|
1529
|
+
* // $ npm install googleapis
|
|
1530
|
+
* // ```
|
|
1531
|
+
*
|
|
1532
|
+
* const {google} = require('googleapis');
|
|
1533
|
+
* const translate = google.translate('v3');
|
|
1534
|
+
*
|
|
1535
|
+
* async function main() {
|
|
1536
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1537
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1538
|
+
* scopes: [
|
|
1539
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1540
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1541
|
+
* ],
|
|
1542
|
+
* });
|
|
1543
|
+
*
|
|
1544
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1545
|
+
* const authClient = await auth.getClient();
|
|
1546
|
+
* google.options({auth: authClient});
|
|
1547
|
+
*
|
|
1548
|
+
* // Do the magic
|
|
1549
|
+
* const res = await translate.projects.translateText({
|
|
1550
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}` or `projects/{project-number-or-id\}/locations/{location-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
1551
|
+
* parent: 'projects/my-project',
|
|
1552
|
+
*
|
|
1553
|
+
* // Request body metadata
|
|
1554
|
+
* requestBody: {
|
|
1555
|
+
* // request body parameters
|
|
1556
|
+
* // {
|
|
1557
|
+
* // "contents": [],
|
|
1558
|
+
* // "glossaryConfig": {},
|
|
1559
|
+
* // "labels": {},
|
|
1560
|
+
* // "mimeType": "my_mimeType",
|
|
1561
|
+
* // "model": "my_model",
|
|
1562
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
1563
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
1564
|
+
* // "transliterationConfig": {}
|
|
1565
|
+
* // }
|
|
1566
|
+
* },
|
|
1567
|
+
* });
|
|
1568
|
+
* console.log(res.data);
|
|
1569
|
+
*
|
|
1570
|
+
* // Example response
|
|
1571
|
+
* // {
|
|
1572
|
+
* // "glossaryTranslations": [],
|
|
1573
|
+
* // "translations": []
|
|
1574
|
+
* // }
|
|
1575
|
+
* }
|
|
1576
|
+
*
|
|
1577
|
+
* main().catch(e => {
|
|
1578
|
+
* console.error(e);
|
|
1579
|
+
* throw e;
|
|
1580
|
+
* });
|
|
1581
|
+
*
|
|
1582
|
+
* ```
|
|
1348
1583
|
*
|
|
1349
1584
|
* @param params - Parameters for request
|
|
1350
1585
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1412,6 +1647,68 @@ export declare namespace translate_v3 {
|
|
|
1412
1647
|
constructor(context: APIRequestContext);
|
|
1413
1648
|
/**
|
|
1414
1649
|
* Translate text using Adaptive MT.
|
|
1650
|
+
* @example
|
|
1651
|
+
* ```js
|
|
1652
|
+
* // Before running the sample:
|
|
1653
|
+
* // - Enable the API at:
|
|
1654
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1655
|
+
* // - Login into gcloud by running:
|
|
1656
|
+
* // ```sh
|
|
1657
|
+
* // $ gcloud auth application-default login
|
|
1658
|
+
* // ```
|
|
1659
|
+
* // - Install the npm module by running:
|
|
1660
|
+
* // ```sh
|
|
1661
|
+
* // $ npm install googleapis
|
|
1662
|
+
* // ```
|
|
1663
|
+
*
|
|
1664
|
+
* const {google} = require('googleapis');
|
|
1665
|
+
* const translate = google.translate('v3');
|
|
1666
|
+
*
|
|
1667
|
+
* async function main() {
|
|
1668
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1669
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1670
|
+
* scopes: [
|
|
1671
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1672
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1673
|
+
* ],
|
|
1674
|
+
* });
|
|
1675
|
+
*
|
|
1676
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1677
|
+
* const authClient = await auth.getClient();
|
|
1678
|
+
* google.options({auth: authClient});
|
|
1679
|
+
*
|
|
1680
|
+
* // Do the magic
|
|
1681
|
+
* const res = await translate.projects.locations.adaptiveMtTranslate({
|
|
1682
|
+
* // Required. Location to make a regional call. Format: `projects/{project-number-or-id\}/locations/{location-id\}`.
|
|
1683
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1684
|
+
*
|
|
1685
|
+
* // Request body metadata
|
|
1686
|
+
* requestBody: {
|
|
1687
|
+
* // request body parameters
|
|
1688
|
+
* // {
|
|
1689
|
+
* // "content": [],
|
|
1690
|
+
* // "dataset": "my_dataset",
|
|
1691
|
+
* // "glossaryConfig": {},
|
|
1692
|
+
* // "referenceSentenceConfig": {}
|
|
1693
|
+
* // }
|
|
1694
|
+
* },
|
|
1695
|
+
* });
|
|
1696
|
+
* console.log(res.data);
|
|
1697
|
+
*
|
|
1698
|
+
* // Example response
|
|
1699
|
+
* // {
|
|
1700
|
+
* // "glossaryTranslations": [],
|
|
1701
|
+
* // "languageCode": "my_languageCode",
|
|
1702
|
+
* // "translations": []
|
|
1703
|
+
* // }
|
|
1704
|
+
* }
|
|
1705
|
+
*
|
|
1706
|
+
* main().catch(e => {
|
|
1707
|
+
* console.error(e);
|
|
1708
|
+
* throw e;
|
|
1709
|
+
* });
|
|
1710
|
+
*
|
|
1711
|
+
* ```
|
|
1415
1712
|
*
|
|
1416
1713
|
* @param params - Parameters for request
|
|
1417
1714
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1426,6 +1723,76 @@ export declare namespace translate_v3 {
|
|
|
1426
1723
|
adaptiveMtTranslate(callback: BodyResponseCallback<Schema$AdaptiveMtTranslateResponse>): void;
|
|
1427
1724
|
/**
|
|
1428
1725
|
* Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
|
|
1726
|
+
* @example
|
|
1727
|
+
* ```js
|
|
1728
|
+
* // Before running the sample:
|
|
1729
|
+
* // - Enable the API at:
|
|
1730
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1731
|
+
* // - Login into gcloud by running:
|
|
1732
|
+
* // ```sh
|
|
1733
|
+
* // $ gcloud auth application-default login
|
|
1734
|
+
* // ```
|
|
1735
|
+
* // - Install the npm module by running:
|
|
1736
|
+
* // ```sh
|
|
1737
|
+
* // $ npm install googleapis
|
|
1738
|
+
* // ```
|
|
1739
|
+
*
|
|
1740
|
+
* const {google} = require('googleapis');
|
|
1741
|
+
* const translate = google.translate('v3');
|
|
1742
|
+
*
|
|
1743
|
+
* async function main() {
|
|
1744
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1745
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1746
|
+
* scopes: [
|
|
1747
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1748
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1749
|
+
* ],
|
|
1750
|
+
* });
|
|
1751
|
+
*
|
|
1752
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1753
|
+
* const authClient = await auth.getClient();
|
|
1754
|
+
* google.options({auth: authClient});
|
|
1755
|
+
*
|
|
1756
|
+
* // Do the magic
|
|
1757
|
+
* const res = await translate.projects.locations.batchTranslateDocument({
|
|
1758
|
+
* // 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.
|
|
1759
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1760
|
+
*
|
|
1761
|
+
* // Request body metadata
|
|
1762
|
+
* requestBody: {
|
|
1763
|
+
* // request body parameters
|
|
1764
|
+
* // {
|
|
1765
|
+
* // "customizedAttribution": "my_customizedAttribution",
|
|
1766
|
+
* // "enableRotationCorrection": false,
|
|
1767
|
+
* // "enableShadowRemovalNativePdf": false,
|
|
1768
|
+
* // "formatConversions": {},
|
|
1769
|
+
* // "glossaries": {},
|
|
1770
|
+
* // "inputConfigs": [],
|
|
1771
|
+
* // "models": {},
|
|
1772
|
+
* // "outputConfig": {},
|
|
1773
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
1774
|
+
* // "targetLanguageCodes": []
|
|
1775
|
+
* // }
|
|
1776
|
+
* },
|
|
1777
|
+
* });
|
|
1778
|
+
* console.log(res.data);
|
|
1779
|
+
*
|
|
1780
|
+
* // Example response
|
|
1781
|
+
* // {
|
|
1782
|
+
* // "done": false,
|
|
1783
|
+
* // "error": {},
|
|
1784
|
+
* // "metadata": {},
|
|
1785
|
+
* // "name": "my_name",
|
|
1786
|
+
* // "response": {}
|
|
1787
|
+
* // }
|
|
1788
|
+
* }
|
|
1789
|
+
*
|
|
1790
|
+
* main().catch(e => {
|
|
1791
|
+
* console.error(e);
|
|
1792
|
+
* throw e;
|
|
1793
|
+
* });
|
|
1794
|
+
*
|
|
1795
|
+
* ```
|
|
1429
1796
|
*
|
|
1430
1797
|
* @param params - Parameters for request
|
|
1431
1798
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1440,6 +1807,73 @@ export declare namespace translate_v3 {
|
|
|
1440
1807
|
batchTranslateDocument(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1441
1808
|
/**
|
|
1442
1809
|
* Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location. This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
|
|
1810
|
+
* @example
|
|
1811
|
+
* ```js
|
|
1812
|
+
* // Before running the sample:
|
|
1813
|
+
* // - Enable the API at:
|
|
1814
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1815
|
+
* // - Login into gcloud by running:
|
|
1816
|
+
* // ```sh
|
|
1817
|
+
* // $ gcloud auth application-default login
|
|
1818
|
+
* // ```
|
|
1819
|
+
* // - Install the npm module by running:
|
|
1820
|
+
* // ```sh
|
|
1821
|
+
* // $ npm install googleapis
|
|
1822
|
+
* // ```
|
|
1823
|
+
*
|
|
1824
|
+
* const {google} = require('googleapis');
|
|
1825
|
+
* const translate = google.translate('v3');
|
|
1826
|
+
*
|
|
1827
|
+
* async function main() {
|
|
1828
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1829
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1830
|
+
* scopes: [
|
|
1831
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1832
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1833
|
+
* ],
|
|
1834
|
+
* });
|
|
1835
|
+
*
|
|
1836
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1837
|
+
* const authClient = await auth.getClient();
|
|
1838
|
+
* google.options({auth: authClient});
|
|
1839
|
+
*
|
|
1840
|
+
* // Do the magic
|
|
1841
|
+
* const res = await translate.projects.locations.batchTranslateText({
|
|
1842
|
+
* // 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.
|
|
1843
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1844
|
+
*
|
|
1845
|
+
* // Request body metadata
|
|
1846
|
+
* requestBody: {
|
|
1847
|
+
* // request body parameters
|
|
1848
|
+
* // {
|
|
1849
|
+
* // "glossaries": {},
|
|
1850
|
+
* // "inputConfigs": [],
|
|
1851
|
+
* // "labels": {},
|
|
1852
|
+
* // "models": {},
|
|
1853
|
+
* // "outputConfig": {},
|
|
1854
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
1855
|
+
* // "targetLanguageCodes": []
|
|
1856
|
+
* // }
|
|
1857
|
+
* },
|
|
1858
|
+
* });
|
|
1859
|
+
* console.log(res.data);
|
|
1860
|
+
*
|
|
1861
|
+
* // Example response
|
|
1862
|
+
* // {
|
|
1863
|
+
* // "done": false,
|
|
1864
|
+
* // "error": {},
|
|
1865
|
+
* // "metadata": {},
|
|
1866
|
+
* // "name": "my_name",
|
|
1867
|
+
* // "response": {}
|
|
1868
|
+
* // }
|
|
1869
|
+
* }
|
|
1870
|
+
*
|
|
1871
|
+
* main().catch(e => {
|
|
1872
|
+
* console.error(e);
|
|
1873
|
+
* throw e;
|
|
1874
|
+
* });
|
|
1875
|
+
*
|
|
1876
|
+
* ```
|
|
1443
1877
|
*
|
|
1444
1878
|
* @param params - Parameters for request
|
|
1445
1879
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1454,6 +1888,66 @@ export declare namespace translate_v3 {
|
|
|
1454
1888
|
batchTranslateText(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1455
1889
|
/**
|
|
1456
1890
|
* Detects the language of text within a request.
|
|
1891
|
+
* @example
|
|
1892
|
+
* ```js
|
|
1893
|
+
* // Before running the sample:
|
|
1894
|
+
* // - Enable the API at:
|
|
1895
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1896
|
+
* // - Login into gcloud by running:
|
|
1897
|
+
* // ```sh
|
|
1898
|
+
* // $ gcloud auth application-default login
|
|
1899
|
+
* // ```
|
|
1900
|
+
* // - Install the npm module by running:
|
|
1901
|
+
* // ```sh
|
|
1902
|
+
* // $ npm install googleapis
|
|
1903
|
+
* // ```
|
|
1904
|
+
*
|
|
1905
|
+
* const {google} = require('googleapis');
|
|
1906
|
+
* const translate = google.translate('v3');
|
|
1907
|
+
*
|
|
1908
|
+
* async function main() {
|
|
1909
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1910
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1911
|
+
* scopes: [
|
|
1912
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1913
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1914
|
+
* ],
|
|
1915
|
+
* });
|
|
1916
|
+
*
|
|
1917
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1918
|
+
* const authClient = await auth.getClient();
|
|
1919
|
+
* google.options({auth: authClient});
|
|
1920
|
+
*
|
|
1921
|
+
* // Do the magic
|
|
1922
|
+
* const res = await translate.projects.locations.detectLanguage({
|
|
1923
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}/locations/{location-id\}` or `projects/{project-number-or-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
1924
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1925
|
+
*
|
|
1926
|
+
* // Request body metadata
|
|
1927
|
+
* requestBody: {
|
|
1928
|
+
* // request body parameters
|
|
1929
|
+
* // {
|
|
1930
|
+
* // "content": "my_content",
|
|
1931
|
+
* // "labels": {},
|
|
1932
|
+
* // "mimeType": "my_mimeType",
|
|
1933
|
+
* // "model": "my_model"
|
|
1934
|
+
* // }
|
|
1935
|
+
* },
|
|
1936
|
+
* });
|
|
1937
|
+
* console.log(res.data);
|
|
1938
|
+
*
|
|
1939
|
+
* // Example response
|
|
1940
|
+
* // {
|
|
1941
|
+
* // "languages": []
|
|
1942
|
+
* // }
|
|
1943
|
+
* }
|
|
1944
|
+
*
|
|
1945
|
+
* main().catch(e => {
|
|
1946
|
+
* console.error(e);
|
|
1947
|
+
* throw e;
|
|
1948
|
+
* });
|
|
1949
|
+
*
|
|
1950
|
+
* ```
|
|
1457
1951
|
*
|
|
1458
1952
|
* @param params - Parameters for request
|
|
1459
1953
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1468,6 +1962,59 @@ export declare namespace translate_v3 {
|
|
|
1468
1962
|
detectLanguage(callback: BodyResponseCallback<Schema$DetectLanguageResponse>): void;
|
|
1469
1963
|
/**
|
|
1470
1964
|
* Gets information about a location.
|
|
1965
|
+
* @example
|
|
1966
|
+
* ```js
|
|
1967
|
+
* // Before running the sample:
|
|
1968
|
+
* // - Enable the API at:
|
|
1969
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1970
|
+
* // - Login into gcloud by running:
|
|
1971
|
+
* // ```sh
|
|
1972
|
+
* // $ gcloud auth application-default login
|
|
1973
|
+
* // ```
|
|
1974
|
+
* // - Install the npm module by running:
|
|
1975
|
+
* // ```sh
|
|
1976
|
+
* // $ npm install googleapis
|
|
1977
|
+
* // ```
|
|
1978
|
+
*
|
|
1979
|
+
* const {google} = require('googleapis');
|
|
1980
|
+
* const translate = google.translate('v3');
|
|
1981
|
+
*
|
|
1982
|
+
* async function main() {
|
|
1983
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1984
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1985
|
+
* scopes: [
|
|
1986
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1987
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1988
|
+
* ],
|
|
1989
|
+
* });
|
|
1990
|
+
*
|
|
1991
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1992
|
+
* const authClient = await auth.getClient();
|
|
1993
|
+
* google.options({auth: authClient});
|
|
1994
|
+
*
|
|
1995
|
+
* // Do the magic
|
|
1996
|
+
* const res = await translate.projects.locations.get({
|
|
1997
|
+
* // Resource name for the location.
|
|
1998
|
+
* name: 'projects/my-project/locations/my-location',
|
|
1999
|
+
* });
|
|
2000
|
+
* console.log(res.data);
|
|
2001
|
+
*
|
|
2002
|
+
* // Example response
|
|
2003
|
+
* // {
|
|
2004
|
+
* // "displayName": "my_displayName",
|
|
2005
|
+
* // "labels": {},
|
|
2006
|
+
* // "locationId": "my_locationId",
|
|
2007
|
+
* // "metadata": {},
|
|
2008
|
+
* // "name": "my_name"
|
|
2009
|
+
* // }
|
|
2010
|
+
* }
|
|
2011
|
+
*
|
|
2012
|
+
* main().catch(e => {
|
|
2013
|
+
* console.error(e);
|
|
2014
|
+
* throw e;
|
|
2015
|
+
* });
|
|
2016
|
+
*
|
|
2017
|
+
* ```
|
|
1471
2018
|
*
|
|
1472
2019
|
* @param params - Parameters for request
|
|
1473
2020
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1482,6 +2029,59 @@ export declare namespace translate_v3 {
|
|
|
1482
2029
|
get(callback: BodyResponseCallback<Schema$Location>): void;
|
|
1483
2030
|
/**
|
|
1484
2031
|
* Returns a list of supported languages for translation.
|
|
2032
|
+
* @example
|
|
2033
|
+
* ```js
|
|
2034
|
+
* // Before running the sample:
|
|
2035
|
+
* // - Enable the API at:
|
|
2036
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2037
|
+
* // - Login into gcloud by running:
|
|
2038
|
+
* // ```sh
|
|
2039
|
+
* // $ gcloud auth application-default login
|
|
2040
|
+
* // ```
|
|
2041
|
+
* // - Install the npm module by running:
|
|
2042
|
+
* // ```sh
|
|
2043
|
+
* // $ npm install googleapis
|
|
2044
|
+
* // ```
|
|
2045
|
+
*
|
|
2046
|
+
* const {google} = require('googleapis');
|
|
2047
|
+
* const translate = google.translate('v3');
|
|
2048
|
+
*
|
|
2049
|
+
* async function main() {
|
|
2050
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2051
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2052
|
+
* scopes: [
|
|
2053
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2054
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2055
|
+
* ],
|
|
2056
|
+
* });
|
|
2057
|
+
*
|
|
2058
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2059
|
+
* const authClient = await auth.getClient();
|
|
2060
|
+
* google.options({auth: authClient});
|
|
2061
|
+
*
|
|
2062
|
+
* // Do the magic
|
|
2063
|
+
* const res = await translate.projects.locations.getSupportedLanguages({
|
|
2064
|
+
* // Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.
|
|
2065
|
+
* displayLanguageCode: 'placeholder-value',
|
|
2066
|
+
* // Optional. Get supported languages of this model. The 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`, Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.
|
|
2067
|
+
* model: 'placeholder-value',
|
|
2068
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}` or `projects/{project-number-or-id\}/locations/{location-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
2069
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2070
|
+
* });
|
|
2071
|
+
* console.log(res.data);
|
|
2072
|
+
*
|
|
2073
|
+
* // Example response
|
|
2074
|
+
* // {
|
|
2075
|
+
* // "languages": []
|
|
2076
|
+
* // }
|
|
2077
|
+
* }
|
|
2078
|
+
*
|
|
2079
|
+
* main().catch(e => {
|
|
2080
|
+
* console.error(e);
|
|
2081
|
+
* throw e;
|
|
2082
|
+
* });
|
|
2083
|
+
*
|
|
2084
|
+
* ```
|
|
1485
2085
|
*
|
|
1486
2086
|
* @param params - Parameters for request
|
|
1487
2087
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1496,6 +2096,64 @@ export declare namespace translate_v3 {
|
|
|
1496
2096
|
getSupportedLanguages(callback: BodyResponseCallback<Schema$SupportedLanguages>): void;
|
|
1497
2097
|
/**
|
|
1498
2098
|
* Lists information about the supported locations for this service.
|
|
2099
|
+
* @example
|
|
2100
|
+
* ```js
|
|
2101
|
+
* // Before running the sample:
|
|
2102
|
+
* // - Enable the API at:
|
|
2103
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2104
|
+
* // - Login into gcloud by running:
|
|
2105
|
+
* // ```sh
|
|
2106
|
+
* // $ gcloud auth application-default login
|
|
2107
|
+
* // ```
|
|
2108
|
+
* // - Install the npm module by running:
|
|
2109
|
+
* // ```sh
|
|
2110
|
+
* // $ npm install googleapis
|
|
2111
|
+
* // ```
|
|
2112
|
+
*
|
|
2113
|
+
* const {google} = require('googleapis');
|
|
2114
|
+
* const translate = google.translate('v3');
|
|
2115
|
+
*
|
|
2116
|
+
* async function main() {
|
|
2117
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2118
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2119
|
+
* scopes: [
|
|
2120
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2121
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2122
|
+
* ],
|
|
2123
|
+
* });
|
|
2124
|
+
*
|
|
2125
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2126
|
+
* const authClient = await auth.getClient();
|
|
2127
|
+
* google.options({auth: authClient});
|
|
2128
|
+
*
|
|
2129
|
+
* // Do the magic
|
|
2130
|
+
* const res = await translate.projects.locations.list({
|
|
2131
|
+
* // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
|
|
2132
|
+
* extraLocationTypes: 'placeholder-value',
|
|
2133
|
+
* // A filter to narrow down results to a preferred subset. The filtering language accepts strings like `"displayName=tokyo"`, and is documented in more detail in [AIP-160](https://google.aip.dev/160).
|
|
2134
|
+
* filter: 'placeholder-value',
|
|
2135
|
+
* // The resource that owns the locations collection, if applicable.
|
|
2136
|
+
* name: 'projects/my-project',
|
|
2137
|
+
* // The maximum number of results to return. If not set, the service selects a default.
|
|
2138
|
+
* pageSize: 'placeholder-value',
|
|
2139
|
+
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
|
|
2140
|
+
* pageToken: 'placeholder-value',
|
|
2141
|
+
* });
|
|
2142
|
+
* console.log(res.data);
|
|
2143
|
+
*
|
|
2144
|
+
* // Example response
|
|
2145
|
+
* // {
|
|
2146
|
+
* // "locations": [],
|
|
2147
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
2148
|
+
* // }
|
|
2149
|
+
* }
|
|
2150
|
+
*
|
|
2151
|
+
* main().catch(e => {
|
|
2152
|
+
* console.error(e);
|
|
2153
|
+
* throw e;
|
|
2154
|
+
* });
|
|
2155
|
+
*
|
|
2156
|
+
* ```
|
|
1499
2157
|
*
|
|
1500
2158
|
* @param params - Parameters for request
|
|
1501
2159
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1510,6 +2168,64 @@ export declare namespace translate_v3 {
|
|
|
1510
2168
|
list(callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
|
|
1511
2169
|
/**
|
|
1512
2170
|
* Romanize input text written in non-Latin scripts to Latin text.
|
|
2171
|
+
* @example
|
|
2172
|
+
* ```js
|
|
2173
|
+
* // Before running the sample:
|
|
2174
|
+
* // - Enable the API at:
|
|
2175
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2176
|
+
* // - Login into gcloud by running:
|
|
2177
|
+
* // ```sh
|
|
2178
|
+
* // $ gcloud auth application-default login
|
|
2179
|
+
* // ```
|
|
2180
|
+
* // - Install the npm module by running:
|
|
2181
|
+
* // ```sh
|
|
2182
|
+
* // $ npm install googleapis
|
|
2183
|
+
* // ```
|
|
2184
|
+
*
|
|
2185
|
+
* const {google} = require('googleapis');
|
|
2186
|
+
* const translate = google.translate('v3');
|
|
2187
|
+
*
|
|
2188
|
+
* async function main() {
|
|
2189
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2190
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2191
|
+
* scopes: [
|
|
2192
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2193
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2194
|
+
* ],
|
|
2195
|
+
* });
|
|
2196
|
+
*
|
|
2197
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2198
|
+
* const authClient = await auth.getClient();
|
|
2199
|
+
* google.options({auth: authClient});
|
|
2200
|
+
*
|
|
2201
|
+
* // Do the magic
|
|
2202
|
+
* const res = await translate.projects.locations.romanizeText({
|
|
2203
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}/locations/{location-id\}` or `projects/{project-number-or-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`.
|
|
2204
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2205
|
+
*
|
|
2206
|
+
* // Request body metadata
|
|
2207
|
+
* requestBody: {
|
|
2208
|
+
* // request body parameters
|
|
2209
|
+
* // {
|
|
2210
|
+
* // "contents": [],
|
|
2211
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode"
|
|
2212
|
+
* // }
|
|
2213
|
+
* },
|
|
2214
|
+
* });
|
|
2215
|
+
* console.log(res.data);
|
|
2216
|
+
*
|
|
2217
|
+
* // Example response
|
|
2218
|
+
* // {
|
|
2219
|
+
* // "romanizations": []
|
|
2220
|
+
* // }
|
|
2221
|
+
* }
|
|
2222
|
+
*
|
|
2223
|
+
* main().catch(e => {
|
|
2224
|
+
* console.error(e);
|
|
2225
|
+
* throw e;
|
|
2226
|
+
* });
|
|
2227
|
+
*
|
|
2228
|
+
* ```
|
|
1513
2229
|
*
|
|
1514
2230
|
* @param params - Parameters for request
|
|
1515
2231
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1524,6 +2240,76 @@ export declare namespace translate_v3 {
|
|
|
1524
2240
|
romanizeText(callback: BodyResponseCallback<Schema$RomanizeTextResponse>): void;
|
|
1525
2241
|
/**
|
|
1526
2242
|
* Translates documents in synchronous mode.
|
|
2243
|
+
* @example
|
|
2244
|
+
* ```js
|
|
2245
|
+
* // Before running the sample:
|
|
2246
|
+
* // - Enable the API at:
|
|
2247
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2248
|
+
* // - Login into gcloud by running:
|
|
2249
|
+
* // ```sh
|
|
2250
|
+
* // $ gcloud auth application-default login
|
|
2251
|
+
* // ```
|
|
2252
|
+
* // - Install the npm module by running:
|
|
2253
|
+
* // ```sh
|
|
2254
|
+
* // $ npm install googleapis
|
|
2255
|
+
* // ```
|
|
2256
|
+
*
|
|
2257
|
+
* const {google} = require('googleapis');
|
|
2258
|
+
* const translate = google.translate('v3');
|
|
2259
|
+
*
|
|
2260
|
+
* async function main() {
|
|
2261
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2262
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2263
|
+
* scopes: [
|
|
2264
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2265
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2266
|
+
* ],
|
|
2267
|
+
* });
|
|
2268
|
+
*
|
|
2269
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2270
|
+
* const authClient = await auth.getClient();
|
|
2271
|
+
* google.options({auth: authClient});
|
|
2272
|
+
*
|
|
2273
|
+
* // Do the magic
|
|
2274
|
+
* const res = await translate.projects.locations.translateDocument({
|
|
2275
|
+
* // Required. Location to make a regional call. Format: `projects/{project-number-or-id\}/locations/{location-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have the same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
2276
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2277
|
+
*
|
|
2278
|
+
* // Request body metadata
|
|
2279
|
+
* requestBody: {
|
|
2280
|
+
* // request body parameters
|
|
2281
|
+
* // {
|
|
2282
|
+
* // "customizedAttribution": "my_customizedAttribution",
|
|
2283
|
+
* // "documentInputConfig": {},
|
|
2284
|
+
* // "documentOutputConfig": {},
|
|
2285
|
+
* // "enableRotationCorrection": false,
|
|
2286
|
+
* // "enableShadowRemovalNativePdf": false,
|
|
2287
|
+
* // "glossaryConfig": {},
|
|
2288
|
+
* // "isTranslateNativePdfOnly": false,
|
|
2289
|
+
* // "labels": {},
|
|
2290
|
+
* // "model": "my_model",
|
|
2291
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2292
|
+
* // "targetLanguageCode": "my_targetLanguageCode"
|
|
2293
|
+
* // }
|
|
2294
|
+
* },
|
|
2295
|
+
* });
|
|
2296
|
+
* console.log(res.data);
|
|
2297
|
+
*
|
|
2298
|
+
* // Example response
|
|
2299
|
+
* // {
|
|
2300
|
+
* // "documentTranslation": {},
|
|
2301
|
+
* // "glossaryConfig": {},
|
|
2302
|
+
* // "glossaryDocumentTranslation": {},
|
|
2303
|
+
* // "model": "my_model"
|
|
2304
|
+
* // }
|
|
2305
|
+
* }
|
|
2306
|
+
*
|
|
2307
|
+
* main().catch(e => {
|
|
2308
|
+
* console.error(e);
|
|
2309
|
+
* throw e;
|
|
2310
|
+
* });
|
|
2311
|
+
*
|
|
2312
|
+
* ```
|
|
1527
2313
|
*
|
|
1528
2314
|
* @param params - Parameters for request
|
|
1529
2315
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1538,6 +2324,71 @@ export declare namespace translate_v3 {
|
|
|
1538
2324
|
translateDocument(callback: BodyResponseCallback<Schema$TranslateDocumentResponse>): void;
|
|
1539
2325
|
/**
|
|
1540
2326
|
* Translates input text and returns translated text.
|
|
2327
|
+
* @example
|
|
2328
|
+
* ```js
|
|
2329
|
+
* // Before running the sample:
|
|
2330
|
+
* // - Enable the API at:
|
|
2331
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2332
|
+
* // - Login into gcloud by running:
|
|
2333
|
+
* // ```sh
|
|
2334
|
+
* // $ gcloud auth application-default login
|
|
2335
|
+
* // ```
|
|
2336
|
+
* // - Install the npm module by running:
|
|
2337
|
+
* // ```sh
|
|
2338
|
+
* // $ npm install googleapis
|
|
2339
|
+
* // ```
|
|
2340
|
+
*
|
|
2341
|
+
* const {google} = require('googleapis');
|
|
2342
|
+
* const translate = google.translate('v3');
|
|
2343
|
+
*
|
|
2344
|
+
* async function main() {
|
|
2345
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2346
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2347
|
+
* scopes: [
|
|
2348
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2349
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2350
|
+
* ],
|
|
2351
|
+
* });
|
|
2352
|
+
*
|
|
2353
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2354
|
+
* const authClient = await auth.getClient();
|
|
2355
|
+
* google.options({auth: authClient});
|
|
2356
|
+
*
|
|
2357
|
+
* // Do the magic
|
|
2358
|
+
* const res = await translate.projects.locations.translateText({
|
|
2359
|
+
* // Required. Project or location to make a call. Must refer to a caller's project. Format: `projects/{project-number-or-id\}` or `projects/{project-number-or-id\}/locations/{location-id\}`. For global calls, use `projects/{project-number-or-id\}/locations/global` or `projects/{project-number-or-id\}`. Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
|
|
2360
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2361
|
+
*
|
|
2362
|
+
* // Request body metadata
|
|
2363
|
+
* requestBody: {
|
|
2364
|
+
* // request body parameters
|
|
2365
|
+
* // {
|
|
2366
|
+
* // "contents": [],
|
|
2367
|
+
* // "glossaryConfig": {},
|
|
2368
|
+
* // "labels": {},
|
|
2369
|
+
* // "mimeType": "my_mimeType",
|
|
2370
|
+
* // "model": "my_model",
|
|
2371
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2372
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
2373
|
+
* // "transliterationConfig": {}
|
|
2374
|
+
* // }
|
|
2375
|
+
* },
|
|
2376
|
+
* });
|
|
2377
|
+
* console.log(res.data);
|
|
2378
|
+
*
|
|
2379
|
+
* // Example response
|
|
2380
|
+
* // {
|
|
2381
|
+
* // "glossaryTranslations": [],
|
|
2382
|
+
* // "translations": []
|
|
2383
|
+
* // }
|
|
2384
|
+
* }
|
|
2385
|
+
*
|
|
2386
|
+
* main().catch(e => {
|
|
2387
|
+
* console.error(e);
|
|
2388
|
+
* throw e;
|
|
2389
|
+
* });
|
|
2390
|
+
*
|
|
2391
|
+
* ```
|
|
1541
2392
|
*
|
|
1542
2393
|
* @param params - Parameters for request
|
|
1543
2394
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1670,6 +2521,75 @@ export declare namespace translate_v3 {
|
|
|
1670
2521
|
constructor(context: APIRequestContext);
|
|
1671
2522
|
/**
|
|
1672
2523
|
* Creates an Adaptive MT dataset.
|
|
2524
|
+
* @example
|
|
2525
|
+
* ```js
|
|
2526
|
+
* // Before running the sample:
|
|
2527
|
+
* // - Enable the API at:
|
|
2528
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2529
|
+
* // - Login into gcloud by running:
|
|
2530
|
+
* // ```sh
|
|
2531
|
+
* // $ gcloud auth application-default login
|
|
2532
|
+
* // ```
|
|
2533
|
+
* // - Install the npm module by running:
|
|
2534
|
+
* // ```sh
|
|
2535
|
+
* // $ npm install googleapis
|
|
2536
|
+
* // ```
|
|
2537
|
+
*
|
|
2538
|
+
* const {google} = require('googleapis');
|
|
2539
|
+
* const translate = google.translate('v3');
|
|
2540
|
+
*
|
|
2541
|
+
* async function main() {
|
|
2542
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2543
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2544
|
+
* scopes: [
|
|
2545
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2546
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2547
|
+
* ],
|
|
2548
|
+
* });
|
|
2549
|
+
*
|
|
2550
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2551
|
+
* const authClient = await auth.getClient();
|
|
2552
|
+
* google.options({auth: authClient});
|
|
2553
|
+
*
|
|
2554
|
+
* // Do the magic
|
|
2555
|
+
* const res = await translate.projects.locations.adaptiveMtDatasets.create({
|
|
2556
|
+
* // Required. Name of the parent project. In form of `projects/{project-number-or-id\}/locations/{location-id\}`
|
|
2557
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2558
|
+
*
|
|
2559
|
+
* // Request body metadata
|
|
2560
|
+
* requestBody: {
|
|
2561
|
+
* // request body parameters
|
|
2562
|
+
* // {
|
|
2563
|
+
* // "createTime": "my_createTime",
|
|
2564
|
+
* // "displayName": "my_displayName",
|
|
2565
|
+
* // "exampleCount": 0,
|
|
2566
|
+
* // "name": "my_name",
|
|
2567
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2568
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
2569
|
+
* // "updateTime": "my_updateTime"
|
|
2570
|
+
* // }
|
|
2571
|
+
* },
|
|
2572
|
+
* });
|
|
2573
|
+
* console.log(res.data);
|
|
2574
|
+
*
|
|
2575
|
+
* // Example response
|
|
2576
|
+
* // {
|
|
2577
|
+
* // "createTime": "my_createTime",
|
|
2578
|
+
* // "displayName": "my_displayName",
|
|
2579
|
+
* // "exampleCount": 0,
|
|
2580
|
+
* // "name": "my_name",
|
|
2581
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2582
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
2583
|
+
* // "updateTime": "my_updateTime"
|
|
2584
|
+
* // }
|
|
2585
|
+
* }
|
|
2586
|
+
*
|
|
2587
|
+
* main().catch(e => {
|
|
2588
|
+
* console.error(e);
|
|
2589
|
+
* throw e;
|
|
2590
|
+
* });
|
|
2591
|
+
*
|
|
2592
|
+
* ```
|
|
1673
2593
|
*
|
|
1674
2594
|
* @param params - Parameters for request
|
|
1675
2595
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1684,6 +2604,53 @@ export declare namespace translate_v3 {
|
|
|
1684
2604
|
create(callback: BodyResponseCallback<Schema$AdaptiveMtDataset>): void;
|
|
1685
2605
|
/**
|
|
1686
2606
|
* Deletes an Adaptive MT dataset, including all its entries and associated metadata.
|
|
2607
|
+
* @example
|
|
2608
|
+
* ```js
|
|
2609
|
+
* // Before running the sample:
|
|
2610
|
+
* // - Enable the API at:
|
|
2611
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2612
|
+
* // - Login into gcloud by running:
|
|
2613
|
+
* // ```sh
|
|
2614
|
+
* // $ gcloud auth application-default login
|
|
2615
|
+
* // ```
|
|
2616
|
+
* // - Install the npm module by running:
|
|
2617
|
+
* // ```sh
|
|
2618
|
+
* // $ npm install googleapis
|
|
2619
|
+
* // ```
|
|
2620
|
+
*
|
|
2621
|
+
* const {google} = require('googleapis');
|
|
2622
|
+
* const translate = google.translate('v3');
|
|
2623
|
+
*
|
|
2624
|
+
* async function main() {
|
|
2625
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2626
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2627
|
+
* scopes: [
|
|
2628
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2629
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2630
|
+
* ],
|
|
2631
|
+
* });
|
|
2632
|
+
*
|
|
2633
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2634
|
+
* const authClient = await auth.getClient();
|
|
2635
|
+
* google.options({auth: authClient});
|
|
2636
|
+
*
|
|
2637
|
+
* // Do the magic
|
|
2638
|
+
* const res = await translate.projects.locations.adaptiveMtDatasets.delete({
|
|
2639
|
+
* // Required. Name of the dataset. In the form of `projects/{project-number-or-id\}/locations/{location-id\}/adaptiveMtDatasets/{adaptive-mt-dataset-id\}`
|
|
2640
|
+
* name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
|
|
2641
|
+
* });
|
|
2642
|
+
* console.log(res.data);
|
|
2643
|
+
*
|
|
2644
|
+
* // Example response
|
|
2645
|
+
* // {}
|
|
2646
|
+
* }
|
|
2647
|
+
*
|
|
2648
|
+
* main().catch(e => {
|
|
2649
|
+
* console.error(e);
|
|
2650
|
+
* throw e;
|
|
2651
|
+
* });
|
|
2652
|
+
*
|
|
2653
|
+
* ```
|
|
1687
2654
|
*
|
|
1688
2655
|
* @param params - Parameters for request
|
|
1689
2656
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1698,6 +2665,61 @@ export declare namespace translate_v3 {
|
|
|
1698
2665
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
1699
2666
|
/**
|
|
1700
2667
|
* Gets the Adaptive MT dataset.
|
|
2668
|
+
* @example
|
|
2669
|
+
* ```js
|
|
2670
|
+
* // Before running the sample:
|
|
2671
|
+
* // - Enable the API at:
|
|
2672
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2673
|
+
* // - Login into gcloud by running:
|
|
2674
|
+
* // ```sh
|
|
2675
|
+
* // $ gcloud auth application-default login
|
|
2676
|
+
* // ```
|
|
2677
|
+
* // - Install the npm module by running:
|
|
2678
|
+
* // ```sh
|
|
2679
|
+
* // $ npm install googleapis
|
|
2680
|
+
* // ```
|
|
2681
|
+
*
|
|
2682
|
+
* const {google} = require('googleapis');
|
|
2683
|
+
* const translate = google.translate('v3');
|
|
2684
|
+
*
|
|
2685
|
+
* async function main() {
|
|
2686
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2687
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2688
|
+
* scopes: [
|
|
2689
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2690
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2691
|
+
* ],
|
|
2692
|
+
* });
|
|
2693
|
+
*
|
|
2694
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2695
|
+
* const authClient = await auth.getClient();
|
|
2696
|
+
* google.options({auth: authClient});
|
|
2697
|
+
*
|
|
2698
|
+
* // Do the magic
|
|
2699
|
+
* const res = await translate.projects.locations.adaptiveMtDatasets.get({
|
|
2700
|
+
* // Required. Name of the dataset. In the form of `projects/{project-number-or-id\}/locations/{location-id\}/adaptiveMtDatasets/{adaptive-mt-dataset-id\}`
|
|
2701
|
+
* name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
|
|
2702
|
+
* });
|
|
2703
|
+
* console.log(res.data);
|
|
2704
|
+
*
|
|
2705
|
+
* // Example response
|
|
2706
|
+
* // {
|
|
2707
|
+
* // "createTime": "my_createTime",
|
|
2708
|
+
* // "displayName": "my_displayName",
|
|
2709
|
+
* // "exampleCount": 0,
|
|
2710
|
+
* // "name": "my_name",
|
|
2711
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2712
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
2713
|
+
* // "updateTime": "my_updateTime"
|
|
2714
|
+
* // }
|
|
2715
|
+
* }
|
|
2716
|
+
*
|
|
2717
|
+
* main().catch(e => {
|
|
2718
|
+
* console.error(e);
|
|
2719
|
+
* throw e;
|
|
2720
|
+
* });
|
|
2721
|
+
*
|
|
2722
|
+
* ```
|
|
1701
2723
|
*
|
|
1702
2724
|
* @param params - Parameters for request
|
|
1703
2725
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1712,6 +2734,66 @@ export declare namespace translate_v3 {
|
|
|
1712
2734
|
get(callback: BodyResponseCallback<Schema$AdaptiveMtDataset>): void;
|
|
1713
2735
|
/**
|
|
1714
2736
|
* Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
|
|
2737
|
+
* @example
|
|
2738
|
+
* ```js
|
|
2739
|
+
* // Before running the sample:
|
|
2740
|
+
* // - Enable the API at:
|
|
2741
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2742
|
+
* // - Login into gcloud by running:
|
|
2743
|
+
* // ```sh
|
|
2744
|
+
* // $ gcloud auth application-default login
|
|
2745
|
+
* // ```
|
|
2746
|
+
* // - Install the npm module by running:
|
|
2747
|
+
* // ```sh
|
|
2748
|
+
* // $ npm install googleapis
|
|
2749
|
+
* // ```
|
|
2750
|
+
*
|
|
2751
|
+
* const {google} = require('googleapis');
|
|
2752
|
+
* const translate = google.translate('v3');
|
|
2753
|
+
*
|
|
2754
|
+
* async function main() {
|
|
2755
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2756
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2757
|
+
* scopes: [
|
|
2758
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2759
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2760
|
+
* ],
|
|
2761
|
+
* });
|
|
2762
|
+
*
|
|
2763
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2764
|
+
* const authClient = await auth.getClient();
|
|
2765
|
+
* google.options({auth: authClient});
|
|
2766
|
+
*
|
|
2767
|
+
* // Do the magic
|
|
2768
|
+
* const res =
|
|
2769
|
+
* await translate.projects.locations.adaptiveMtDatasets.importAdaptiveMtFile({
|
|
2770
|
+
* // Required. The resource name of the file, in form of `projects/{project-number-or-id\}/locations/{location_id\}/adaptiveMtDatasets/{dataset\}`
|
|
2771
|
+
* parent:
|
|
2772
|
+
* 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
|
|
2773
|
+
*
|
|
2774
|
+
* // Request body metadata
|
|
2775
|
+
* requestBody: {
|
|
2776
|
+
* // request body parameters
|
|
2777
|
+
* // {
|
|
2778
|
+
* // "fileInputSource": {},
|
|
2779
|
+
* // "gcsInputSource": {}
|
|
2780
|
+
* // }
|
|
2781
|
+
* },
|
|
2782
|
+
* });
|
|
2783
|
+
* console.log(res.data);
|
|
2784
|
+
*
|
|
2785
|
+
* // Example response
|
|
2786
|
+
* // {
|
|
2787
|
+
* // "adaptiveMtFile": {}
|
|
2788
|
+
* // }
|
|
2789
|
+
* }
|
|
2790
|
+
*
|
|
2791
|
+
* main().catch(e => {
|
|
2792
|
+
* console.error(e);
|
|
2793
|
+
* throw e;
|
|
2794
|
+
* });
|
|
2795
|
+
*
|
|
2796
|
+
* ```
|
|
1715
2797
|
*
|
|
1716
2798
|
* @param params - Parameters for request
|
|
1717
2799
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1726,6 +2808,62 @@ export declare namespace translate_v3 {
|
|
|
1726
2808
|
importAdaptiveMtFile(callback: BodyResponseCallback<Schema$ImportAdaptiveMtFileResponse>): void;
|
|
1727
2809
|
/**
|
|
1728
2810
|
* Lists all Adaptive MT datasets for which the caller has read permission.
|
|
2811
|
+
* @example
|
|
2812
|
+
* ```js
|
|
2813
|
+
* // Before running the sample:
|
|
2814
|
+
* // - Enable the API at:
|
|
2815
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2816
|
+
* // - Login into gcloud by running:
|
|
2817
|
+
* // ```sh
|
|
2818
|
+
* // $ gcloud auth application-default login
|
|
2819
|
+
* // ```
|
|
2820
|
+
* // - Install the npm module by running:
|
|
2821
|
+
* // ```sh
|
|
2822
|
+
* // $ npm install googleapis
|
|
2823
|
+
* // ```
|
|
2824
|
+
*
|
|
2825
|
+
* const {google} = require('googleapis');
|
|
2826
|
+
* const translate = google.translate('v3');
|
|
2827
|
+
*
|
|
2828
|
+
* async function main() {
|
|
2829
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2830
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2831
|
+
* scopes: [
|
|
2832
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2833
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2834
|
+
* ],
|
|
2835
|
+
* });
|
|
2836
|
+
*
|
|
2837
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2838
|
+
* const authClient = await auth.getClient();
|
|
2839
|
+
* google.options({auth: authClient});
|
|
2840
|
+
*
|
|
2841
|
+
* // Do the magic
|
|
2842
|
+
* const res = await translate.projects.locations.adaptiveMtDatasets.list({
|
|
2843
|
+
* // Optional. An expression for filtering the results of the request. Filter is not supported yet.
|
|
2844
|
+
* filter: 'placeholder-value',
|
|
2845
|
+
* // Optional. Requested page size. The server may return fewer results than requested. If unspecified, the server picks an appropriate default.
|
|
2846
|
+
* pageSize: 'placeholder-value',
|
|
2847
|
+
* // 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.
|
|
2848
|
+
* pageToken: 'placeholder-value',
|
|
2849
|
+
* // Required. The resource name of the project from which to list the Adaptive MT datasets. `projects/{project-number-or-id\}/locations/{location-id\}`
|
|
2850
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2851
|
+
* });
|
|
2852
|
+
* console.log(res.data);
|
|
2853
|
+
*
|
|
2854
|
+
* // Example response
|
|
2855
|
+
* // {
|
|
2856
|
+
* // "adaptiveMtDatasets": [],
|
|
2857
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
2858
|
+
* // }
|
|
2859
|
+
* }
|
|
2860
|
+
*
|
|
2861
|
+
* main().catch(e => {
|
|
2862
|
+
* console.error(e);
|
|
2863
|
+
* throw e;
|
|
2864
|
+
* });
|
|
2865
|
+
*
|
|
2866
|
+
* ```
|
|
1729
2867
|
*
|
|
1730
2868
|
* @param params - Parameters for request
|
|
1731
2869
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1795,6 +2933,56 @@ export declare namespace translate_v3 {
|
|
|
1795
2933
|
constructor(context: APIRequestContext);
|
|
1796
2934
|
/**
|
|
1797
2935
|
* Deletes an AdaptiveMtFile along with its sentences.
|
|
2936
|
+
* @example
|
|
2937
|
+
* ```js
|
|
2938
|
+
* // Before running the sample:
|
|
2939
|
+
* // - Enable the API at:
|
|
2940
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2941
|
+
* // - Login into gcloud by running:
|
|
2942
|
+
* // ```sh
|
|
2943
|
+
* // $ gcloud auth application-default login
|
|
2944
|
+
* // ```
|
|
2945
|
+
* // - Install the npm module by running:
|
|
2946
|
+
* // ```sh
|
|
2947
|
+
* // $ npm install googleapis
|
|
2948
|
+
* // ```
|
|
2949
|
+
*
|
|
2950
|
+
* const {google} = require('googleapis');
|
|
2951
|
+
* const translate = google.translate('v3');
|
|
2952
|
+
*
|
|
2953
|
+
* async function main() {
|
|
2954
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2955
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2956
|
+
* scopes: [
|
|
2957
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2958
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2959
|
+
* ],
|
|
2960
|
+
* });
|
|
2961
|
+
*
|
|
2962
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2963
|
+
* const authClient = await auth.getClient();
|
|
2964
|
+
* google.options({auth: authClient});
|
|
2965
|
+
*
|
|
2966
|
+
* // Do the magic
|
|
2967
|
+
* const res =
|
|
2968
|
+
* await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.delete(
|
|
2969
|
+
* {
|
|
2970
|
+
* // Required. The resource name of the file to delete, in form of `projects/{project-number-or-id\}/locations/{location_id\}/adaptiveMtDatasets/{dataset\}/adaptiveMtFiles/{file\}`
|
|
2971
|
+
* name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset/adaptiveMtFiles/my-adaptiveMtFile',
|
|
2972
|
+
* },
|
|
2973
|
+
* );
|
|
2974
|
+
* console.log(res.data);
|
|
2975
|
+
*
|
|
2976
|
+
* // Example response
|
|
2977
|
+
* // {}
|
|
2978
|
+
* }
|
|
2979
|
+
*
|
|
2980
|
+
* main().catch(e => {
|
|
2981
|
+
* console.error(e);
|
|
2982
|
+
* throw e;
|
|
2983
|
+
* });
|
|
2984
|
+
*
|
|
2985
|
+
* ```
|
|
1798
2986
|
*
|
|
1799
2987
|
* @param params - Parameters for request
|
|
1800
2988
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1809,6 +2997,60 @@ export declare namespace translate_v3 {
|
|
|
1809
2997
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
1810
2998
|
/**
|
|
1811
2999
|
* Gets and AdaptiveMtFile
|
|
3000
|
+
* @example
|
|
3001
|
+
* ```js
|
|
3002
|
+
* // Before running the sample:
|
|
3003
|
+
* // - Enable the API at:
|
|
3004
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3005
|
+
* // - Login into gcloud by running:
|
|
3006
|
+
* // ```sh
|
|
3007
|
+
* // $ gcloud auth application-default login
|
|
3008
|
+
* // ```
|
|
3009
|
+
* // - Install the npm module by running:
|
|
3010
|
+
* // ```sh
|
|
3011
|
+
* // $ npm install googleapis
|
|
3012
|
+
* // ```
|
|
3013
|
+
*
|
|
3014
|
+
* const {google} = require('googleapis');
|
|
3015
|
+
* const translate = google.translate('v3');
|
|
3016
|
+
*
|
|
3017
|
+
* async function main() {
|
|
3018
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3019
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3020
|
+
* scopes: [
|
|
3021
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3022
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3023
|
+
* ],
|
|
3024
|
+
* });
|
|
3025
|
+
*
|
|
3026
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3027
|
+
* const authClient = await auth.getClient();
|
|
3028
|
+
* google.options({auth: authClient});
|
|
3029
|
+
*
|
|
3030
|
+
* // Do the magic
|
|
3031
|
+
* const res =
|
|
3032
|
+
* await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.get({
|
|
3033
|
+
* // Required. The resource name of the file, in form of `projects/{project-number-or-id\}/locations/{location_id\}/adaptiveMtDatasets/{dataset\}/adaptiveMtFiles/{file\}`
|
|
3034
|
+
* name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset/adaptiveMtFiles/my-adaptiveMtFile',
|
|
3035
|
+
* });
|
|
3036
|
+
* console.log(res.data);
|
|
3037
|
+
*
|
|
3038
|
+
* // Example response
|
|
3039
|
+
* // {
|
|
3040
|
+
* // "createTime": "my_createTime",
|
|
3041
|
+
* // "displayName": "my_displayName",
|
|
3042
|
+
* // "entryCount": 0,
|
|
3043
|
+
* // "name": "my_name",
|
|
3044
|
+
* // "updateTime": "my_updateTime"
|
|
3045
|
+
* // }
|
|
3046
|
+
* }
|
|
3047
|
+
*
|
|
3048
|
+
* main().catch(e => {
|
|
3049
|
+
* console.error(e);
|
|
3050
|
+
* throw e;
|
|
3051
|
+
* });
|
|
3052
|
+
*
|
|
3053
|
+
* ```
|
|
1812
3054
|
*
|
|
1813
3055
|
* @param params - Parameters for request
|
|
1814
3056
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1823,6 +3065,62 @@ export declare namespace translate_v3 {
|
|
|
1823
3065
|
get(callback: BodyResponseCallback<Schema$AdaptiveMtFile>): void;
|
|
1824
3066
|
/**
|
|
1825
3067
|
* Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
|
|
3068
|
+
* @example
|
|
3069
|
+
* ```js
|
|
3070
|
+
* // Before running the sample:
|
|
3071
|
+
* // - Enable the API at:
|
|
3072
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3073
|
+
* // - Login into gcloud by running:
|
|
3074
|
+
* // ```sh
|
|
3075
|
+
* // $ gcloud auth application-default login
|
|
3076
|
+
* // ```
|
|
3077
|
+
* // - Install the npm module by running:
|
|
3078
|
+
* // ```sh
|
|
3079
|
+
* // $ npm install googleapis
|
|
3080
|
+
* // ```
|
|
3081
|
+
*
|
|
3082
|
+
* const {google} = require('googleapis');
|
|
3083
|
+
* const translate = google.translate('v3');
|
|
3084
|
+
*
|
|
3085
|
+
* async function main() {
|
|
3086
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3087
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3088
|
+
* scopes: [
|
|
3089
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3090
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3091
|
+
* ],
|
|
3092
|
+
* });
|
|
3093
|
+
*
|
|
3094
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3095
|
+
* const authClient = await auth.getClient();
|
|
3096
|
+
* google.options({auth: authClient});
|
|
3097
|
+
*
|
|
3098
|
+
* // Do the magic
|
|
3099
|
+
* const res =
|
|
3100
|
+
* await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.list({
|
|
3101
|
+
* // Optional.
|
|
3102
|
+
* pageSize: 'placeholder-value',
|
|
3103
|
+
* // 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.
|
|
3104
|
+
* pageToken: 'placeholder-value',
|
|
3105
|
+
* // Required. The resource name of the project from which to list the Adaptive MT files. `projects/{project\}/locations/{location\}/adaptiveMtDatasets/{dataset\}`
|
|
3106
|
+
* parent:
|
|
3107
|
+
* 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
|
|
3108
|
+
* });
|
|
3109
|
+
* console.log(res.data);
|
|
3110
|
+
*
|
|
3111
|
+
* // Example response
|
|
3112
|
+
* // {
|
|
3113
|
+
* // "adaptiveMtFiles": [],
|
|
3114
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
3115
|
+
* // }
|
|
3116
|
+
* }
|
|
3117
|
+
*
|
|
3118
|
+
* main().catch(e => {
|
|
3119
|
+
* console.error(e);
|
|
3120
|
+
* throw e;
|
|
3121
|
+
* });
|
|
3122
|
+
*
|
|
3123
|
+
* ```
|
|
1826
3124
|
*
|
|
1827
3125
|
* @param params - Parameters for request
|
|
1828
3126
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1867,6 +3165,63 @@ export declare namespace translate_v3 {
|
|
|
1867
3165
|
constructor(context: APIRequestContext);
|
|
1868
3166
|
/**
|
|
1869
3167
|
* Lists all AdaptiveMtSentences under a given file/dataset.
|
|
3168
|
+
* @example
|
|
3169
|
+
* ```js
|
|
3170
|
+
* // Before running the sample:
|
|
3171
|
+
* // - Enable the API at:
|
|
3172
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3173
|
+
* // - Login into gcloud by running:
|
|
3174
|
+
* // ```sh
|
|
3175
|
+
* // $ gcloud auth application-default login
|
|
3176
|
+
* // ```
|
|
3177
|
+
* // - Install the npm module by running:
|
|
3178
|
+
* // ```sh
|
|
3179
|
+
* // $ npm install googleapis
|
|
3180
|
+
* // ```
|
|
3181
|
+
*
|
|
3182
|
+
* const {google} = require('googleapis');
|
|
3183
|
+
* const translate = google.translate('v3');
|
|
3184
|
+
*
|
|
3185
|
+
* async function main() {
|
|
3186
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3187
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3188
|
+
* scopes: [
|
|
3189
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3190
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3191
|
+
* ],
|
|
3192
|
+
* });
|
|
3193
|
+
*
|
|
3194
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3195
|
+
* const authClient = await auth.getClient();
|
|
3196
|
+
* google.options({auth: authClient});
|
|
3197
|
+
*
|
|
3198
|
+
* // Do the magic
|
|
3199
|
+
* const res =
|
|
3200
|
+
* await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.adaptiveMtSentences.list(
|
|
3201
|
+
* {
|
|
3202
|
+
* pageSize: 'placeholder-value',
|
|
3203
|
+
* // 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.
|
|
3204
|
+
* pageToken: 'placeholder-value',
|
|
3205
|
+
* // 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\}`
|
|
3206
|
+
* parent:
|
|
3207
|
+
* 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset/adaptiveMtFiles/my-adaptiveMtFile',
|
|
3208
|
+
* },
|
|
3209
|
+
* );
|
|
3210
|
+
* console.log(res.data);
|
|
3211
|
+
*
|
|
3212
|
+
* // Example response
|
|
3213
|
+
* // {
|
|
3214
|
+
* // "adaptiveMtSentences": [],
|
|
3215
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
3216
|
+
* // }
|
|
3217
|
+
* }
|
|
3218
|
+
*
|
|
3219
|
+
* main().catch(e => {
|
|
3220
|
+
* console.error(e);
|
|
3221
|
+
* throw e;
|
|
3222
|
+
* });
|
|
3223
|
+
*
|
|
3224
|
+
* ```
|
|
1870
3225
|
*
|
|
1871
3226
|
* @param params - Parameters for request
|
|
1872
3227
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1899,6 +3254,63 @@ export declare namespace translate_v3 {
|
|
|
1899
3254
|
constructor(context: APIRequestContext);
|
|
1900
3255
|
/**
|
|
1901
3256
|
* Lists all AdaptiveMtSentences under a given file/dataset.
|
|
3257
|
+
* @example
|
|
3258
|
+
* ```js
|
|
3259
|
+
* // Before running the sample:
|
|
3260
|
+
* // - Enable the API at:
|
|
3261
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3262
|
+
* // - Login into gcloud by running:
|
|
3263
|
+
* // ```sh
|
|
3264
|
+
* // $ gcloud auth application-default login
|
|
3265
|
+
* // ```
|
|
3266
|
+
* // - Install the npm module by running:
|
|
3267
|
+
* // ```sh
|
|
3268
|
+
* // $ npm install googleapis
|
|
3269
|
+
* // ```
|
|
3270
|
+
*
|
|
3271
|
+
* const {google} = require('googleapis');
|
|
3272
|
+
* const translate = google.translate('v3');
|
|
3273
|
+
*
|
|
3274
|
+
* async function main() {
|
|
3275
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3276
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3277
|
+
* scopes: [
|
|
3278
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3279
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3280
|
+
* ],
|
|
3281
|
+
* });
|
|
3282
|
+
*
|
|
3283
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3284
|
+
* const authClient = await auth.getClient();
|
|
3285
|
+
* google.options({auth: authClient});
|
|
3286
|
+
*
|
|
3287
|
+
* // Do the magic
|
|
3288
|
+
* const res =
|
|
3289
|
+
* await translate.projects.locations.adaptiveMtDatasets.adaptiveMtSentences.list(
|
|
3290
|
+
* {
|
|
3291
|
+
* pageSize: 'placeholder-value',
|
|
3292
|
+
* // 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.
|
|
3293
|
+
* pageToken: 'placeholder-value',
|
|
3294
|
+
* // 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\}`
|
|
3295
|
+
* parent:
|
|
3296
|
+
* 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
|
|
3297
|
+
* },
|
|
3298
|
+
* );
|
|
3299
|
+
* console.log(res.data);
|
|
3300
|
+
*
|
|
3301
|
+
* // Example response
|
|
3302
|
+
* // {
|
|
3303
|
+
* // "adaptiveMtSentences": [],
|
|
3304
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
3305
|
+
* // }
|
|
3306
|
+
* }
|
|
3307
|
+
*
|
|
3308
|
+
* main().catch(e => {
|
|
3309
|
+
* console.error(e);
|
|
3310
|
+
* throw e;
|
|
3311
|
+
* });
|
|
3312
|
+
*
|
|
3313
|
+
* ```
|
|
1902
3314
|
*
|
|
1903
3315
|
* @param params - Parameters for request
|
|
1904
3316
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1932,6 +3344,76 @@ export declare namespace translate_v3 {
|
|
|
1932
3344
|
constructor(context: APIRequestContext);
|
|
1933
3345
|
/**
|
|
1934
3346
|
* Creates a Dataset.
|
|
3347
|
+
* @example
|
|
3348
|
+
* ```js
|
|
3349
|
+
* // Before running the sample:
|
|
3350
|
+
* // - Enable the API at:
|
|
3351
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3352
|
+
* // - Login into gcloud by running:
|
|
3353
|
+
* // ```sh
|
|
3354
|
+
* // $ gcloud auth application-default login
|
|
3355
|
+
* // ```
|
|
3356
|
+
* // - Install the npm module by running:
|
|
3357
|
+
* // ```sh
|
|
3358
|
+
* // $ npm install googleapis
|
|
3359
|
+
* // ```
|
|
3360
|
+
*
|
|
3361
|
+
* const {google} = require('googleapis');
|
|
3362
|
+
* const translate = google.translate('v3');
|
|
3363
|
+
*
|
|
3364
|
+
* async function main() {
|
|
3365
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3366
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3367
|
+
* scopes: [
|
|
3368
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3369
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3370
|
+
* ],
|
|
3371
|
+
* });
|
|
3372
|
+
*
|
|
3373
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3374
|
+
* const authClient = await auth.getClient();
|
|
3375
|
+
* google.options({auth: authClient});
|
|
3376
|
+
*
|
|
3377
|
+
* // Do the magic
|
|
3378
|
+
* const res = await translate.projects.locations.datasets.create({
|
|
3379
|
+
* // Required. The project name.
|
|
3380
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
3381
|
+
*
|
|
3382
|
+
* // Request body metadata
|
|
3383
|
+
* requestBody: {
|
|
3384
|
+
* // request body parameters
|
|
3385
|
+
* // {
|
|
3386
|
+
* // "createTime": "my_createTime",
|
|
3387
|
+
* // "displayName": "my_displayName",
|
|
3388
|
+
* // "exampleCount": 0,
|
|
3389
|
+
* // "name": "my_name",
|
|
3390
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
3391
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
3392
|
+
* // "testExampleCount": 0,
|
|
3393
|
+
* // "trainExampleCount": 0,
|
|
3394
|
+
* // "updateTime": "my_updateTime",
|
|
3395
|
+
* // "validateExampleCount": 0
|
|
3396
|
+
* // }
|
|
3397
|
+
* },
|
|
3398
|
+
* });
|
|
3399
|
+
* console.log(res.data);
|
|
3400
|
+
*
|
|
3401
|
+
* // Example response
|
|
3402
|
+
* // {
|
|
3403
|
+
* // "done": false,
|
|
3404
|
+
* // "error": {},
|
|
3405
|
+
* // "metadata": {},
|
|
3406
|
+
* // "name": "my_name",
|
|
3407
|
+
* // "response": {}
|
|
3408
|
+
* // }
|
|
3409
|
+
* }
|
|
3410
|
+
*
|
|
3411
|
+
* main().catch(e => {
|
|
3412
|
+
* console.error(e);
|
|
3413
|
+
* throw e;
|
|
3414
|
+
* });
|
|
3415
|
+
*
|
|
3416
|
+
* ```
|
|
1935
3417
|
*
|
|
1936
3418
|
* @param params - Parameters for request
|
|
1937
3419
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1946,6 +3428,59 @@ export declare namespace translate_v3 {
|
|
|
1946
3428
|
create(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1947
3429
|
/**
|
|
1948
3430
|
* Deletes a dataset and all of its contents.
|
|
3431
|
+
* @example
|
|
3432
|
+
* ```js
|
|
3433
|
+
* // Before running the sample:
|
|
3434
|
+
* // - Enable the API at:
|
|
3435
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3436
|
+
* // - Login into gcloud by running:
|
|
3437
|
+
* // ```sh
|
|
3438
|
+
* // $ gcloud auth application-default login
|
|
3439
|
+
* // ```
|
|
3440
|
+
* // - Install the npm module by running:
|
|
3441
|
+
* // ```sh
|
|
3442
|
+
* // $ npm install googleapis
|
|
3443
|
+
* // ```
|
|
3444
|
+
*
|
|
3445
|
+
* const {google} = require('googleapis');
|
|
3446
|
+
* const translate = google.translate('v3');
|
|
3447
|
+
*
|
|
3448
|
+
* async function main() {
|
|
3449
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3450
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3451
|
+
* scopes: [
|
|
3452
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3453
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3454
|
+
* ],
|
|
3455
|
+
* });
|
|
3456
|
+
*
|
|
3457
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3458
|
+
* const authClient = await auth.getClient();
|
|
3459
|
+
* google.options({auth: authClient});
|
|
3460
|
+
*
|
|
3461
|
+
* // Do the magic
|
|
3462
|
+
* const res = await translate.projects.locations.datasets.delete({
|
|
3463
|
+
* // Required. The name of the dataset to delete.
|
|
3464
|
+
* name: 'projects/my-project/locations/my-location/datasets/my-dataset',
|
|
3465
|
+
* });
|
|
3466
|
+
* console.log(res.data);
|
|
3467
|
+
*
|
|
3468
|
+
* // Example response
|
|
3469
|
+
* // {
|
|
3470
|
+
* // "done": false,
|
|
3471
|
+
* // "error": {},
|
|
3472
|
+
* // "metadata": {},
|
|
3473
|
+
* // "name": "my_name",
|
|
3474
|
+
* // "response": {}
|
|
3475
|
+
* // }
|
|
3476
|
+
* }
|
|
3477
|
+
*
|
|
3478
|
+
* main().catch(e => {
|
|
3479
|
+
* console.error(e);
|
|
3480
|
+
* throw e;
|
|
3481
|
+
* });
|
|
3482
|
+
*
|
|
3483
|
+
* ```
|
|
1949
3484
|
*
|
|
1950
3485
|
* @param params - Parameters for request
|
|
1951
3486
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1960,6 +3495,67 @@ export declare namespace translate_v3 {
|
|
|
1960
3495
|
delete(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1961
3496
|
/**
|
|
1962
3497
|
* Exports dataset's data to the provided output location.
|
|
3498
|
+
* @example
|
|
3499
|
+
* ```js
|
|
3500
|
+
* // Before running the sample:
|
|
3501
|
+
* // - Enable the API at:
|
|
3502
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3503
|
+
* // - Login into gcloud by running:
|
|
3504
|
+
* // ```sh
|
|
3505
|
+
* // $ gcloud auth application-default login
|
|
3506
|
+
* // ```
|
|
3507
|
+
* // - Install the npm module by running:
|
|
3508
|
+
* // ```sh
|
|
3509
|
+
* // $ npm install googleapis
|
|
3510
|
+
* // ```
|
|
3511
|
+
*
|
|
3512
|
+
* const {google} = require('googleapis');
|
|
3513
|
+
* const translate = google.translate('v3');
|
|
3514
|
+
*
|
|
3515
|
+
* async function main() {
|
|
3516
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3517
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3518
|
+
* scopes: [
|
|
3519
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3520
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3521
|
+
* ],
|
|
3522
|
+
* });
|
|
3523
|
+
*
|
|
3524
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3525
|
+
* const authClient = await auth.getClient();
|
|
3526
|
+
* google.options({auth: authClient});
|
|
3527
|
+
*
|
|
3528
|
+
* // Do the magic
|
|
3529
|
+
* const res = await translate.projects.locations.datasets.exportData({
|
|
3530
|
+
* // Required. Name of the dataset. In form of `projects/{project-number-or-id\}/locations/{location-id\}/datasets/{dataset-id\}`
|
|
3531
|
+
* dataset: 'projects/my-project/locations/my-location/datasets/my-dataset',
|
|
3532
|
+
*
|
|
3533
|
+
* // Request body metadata
|
|
3534
|
+
* requestBody: {
|
|
3535
|
+
* // request body parameters
|
|
3536
|
+
* // {
|
|
3537
|
+
* // "outputConfig": {}
|
|
3538
|
+
* // }
|
|
3539
|
+
* },
|
|
3540
|
+
* });
|
|
3541
|
+
* console.log(res.data);
|
|
3542
|
+
*
|
|
3543
|
+
* // Example response
|
|
3544
|
+
* // {
|
|
3545
|
+
* // "done": false,
|
|
3546
|
+
* // "error": {},
|
|
3547
|
+
* // "metadata": {},
|
|
3548
|
+
* // "name": "my_name",
|
|
3549
|
+
* // "response": {}
|
|
3550
|
+
* // }
|
|
3551
|
+
* }
|
|
3552
|
+
*
|
|
3553
|
+
* main().catch(e => {
|
|
3554
|
+
* console.error(e);
|
|
3555
|
+
* throw e;
|
|
3556
|
+
* });
|
|
3557
|
+
*
|
|
3558
|
+
* ```
|
|
1963
3559
|
*
|
|
1964
3560
|
* @param params - Parameters for request
|
|
1965
3561
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1974,6 +3570,64 @@ export declare namespace translate_v3 {
|
|
|
1974
3570
|
exportData(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1975
3571
|
/**
|
|
1976
3572
|
* Gets a Dataset.
|
|
3573
|
+
* @example
|
|
3574
|
+
* ```js
|
|
3575
|
+
* // Before running the sample:
|
|
3576
|
+
* // - Enable the API at:
|
|
3577
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3578
|
+
* // - Login into gcloud by running:
|
|
3579
|
+
* // ```sh
|
|
3580
|
+
* // $ gcloud auth application-default login
|
|
3581
|
+
* // ```
|
|
3582
|
+
* // - Install the npm module by running:
|
|
3583
|
+
* // ```sh
|
|
3584
|
+
* // $ npm install googleapis
|
|
3585
|
+
* // ```
|
|
3586
|
+
*
|
|
3587
|
+
* const {google} = require('googleapis');
|
|
3588
|
+
* const translate = google.translate('v3');
|
|
3589
|
+
*
|
|
3590
|
+
* async function main() {
|
|
3591
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3592
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3593
|
+
* scopes: [
|
|
3594
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3595
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3596
|
+
* ],
|
|
3597
|
+
* });
|
|
3598
|
+
*
|
|
3599
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3600
|
+
* const authClient = await auth.getClient();
|
|
3601
|
+
* google.options({auth: authClient});
|
|
3602
|
+
*
|
|
3603
|
+
* // Do the magic
|
|
3604
|
+
* const res = await translate.projects.locations.datasets.get({
|
|
3605
|
+
* // Required. The resource name of the dataset to retrieve.
|
|
3606
|
+
* name: 'projects/my-project/locations/my-location/datasets/my-dataset',
|
|
3607
|
+
* });
|
|
3608
|
+
* console.log(res.data);
|
|
3609
|
+
*
|
|
3610
|
+
* // Example response
|
|
3611
|
+
* // {
|
|
3612
|
+
* // "createTime": "my_createTime",
|
|
3613
|
+
* // "displayName": "my_displayName",
|
|
3614
|
+
* // "exampleCount": 0,
|
|
3615
|
+
* // "name": "my_name",
|
|
3616
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
3617
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
3618
|
+
* // "testExampleCount": 0,
|
|
3619
|
+
* // "trainExampleCount": 0,
|
|
3620
|
+
* // "updateTime": "my_updateTime",
|
|
3621
|
+
* // "validateExampleCount": 0
|
|
3622
|
+
* // }
|
|
3623
|
+
* }
|
|
3624
|
+
*
|
|
3625
|
+
* main().catch(e => {
|
|
3626
|
+
* console.error(e);
|
|
3627
|
+
* throw e;
|
|
3628
|
+
* });
|
|
3629
|
+
*
|
|
3630
|
+
* ```
|
|
1977
3631
|
*
|
|
1978
3632
|
* @param params - Parameters for request
|
|
1979
3633
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1988,6 +3642,67 @@ export declare namespace translate_v3 {
|
|
|
1988
3642
|
get(callback: BodyResponseCallback<Schema$Dataset>): void;
|
|
1989
3643
|
/**
|
|
1990
3644
|
* Import sentence pairs into translation Dataset.
|
|
3645
|
+
* @example
|
|
3646
|
+
* ```js
|
|
3647
|
+
* // Before running the sample:
|
|
3648
|
+
* // - Enable the API at:
|
|
3649
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3650
|
+
* // - Login into gcloud by running:
|
|
3651
|
+
* // ```sh
|
|
3652
|
+
* // $ gcloud auth application-default login
|
|
3653
|
+
* // ```
|
|
3654
|
+
* // - Install the npm module by running:
|
|
3655
|
+
* // ```sh
|
|
3656
|
+
* // $ npm install googleapis
|
|
3657
|
+
* // ```
|
|
3658
|
+
*
|
|
3659
|
+
* const {google} = require('googleapis');
|
|
3660
|
+
* const translate = google.translate('v3');
|
|
3661
|
+
*
|
|
3662
|
+
* async function main() {
|
|
3663
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3664
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3665
|
+
* scopes: [
|
|
3666
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3667
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3668
|
+
* ],
|
|
3669
|
+
* });
|
|
3670
|
+
*
|
|
3671
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3672
|
+
* const authClient = await auth.getClient();
|
|
3673
|
+
* google.options({auth: authClient});
|
|
3674
|
+
*
|
|
3675
|
+
* // Do the magic
|
|
3676
|
+
* const res = await translate.projects.locations.datasets.importData({
|
|
3677
|
+
* // Required. Name of the dataset. In form of `projects/{project-number-or-id\}/locations/{location-id\}/datasets/{dataset-id\}`
|
|
3678
|
+
* dataset: 'projects/my-project/locations/my-location/datasets/my-dataset',
|
|
3679
|
+
*
|
|
3680
|
+
* // Request body metadata
|
|
3681
|
+
* requestBody: {
|
|
3682
|
+
* // request body parameters
|
|
3683
|
+
* // {
|
|
3684
|
+
* // "inputConfig": {}
|
|
3685
|
+
* // }
|
|
3686
|
+
* },
|
|
3687
|
+
* });
|
|
3688
|
+
* console.log(res.data);
|
|
3689
|
+
*
|
|
3690
|
+
* // Example response
|
|
3691
|
+
* // {
|
|
3692
|
+
* // "done": false,
|
|
3693
|
+
* // "error": {},
|
|
3694
|
+
* // "metadata": {},
|
|
3695
|
+
* // "name": "my_name",
|
|
3696
|
+
* // "response": {}
|
|
3697
|
+
* // }
|
|
3698
|
+
* }
|
|
3699
|
+
*
|
|
3700
|
+
* main().catch(e => {
|
|
3701
|
+
* console.error(e);
|
|
3702
|
+
* throw e;
|
|
3703
|
+
* });
|
|
3704
|
+
*
|
|
3705
|
+
* ```
|
|
1991
3706
|
*
|
|
1992
3707
|
* @param params - Parameters for request
|
|
1993
3708
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2002,6 +3717,60 @@ export declare namespace translate_v3 {
|
|
|
2002
3717
|
importData(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2003
3718
|
/**
|
|
2004
3719
|
* Lists datasets.
|
|
3720
|
+
* @example
|
|
3721
|
+
* ```js
|
|
3722
|
+
* // Before running the sample:
|
|
3723
|
+
* // - Enable the API at:
|
|
3724
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3725
|
+
* // - Login into gcloud by running:
|
|
3726
|
+
* // ```sh
|
|
3727
|
+
* // $ gcloud auth application-default login
|
|
3728
|
+
* // ```
|
|
3729
|
+
* // - Install the npm module by running:
|
|
3730
|
+
* // ```sh
|
|
3731
|
+
* // $ npm install googleapis
|
|
3732
|
+
* // ```
|
|
3733
|
+
*
|
|
3734
|
+
* const {google} = require('googleapis');
|
|
3735
|
+
* const translate = google.translate('v3');
|
|
3736
|
+
*
|
|
3737
|
+
* async function main() {
|
|
3738
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3739
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3740
|
+
* scopes: [
|
|
3741
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3742
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3743
|
+
* ],
|
|
3744
|
+
* });
|
|
3745
|
+
*
|
|
3746
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3747
|
+
* const authClient = await auth.getClient();
|
|
3748
|
+
* google.options({auth: authClient});
|
|
3749
|
+
*
|
|
3750
|
+
* // Do the magic
|
|
3751
|
+
* const res = await translate.projects.locations.datasets.list({
|
|
3752
|
+
* // Optional. Requested page size. The server can return fewer results than requested.
|
|
3753
|
+
* pageSize: 'placeholder-value',
|
|
3754
|
+
* // 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.
|
|
3755
|
+
* pageToken: 'placeholder-value',
|
|
3756
|
+
* // Required. Name of the parent project. In form of `projects/{project-number-or-id\}/locations/{location-id\}`
|
|
3757
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
3758
|
+
* });
|
|
3759
|
+
* console.log(res.data);
|
|
3760
|
+
*
|
|
3761
|
+
* // Example response
|
|
3762
|
+
* // {
|
|
3763
|
+
* // "datasets": [],
|
|
3764
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
3765
|
+
* // }
|
|
3766
|
+
* }
|
|
3767
|
+
*
|
|
3768
|
+
* main().catch(e => {
|
|
3769
|
+
* console.error(e);
|
|
3770
|
+
* throw e;
|
|
3771
|
+
* });
|
|
3772
|
+
*
|
|
3773
|
+
* ```
|
|
2005
3774
|
*
|
|
2006
3775
|
* @param params - Parameters for request
|
|
2007
3776
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2076,6 +3845,62 @@ export declare namespace translate_v3 {
|
|
|
2076
3845
|
constructor(context: APIRequestContext);
|
|
2077
3846
|
/**
|
|
2078
3847
|
* Lists sentence pairs in the dataset.
|
|
3848
|
+
* @example
|
|
3849
|
+
* ```js
|
|
3850
|
+
* // Before running the sample:
|
|
3851
|
+
* // - Enable the API at:
|
|
3852
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3853
|
+
* // - Login into gcloud by running:
|
|
3854
|
+
* // ```sh
|
|
3855
|
+
* // $ gcloud auth application-default login
|
|
3856
|
+
* // ```
|
|
3857
|
+
* // - Install the npm module by running:
|
|
3858
|
+
* // ```sh
|
|
3859
|
+
* // $ npm install googleapis
|
|
3860
|
+
* // ```
|
|
3861
|
+
*
|
|
3862
|
+
* const {google} = require('googleapis');
|
|
3863
|
+
* const translate = google.translate('v3');
|
|
3864
|
+
*
|
|
3865
|
+
* async function main() {
|
|
3866
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3867
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3868
|
+
* scopes: [
|
|
3869
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3870
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3871
|
+
* ],
|
|
3872
|
+
* });
|
|
3873
|
+
*
|
|
3874
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3875
|
+
* const authClient = await auth.getClient();
|
|
3876
|
+
* google.options({auth: authClient});
|
|
3877
|
+
*
|
|
3878
|
+
* // Do the magic
|
|
3879
|
+
* const res = await translate.projects.locations.datasets.examples.list({
|
|
3880
|
+
* // Optional. An expression for filtering the examples that will be returned. Example filter: * `usage=TRAIN`
|
|
3881
|
+
* filter: 'placeholder-value',
|
|
3882
|
+
* // Optional. Requested page size. The server can return fewer results than requested.
|
|
3883
|
+
* pageSize: 'placeholder-value',
|
|
3884
|
+
* // 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.
|
|
3885
|
+
* pageToken: 'placeholder-value',
|
|
3886
|
+
* // Required. Name of the parent dataset. In form of `projects/{project-number-or-id\}/locations/{location-id\}/datasets/{dataset-id\}`
|
|
3887
|
+
* parent: 'projects/my-project/locations/my-location/datasets/my-dataset',
|
|
3888
|
+
* });
|
|
3889
|
+
* console.log(res.data);
|
|
3890
|
+
*
|
|
3891
|
+
* // Example response
|
|
3892
|
+
* // {
|
|
3893
|
+
* // "examples": [],
|
|
3894
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
3895
|
+
* // }
|
|
3896
|
+
* }
|
|
3897
|
+
*
|
|
3898
|
+
* main().catch(e => {
|
|
3899
|
+
* console.error(e);
|
|
3900
|
+
* throw e;
|
|
3901
|
+
* });
|
|
3902
|
+
*
|
|
3903
|
+
* ```
|
|
2079
3904
|
*
|
|
2080
3905
|
* @param params - Parameters for request
|
|
2081
3906
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2113,6 +3938,74 @@ export declare namespace translate_v3 {
|
|
|
2113
3938
|
constructor(context: APIRequestContext);
|
|
2114
3939
|
/**
|
|
2115
3940
|
* Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
|
|
3941
|
+
* @example
|
|
3942
|
+
* ```js
|
|
3943
|
+
* // Before running the sample:
|
|
3944
|
+
* // - Enable the API at:
|
|
3945
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3946
|
+
* // - Login into gcloud by running:
|
|
3947
|
+
* // ```sh
|
|
3948
|
+
* // $ gcloud auth application-default login
|
|
3949
|
+
* // ```
|
|
3950
|
+
* // - Install the npm module by running:
|
|
3951
|
+
* // ```sh
|
|
3952
|
+
* // $ npm install googleapis
|
|
3953
|
+
* // ```
|
|
3954
|
+
*
|
|
3955
|
+
* const {google} = require('googleapis');
|
|
3956
|
+
* const translate = google.translate('v3');
|
|
3957
|
+
*
|
|
3958
|
+
* async function main() {
|
|
3959
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3960
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3961
|
+
* scopes: [
|
|
3962
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3963
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3964
|
+
* ],
|
|
3965
|
+
* });
|
|
3966
|
+
*
|
|
3967
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3968
|
+
* const authClient = await auth.getClient();
|
|
3969
|
+
* google.options({auth: authClient});
|
|
3970
|
+
*
|
|
3971
|
+
* // Do the magic
|
|
3972
|
+
* const res = await translate.projects.locations.glossaries.create({
|
|
3973
|
+
* // Required. The project name.
|
|
3974
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
3975
|
+
*
|
|
3976
|
+
* // Request body metadata
|
|
3977
|
+
* requestBody: {
|
|
3978
|
+
* // request body parameters
|
|
3979
|
+
* // {
|
|
3980
|
+
* // "displayName": "my_displayName",
|
|
3981
|
+
* // "endTime": "my_endTime",
|
|
3982
|
+
* // "entryCount": 0,
|
|
3983
|
+
* // "inputConfig": {},
|
|
3984
|
+
* // "languageCodesSet": {},
|
|
3985
|
+
* // "languagePair": {},
|
|
3986
|
+
* // "name": "my_name",
|
|
3987
|
+
* // "submitTime": "my_submitTime"
|
|
3988
|
+
* // }
|
|
3989
|
+
* },
|
|
3990
|
+
* });
|
|
3991
|
+
* console.log(res.data);
|
|
3992
|
+
*
|
|
3993
|
+
* // Example response
|
|
3994
|
+
* // {
|
|
3995
|
+
* // "done": false,
|
|
3996
|
+
* // "error": {},
|
|
3997
|
+
* // "metadata": {},
|
|
3998
|
+
* // "name": "my_name",
|
|
3999
|
+
* // "response": {}
|
|
4000
|
+
* // }
|
|
4001
|
+
* }
|
|
4002
|
+
*
|
|
4003
|
+
* main().catch(e => {
|
|
4004
|
+
* console.error(e);
|
|
4005
|
+
* throw e;
|
|
4006
|
+
* });
|
|
4007
|
+
*
|
|
4008
|
+
* ```
|
|
2116
4009
|
*
|
|
2117
4010
|
* @param params - Parameters for request
|
|
2118
4011
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2127,6 +4020,59 @@ export declare namespace translate_v3 {
|
|
|
2127
4020
|
create(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2128
4021
|
/**
|
|
2129
4022
|
* Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
|
|
4023
|
+
* @example
|
|
4024
|
+
* ```js
|
|
4025
|
+
* // Before running the sample:
|
|
4026
|
+
* // - Enable the API at:
|
|
4027
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4028
|
+
* // - Login into gcloud by running:
|
|
4029
|
+
* // ```sh
|
|
4030
|
+
* // $ gcloud auth application-default login
|
|
4031
|
+
* // ```
|
|
4032
|
+
* // - Install the npm module by running:
|
|
4033
|
+
* // ```sh
|
|
4034
|
+
* // $ npm install googleapis
|
|
4035
|
+
* // ```
|
|
4036
|
+
*
|
|
4037
|
+
* const {google} = require('googleapis');
|
|
4038
|
+
* const translate = google.translate('v3');
|
|
4039
|
+
*
|
|
4040
|
+
* async function main() {
|
|
4041
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4042
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4043
|
+
* scopes: [
|
|
4044
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4045
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4046
|
+
* ],
|
|
4047
|
+
* });
|
|
4048
|
+
*
|
|
4049
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4050
|
+
* const authClient = await auth.getClient();
|
|
4051
|
+
* google.options({auth: authClient});
|
|
4052
|
+
*
|
|
4053
|
+
* // Do the magic
|
|
4054
|
+
* const res = await translate.projects.locations.glossaries.delete({
|
|
4055
|
+
* // Required. The name of the glossary to delete.
|
|
4056
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
4057
|
+
* });
|
|
4058
|
+
* console.log(res.data);
|
|
4059
|
+
*
|
|
4060
|
+
* // Example response
|
|
4061
|
+
* // {
|
|
4062
|
+
* // "done": false,
|
|
4063
|
+
* // "error": {},
|
|
4064
|
+
* // "metadata": {},
|
|
4065
|
+
* // "name": "my_name",
|
|
4066
|
+
* // "response": {}
|
|
4067
|
+
* // }
|
|
4068
|
+
* }
|
|
4069
|
+
*
|
|
4070
|
+
* main().catch(e => {
|
|
4071
|
+
* console.error(e);
|
|
4072
|
+
* throw e;
|
|
4073
|
+
* });
|
|
4074
|
+
*
|
|
4075
|
+
* ```
|
|
2130
4076
|
*
|
|
2131
4077
|
* @param params - Parameters for request
|
|
2132
4078
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2141,6 +4087,62 @@ export declare namespace translate_v3 {
|
|
|
2141
4087
|
delete(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2142
4088
|
/**
|
|
2143
4089
|
* Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
|
|
4090
|
+
* @example
|
|
4091
|
+
* ```js
|
|
4092
|
+
* // Before running the sample:
|
|
4093
|
+
* // - Enable the API at:
|
|
4094
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4095
|
+
* // - Login into gcloud by running:
|
|
4096
|
+
* // ```sh
|
|
4097
|
+
* // $ gcloud auth application-default login
|
|
4098
|
+
* // ```
|
|
4099
|
+
* // - Install the npm module by running:
|
|
4100
|
+
* // ```sh
|
|
4101
|
+
* // $ npm install googleapis
|
|
4102
|
+
* // ```
|
|
4103
|
+
*
|
|
4104
|
+
* const {google} = require('googleapis');
|
|
4105
|
+
* const translate = google.translate('v3');
|
|
4106
|
+
*
|
|
4107
|
+
* async function main() {
|
|
4108
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4109
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4110
|
+
* scopes: [
|
|
4111
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4112
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4113
|
+
* ],
|
|
4114
|
+
* });
|
|
4115
|
+
*
|
|
4116
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4117
|
+
* const authClient = await auth.getClient();
|
|
4118
|
+
* google.options({auth: authClient});
|
|
4119
|
+
*
|
|
4120
|
+
* // Do the magic
|
|
4121
|
+
* const res = await translate.projects.locations.glossaries.get({
|
|
4122
|
+
* // Required. The name of the glossary to retrieve.
|
|
4123
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
4124
|
+
* });
|
|
4125
|
+
* console.log(res.data);
|
|
4126
|
+
*
|
|
4127
|
+
* // Example response
|
|
4128
|
+
* // {
|
|
4129
|
+
* // "displayName": "my_displayName",
|
|
4130
|
+
* // "endTime": "my_endTime",
|
|
4131
|
+
* // "entryCount": 0,
|
|
4132
|
+
* // "inputConfig": {},
|
|
4133
|
+
* // "languageCodesSet": {},
|
|
4134
|
+
* // "languagePair": {},
|
|
4135
|
+
* // "name": "my_name",
|
|
4136
|
+
* // "submitTime": "my_submitTime"
|
|
4137
|
+
* // }
|
|
4138
|
+
* }
|
|
4139
|
+
*
|
|
4140
|
+
* main().catch(e => {
|
|
4141
|
+
* console.error(e);
|
|
4142
|
+
* throw e;
|
|
4143
|
+
* });
|
|
4144
|
+
*
|
|
4145
|
+
* ```
|
|
2144
4146
|
*
|
|
2145
4147
|
* @param params - Parameters for request
|
|
2146
4148
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2155,6 +4157,62 @@ export declare namespace translate_v3 {
|
|
|
2155
4157
|
get(callback: BodyResponseCallback<Schema$Glossary>): void;
|
|
2156
4158
|
/**
|
|
2157
4159
|
* Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
|
|
4160
|
+
* @example
|
|
4161
|
+
* ```js
|
|
4162
|
+
* // Before running the sample:
|
|
4163
|
+
* // - Enable the API at:
|
|
4164
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4165
|
+
* // - Login into gcloud by running:
|
|
4166
|
+
* // ```sh
|
|
4167
|
+
* // $ gcloud auth application-default login
|
|
4168
|
+
* // ```
|
|
4169
|
+
* // - Install the npm module by running:
|
|
4170
|
+
* // ```sh
|
|
4171
|
+
* // $ npm install googleapis
|
|
4172
|
+
* // ```
|
|
4173
|
+
*
|
|
4174
|
+
* const {google} = require('googleapis');
|
|
4175
|
+
* const translate = google.translate('v3');
|
|
4176
|
+
*
|
|
4177
|
+
* async function main() {
|
|
4178
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4179
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4180
|
+
* scopes: [
|
|
4181
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4182
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4183
|
+
* ],
|
|
4184
|
+
* });
|
|
4185
|
+
*
|
|
4186
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4187
|
+
* const authClient = await auth.getClient();
|
|
4188
|
+
* google.options({auth: authClient});
|
|
4189
|
+
*
|
|
4190
|
+
* // Do the magic
|
|
4191
|
+
* const res = await translate.projects.locations.glossaries.list({
|
|
4192
|
+
* // 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.
|
|
4193
|
+
* filter: 'placeholder-value',
|
|
4194
|
+
* // Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.
|
|
4195
|
+
* pageSize: 'placeholder-value',
|
|
4196
|
+
* // 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.
|
|
4197
|
+
* pageToken: 'placeholder-value',
|
|
4198
|
+
* // Required. The name of the project from which to list all of the glossaries.
|
|
4199
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
4200
|
+
* });
|
|
4201
|
+
* console.log(res.data);
|
|
4202
|
+
*
|
|
4203
|
+
* // Example response
|
|
4204
|
+
* // {
|
|
4205
|
+
* // "glossaries": [],
|
|
4206
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
4207
|
+
* // }
|
|
4208
|
+
* }
|
|
4209
|
+
*
|
|
4210
|
+
* main().catch(e => {
|
|
4211
|
+
* console.error(e);
|
|
4212
|
+
* throw e;
|
|
4213
|
+
* });
|
|
4214
|
+
*
|
|
4215
|
+
* ```
|
|
2158
4216
|
*
|
|
2159
4217
|
* @param params - Parameters for request
|
|
2160
4218
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2169,6 +4227,76 @@ export declare namespace translate_v3 {
|
|
|
2169
4227
|
list(callback: BodyResponseCallback<Schema$ListGlossariesResponse>): void;
|
|
2170
4228
|
/**
|
|
2171
4229
|
* Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.
|
|
4230
|
+
* @example
|
|
4231
|
+
* ```js
|
|
4232
|
+
* // Before running the sample:
|
|
4233
|
+
* // - Enable the API at:
|
|
4234
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4235
|
+
* // - Login into gcloud by running:
|
|
4236
|
+
* // ```sh
|
|
4237
|
+
* // $ gcloud auth application-default login
|
|
4238
|
+
* // ```
|
|
4239
|
+
* // - Install the npm module by running:
|
|
4240
|
+
* // ```sh
|
|
4241
|
+
* // $ npm install googleapis
|
|
4242
|
+
* // ```
|
|
4243
|
+
*
|
|
4244
|
+
* const {google} = require('googleapis');
|
|
4245
|
+
* const translate = google.translate('v3');
|
|
4246
|
+
*
|
|
4247
|
+
* async function main() {
|
|
4248
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4249
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4250
|
+
* scopes: [
|
|
4251
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4252
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4253
|
+
* ],
|
|
4254
|
+
* });
|
|
4255
|
+
*
|
|
4256
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4257
|
+
* const authClient = await auth.getClient();
|
|
4258
|
+
* google.options({auth: authClient});
|
|
4259
|
+
*
|
|
4260
|
+
* // Do the magic
|
|
4261
|
+
* const res = await translate.projects.locations.glossaries.patch({
|
|
4262
|
+
* // Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id\}/locations/{location-id\}/glossaries/{glossary-id\}`.
|
|
4263
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
4264
|
+
* // The list of fields to be updated. Currently only `display_name` and 'input_config'
|
|
4265
|
+
* updateMask: 'placeholder-value',
|
|
4266
|
+
*
|
|
4267
|
+
* // Request body metadata
|
|
4268
|
+
* requestBody: {
|
|
4269
|
+
* // request body parameters
|
|
4270
|
+
* // {
|
|
4271
|
+
* // "displayName": "my_displayName",
|
|
4272
|
+
* // "endTime": "my_endTime",
|
|
4273
|
+
* // "entryCount": 0,
|
|
4274
|
+
* // "inputConfig": {},
|
|
4275
|
+
* // "languageCodesSet": {},
|
|
4276
|
+
* // "languagePair": {},
|
|
4277
|
+
* // "name": "my_name",
|
|
4278
|
+
* // "submitTime": "my_submitTime"
|
|
4279
|
+
* // }
|
|
4280
|
+
* },
|
|
4281
|
+
* });
|
|
4282
|
+
* console.log(res.data);
|
|
4283
|
+
*
|
|
4284
|
+
* // Example response
|
|
4285
|
+
* // {
|
|
4286
|
+
* // "done": false,
|
|
4287
|
+
* // "error": {},
|
|
4288
|
+
* // "metadata": {},
|
|
4289
|
+
* // "name": "my_name",
|
|
4290
|
+
* // "response": {}
|
|
4291
|
+
* // }
|
|
4292
|
+
* }
|
|
4293
|
+
*
|
|
4294
|
+
* main().catch(e => {
|
|
4295
|
+
* console.error(e);
|
|
4296
|
+
* throw e;
|
|
4297
|
+
* });
|
|
4298
|
+
*
|
|
4299
|
+
* ```
|
|
2172
4300
|
*
|
|
2173
4301
|
* @param params - Parameters for request
|
|
2174
4302
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2241,6 +4369,71 @@ export declare namespace translate_v3 {
|
|
|
2241
4369
|
constructor(context: APIRequestContext);
|
|
2242
4370
|
/**
|
|
2243
4371
|
* Creates a glossary entry.
|
|
4372
|
+
* @example
|
|
4373
|
+
* ```js
|
|
4374
|
+
* // Before running the sample:
|
|
4375
|
+
* // - Enable the API at:
|
|
4376
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4377
|
+
* // - Login into gcloud by running:
|
|
4378
|
+
* // ```sh
|
|
4379
|
+
* // $ gcloud auth application-default login
|
|
4380
|
+
* // ```
|
|
4381
|
+
* // - Install the npm module by running:
|
|
4382
|
+
* // ```sh
|
|
4383
|
+
* // $ npm install googleapis
|
|
4384
|
+
* // ```
|
|
4385
|
+
*
|
|
4386
|
+
* const {google} = require('googleapis');
|
|
4387
|
+
* const translate = google.translate('v3');
|
|
4388
|
+
*
|
|
4389
|
+
* async function main() {
|
|
4390
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4391
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4392
|
+
* scopes: [
|
|
4393
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4394
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4395
|
+
* ],
|
|
4396
|
+
* });
|
|
4397
|
+
*
|
|
4398
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4399
|
+
* const authClient = await auth.getClient();
|
|
4400
|
+
* google.options({auth: authClient});
|
|
4401
|
+
*
|
|
4402
|
+
* // Do the magic
|
|
4403
|
+
* const res =
|
|
4404
|
+
* await translate.projects.locations.glossaries.glossaryEntries.create({
|
|
4405
|
+
* // Required. The resource name of the glossary to create the entry under.
|
|
4406
|
+
* parent:
|
|
4407
|
+
* 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
4408
|
+
*
|
|
4409
|
+
* // Request body metadata
|
|
4410
|
+
* requestBody: {
|
|
4411
|
+
* // request body parameters
|
|
4412
|
+
* // {
|
|
4413
|
+
* // "description": "my_description",
|
|
4414
|
+
* // "name": "my_name",
|
|
4415
|
+
* // "termsPair": {},
|
|
4416
|
+
* // "termsSet": {}
|
|
4417
|
+
* // }
|
|
4418
|
+
* },
|
|
4419
|
+
* });
|
|
4420
|
+
* console.log(res.data);
|
|
4421
|
+
*
|
|
4422
|
+
* // Example response
|
|
4423
|
+
* // {
|
|
4424
|
+
* // "description": "my_description",
|
|
4425
|
+
* // "name": "my_name",
|
|
4426
|
+
* // "termsPair": {},
|
|
4427
|
+
* // "termsSet": {}
|
|
4428
|
+
* // }
|
|
4429
|
+
* }
|
|
4430
|
+
*
|
|
4431
|
+
* main().catch(e => {
|
|
4432
|
+
* console.error(e);
|
|
4433
|
+
* throw e;
|
|
4434
|
+
* });
|
|
4435
|
+
*
|
|
4436
|
+
* ```
|
|
2244
4437
|
*
|
|
2245
4438
|
* @param params - Parameters for request
|
|
2246
4439
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2255,6 +4448,54 @@ export declare namespace translate_v3 {
|
|
|
2255
4448
|
create(callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
2256
4449
|
/**
|
|
2257
4450
|
* Deletes a single entry from the glossary
|
|
4451
|
+
* @example
|
|
4452
|
+
* ```js
|
|
4453
|
+
* // Before running the sample:
|
|
4454
|
+
* // - Enable the API at:
|
|
4455
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4456
|
+
* // - Login into gcloud by running:
|
|
4457
|
+
* // ```sh
|
|
4458
|
+
* // $ gcloud auth application-default login
|
|
4459
|
+
* // ```
|
|
4460
|
+
* // - Install the npm module by running:
|
|
4461
|
+
* // ```sh
|
|
4462
|
+
* // $ npm install googleapis
|
|
4463
|
+
* // ```
|
|
4464
|
+
*
|
|
4465
|
+
* const {google} = require('googleapis');
|
|
4466
|
+
* const translate = google.translate('v3');
|
|
4467
|
+
*
|
|
4468
|
+
* async function main() {
|
|
4469
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4470
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4471
|
+
* scopes: [
|
|
4472
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4473
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4474
|
+
* ],
|
|
4475
|
+
* });
|
|
4476
|
+
*
|
|
4477
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4478
|
+
* const authClient = await auth.getClient();
|
|
4479
|
+
* google.options({auth: authClient});
|
|
4480
|
+
*
|
|
4481
|
+
* // Do the magic
|
|
4482
|
+
* const res =
|
|
4483
|
+
* await translate.projects.locations.glossaries.glossaryEntries.delete({
|
|
4484
|
+
* // Required. The resource name of the glossary entry to delete
|
|
4485
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie/glossaryEntries/my-glossaryEntrie',
|
|
4486
|
+
* });
|
|
4487
|
+
* console.log(res.data);
|
|
4488
|
+
*
|
|
4489
|
+
* // Example response
|
|
4490
|
+
* // {}
|
|
4491
|
+
* }
|
|
4492
|
+
*
|
|
4493
|
+
* main().catch(e => {
|
|
4494
|
+
* console.error(e);
|
|
4495
|
+
* throw e;
|
|
4496
|
+
* });
|
|
4497
|
+
*
|
|
4498
|
+
* ```
|
|
2258
4499
|
*
|
|
2259
4500
|
* @param params - Parameters for request
|
|
2260
4501
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2269,6 +4510,60 @@ export declare namespace translate_v3 {
|
|
|
2269
4510
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
2270
4511
|
/**
|
|
2271
4512
|
* Gets a single glossary entry by the given id.
|
|
4513
|
+
* @example
|
|
4514
|
+
* ```js
|
|
4515
|
+
* // Before running the sample:
|
|
4516
|
+
* // - Enable the API at:
|
|
4517
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4518
|
+
* // - Login into gcloud by running:
|
|
4519
|
+
* // ```sh
|
|
4520
|
+
* // $ gcloud auth application-default login
|
|
4521
|
+
* // ```
|
|
4522
|
+
* // - Install the npm module by running:
|
|
4523
|
+
* // ```sh
|
|
4524
|
+
* // $ npm install googleapis
|
|
4525
|
+
* // ```
|
|
4526
|
+
*
|
|
4527
|
+
* const {google} = require('googleapis');
|
|
4528
|
+
* const translate = google.translate('v3');
|
|
4529
|
+
*
|
|
4530
|
+
* async function main() {
|
|
4531
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4532
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4533
|
+
* scopes: [
|
|
4534
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4535
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4536
|
+
* ],
|
|
4537
|
+
* });
|
|
4538
|
+
*
|
|
4539
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4540
|
+
* const authClient = await auth.getClient();
|
|
4541
|
+
* google.options({auth: authClient});
|
|
4542
|
+
*
|
|
4543
|
+
* // Do the magic
|
|
4544
|
+
* const res = await translate.projects.locations.glossaries.glossaryEntries.get(
|
|
4545
|
+
* {
|
|
4546
|
+
* // Required. The resource name of the glossary entry to get
|
|
4547
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie/glossaryEntries/my-glossaryEntrie',
|
|
4548
|
+
* },
|
|
4549
|
+
* );
|
|
4550
|
+
* console.log(res.data);
|
|
4551
|
+
*
|
|
4552
|
+
* // Example response
|
|
4553
|
+
* // {
|
|
4554
|
+
* // "description": "my_description",
|
|
4555
|
+
* // "name": "my_name",
|
|
4556
|
+
* // "termsPair": {},
|
|
4557
|
+
* // "termsSet": {}
|
|
4558
|
+
* // }
|
|
4559
|
+
* }
|
|
4560
|
+
*
|
|
4561
|
+
* main().catch(e => {
|
|
4562
|
+
* console.error(e);
|
|
4563
|
+
* throw e;
|
|
4564
|
+
* });
|
|
4565
|
+
*
|
|
4566
|
+
* ```
|
|
2272
4567
|
*
|
|
2273
4568
|
* @param params - Parameters for request
|
|
2274
4569
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2283,6 +4578,62 @@ export declare namespace translate_v3 {
|
|
|
2283
4578
|
get(callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
2284
4579
|
/**
|
|
2285
4580
|
* List the entries for the glossary.
|
|
4581
|
+
* @example
|
|
4582
|
+
* ```js
|
|
4583
|
+
* // Before running the sample:
|
|
4584
|
+
* // - Enable the API at:
|
|
4585
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4586
|
+
* // - Login into gcloud by running:
|
|
4587
|
+
* // ```sh
|
|
4588
|
+
* // $ gcloud auth application-default login
|
|
4589
|
+
* // ```
|
|
4590
|
+
* // - Install the npm module by running:
|
|
4591
|
+
* // ```sh
|
|
4592
|
+
* // $ npm install googleapis
|
|
4593
|
+
* // ```
|
|
4594
|
+
*
|
|
4595
|
+
* const {google} = require('googleapis');
|
|
4596
|
+
* const translate = google.translate('v3');
|
|
4597
|
+
*
|
|
4598
|
+
* async function main() {
|
|
4599
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4600
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4601
|
+
* scopes: [
|
|
4602
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4603
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4604
|
+
* ],
|
|
4605
|
+
* });
|
|
4606
|
+
*
|
|
4607
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4608
|
+
* const authClient = await auth.getClient();
|
|
4609
|
+
* google.options({auth: authClient});
|
|
4610
|
+
*
|
|
4611
|
+
* // Do the magic
|
|
4612
|
+
* const res =
|
|
4613
|
+
* await translate.projects.locations.glossaries.glossaryEntries.list({
|
|
4614
|
+
* // Optional. Requested page size. The server may return fewer glossary entries than requested. If unspecified, the server picks an appropriate default.
|
|
4615
|
+
* pageSize: 'placeholder-value',
|
|
4616
|
+
* // 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.
|
|
4617
|
+
* pageToken: 'placeholder-value',
|
|
4618
|
+
* // Required. The parent glossary resource name for listing the glossary's entries.
|
|
4619
|
+
* parent:
|
|
4620
|
+
* 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
4621
|
+
* });
|
|
4622
|
+
* console.log(res.data);
|
|
4623
|
+
*
|
|
4624
|
+
* // Example response
|
|
4625
|
+
* // {
|
|
4626
|
+
* // "glossaryEntries": [],
|
|
4627
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
4628
|
+
* // }
|
|
4629
|
+
* }
|
|
4630
|
+
*
|
|
4631
|
+
* main().catch(e => {
|
|
4632
|
+
* console.error(e);
|
|
4633
|
+
* throw e;
|
|
4634
|
+
* });
|
|
4635
|
+
*
|
|
4636
|
+
* ```
|
|
2286
4637
|
*
|
|
2287
4638
|
* @param params - Parameters for request
|
|
2288
4639
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2297,6 +4648,70 @@ export declare namespace translate_v3 {
|
|
|
2297
4648
|
list(callback: BodyResponseCallback<Schema$ListGlossaryEntriesResponse>): void;
|
|
2298
4649
|
/**
|
|
2299
4650
|
* Updates a glossary entry.
|
|
4651
|
+
* @example
|
|
4652
|
+
* ```js
|
|
4653
|
+
* // Before running the sample:
|
|
4654
|
+
* // - Enable the API at:
|
|
4655
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4656
|
+
* // - Login into gcloud by running:
|
|
4657
|
+
* // ```sh
|
|
4658
|
+
* // $ gcloud auth application-default login
|
|
4659
|
+
* // ```
|
|
4660
|
+
* // - Install the npm module by running:
|
|
4661
|
+
* // ```sh
|
|
4662
|
+
* // $ npm install googleapis
|
|
4663
|
+
* // ```
|
|
4664
|
+
*
|
|
4665
|
+
* const {google} = require('googleapis');
|
|
4666
|
+
* const translate = google.translate('v3');
|
|
4667
|
+
*
|
|
4668
|
+
* async function main() {
|
|
4669
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4670
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4671
|
+
* scopes: [
|
|
4672
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4673
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4674
|
+
* ],
|
|
4675
|
+
* });
|
|
4676
|
+
*
|
|
4677
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4678
|
+
* const authClient = await auth.getClient();
|
|
4679
|
+
* google.options({auth: authClient});
|
|
4680
|
+
*
|
|
4681
|
+
* // Do the magic
|
|
4682
|
+
* const res =
|
|
4683
|
+
* await translate.projects.locations.glossaries.glossaryEntries.patch({
|
|
4684
|
+
* // Identifier. The resource name of the entry. Format: `projects/x/locations/x/glossaries/x/glossaryEntries/x`
|
|
4685
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie/glossaryEntries/my-glossaryEntrie',
|
|
4686
|
+
*
|
|
4687
|
+
* // Request body metadata
|
|
4688
|
+
* requestBody: {
|
|
4689
|
+
* // request body parameters
|
|
4690
|
+
* // {
|
|
4691
|
+
* // "description": "my_description",
|
|
4692
|
+
* // "name": "my_name",
|
|
4693
|
+
* // "termsPair": {},
|
|
4694
|
+
* // "termsSet": {}
|
|
4695
|
+
* // }
|
|
4696
|
+
* },
|
|
4697
|
+
* });
|
|
4698
|
+
* console.log(res.data);
|
|
4699
|
+
*
|
|
4700
|
+
* // Example response
|
|
4701
|
+
* // {
|
|
4702
|
+
* // "description": "my_description",
|
|
4703
|
+
* // "name": "my_name",
|
|
4704
|
+
* // "termsPair": {},
|
|
4705
|
+
* // "termsSet": {}
|
|
4706
|
+
* // }
|
|
4707
|
+
* }
|
|
4708
|
+
*
|
|
4709
|
+
* main().catch(e => {
|
|
4710
|
+
* console.error(e);
|
|
4711
|
+
* throw e;
|
|
4712
|
+
* });
|
|
4713
|
+
*
|
|
4714
|
+
* ```
|
|
2300
4715
|
*
|
|
2301
4716
|
* @param params - Parameters for request
|
|
2302
4717
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2361,6 +4776,76 @@ export declare namespace translate_v3 {
|
|
|
2361
4776
|
constructor(context: APIRequestContext);
|
|
2362
4777
|
/**
|
|
2363
4778
|
* Creates a Model.
|
|
4779
|
+
* @example
|
|
4780
|
+
* ```js
|
|
4781
|
+
* // Before running the sample:
|
|
4782
|
+
* // - Enable the API at:
|
|
4783
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4784
|
+
* // - Login into gcloud by running:
|
|
4785
|
+
* // ```sh
|
|
4786
|
+
* // $ gcloud auth application-default login
|
|
4787
|
+
* // ```
|
|
4788
|
+
* // - Install the npm module by running:
|
|
4789
|
+
* // ```sh
|
|
4790
|
+
* // $ npm install googleapis
|
|
4791
|
+
* // ```
|
|
4792
|
+
*
|
|
4793
|
+
* const {google} = require('googleapis');
|
|
4794
|
+
* const translate = google.translate('v3');
|
|
4795
|
+
*
|
|
4796
|
+
* async function main() {
|
|
4797
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4798
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4799
|
+
* scopes: [
|
|
4800
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4801
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4802
|
+
* ],
|
|
4803
|
+
* });
|
|
4804
|
+
*
|
|
4805
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4806
|
+
* const authClient = await auth.getClient();
|
|
4807
|
+
* google.options({auth: authClient});
|
|
4808
|
+
*
|
|
4809
|
+
* // Do the magic
|
|
4810
|
+
* const res = await translate.projects.locations.models.create({
|
|
4811
|
+
* // Required. The project name, in form of `projects/{project\}/locations/{location\}`
|
|
4812
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
4813
|
+
*
|
|
4814
|
+
* // Request body metadata
|
|
4815
|
+
* requestBody: {
|
|
4816
|
+
* // request body parameters
|
|
4817
|
+
* // {
|
|
4818
|
+
* // "createTime": "my_createTime",
|
|
4819
|
+
* // "dataset": "my_dataset",
|
|
4820
|
+
* // "displayName": "my_displayName",
|
|
4821
|
+
* // "name": "my_name",
|
|
4822
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
4823
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
4824
|
+
* // "testExampleCount": 0,
|
|
4825
|
+
* // "trainExampleCount": 0,
|
|
4826
|
+
* // "updateTime": "my_updateTime",
|
|
4827
|
+
* // "validateExampleCount": 0
|
|
4828
|
+
* // }
|
|
4829
|
+
* },
|
|
4830
|
+
* });
|
|
4831
|
+
* console.log(res.data);
|
|
4832
|
+
*
|
|
4833
|
+
* // Example response
|
|
4834
|
+
* // {
|
|
4835
|
+
* // "done": false,
|
|
4836
|
+
* // "error": {},
|
|
4837
|
+
* // "metadata": {},
|
|
4838
|
+
* // "name": "my_name",
|
|
4839
|
+
* // "response": {}
|
|
4840
|
+
* // }
|
|
4841
|
+
* }
|
|
4842
|
+
*
|
|
4843
|
+
* main().catch(e => {
|
|
4844
|
+
* console.error(e);
|
|
4845
|
+
* throw e;
|
|
4846
|
+
* });
|
|
4847
|
+
*
|
|
4848
|
+
* ```
|
|
2364
4849
|
*
|
|
2365
4850
|
* @param params - Parameters for request
|
|
2366
4851
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2375,6 +4860,59 @@ export declare namespace translate_v3 {
|
|
|
2375
4860
|
create(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2376
4861
|
/**
|
|
2377
4862
|
* Deletes a model.
|
|
4863
|
+
* @example
|
|
4864
|
+
* ```js
|
|
4865
|
+
* // Before running the sample:
|
|
4866
|
+
* // - Enable the API at:
|
|
4867
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4868
|
+
* // - Login into gcloud by running:
|
|
4869
|
+
* // ```sh
|
|
4870
|
+
* // $ gcloud auth application-default login
|
|
4871
|
+
* // ```
|
|
4872
|
+
* // - Install the npm module by running:
|
|
4873
|
+
* // ```sh
|
|
4874
|
+
* // $ npm install googleapis
|
|
4875
|
+
* // ```
|
|
4876
|
+
*
|
|
4877
|
+
* const {google} = require('googleapis');
|
|
4878
|
+
* const translate = google.translate('v3');
|
|
4879
|
+
*
|
|
4880
|
+
* async function main() {
|
|
4881
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4882
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4883
|
+
* scopes: [
|
|
4884
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4885
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4886
|
+
* ],
|
|
4887
|
+
* });
|
|
4888
|
+
*
|
|
4889
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4890
|
+
* const authClient = await auth.getClient();
|
|
4891
|
+
* google.options({auth: authClient});
|
|
4892
|
+
*
|
|
4893
|
+
* // Do the magic
|
|
4894
|
+
* const res = await translate.projects.locations.models.delete({
|
|
4895
|
+
* // Required. The name of the model to delete.
|
|
4896
|
+
* name: 'projects/my-project/locations/my-location/models/my-model',
|
|
4897
|
+
* });
|
|
4898
|
+
* console.log(res.data);
|
|
4899
|
+
*
|
|
4900
|
+
* // Example response
|
|
4901
|
+
* // {
|
|
4902
|
+
* // "done": false,
|
|
4903
|
+
* // "error": {},
|
|
4904
|
+
* // "metadata": {},
|
|
4905
|
+
* // "name": "my_name",
|
|
4906
|
+
* // "response": {}
|
|
4907
|
+
* // }
|
|
4908
|
+
* }
|
|
4909
|
+
*
|
|
4910
|
+
* main().catch(e => {
|
|
4911
|
+
* console.error(e);
|
|
4912
|
+
* throw e;
|
|
4913
|
+
* });
|
|
4914
|
+
*
|
|
4915
|
+
* ```
|
|
2378
4916
|
*
|
|
2379
4917
|
* @param params - Parameters for request
|
|
2380
4918
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2389,6 +4927,64 @@ export declare namespace translate_v3 {
|
|
|
2389
4927
|
delete(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2390
4928
|
/**
|
|
2391
4929
|
* Gets a model.
|
|
4930
|
+
* @example
|
|
4931
|
+
* ```js
|
|
4932
|
+
* // Before running the sample:
|
|
4933
|
+
* // - Enable the API at:
|
|
4934
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
4935
|
+
* // - Login into gcloud by running:
|
|
4936
|
+
* // ```sh
|
|
4937
|
+
* // $ gcloud auth application-default login
|
|
4938
|
+
* // ```
|
|
4939
|
+
* // - Install the npm module by running:
|
|
4940
|
+
* // ```sh
|
|
4941
|
+
* // $ npm install googleapis
|
|
4942
|
+
* // ```
|
|
4943
|
+
*
|
|
4944
|
+
* const {google} = require('googleapis');
|
|
4945
|
+
* const translate = google.translate('v3');
|
|
4946
|
+
*
|
|
4947
|
+
* async function main() {
|
|
4948
|
+
* const auth = new google.auth.GoogleAuth({
|
|
4949
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
4950
|
+
* scopes: [
|
|
4951
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
4952
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
4953
|
+
* ],
|
|
4954
|
+
* });
|
|
4955
|
+
*
|
|
4956
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
4957
|
+
* const authClient = await auth.getClient();
|
|
4958
|
+
* google.options({auth: authClient});
|
|
4959
|
+
*
|
|
4960
|
+
* // Do the magic
|
|
4961
|
+
* const res = await translate.projects.locations.models.get({
|
|
4962
|
+
* // Required. The resource name of the model to retrieve.
|
|
4963
|
+
* name: 'projects/my-project/locations/my-location/models/my-model',
|
|
4964
|
+
* });
|
|
4965
|
+
* console.log(res.data);
|
|
4966
|
+
*
|
|
4967
|
+
* // Example response
|
|
4968
|
+
* // {
|
|
4969
|
+
* // "createTime": "my_createTime",
|
|
4970
|
+
* // "dataset": "my_dataset",
|
|
4971
|
+
* // "displayName": "my_displayName",
|
|
4972
|
+
* // "name": "my_name",
|
|
4973
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
4974
|
+
* // "targetLanguageCode": "my_targetLanguageCode",
|
|
4975
|
+
* // "testExampleCount": 0,
|
|
4976
|
+
* // "trainExampleCount": 0,
|
|
4977
|
+
* // "updateTime": "my_updateTime",
|
|
4978
|
+
* // "validateExampleCount": 0
|
|
4979
|
+
* // }
|
|
4980
|
+
* }
|
|
4981
|
+
*
|
|
4982
|
+
* main().catch(e => {
|
|
4983
|
+
* console.error(e);
|
|
4984
|
+
* throw e;
|
|
4985
|
+
* });
|
|
4986
|
+
*
|
|
4987
|
+
* ```
|
|
2392
4988
|
*
|
|
2393
4989
|
* @param params - Parameters for request
|
|
2394
4990
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2403,6 +4999,62 @@ export declare namespace translate_v3 {
|
|
|
2403
4999
|
get(callback: BodyResponseCallback<Schema$Model>): void;
|
|
2404
5000
|
/**
|
|
2405
5001
|
* Lists models.
|
|
5002
|
+
* @example
|
|
5003
|
+
* ```js
|
|
5004
|
+
* // Before running the sample:
|
|
5005
|
+
* // - Enable the API at:
|
|
5006
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
5007
|
+
* // - Login into gcloud by running:
|
|
5008
|
+
* // ```sh
|
|
5009
|
+
* // $ gcloud auth application-default login
|
|
5010
|
+
* // ```
|
|
5011
|
+
* // - Install the npm module by running:
|
|
5012
|
+
* // ```sh
|
|
5013
|
+
* // $ npm install googleapis
|
|
5014
|
+
* // ```
|
|
5015
|
+
*
|
|
5016
|
+
* const {google} = require('googleapis');
|
|
5017
|
+
* const translate = google.translate('v3');
|
|
5018
|
+
*
|
|
5019
|
+
* async function main() {
|
|
5020
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5021
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5022
|
+
* scopes: [
|
|
5023
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5024
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
5025
|
+
* ],
|
|
5026
|
+
* });
|
|
5027
|
+
*
|
|
5028
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5029
|
+
* const authClient = await auth.getClient();
|
|
5030
|
+
* google.options({auth: authClient});
|
|
5031
|
+
*
|
|
5032
|
+
* // Do the magic
|
|
5033
|
+
* const res = await translate.projects.locations.models.list({
|
|
5034
|
+
* // Optional. An expression for filtering the models that will be returned. Supported filter: `dataset_id=${dataset_id\}`
|
|
5035
|
+
* filter: 'placeholder-value',
|
|
5036
|
+
* // Optional. Requested page size. The server can return fewer results than requested.
|
|
5037
|
+
* pageSize: 'placeholder-value',
|
|
5038
|
+
* // 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.
|
|
5039
|
+
* pageToken: 'placeholder-value',
|
|
5040
|
+
* // Required. Name of the parent project. In form of `projects/{project-number-or-id\}/locations/{location-id\}`
|
|
5041
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
5042
|
+
* });
|
|
5043
|
+
* console.log(res.data);
|
|
5044
|
+
*
|
|
5045
|
+
* // Example response
|
|
5046
|
+
* // {
|
|
5047
|
+
* // "models": [],
|
|
5048
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
5049
|
+
* // }
|
|
5050
|
+
* }
|
|
5051
|
+
*
|
|
5052
|
+
* main().catch(e => {
|
|
5053
|
+
* console.error(e);
|
|
5054
|
+
* throw e;
|
|
5055
|
+
* });
|
|
5056
|
+
*
|
|
5057
|
+
* ```
|
|
2406
5058
|
*
|
|
2407
5059
|
* @param params - Parameters for request
|
|
2408
5060
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2461,6 +5113,59 @@ export declare namespace translate_v3 {
|
|
|
2461
5113
|
constructor(context: APIRequestContext);
|
|
2462
5114
|
/**
|
|
2463
5115
|
* 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`.
|
|
5116
|
+
* @example
|
|
5117
|
+
* ```js
|
|
5118
|
+
* // Before running the sample:
|
|
5119
|
+
* // - Enable the API at:
|
|
5120
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
5121
|
+
* // - Login into gcloud by running:
|
|
5122
|
+
* // ```sh
|
|
5123
|
+
* // $ gcloud auth application-default login
|
|
5124
|
+
* // ```
|
|
5125
|
+
* // - Install the npm module by running:
|
|
5126
|
+
* // ```sh
|
|
5127
|
+
* // $ npm install googleapis
|
|
5128
|
+
* // ```
|
|
5129
|
+
*
|
|
5130
|
+
* const {google} = require('googleapis');
|
|
5131
|
+
* const translate = google.translate('v3');
|
|
5132
|
+
*
|
|
5133
|
+
* async function main() {
|
|
5134
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5135
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5136
|
+
* scopes: [
|
|
5137
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5138
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
5139
|
+
* ],
|
|
5140
|
+
* });
|
|
5141
|
+
*
|
|
5142
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5143
|
+
* const authClient = await auth.getClient();
|
|
5144
|
+
* google.options({auth: authClient});
|
|
5145
|
+
*
|
|
5146
|
+
* // Do the magic
|
|
5147
|
+
* const res = await translate.projects.locations.operations.cancel({
|
|
5148
|
+
* // The name of the operation resource to be cancelled.
|
|
5149
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
5150
|
+
*
|
|
5151
|
+
* // Request body metadata
|
|
5152
|
+
* requestBody: {
|
|
5153
|
+
* // request body parameters
|
|
5154
|
+
* // {}
|
|
5155
|
+
* },
|
|
5156
|
+
* });
|
|
5157
|
+
* console.log(res.data);
|
|
5158
|
+
*
|
|
5159
|
+
* // Example response
|
|
5160
|
+
* // {}
|
|
5161
|
+
* }
|
|
5162
|
+
*
|
|
5163
|
+
* main().catch(e => {
|
|
5164
|
+
* console.error(e);
|
|
5165
|
+
* throw e;
|
|
5166
|
+
* });
|
|
5167
|
+
*
|
|
5168
|
+
* ```
|
|
2464
5169
|
*
|
|
2465
5170
|
* @param params - Parameters for request
|
|
2466
5171
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2475,6 +5180,53 @@ export declare namespace translate_v3 {
|
|
|
2475
5180
|
cancel(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
2476
5181
|
/**
|
|
2477
5182
|
* 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`.
|
|
5183
|
+
* @example
|
|
5184
|
+
* ```js
|
|
5185
|
+
* // Before running the sample:
|
|
5186
|
+
* // - Enable the API at:
|
|
5187
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
5188
|
+
* // - Login into gcloud by running:
|
|
5189
|
+
* // ```sh
|
|
5190
|
+
* // $ gcloud auth application-default login
|
|
5191
|
+
* // ```
|
|
5192
|
+
* // - Install the npm module by running:
|
|
5193
|
+
* // ```sh
|
|
5194
|
+
* // $ npm install googleapis
|
|
5195
|
+
* // ```
|
|
5196
|
+
*
|
|
5197
|
+
* const {google} = require('googleapis');
|
|
5198
|
+
* const translate = google.translate('v3');
|
|
5199
|
+
*
|
|
5200
|
+
* async function main() {
|
|
5201
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5202
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5203
|
+
* scopes: [
|
|
5204
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5205
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
5206
|
+
* ],
|
|
5207
|
+
* });
|
|
5208
|
+
*
|
|
5209
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5210
|
+
* const authClient = await auth.getClient();
|
|
5211
|
+
* google.options({auth: authClient});
|
|
5212
|
+
*
|
|
5213
|
+
* // Do the magic
|
|
5214
|
+
* const res = await translate.projects.locations.operations.delete({
|
|
5215
|
+
* // The name of the operation resource to be deleted.
|
|
5216
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
5217
|
+
* });
|
|
5218
|
+
* console.log(res.data);
|
|
5219
|
+
*
|
|
5220
|
+
* // Example response
|
|
5221
|
+
* // {}
|
|
5222
|
+
* }
|
|
5223
|
+
*
|
|
5224
|
+
* main().catch(e => {
|
|
5225
|
+
* console.error(e);
|
|
5226
|
+
* throw e;
|
|
5227
|
+
* });
|
|
5228
|
+
*
|
|
5229
|
+
* ```
|
|
2478
5230
|
*
|
|
2479
5231
|
* @param params - Parameters for request
|
|
2480
5232
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2489,6 +5241,59 @@ export declare namespace translate_v3 {
|
|
|
2489
5241
|
delete(callback: BodyResponseCallback<Schema$Empty>): void;
|
|
2490
5242
|
/**
|
|
2491
5243
|
* 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.
|
|
5244
|
+
* @example
|
|
5245
|
+
* ```js
|
|
5246
|
+
* // Before running the sample:
|
|
5247
|
+
* // - Enable the API at:
|
|
5248
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
5249
|
+
* // - Login into gcloud by running:
|
|
5250
|
+
* // ```sh
|
|
5251
|
+
* // $ gcloud auth application-default login
|
|
5252
|
+
* // ```
|
|
5253
|
+
* // - Install the npm module by running:
|
|
5254
|
+
* // ```sh
|
|
5255
|
+
* // $ npm install googleapis
|
|
5256
|
+
* // ```
|
|
5257
|
+
*
|
|
5258
|
+
* const {google} = require('googleapis');
|
|
5259
|
+
* const translate = google.translate('v3');
|
|
5260
|
+
*
|
|
5261
|
+
* async function main() {
|
|
5262
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5263
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5264
|
+
* scopes: [
|
|
5265
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5266
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
5267
|
+
* ],
|
|
5268
|
+
* });
|
|
5269
|
+
*
|
|
5270
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5271
|
+
* const authClient = await auth.getClient();
|
|
5272
|
+
* google.options({auth: authClient});
|
|
5273
|
+
*
|
|
5274
|
+
* // Do the magic
|
|
5275
|
+
* const res = await translate.projects.locations.operations.get({
|
|
5276
|
+
* // The name of the operation resource.
|
|
5277
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
5278
|
+
* });
|
|
5279
|
+
* console.log(res.data);
|
|
5280
|
+
*
|
|
5281
|
+
* // Example response
|
|
5282
|
+
* // {
|
|
5283
|
+
* // "done": false,
|
|
5284
|
+
* // "error": {},
|
|
5285
|
+
* // "metadata": {},
|
|
5286
|
+
* // "name": "my_name",
|
|
5287
|
+
* // "response": {}
|
|
5288
|
+
* // }
|
|
5289
|
+
* }
|
|
5290
|
+
*
|
|
5291
|
+
* main().catch(e => {
|
|
5292
|
+
* console.error(e);
|
|
5293
|
+
* throw e;
|
|
5294
|
+
* });
|
|
5295
|
+
*
|
|
5296
|
+
* ```
|
|
2492
5297
|
*
|
|
2493
5298
|
* @param params - Parameters for request
|
|
2494
5299
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2503,6 +5308,62 @@ export declare namespace translate_v3 {
|
|
|
2503
5308
|
get(callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2504
5309
|
/**
|
|
2505
5310
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
5311
|
+
* @example
|
|
5312
|
+
* ```js
|
|
5313
|
+
* // Before running the sample:
|
|
5314
|
+
* // - Enable the API at:
|
|
5315
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
5316
|
+
* // - Login into gcloud by running:
|
|
5317
|
+
* // ```sh
|
|
5318
|
+
* // $ gcloud auth application-default login
|
|
5319
|
+
* // ```
|
|
5320
|
+
* // - Install the npm module by running:
|
|
5321
|
+
* // ```sh
|
|
5322
|
+
* // $ npm install googleapis
|
|
5323
|
+
* // ```
|
|
5324
|
+
*
|
|
5325
|
+
* const {google} = require('googleapis');
|
|
5326
|
+
* const translate = google.translate('v3');
|
|
5327
|
+
*
|
|
5328
|
+
* async function main() {
|
|
5329
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5330
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5331
|
+
* scopes: [
|
|
5332
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5333
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
5334
|
+
* ],
|
|
5335
|
+
* });
|
|
5336
|
+
*
|
|
5337
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5338
|
+
* const authClient = await auth.getClient();
|
|
5339
|
+
* google.options({auth: authClient});
|
|
5340
|
+
*
|
|
5341
|
+
* // Do the magic
|
|
5342
|
+
* const res = await translate.projects.locations.operations.list({
|
|
5343
|
+
* // The standard list filter.
|
|
5344
|
+
* filter: 'placeholder-value',
|
|
5345
|
+
* // The name of the operation's parent resource.
|
|
5346
|
+
* name: 'projects/my-project/locations/my-location',
|
|
5347
|
+
* // The standard list page size.
|
|
5348
|
+
* pageSize: 'placeholder-value',
|
|
5349
|
+
* // The standard list page token.
|
|
5350
|
+
* pageToken: 'placeholder-value',
|
|
5351
|
+
* });
|
|
5352
|
+
* console.log(res.data);
|
|
5353
|
+
*
|
|
5354
|
+
* // Example response
|
|
5355
|
+
* // {
|
|
5356
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
5357
|
+
* // "operations": []
|
|
5358
|
+
* // }
|
|
5359
|
+
* }
|
|
5360
|
+
*
|
|
5361
|
+
* main().catch(e => {
|
|
5362
|
+
* console.error(e);
|
|
5363
|
+
* throw e;
|
|
5364
|
+
* });
|
|
5365
|
+
*
|
|
5366
|
+
* ```
|
|
2506
5367
|
*
|
|
2507
5368
|
* @param params - Parameters for request
|
|
2508
5369
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2517,6 +5378,67 @@ export declare namespace translate_v3 {
|
|
|
2517
5378
|
list(callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
|
|
2518
5379
|
/**
|
|
2519
5380
|
* Waits until the specified long-running operation is done or reaches at most a specified timeout, returning the latest state. If the operation is already done, the latest state is immediately returned. If the timeout specified is greater than the default HTTP/RPC timeout, the HTTP/RPC timeout is used. If the server does not support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Note that this method is on a best-effort basis. It may return the latest state before the specified timeout (including immediately), meaning even an immediate response is no guarantee that the operation is done.
|
|
5381
|
+
* @example
|
|
5382
|
+
* ```js
|
|
5383
|
+
* // Before running the sample:
|
|
5384
|
+
* // - Enable the API at:
|
|
5385
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
5386
|
+
* // - Login into gcloud by running:
|
|
5387
|
+
* // ```sh
|
|
5388
|
+
* // $ gcloud auth application-default login
|
|
5389
|
+
* // ```
|
|
5390
|
+
* // - Install the npm module by running:
|
|
5391
|
+
* // ```sh
|
|
5392
|
+
* // $ npm install googleapis
|
|
5393
|
+
* // ```
|
|
5394
|
+
*
|
|
5395
|
+
* const {google} = require('googleapis');
|
|
5396
|
+
* const translate = google.translate('v3');
|
|
5397
|
+
*
|
|
5398
|
+
* async function main() {
|
|
5399
|
+
* const auth = new google.auth.GoogleAuth({
|
|
5400
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
5401
|
+
* scopes: [
|
|
5402
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
5403
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
5404
|
+
* ],
|
|
5405
|
+
* });
|
|
5406
|
+
*
|
|
5407
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
5408
|
+
* const authClient = await auth.getClient();
|
|
5409
|
+
* google.options({auth: authClient});
|
|
5410
|
+
*
|
|
5411
|
+
* // Do the magic
|
|
5412
|
+
* const res = await translate.projects.locations.operations.wait({
|
|
5413
|
+
* // The name of the operation resource to wait on.
|
|
5414
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
5415
|
+
*
|
|
5416
|
+
* // Request body metadata
|
|
5417
|
+
* requestBody: {
|
|
5418
|
+
* // request body parameters
|
|
5419
|
+
* // {
|
|
5420
|
+
* // "timeout": "my_timeout"
|
|
5421
|
+
* // }
|
|
5422
|
+
* },
|
|
5423
|
+
* });
|
|
5424
|
+
* console.log(res.data);
|
|
5425
|
+
*
|
|
5426
|
+
* // Example response
|
|
5427
|
+
* // {
|
|
5428
|
+
* // "done": false,
|
|
5429
|
+
* // "error": {},
|
|
5430
|
+
* // "metadata": {},
|
|
5431
|
+
* // "name": "my_name",
|
|
5432
|
+
* // "response": {}
|
|
5433
|
+
* // }
|
|
5434
|
+
* }
|
|
5435
|
+
*
|
|
5436
|
+
* main().catch(e => {
|
|
5437
|
+
* console.error(e);
|
|
5438
|
+
* throw e;
|
|
5439
|
+
* });
|
|
5440
|
+
*
|
|
5441
|
+
* ```
|
|
2520
5442
|
*
|
|
2521
5443
|
* @param params - Parameters for request
|
|
2522
5444
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|