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