@googleapis/translate 3.5.0 → 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 +44 -0
- package/build/index.d.ts +1 -1
- package/build/index.js.map +1 -1
- package/build/v2.d.ts +291 -11
- package/build/v2.js.map +1 -1
- package/build/v3.d.ts +3024 -101
- package/build/v3.js.map +1 -1
- package/build/v3beta1.d.ts +1214 -41
- package/build/v3beta1.js.map +1 -1
- package/index.ts +0 -1
- package/package.json +2 -2
- package/v2.ts +301 -21
- package/v3.ts +3176 -175
- package/v3beta1.ts +1274 -71
package/build/v3.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient,
|
|
2
|
+
import { OAuth2Client, JWT, Compute, UserRefreshClient, BaseExternalAccountClient, GaxiosResponseWithHTTP2, GoogleConfigurable, MethodOptions, StreamMethodOptions, GlobalOptions, GoogleAuth, BodyResponseCallback, APIRequestContext } from 'googleapis-common';
|
|
3
3
|
import { Readable } from 'stream';
|
|
4
4
|
export declare namespace translate_v3 {
|
|
5
5
|
export interface Options extends GlobalOptions {
|
|
@@ -1303,56 +1303,292 @@ 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`.
|
|
1309
1369
|
* @param callback - Optional callback that handles the response.
|
|
1310
1370
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1311
1371
|
*/
|
|
1312
|
-
detectLanguage(params: Params$Resource$Projects$Detectlanguage, options: StreamMethodOptions):
|
|
1313
|
-
detectLanguage(params?: Params$Resource$Projects$Detectlanguage, options?: MethodOptions):
|
|
1372
|
+
detectLanguage(params: Params$Resource$Projects$Detectlanguage, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1373
|
+
detectLanguage(params?: Params$Resource$Projects$Detectlanguage, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$DetectLanguageResponse>>;
|
|
1314
1374
|
detectLanguage(params: Params$Resource$Projects$Detectlanguage, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1315
1375
|
detectLanguage(params: Params$Resource$Projects$Detectlanguage, options: MethodOptions | BodyResponseCallback<Schema$DetectLanguageResponse>, callback: BodyResponseCallback<Schema$DetectLanguageResponse>): void;
|
|
1316
1376
|
detectLanguage(params: Params$Resource$Projects$Detectlanguage, callback: BodyResponseCallback<Schema$DetectLanguageResponse>): void;
|
|
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`.
|
|
1323
1436
|
* @param callback - Optional callback that handles the response.
|
|
1324
1437
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1325
1438
|
*/
|
|
1326
|
-
getSupportedLanguages(params: Params$Resource$Projects$Getsupportedlanguages, options: StreamMethodOptions):
|
|
1327
|
-
getSupportedLanguages(params?: Params$Resource$Projects$Getsupportedlanguages, options?: MethodOptions):
|
|
1439
|
+
getSupportedLanguages(params: Params$Resource$Projects$Getsupportedlanguages, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1440
|
+
getSupportedLanguages(params?: Params$Resource$Projects$Getsupportedlanguages, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$SupportedLanguages>>;
|
|
1328
1441
|
getSupportedLanguages(params: Params$Resource$Projects$Getsupportedlanguages, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1329
1442
|
getSupportedLanguages(params: Params$Resource$Projects$Getsupportedlanguages, options: MethodOptions | BodyResponseCallback<Schema$SupportedLanguages>, callback: BodyResponseCallback<Schema$SupportedLanguages>): void;
|
|
1330
1443
|
getSupportedLanguages(params: Params$Resource$Projects$Getsupportedlanguages, callback: BodyResponseCallback<Schema$SupportedLanguages>): void;
|
|
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`.
|
|
1337
1508
|
* @param callback - Optional callback that handles the response.
|
|
1338
1509
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1339
1510
|
*/
|
|
1340
|
-
romanizeText(params: Params$Resource$Projects$Romanizetext, options: StreamMethodOptions):
|
|
1341
|
-
romanizeText(params?: Params$Resource$Projects$Romanizetext, options?: MethodOptions):
|
|
1511
|
+
romanizeText(params: Params$Resource$Projects$Romanizetext, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1512
|
+
romanizeText(params?: Params$Resource$Projects$Romanizetext, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$RomanizeTextResponse>>;
|
|
1342
1513
|
romanizeText(params: Params$Resource$Projects$Romanizetext, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1343
1514
|
romanizeText(params: Params$Resource$Projects$Romanizetext, options: MethodOptions | BodyResponseCallback<Schema$RomanizeTextResponse>, callback: BodyResponseCallback<Schema$RomanizeTextResponse>): void;
|
|
1344
1515
|
romanizeText(params: Params$Resource$Projects$Romanizetext, callback: BodyResponseCallback<Schema$RomanizeTextResponse>): void;
|
|
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`.
|
|
1351
1587
|
* @param callback - Optional callback that handles the response.
|
|
1352
1588
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1353
1589
|
*/
|
|
1354
|
-
translateText(params: Params$Resource$Projects$Translatetext, options: StreamMethodOptions):
|
|
1355
|
-
translateText(params?: Params$Resource$Projects$Translatetext, options?: MethodOptions):
|
|
1590
|
+
translateText(params: Params$Resource$Projects$Translatetext, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1591
|
+
translateText(params?: Params$Resource$Projects$Translatetext, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TranslateTextResponse>>;
|
|
1356
1592
|
translateText(params: Params$Resource$Projects$Translatetext, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1357
1593
|
translateText(params: Params$Resource$Projects$Translatetext, options: MethodOptions | BodyResponseCallback<Schema$TranslateTextResponse>, callback: BodyResponseCallback<Schema$TranslateTextResponse>): void;
|
|
1358
1594
|
translateText(params: Params$Resource$Projects$Translatetext, callback: BodyResponseCallback<Schema$TranslateTextResponse>): void;
|
|
@@ -1412,140 +1648,756 @@ 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`.
|
|
1418
1716
|
* @param callback - Optional callback that handles the response.
|
|
1419
1717
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1420
1718
|
*/
|
|
1421
|
-
adaptiveMtTranslate(params: Params$Resource$Projects$Locations$Adaptivemttranslate, options: StreamMethodOptions):
|
|
1422
|
-
adaptiveMtTranslate(params?: Params$Resource$Projects$Locations$Adaptivemttranslate, options?: MethodOptions):
|
|
1719
|
+
adaptiveMtTranslate(params: Params$Resource$Projects$Locations$Adaptivemttranslate, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1720
|
+
adaptiveMtTranslate(params?: Params$Resource$Projects$Locations$Adaptivemttranslate, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtTranslateResponse>>;
|
|
1423
1721
|
adaptiveMtTranslate(params: Params$Resource$Projects$Locations$Adaptivemttranslate, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1424
1722
|
adaptiveMtTranslate(params: Params$Resource$Projects$Locations$Adaptivemttranslate, options: MethodOptions | BodyResponseCallback<Schema$AdaptiveMtTranslateResponse>, callback: BodyResponseCallback<Schema$AdaptiveMtTranslateResponse>): void;
|
|
1425
1723
|
adaptiveMtTranslate(params: Params$Resource$Projects$Locations$Adaptivemttranslate, callback: BodyResponseCallback<Schema$AdaptiveMtTranslateResponse>): void;
|
|
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`.
|
|
1432
1800
|
* @param callback - Optional callback that handles the response.
|
|
1433
1801
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1434
1802
|
*/
|
|
1435
|
-
batchTranslateDocument(params: Params$Resource$Projects$Locations$Batchtranslatedocument, options: StreamMethodOptions):
|
|
1436
|
-
batchTranslateDocument(params?: Params$Resource$Projects$Locations$Batchtranslatedocument, options?: MethodOptions):
|
|
1803
|
+
batchTranslateDocument(params: Params$Resource$Projects$Locations$Batchtranslatedocument, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1804
|
+
batchTranslateDocument(params?: Params$Resource$Projects$Locations$Batchtranslatedocument, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
1437
1805
|
batchTranslateDocument(params: Params$Resource$Projects$Locations$Batchtranslatedocument, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1438
1806
|
batchTranslateDocument(params: Params$Resource$Projects$Locations$Batchtranslatedocument, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1439
1807
|
batchTranslateDocument(params: Params$Resource$Projects$Locations$Batchtranslatedocument, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
1446
1881
|
* @param callback - Optional callback that handles the response.
|
|
1447
1882
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1448
1883
|
*/
|
|
1449
|
-
batchTranslateText(params: Params$Resource$Projects$Locations$Batchtranslatetext, options: StreamMethodOptions):
|
|
1450
|
-
batchTranslateText(params?: Params$Resource$Projects$Locations$Batchtranslatetext, options?: MethodOptions):
|
|
1884
|
+
batchTranslateText(params: Params$Resource$Projects$Locations$Batchtranslatetext, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1885
|
+
batchTranslateText(params?: Params$Resource$Projects$Locations$Batchtranslatetext, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
1451
1886
|
batchTranslateText(params: Params$Resource$Projects$Locations$Batchtranslatetext, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1452
1887
|
batchTranslateText(params: Params$Resource$Projects$Locations$Batchtranslatetext, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1453
1888
|
batchTranslateText(params: Params$Resource$Projects$Locations$Batchtranslatetext, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
1460
1955
|
* @param callback - Optional callback that handles the response.
|
|
1461
1956
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1462
1957
|
*/
|
|
1463
|
-
detectLanguage(params: Params$Resource$Projects$Locations$Detectlanguage, options: StreamMethodOptions):
|
|
1464
|
-
detectLanguage(params?: Params$Resource$Projects$Locations$Detectlanguage, options?: MethodOptions):
|
|
1958
|
+
detectLanguage(params: Params$Resource$Projects$Locations$Detectlanguage, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
1959
|
+
detectLanguage(params?: Params$Resource$Projects$Locations$Detectlanguage, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$DetectLanguageResponse>>;
|
|
1465
1960
|
detectLanguage(params: Params$Resource$Projects$Locations$Detectlanguage, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1466
1961
|
detectLanguage(params: Params$Resource$Projects$Locations$Detectlanguage, options: MethodOptions | BodyResponseCallback<Schema$DetectLanguageResponse>, callback: BodyResponseCallback<Schema$DetectLanguageResponse>): void;
|
|
1467
1962
|
detectLanguage(params: Params$Resource$Projects$Locations$Detectlanguage, callback: BodyResponseCallback<Schema$DetectLanguageResponse>): void;
|
|
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`.
|
|
1474
2022
|
* @param callback - Optional callback that handles the response.
|
|
1475
2023
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1476
2024
|
*/
|
|
1477
|
-
get(params: Params$Resource$Projects$Locations$Get, options: StreamMethodOptions):
|
|
1478
|
-
get(params?: Params$Resource$Projects$Locations$Get, options?: MethodOptions):
|
|
2025
|
+
get(params: Params$Resource$Projects$Locations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2026
|
+
get(params?: Params$Resource$Projects$Locations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Location>>;
|
|
1479
2027
|
get(params: Params$Resource$Projects$Locations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1480
2028
|
get(params: Params$Resource$Projects$Locations$Get, options: MethodOptions | BodyResponseCallback<Schema$Location>, callback: BodyResponseCallback<Schema$Location>): void;
|
|
1481
2029
|
get(params: Params$Resource$Projects$Locations$Get, callback: BodyResponseCallback<Schema$Location>): void;
|
|
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`.
|
|
1488
2089
|
* @param callback - Optional callback that handles the response.
|
|
1489
2090
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1490
2091
|
*/
|
|
1491
|
-
getSupportedLanguages(params: Params$Resource$Projects$Locations$Getsupportedlanguages, options: StreamMethodOptions):
|
|
1492
|
-
getSupportedLanguages(params?: Params$Resource$Projects$Locations$Getsupportedlanguages, options?: MethodOptions):
|
|
2092
|
+
getSupportedLanguages(params: Params$Resource$Projects$Locations$Getsupportedlanguages, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2093
|
+
getSupportedLanguages(params?: Params$Resource$Projects$Locations$Getsupportedlanguages, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$SupportedLanguages>>;
|
|
1493
2094
|
getSupportedLanguages(params: Params$Resource$Projects$Locations$Getsupportedlanguages, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1494
2095
|
getSupportedLanguages(params: Params$Resource$Projects$Locations$Getsupportedlanguages, options: MethodOptions | BodyResponseCallback<Schema$SupportedLanguages>, callback: BodyResponseCallback<Schema$SupportedLanguages>): void;
|
|
1495
2096
|
getSupportedLanguages(params: Params$Resource$Projects$Locations$Getsupportedlanguages, callback: BodyResponseCallback<Schema$SupportedLanguages>): void;
|
|
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`.
|
|
1502
2161
|
* @param callback - Optional callback that handles the response.
|
|
1503
2162
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1504
2163
|
*/
|
|
1505
|
-
list(params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions):
|
|
1506
|
-
list(params?: Params$Resource$Projects$Locations$List, options?: MethodOptions):
|
|
2164
|
+
list(params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2165
|
+
list(params?: Params$Resource$Projects$Locations$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>;
|
|
1507
2166
|
list(params: Params$Resource$Projects$Locations$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1508
2167
|
list(params: Params$Resource$Projects$Locations$List, options: MethodOptions | BodyResponseCallback<Schema$ListLocationsResponse>, callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
|
|
1509
2168
|
list(params: Params$Resource$Projects$Locations$List, callback: BodyResponseCallback<Schema$ListLocationsResponse>): void;
|
|
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`.
|
|
1516
2233
|
* @param callback - Optional callback that handles the response.
|
|
1517
2234
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1518
2235
|
*/
|
|
1519
|
-
romanizeText(params: Params$Resource$Projects$Locations$Romanizetext, options: StreamMethodOptions):
|
|
1520
|
-
romanizeText(params?: Params$Resource$Projects$Locations$Romanizetext, options?: MethodOptions):
|
|
2236
|
+
romanizeText(params: Params$Resource$Projects$Locations$Romanizetext, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2237
|
+
romanizeText(params?: Params$Resource$Projects$Locations$Romanizetext, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$RomanizeTextResponse>>;
|
|
1521
2238
|
romanizeText(params: Params$Resource$Projects$Locations$Romanizetext, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1522
2239
|
romanizeText(params: Params$Resource$Projects$Locations$Romanizetext, options: MethodOptions | BodyResponseCallback<Schema$RomanizeTextResponse>, callback: BodyResponseCallback<Schema$RomanizeTextResponse>): void;
|
|
1523
2240
|
romanizeText(params: Params$Resource$Projects$Locations$Romanizetext, callback: BodyResponseCallback<Schema$RomanizeTextResponse>): void;
|
|
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`.
|
|
1530
2317
|
* @param callback - Optional callback that handles the response.
|
|
1531
2318
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1532
2319
|
*/
|
|
1533
|
-
translateDocument(params: Params$Resource$Projects$Locations$Translatedocument, options: StreamMethodOptions):
|
|
1534
|
-
translateDocument(params?: Params$Resource$Projects$Locations$Translatedocument, options?: MethodOptions):
|
|
2320
|
+
translateDocument(params: Params$Resource$Projects$Locations$Translatedocument, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2321
|
+
translateDocument(params?: Params$Resource$Projects$Locations$Translatedocument, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TranslateDocumentResponse>>;
|
|
1535
2322
|
translateDocument(params: Params$Resource$Projects$Locations$Translatedocument, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1536
2323
|
translateDocument(params: Params$Resource$Projects$Locations$Translatedocument, options: MethodOptions | BodyResponseCallback<Schema$TranslateDocumentResponse>, callback: BodyResponseCallback<Schema$TranslateDocumentResponse>): void;
|
|
1537
2324
|
translateDocument(params: Params$Resource$Projects$Locations$Translatedocument, callback: BodyResponseCallback<Schema$TranslateDocumentResponse>): void;
|
|
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`.
|
|
1544
2396
|
* @param callback - Optional callback that handles the response.
|
|
1545
2397
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1546
2398
|
*/
|
|
1547
|
-
translateText(params: Params$Resource$Projects$Locations$Translatetext, options: StreamMethodOptions):
|
|
1548
|
-
translateText(params?: Params$Resource$Projects$Locations$Translatetext, options?: MethodOptions):
|
|
2399
|
+
translateText(params: Params$Resource$Projects$Locations$Translatetext, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2400
|
+
translateText(params?: Params$Resource$Projects$Locations$Translatetext, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$TranslateTextResponse>>;
|
|
1549
2401
|
translateText(params: Params$Resource$Projects$Locations$Translatetext, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1550
2402
|
translateText(params: Params$Resource$Projects$Locations$Translatetext, options: MethodOptions | BodyResponseCallback<Schema$TranslateTextResponse>, callback: BodyResponseCallback<Schema$TranslateTextResponse>): void;
|
|
1551
2403
|
translateText(params: Params$Resource$Projects$Locations$Translatetext, callback: BodyResponseCallback<Schema$TranslateTextResponse>): void;
|
|
@@ -1670,70 +2522,357 @@ 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`.
|
|
1676
2597
|
* @param callback - Optional callback that handles the response.
|
|
1677
2598
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1678
2599
|
*/
|
|
1679
|
-
create(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, options: StreamMethodOptions):
|
|
1680
|
-
create(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, options?: MethodOptions):
|
|
2600
|
+
create(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2601
|
+
create(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtDataset>>;
|
|
1681
2602
|
create(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1682
2603
|
create(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, options: MethodOptions | BodyResponseCallback<Schema$AdaptiveMtDataset>, callback: BodyResponseCallback<Schema$AdaptiveMtDataset>): void;
|
|
1683
2604
|
create(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create, callback: BodyResponseCallback<Schema$AdaptiveMtDataset>): void;
|
|
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`.
|
|
1690
2658
|
* @param callback - Optional callback that handles the response.
|
|
1691
2659
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1692
2660
|
*/
|
|
1693
|
-
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, options: StreamMethodOptions):
|
|
1694
|
-
delete(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, options?: MethodOptions):
|
|
2661
|
+
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2662
|
+
delete(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
1695
2663
|
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1696
2664
|
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
1697
2665
|
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
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`.
|
|
1704
2727
|
* @param callback - Optional callback that handles the response.
|
|
1705
2728
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1706
2729
|
*/
|
|
1707
|
-
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, options: StreamMethodOptions):
|
|
1708
|
-
get(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, options?: MethodOptions):
|
|
2730
|
+
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2731
|
+
get(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtDataset>>;
|
|
1709
2732
|
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1710
2733
|
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, options: MethodOptions | BodyResponseCallback<Schema$AdaptiveMtDataset>, callback: BodyResponseCallback<Schema$AdaptiveMtDataset>): void;
|
|
1711
2734
|
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get, callback: BodyResponseCallback<Schema$AdaptiveMtDataset>): void;
|
|
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`.
|
|
1718
2801
|
* @param callback - Optional callback that handles the response.
|
|
1719
2802
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1720
2803
|
*/
|
|
1721
|
-
importAdaptiveMtFile(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, options: StreamMethodOptions):
|
|
1722
|
-
importAdaptiveMtFile(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, options?: MethodOptions):
|
|
2804
|
+
importAdaptiveMtFile(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2805
|
+
importAdaptiveMtFile(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ImportAdaptiveMtFileResponse>>;
|
|
1723
2806
|
importAdaptiveMtFile(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1724
2807
|
importAdaptiveMtFile(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, options: MethodOptions | BodyResponseCallback<Schema$ImportAdaptiveMtFileResponse>, callback: BodyResponseCallback<Schema$ImportAdaptiveMtFileResponse>): void;
|
|
1725
2808
|
importAdaptiveMtFile(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile, callback: BodyResponseCallback<Schema$ImportAdaptiveMtFileResponse>): void;
|
|
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`.
|
|
1732
2871
|
* @param callback - Optional callback that handles the response.
|
|
1733
2872
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1734
2873
|
*/
|
|
1735
|
-
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, options: StreamMethodOptions):
|
|
1736
|
-
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, options?: MethodOptions):
|
|
2874
|
+
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2875
|
+
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtDatasetsResponse>>;
|
|
1737
2876
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1738
2877
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, options: MethodOptions | BodyResponseCallback<Schema$ListAdaptiveMtDatasetsResponse>, callback: BodyResponseCallback<Schema$ListAdaptiveMtDatasetsResponse>): void;
|
|
1739
2878
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List, callback: BodyResponseCallback<Schema$ListAdaptiveMtDatasetsResponse>): void;
|
|
@@ -1795,42 +2934,202 @@ 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`.
|
|
1801
2990
|
* @param callback - Optional callback that handles the response.
|
|
1802
2991
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1803
2992
|
*/
|
|
1804
|
-
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, options: StreamMethodOptions):
|
|
1805
|
-
delete(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, options?: MethodOptions):
|
|
2993
|
+
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
2994
|
+
delete(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
1806
2995
|
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1807
2996
|
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
1808
2997
|
delete(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
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`.
|
|
1815
3058
|
* @param callback - Optional callback that handles the response.
|
|
1816
3059
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1817
3060
|
*/
|
|
1818
|
-
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, options: StreamMethodOptions):
|
|
1819
|
-
get(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, options?: MethodOptions):
|
|
3061
|
+
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3062
|
+
get(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtFile>>;
|
|
1820
3063
|
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1821
3064
|
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, options: MethodOptions | BodyResponseCallback<Schema$AdaptiveMtFile>, callback: BodyResponseCallback<Schema$AdaptiveMtFile>): void;
|
|
1822
3065
|
get(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get, callback: BodyResponseCallback<Schema$AdaptiveMtFile>): void;
|
|
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`.
|
|
1829
3128
|
* @param callback - Optional callback that handles the response.
|
|
1830
3129
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1831
3130
|
*/
|
|
1832
|
-
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, options: StreamMethodOptions):
|
|
1833
|
-
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, options?: MethodOptions):
|
|
3131
|
+
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3132
|
+
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtFilesResponse>>;
|
|
1834
3133
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1835
3134
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, options: MethodOptions | BodyResponseCallback<Schema$ListAdaptiveMtFilesResponse>, callback: BodyResponseCallback<Schema$ListAdaptiveMtFilesResponse>): void;
|
|
1836
3135
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List, callback: BodyResponseCallback<Schema$ListAdaptiveMtFilesResponse>): void;
|
|
@@ -1867,14 +3166,71 @@ 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`.
|
|
1873
3229
|
* @param callback - Optional callback that handles the response.
|
|
1874
3230
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1875
3231
|
*/
|
|
1876
|
-
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, options: StreamMethodOptions):
|
|
1877
|
-
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, options?: MethodOptions):
|
|
3232
|
+
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3233
|
+
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtSentencesResponse>>;
|
|
1878
3234
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1879
3235
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, options: MethodOptions | BodyResponseCallback<Schema$ListAdaptiveMtSentencesResponse>, callback: BodyResponseCallback<Schema$ListAdaptiveMtSentencesResponse>): void;
|
|
1880
3236
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List, callback: BodyResponseCallback<Schema$ListAdaptiveMtSentencesResponse>): void;
|
|
@@ -1899,14 +3255,71 @@ 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`.
|
|
1905
3318
|
* @param callback - Optional callback that handles the response.
|
|
1906
3319
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1907
3320
|
*/
|
|
1908
|
-
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, options: StreamMethodOptions):
|
|
1909
|
-
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, options?: MethodOptions):
|
|
3321
|
+
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3322
|
+
list(params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtSentencesResponse>>;
|
|
1910
3323
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1911
3324
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, options: MethodOptions | BodyResponseCallback<Schema$ListAdaptiveMtSentencesResponse>, callback: BodyResponseCallback<Schema$ListAdaptiveMtSentencesResponse>): void;
|
|
1912
3325
|
list(params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List, callback: BodyResponseCallback<Schema$ListAdaptiveMtSentencesResponse>): void;
|
|
@@ -1932,84 +3345,441 @@ 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`.
|
|
1938
3421
|
* @param callback - Optional callback that handles the response.
|
|
1939
3422
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1940
3423
|
*/
|
|
1941
|
-
create(params: Params$Resource$Projects$Locations$Datasets$Create, options: StreamMethodOptions):
|
|
1942
|
-
create(params?: Params$Resource$Projects$Locations$Datasets$Create, options?: MethodOptions):
|
|
3424
|
+
create(params: Params$Resource$Projects$Locations$Datasets$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3425
|
+
create(params?: Params$Resource$Projects$Locations$Datasets$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
1943
3426
|
create(params: Params$Resource$Projects$Locations$Datasets$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1944
3427
|
create(params: Params$Resource$Projects$Locations$Datasets$Create, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1945
3428
|
create(params: Params$Resource$Projects$Locations$Datasets$Create, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
1952
3488
|
* @param callback - Optional callback that handles the response.
|
|
1953
3489
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1954
3490
|
*/
|
|
1955
|
-
delete(params: Params$Resource$Projects$Locations$Datasets$Delete, options: StreamMethodOptions):
|
|
1956
|
-
delete(params?: Params$Resource$Projects$Locations$Datasets$Delete, options?: MethodOptions):
|
|
3491
|
+
delete(params: Params$Resource$Projects$Locations$Datasets$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3492
|
+
delete(params?: Params$Resource$Projects$Locations$Datasets$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
1957
3493
|
delete(params: Params$Resource$Projects$Locations$Datasets$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1958
3494
|
delete(params: Params$Resource$Projects$Locations$Datasets$Delete, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1959
3495
|
delete(params: Params$Resource$Projects$Locations$Datasets$Delete, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
1966
3563
|
* @param callback - Optional callback that handles the response.
|
|
1967
3564
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1968
3565
|
*/
|
|
1969
|
-
exportData(params: Params$Resource$Projects$Locations$Datasets$Exportdata, options: StreamMethodOptions):
|
|
1970
|
-
exportData(params?: Params$Resource$Projects$Locations$Datasets$Exportdata, options?: MethodOptions):
|
|
3566
|
+
exportData(params: Params$Resource$Projects$Locations$Datasets$Exportdata, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3567
|
+
exportData(params?: Params$Resource$Projects$Locations$Datasets$Exportdata, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
1971
3568
|
exportData(params: Params$Resource$Projects$Locations$Datasets$Exportdata, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1972
3569
|
exportData(params: Params$Resource$Projects$Locations$Datasets$Exportdata, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
1973
3570
|
exportData(params: Params$Resource$Projects$Locations$Datasets$Exportdata, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
1980
3635
|
* @param callback - Optional callback that handles the response.
|
|
1981
3636
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1982
3637
|
*/
|
|
1983
|
-
get(params: Params$Resource$Projects$Locations$Datasets$Get, options: StreamMethodOptions):
|
|
1984
|
-
get(params?: Params$Resource$Projects$Locations$Datasets$Get, options?: MethodOptions):
|
|
3638
|
+
get(params: Params$Resource$Projects$Locations$Datasets$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3639
|
+
get(params?: Params$Resource$Projects$Locations$Datasets$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Dataset>>;
|
|
1985
3640
|
get(params: Params$Resource$Projects$Locations$Datasets$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
1986
3641
|
get(params: Params$Resource$Projects$Locations$Datasets$Get, options: MethodOptions | BodyResponseCallback<Schema$Dataset>, callback: BodyResponseCallback<Schema$Dataset>): void;
|
|
1987
3642
|
get(params: Params$Resource$Projects$Locations$Datasets$Get, callback: BodyResponseCallback<Schema$Dataset>): void;
|
|
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`.
|
|
1994
3710
|
* @param callback - Optional callback that handles the response.
|
|
1995
3711
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
1996
3712
|
*/
|
|
1997
|
-
importData(params: Params$Resource$Projects$Locations$Datasets$Importdata, options: StreamMethodOptions):
|
|
1998
|
-
importData(params?: Params$Resource$Projects$Locations$Datasets$Importdata, options?: MethodOptions):
|
|
3713
|
+
importData(params: Params$Resource$Projects$Locations$Datasets$Importdata, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3714
|
+
importData(params?: Params$Resource$Projects$Locations$Datasets$Importdata, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
1999
3715
|
importData(params: Params$Resource$Projects$Locations$Datasets$Importdata, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2000
3716
|
importData(params: Params$Resource$Projects$Locations$Datasets$Importdata, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2001
3717
|
importData(params: Params$Resource$Projects$Locations$Datasets$Importdata, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
2008
3778
|
* @param callback - Optional callback that handles the response.
|
|
2009
3779
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2010
3780
|
*/
|
|
2011
|
-
list(params: Params$Resource$Projects$Locations$Datasets$List, options: StreamMethodOptions):
|
|
2012
|
-
list(params?: Params$Resource$Projects$Locations$Datasets$List, options?: MethodOptions):
|
|
3781
|
+
list(params: Params$Resource$Projects$Locations$Datasets$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3782
|
+
list(params?: Params$Resource$Projects$Locations$Datasets$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListDatasetsResponse>>;
|
|
2013
3783
|
list(params: Params$Resource$Projects$Locations$Datasets$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2014
3784
|
list(params: Params$Resource$Projects$Locations$Datasets$List, options: MethodOptions | BodyResponseCallback<Schema$ListDatasetsResponse>, callback: BodyResponseCallback<Schema$ListDatasetsResponse>): void;
|
|
2015
3785
|
list(params: Params$Resource$Projects$Locations$Datasets$List, callback: BodyResponseCallback<Schema$ListDatasetsResponse>): void;
|
|
@@ -2076,14 +3846,70 @@ 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`.
|
|
2082
3908
|
* @param callback - Optional callback that handles the response.
|
|
2083
3909
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2084
3910
|
*/
|
|
2085
|
-
list(params: Params$Resource$Projects$Locations$Datasets$Examples$List, options: StreamMethodOptions):
|
|
2086
|
-
list(params?: Params$Resource$Projects$Locations$Datasets$Examples$List, options?: MethodOptions):
|
|
3911
|
+
list(params: Params$Resource$Projects$Locations$Datasets$Examples$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
3912
|
+
list(params?: Params$Resource$Projects$Locations$Datasets$Examples$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListExamplesResponse>>;
|
|
2087
3913
|
list(params: Params$Resource$Projects$Locations$Datasets$Examples$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2088
3914
|
list(params: Params$Resource$Projects$Locations$Datasets$Examples$List, options: MethodOptions | BodyResponseCallback<Schema$ListExamplesResponse>, callback: BodyResponseCallback<Schema$ListExamplesResponse>): void;
|
|
2089
3915
|
list(params: Params$Resource$Projects$Locations$Datasets$Examples$List, callback: BodyResponseCallback<Schema$ListExamplesResponse>): void;
|
|
@@ -2113,70 +3939,373 @@ 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`.
|
|
2119
4013
|
* @param callback - Optional callback that handles the response.
|
|
2120
4014
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2121
4015
|
*/
|
|
2122
|
-
create(params: Params$Resource$Projects$Locations$Glossaries$Create, options: StreamMethodOptions):
|
|
2123
|
-
create(params?: Params$Resource$Projects$Locations$Glossaries$Create, options?: MethodOptions):
|
|
4016
|
+
create(params: Params$Resource$Projects$Locations$Glossaries$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4017
|
+
create(params?: Params$Resource$Projects$Locations$Glossaries$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2124
4018
|
create(params: Params$Resource$Projects$Locations$Glossaries$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2125
4019
|
create(params: Params$Resource$Projects$Locations$Glossaries$Create, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2126
4020
|
create(params: Params$Resource$Projects$Locations$Glossaries$Create, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
2133
4080
|
* @param callback - Optional callback that handles the response.
|
|
2134
4081
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2135
4082
|
*/
|
|
2136
|
-
delete(params: Params$Resource$Projects$Locations$Glossaries$Delete, options: StreamMethodOptions):
|
|
2137
|
-
delete(params?: Params$Resource$Projects$Locations$Glossaries$Delete, options?: MethodOptions):
|
|
4083
|
+
delete(params: Params$Resource$Projects$Locations$Glossaries$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4084
|
+
delete(params?: Params$Resource$Projects$Locations$Glossaries$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2138
4085
|
delete(params: Params$Resource$Projects$Locations$Glossaries$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2139
4086
|
delete(params: Params$Resource$Projects$Locations$Glossaries$Delete, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2140
4087
|
delete(params: Params$Resource$Projects$Locations$Glossaries$Delete, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
2147
4150
|
* @param callback - Optional callback that handles the response.
|
|
2148
4151
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2149
4152
|
*/
|
|
2150
|
-
get(params: Params$Resource$Projects$Locations$Glossaries$Get, options: StreamMethodOptions):
|
|
2151
|
-
get(params?: Params$Resource$Projects$Locations$Glossaries$Get, options?: MethodOptions):
|
|
4153
|
+
get(params: Params$Resource$Projects$Locations$Glossaries$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4154
|
+
get(params?: Params$Resource$Projects$Locations$Glossaries$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Glossary>>;
|
|
2152
4155
|
get(params: Params$Resource$Projects$Locations$Glossaries$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2153
4156
|
get(params: Params$Resource$Projects$Locations$Glossaries$Get, options: MethodOptions | BodyResponseCallback<Schema$Glossary>, callback: BodyResponseCallback<Schema$Glossary>): void;
|
|
2154
4157
|
get(params: Params$Resource$Projects$Locations$Glossaries$Get, callback: BodyResponseCallback<Schema$Glossary>): void;
|
|
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`.
|
|
2161
4220
|
* @param callback - Optional callback that handles the response.
|
|
2162
4221
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2163
4222
|
*/
|
|
2164
|
-
list(params: Params$Resource$Projects$Locations$Glossaries$List, options: StreamMethodOptions):
|
|
2165
|
-
list(params?: Params$Resource$Projects$Locations$Glossaries$List, options?: MethodOptions):
|
|
4223
|
+
list(params: Params$Resource$Projects$Locations$Glossaries$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4224
|
+
list(params?: Params$Resource$Projects$Locations$Glossaries$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListGlossariesResponse>>;
|
|
2166
4225
|
list(params: Params$Resource$Projects$Locations$Glossaries$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2167
4226
|
list(params: Params$Resource$Projects$Locations$Glossaries$List, options: MethodOptions | BodyResponseCallback<Schema$ListGlossariesResponse>, callback: BodyResponseCallback<Schema$ListGlossariesResponse>): void;
|
|
2168
4227
|
list(params: Params$Resource$Projects$Locations$Glossaries$List, callback: BodyResponseCallback<Schema$ListGlossariesResponse>): void;
|
|
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`.
|
|
2175
4304
|
* @param callback - Optional callback that handles the response.
|
|
2176
4305
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2177
4306
|
*/
|
|
2178
|
-
patch(params: Params$Resource$Projects$Locations$Glossaries$Patch, options: StreamMethodOptions):
|
|
2179
|
-
patch(params?: Params$Resource$Projects$Locations$Glossaries$Patch, options?: MethodOptions):
|
|
4307
|
+
patch(params: Params$Resource$Projects$Locations$Glossaries$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4308
|
+
patch(params?: Params$Resource$Projects$Locations$Glossaries$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2180
4309
|
patch(params: Params$Resource$Projects$Locations$Glossaries$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2181
4310
|
patch(params: Params$Resource$Projects$Locations$Glossaries$Patch, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2182
4311
|
patch(params: Params$Resource$Projects$Locations$Glossaries$Patch, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
@@ -2241,70 +4370,357 @@ 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`.
|
|
2247
4441
|
* @param callback - Optional callback that handles the response.
|
|
2248
4442
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2249
4443
|
*/
|
|
2250
|
-
create(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, options: StreamMethodOptions):
|
|
2251
|
-
create(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, options?: MethodOptions):
|
|
4444
|
+
create(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4445
|
+
create(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>;
|
|
2252
4446
|
create(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2253
4447
|
create(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, options: MethodOptions | BodyResponseCallback<Schema$GlossaryEntry>, callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
2254
4448
|
create(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create, callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
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`.
|
|
2261
4503
|
* @param callback - Optional callback that handles the response.
|
|
2262
4504
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2263
4505
|
*/
|
|
2264
|
-
delete(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, options: StreamMethodOptions):
|
|
2265
|
-
delete(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, options?: MethodOptions):
|
|
4506
|
+
delete(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4507
|
+
delete(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
2266
4508
|
delete(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2267
4509
|
delete(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
2268
4510
|
delete(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
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`.
|
|
2275
4571
|
* @param callback - Optional callback that handles the response.
|
|
2276
4572
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2277
4573
|
*/
|
|
2278
|
-
get(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, options: StreamMethodOptions):
|
|
2279
|
-
get(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, options?: MethodOptions):
|
|
4574
|
+
get(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4575
|
+
get(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>;
|
|
2280
4576
|
get(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2281
4577
|
get(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, options: MethodOptions | BodyResponseCallback<Schema$GlossaryEntry>, callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
2282
4578
|
get(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get, callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
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`.
|
|
2289
4641
|
* @param callback - Optional callback that handles the response.
|
|
2290
4642
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2291
4643
|
*/
|
|
2292
|
-
list(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, options: StreamMethodOptions):
|
|
2293
|
-
list(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, options?: MethodOptions):
|
|
4644
|
+
list(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4645
|
+
list(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListGlossaryEntriesResponse>>;
|
|
2294
4646
|
list(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2295
4647
|
list(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, options: MethodOptions | BodyResponseCallback<Schema$ListGlossaryEntriesResponse>, callback: BodyResponseCallback<Schema$ListGlossaryEntriesResponse>): void;
|
|
2296
4648
|
list(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List, callback: BodyResponseCallback<Schema$ListGlossaryEntriesResponse>): void;
|
|
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`.
|
|
2303
4719
|
* @param callback - Optional callback that handles the response.
|
|
2304
4720
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2305
4721
|
*/
|
|
2306
|
-
patch(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, options: StreamMethodOptions):
|
|
2307
|
-
patch(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, options?: MethodOptions):
|
|
4722
|
+
patch(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4723
|
+
patch(params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>;
|
|
2308
4724
|
patch(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2309
4725
|
patch(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, options: MethodOptions | BodyResponseCallback<Schema$GlossaryEntry>, callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
2310
4726
|
patch(params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch, callback: BodyResponseCallback<Schema$GlossaryEntry>): void;
|
|
@@ -2361,56 +4777,293 @@ 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`.
|
|
2367
4853
|
* @param callback - Optional callback that handles the response.
|
|
2368
4854
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2369
4855
|
*/
|
|
2370
|
-
create(params: Params$Resource$Projects$Locations$Models$Create, options: StreamMethodOptions):
|
|
2371
|
-
create(params?: Params$Resource$Projects$Locations$Models$Create, options?: MethodOptions):
|
|
4856
|
+
create(params: Params$Resource$Projects$Locations$Models$Create, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4857
|
+
create(params?: Params$Resource$Projects$Locations$Models$Create, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2372
4858
|
create(params: Params$Resource$Projects$Locations$Models$Create, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2373
4859
|
create(params: Params$Resource$Projects$Locations$Models$Create, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2374
4860
|
create(params: Params$Resource$Projects$Locations$Models$Create, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
2381
4920
|
* @param callback - Optional callback that handles the response.
|
|
2382
4921
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2383
4922
|
*/
|
|
2384
|
-
delete(params: Params$Resource$Projects$Locations$Models$Delete, options: StreamMethodOptions):
|
|
2385
|
-
delete(params?: Params$Resource$Projects$Locations$Models$Delete, options?: MethodOptions):
|
|
4923
|
+
delete(params: Params$Resource$Projects$Locations$Models$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4924
|
+
delete(params?: Params$Resource$Projects$Locations$Models$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2386
4925
|
delete(params: Params$Resource$Projects$Locations$Models$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2387
4926
|
delete(params: Params$Resource$Projects$Locations$Models$Delete, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2388
4927
|
delete(params: Params$Resource$Projects$Locations$Models$Delete, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
2395
4992
|
* @param callback - Optional callback that handles the response.
|
|
2396
4993
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2397
4994
|
*/
|
|
2398
|
-
get(params: Params$Resource$Projects$Locations$Models$Get, options: StreamMethodOptions):
|
|
2399
|
-
get(params?: Params$Resource$Projects$Locations$Models$Get, options?: MethodOptions):
|
|
4995
|
+
get(params: Params$Resource$Projects$Locations$Models$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
4996
|
+
get(params?: Params$Resource$Projects$Locations$Models$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Model>>;
|
|
2400
4997
|
get(params: Params$Resource$Projects$Locations$Models$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2401
4998
|
get(params: Params$Resource$Projects$Locations$Models$Get, options: MethodOptions | BodyResponseCallback<Schema$Model>, callback: BodyResponseCallback<Schema$Model>): void;
|
|
2402
4999
|
get(params: Params$Resource$Projects$Locations$Models$Get, callback: BodyResponseCallback<Schema$Model>): void;
|
|
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`.
|
|
2409
5062
|
* @param callback - Optional callback that handles the response.
|
|
2410
5063
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2411
5064
|
*/
|
|
2412
|
-
list(params: Params$Resource$Projects$Locations$Models$List, options: StreamMethodOptions):
|
|
2413
|
-
list(params?: Params$Resource$Projects$Locations$Models$List, options?: MethodOptions):
|
|
5065
|
+
list(params: Params$Resource$Projects$Locations$Models$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5066
|
+
list(params?: Params$Resource$Projects$Locations$Models$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListModelsResponse>>;
|
|
2414
5067
|
list(params: Params$Resource$Projects$Locations$Models$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2415
5068
|
list(params: Params$Resource$Projects$Locations$Models$List, options: MethodOptions | BodyResponseCallback<Schema$ListModelsResponse>, callback: BodyResponseCallback<Schema$ListModelsResponse>): void;
|
|
2416
5069
|
list(params: Params$Resource$Projects$Locations$Models$List, callback: BodyResponseCallback<Schema$ListModelsResponse>): void;
|
|
@@ -2461,70 +5114,340 @@ 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`.
|
|
2467
5173
|
* @param callback - Optional callback that handles the response.
|
|
2468
5174
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2469
5175
|
*/
|
|
2470
|
-
cancel(params: Params$Resource$Projects$Locations$Operations$Cancel, options: StreamMethodOptions):
|
|
2471
|
-
cancel(params?: Params$Resource$Projects$Locations$Operations$Cancel, options?: MethodOptions):
|
|
5176
|
+
cancel(params: Params$Resource$Projects$Locations$Operations$Cancel, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5177
|
+
cancel(params?: Params$Resource$Projects$Locations$Operations$Cancel, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
2472
5178
|
cancel(params: Params$Resource$Projects$Locations$Operations$Cancel, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2473
5179
|
cancel(params: Params$Resource$Projects$Locations$Operations$Cancel, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
2474
5180
|
cancel(params: Params$Resource$Projects$Locations$Operations$Cancel, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
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`.
|
|
2481
5234
|
* @param callback - Optional callback that handles the response.
|
|
2482
5235
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2483
5236
|
*/
|
|
2484
|
-
delete(params: Params$Resource$Projects$Locations$Operations$Delete, options: StreamMethodOptions):
|
|
2485
|
-
delete(params?: Params$Resource$Projects$Locations$Operations$Delete, options?: MethodOptions):
|
|
5237
|
+
delete(params: Params$Resource$Projects$Locations$Operations$Delete, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5238
|
+
delete(params?: Params$Resource$Projects$Locations$Operations$Delete, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
|
|
2486
5239
|
delete(params: Params$Resource$Projects$Locations$Operations$Delete, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2487
5240
|
delete(params: Params$Resource$Projects$Locations$Operations$Delete, options: MethodOptions | BodyResponseCallback<Schema$Empty>, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
2488
5241
|
delete(params: Params$Resource$Projects$Locations$Operations$Delete, callback: BodyResponseCallback<Schema$Empty>): void;
|
|
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`.
|
|
2495
5301
|
* @param callback - Optional callback that handles the response.
|
|
2496
5302
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2497
5303
|
*/
|
|
2498
|
-
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions):
|
|
2499
|
-
get(params?: Params$Resource$Projects$Locations$Operations$Get, options?: MethodOptions):
|
|
5304
|
+
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5305
|
+
get(params?: Params$Resource$Projects$Locations$Operations$Get, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2500
5306
|
get(params: Params$Resource$Projects$Locations$Operations$Get, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2501
5307
|
get(params: Params$Resource$Projects$Locations$Operations$Get, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2502
5308
|
get(params: Params$Resource$Projects$Locations$Operations$Get, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
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`.
|
|
2509
5371
|
* @param callback - Optional callback that handles the response.
|
|
2510
5372
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2511
5373
|
*/
|
|
2512
|
-
list(params: Params$Resource$Projects$Locations$Operations$List, options: StreamMethodOptions):
|
|
2513
|
-
list(params?: Params$Resource$Projects$Locations$Operations$List, options?: MethodOptions):
|
|
5374
|
+
list(params: Params$Resource$Projects$Locations$Operations$List, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5375
|
+
list(params?: Params$Resource$Projects$Locations$Operations$List, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
|
|
2514
5376
|
list(params: Params$Resource$Projects$Locations$Operations$List, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2515
5377
|
list(params: Params$Resource$Projects$Locations$Operations$List, options: MethodOptions | BodyResponseCallback<Schema$ListOperationsResponse>, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
|
|
2516
5378
|
list(params: Params$Resource$Projects$Locations$Operations$List, callback: BodyResponseCallback<Schema$ListOperationsResponse>): void;
|
|
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`.
|
|
2523
5446
|
* @param callback - Optional callback that handles the response.
|
|
2524
5447
|
* @returns A promise if used with async/await, or void if used with a callback.
|
|
2525
5448
|
*/
|
|
2526
|
-
wait(params: Params$Resource$Projects$Locations$Operations$Wait, options: StreamMethodOptions):
|
|
2527
|
-
wait(params?: Params$Resource$Projects$Locations$Operations$Wait, options?: MethodOptions):
|
|
5449
|
+
wait(params: Params$Resource$Projects$Locations$Operations$Wait, options: StreamMethodOptions): Promise<GaxiosResponseWithHTTP2<Readable>>;
|
|
5450
|
+
wait(params?: Params$Resource$Projects$Locations$Operations$Wait, options?: MethodOptions): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
|
|
2528
5451
|
wait(params: Params$Resource$Projects$Locations$Operations$Wait, options: StreamMethodOptions | BodyResponseCallback<Readable>, callback: BodyResponseCallback<Readable>): void;
|
|
2529
5452
|
wait(params: Params$Resource$Projects$Locations$Operations$Wait, options: MethodOptions | BodyResponseCallback<Schema$Operation>, callback: BodyResponseCallback<Schema$Operation>): void;
|
|
2530
5453
|
wait(params: Params$Resource$Projects$Locations$Operations$Wait, callback: BodyResponseCallback<Schema$Operation>): void;
|