@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/v3.ts CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  Compute,
24
24
  UserRefreshClient,
25
25
  BaseExternalAccountClient,
26
- GaxiosPromise,
26
+ GaxiosResponseWithHTTP2,
27
27
  GoogleConfigurable,
28
28
  createAPIRequest,
29
29
  MethodOptions,
@@ -1331,6 +1331,66 @@ export namespace translate_v3 {
1331
1331
 
1332
1332
  /**
1333
1333
  * Detects the language of text within a request.
1334
+ * @example
1335
+ * ```js
1336
+ * // Before running the sample:
1337
+ * // - Enable the API at:
1338
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
1339
+ * // - Login into gcloud by running:
1340
+ * // ```sh
1341
+ * // $ gcloud auth application-default login
1342
+ * // ```
1343
+ * // - Install the npm module by running:
1344
+ * // ```sh
1345
+ * // $ npm install googleapis
1346
+ * // ```
1347
+ *
1348
+ * const {google} = require('googleapis');
1349
+ * const translate = google.translate('v3');
1350
+ *
1351
+ * async function main() {
1352
+ * const auth = new google.auth.GoogleAuth({
1353
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1354
+ * scopes: [
1355
+ * 'https://www.googleapis.com/auth/cloud-platform',
1356
+ * 'https://www.googleapis.com/auth/cloud-translation',
1357
+ * ],
1358
+ * });
1359
+ *
1360
+ * // Acquire an auth client, and bind it to all future calls
1361
+ * const authClient = await auth.getClient();
1362
+ * google.options({auth: authClient});
1363
+ *
1364
+ * // Do the magic
1365
+ * const res = await translate.projects.detectLanguage({
1366
+ * // 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.
1367
+ * parent: 'projects/my-project',
1368
+ *
1369
+ * // Request body metadata
1370
+ * requestBody: {
1371
+ * // request body parameters
1372
+ * // {
1373
+ * // "content": "my_content",
1374
+ * // "labels": {},
1375
+ * // "mimeType": "my_mimeType",
1376
+ * // "model": "my_model"
1377
+ * // }
1378
+ * },
1379
+ * });
1380
+ * console.log(res.data);
1381
+ *
1382
+ * // Example response
1383
+ * // {
1384
+ * // "languages": []
1385
+ * // }
1386
+ * }
1387
+ *
1388
+ * main().catch(e => {
1389
+ * console.error(e);
1390
+ * throw e;
1391
+ * });
1392
+ *
1393
+ * ```
1334
1394
  *
1335
1395
  * @param params - Parameters for request
1336
1396
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1340,11 +1400,11 @@ export namespace translate_v3 {
1340
1400
  detectLanguage(
1341
1401
  params: Params$Resource$Projects$Detectlanguage,
1342
1402
  options: StreamMethodOptions
1343
- ): GaxiosPromise<Readable>;
1403
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1344
1404
  detectLanguage(
1345
1405
  params?: Params$Resource$Projects$Detectlanguage,
1346
1406
  options?: MethodOptions
1347
- ): GaxiosPromise<Schema$DetectLanguageResponse>;
1407
+ ): Promise<GaxiosResponseWithHTTP2<Schema$DetectLanguageResponse>>;
1348
1408
  detectLanguage(
1349
1409
  params: Params$Resource$Projects$Detectlanguage,
1350
1410
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1379,8 +1439,8 @@ export namespace translate_v3 {
1379
1439
  | BodyResponseCallback<Readable>
1380
1440
  ):
1381
1441
  | void
1382
- | GaxiosPromise<Schema$DetectLanguageResponse>
1383
- | GaxiosPromise<Readable> {
1442
+ | Promise<GaxiosResponseWithHTTP2<Schema$DetectLanguageResponse>>
1443
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1384
1444
  let params = (paramsOrCallback ||
1385
1445
  {}) as Params$Resource$Projects$Detectlanguage;
1386
1446
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1426,6 +1486,59 @@ export namespace translate_v3 {
1426
1486
 
1427
1487
  /**
1428
1488
  * Returns a list of supported languages for translation.
1489
+ * @example
1490
+ * ```js
1491
+ * // Before running the sample:
1492
+ * // - Enable the API at:
1493
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
1494
+ * // - Login into gcloud by running:
1495
+ * // ```sh
1496
+ * // $ gcloud auth application-default login
1497
+ * // ```
1498
+ * // - Install the npm module by running:
1499
+ * // ```sh
1500
+ * // $ npm install googleapis
1501
+ * // ```
1502
+ *
1503
+ * const {google} = require('googleapis');
1504
+ * const translate = google.translate('v3');
1505
+ *
1506
+ * async function main() {
1507
+ * const auth = new google.auth.GoogleAuth({
1508
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1509
+ * scopes: [
1510
+ * 'https://www.googleapis.com/auth/cloud-platform',
1511
+ * 'https://www.googleapis.com/auth/cloud-translation',
1512
+ * ],
1513
+ * });
1514
+ *
1515
+ * // Acquire an auth client, and bind it to all future calls
1516
+ * const authClient = await auth.getClient();
1517
+ * google.options({auth: authClient});
1518
+ *
1519
+ * // Do the magic
1520
+ * const res = await translate.projects.getSupportedLanguages({
1521
+ * // 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.
1522
+ * displayLanguageCode: 'placeholder-value',
1523
+ * // 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.
1524
+ * model: 'placeholder-value',
1525
+ * // 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.
1526
+ * parent: 'projects/my-project',
1527
+ * });
1528
+ * console.log(res.data);
1529
+ *
1530
+ * // Example response
1531
+ * // {
1532
+ * // "languages": []
1533
+ * // }
1534
+ * }
1535
+ *
1536
+ * main().catch(e => {
1537
+ * console.error(e);
1538
+ * throw e;
1539
+ * });
1540
+ *
1541
+ * ```
1429
1542
  *
1430
1543
  * @param params - Parameters for request
1431
1544
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1435,11 +1548,11 @@ export namespace translate_v3 {
1435
1548
  getSupportedLanguages(
1436
1549
  params: Params$Resource$Projects$Getsupportedlanguages,
1437
1550
  options: StreamMethodOptions
1438
- ): GaxiosPromise<Readable>;
1551
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1439
1552
  getSupportedLanguages(
1440
1553
  params?: Params$Resource$Projects$Getsupportedlanguages,
1441
1554
  options?: MethodOptions
1442
- ): GaxiosPromise<Schema$SupportedLanguages>;
1555
+ ): Promise<GaxiosResponseWithHTTP2<Schema$SupportedLanguages>>;
1443
1556
  getSupportedLanguages(
1444
1557
  params: Params$Resource$Projects$Getsupportedlanguages,
1445
1558
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1472,8 +1585,8 @@ export namespace translate_v3 {
1472
1585
  | BodyResponseCallback<Readable>
1473
1586
  ):
1474
1587
  | void
1475
- | GaxiosPromise<Schema$SupportedLanguages>
1476
- | GaxiosPromise<Readable> {
1588
+ | Promise<GaxiosResponseWithHTTP2<Schema$SupportedLanguages>>
1589
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1477
1590
  let params = (paramsOrCallback ||
1478
1591
  {}) as Params$Resource$Projects$Getsupportedlanguages;
1479
1592
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1519,6 +1632,64 @@ export namespace translate_v3 {
1519
1632
 
1520
1633
  /**
1521
1634
  * Romanize input text written in non-Latin scripts to Latin text.
1635
+ * @example
1636
+ * ```js
1637
+ * // Before running the sample:
1638
+ * // - Enable the API at:
1639
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
1640
+ * // - Login into gcloud by running:
1641
+ * // ```sh
1642
+ * // $ gcloud auth application-default login
1643
+ * // ```
1644
+ * // - Install the npm module by running:
1645
+ * // ```sh
1646
+ * // $ npm install googleapis
1647
+ * // ```
1648
+ *
1649
+ * const {google} = require('googleapis');
1650
+ * const translate = google.translate('v3');
1651
+ *
1652
+ * async function main() {
1653
+ * const auth = new google.auth.GoogleAuth({
1654
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1655
+ * scopes: [
1656
+ * 'https://www.googleapis.com/auth/cloud-platform',
1657
+ * 'https://www.googleapis.com/auth/cloud-translation',
1658
+ * ],
1659
+ * });
1660
+ *
1661
+ * // Acquire an auth client, and bind it to all future calls
1662
+ * const authClient = await auth.getClient();
1663
+ * google.options({auth: authClient});
1664
+ *
1665
+ * // Do the magic
1666
+ * const res = await translate.projects.romanizeText({
1667
+ * // 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\}`.
1668
+ * parent: 'projects/my-project',
1669
+ *
1670
+ * // Request body metadata
1671
+ * requestBody: {
1672
+ * // request body parameters
1673
+ * // {
1674
+ * // "contents": [],
1675
+ * // "sourceLanguageCode": "my_sourceLanguageCode"
1676
+ * // }
1677
+ * },
1678
+ * });
1679
+ * console.log(res.data);
1680
+ *
1681
+ * // Example response
1682
+ * // {
1683
+ * // "romanizations": []
1684
+ * // }
1685
+ * }
1686
+ *
1687
+ * main().catch(e => {
1688
+ * console.error(e);
1689
+ * throw e;
1690
+ * });
1691
+ *
1692
+ * ```
1522
1693
  *
1523
1694
  * @param params - Parameters for request
1524
1695
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1528,11 +1699,11 @@ export namespace translate_v3 {
1528
1699
  romanizeText(
1529
1700
  params: Params$Resource$Projects$Romanizetext,
1530
1701
  options: StreamMethodOptions
1531
- ): GaxiosPromise<Readable>;
1702
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1532
1703
  romanizeText(
1533
1704
  params?: Params$Resource$Projects$Romanizetext,
1534
1705
  options?: MethodOptions
1535
- ): GaxiosPromise<Schema$RomanizeTextResponse>;
1706
+ ): Promise<GaxiosResponseWithHTTP2<Schema$RomanizeTextResponse>>;
1536
1707
  romanizeText(
1537
1708
  params: Params$Resource$Projects$Romanizetext,
1538
1709
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1567,8 +1738,8 @@ export namespace translate_v3 {
1567
1738
  | BodyResponseCallback<Readable>
1568
1739
  ):
1569
1740
  | void
1570
- | GaxiosPromise<Schema$RomanizeTextResponse>
1571
- | GaxiosPromise<Readable> {
1741
+ | Promise<GaxiosResponseWithHTTP2<Schema$RomanizeTextResponse>>
1742
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1572
1743
  let params = (paramsOrCallback ||
1573
1744
  {}) as Params$Resource$Projects$Romanizetext;
1574
1745
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1614,6 +1785,71 @@ export namespace translate_v3 {
1614
1785
 
1615
1786
  /**
1616
1787
  * Translates input text and returns translated text.
1788
+ * @example
1789
+ * ```js
1790
+ * // Before running the sample:
1791
+ * // - Enable the API at:
1792
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
1793
+ * // - Login into gcloud by running:
1794
+ * // ```sh
1795
+ * // $ gcloud auth application-default login
1796
+ * // ```
1797
+ * // - Install the npm module by running:
1798
+ * // ```sh
1799
+ * // $ npm install googleapis
1800
+ * // ```
1801
+ *
1802
+ * const {google} = require('googleapis');
1803
+ * const translate = google.translate('v3');
1804
+ *
1805
+ * async function main() {
1806
+ * const auth = new google.auth.GoogleAuth({
1807
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1808
+ * scopes: [
1809
+ * 'https://www.googleapis.com/auth/cloud-platform',
1810
+ * 'https://www.googleapis.com/auth/cloud-translation',
1811
+ * ],
1812
+ * });
1813
+ *
1814
+ * // Acquire an auth client, and bind it to all future calls
1815
+ * const authClient = await auth.getClient();
1816
+ * google.options({auth: authClient});
1817
+ *
1818
+ * // Do the magic
1819
+ * const res = await translate.projects.translateText({
1820
+ * // 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.
1821
+ * parent: 'projects/my-project',
1822
+ *
1823
+ * // Request body metadata
1824
+ * requestBody: {
1825
+ * // request body parameters
1826
+ * // {
1827
+ * // "contents": [],
1828
+ * // "glossaryConfig": {},
1829
+ * // "labels": {},
1830
+ * // "mimeType": "my_mimeType",
1831
+ * // "model": "my_model",
1832
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
1833
+ * // "targetLanguageCode": "my_targetLanguageCode",
1834
+ * // "transliterationConfig": {}
1835
+ * // }
1836
+ * },
1837
+ * });
1838
+ * console.log(res.data);
1839
+ *
1840
+ * // Example response
1841
+ * // {
1842
+ * // "glossaryTranslations": [],
1843
+ * // "translations": []
1844
+ * // }
1845
+ * }
1846
+ *
1847
+ * main().catch(e => {
1848
+ * console.error(e);
1849
+ * throw e;
1850
+ * });
1851
+ *
1852
+ * ```
1617
1853
  *
1618
1854
  * @param params - Parameters for request
1619
1855
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1623,11 +1859,11 @@ export namespace translate_v3 {
1623
1859
  translateText(
1624
1860
  params: Params$Resource$Projects$Translatetext,
1625
1861
  options: StreamMethodOptions
1626
- ): GaxiosPromise<Readable>;
1862
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1627
1863
  translateText(
1628
1864
  params?: Params$Resource$Projects$Translatetext,
1629
1865
  options?: MethodOptions
1630
- ): GaxiosPromise<Schema$TranslateTextResponse>;
1866
+ ): Promise<GaxiosResponseWithHTTP2<Schema$TranslateTextResponse>>;
1631
1867
  translateText(
1632
1868
  params: Params$Resource$Projects$Translatetext,
1633
1869
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1662,8 +1898,8 @@ export namespace translate_v3 {
1662
1898
  | BodyResponseCallback<Readable>
1663
1899
  ):
1664
1900
  | void
1665
- | GaxiosPromise<Schema$TranslateTextResponse>
1666
- | GaxiosPromise<Readable> {
1901
+ | Promise<GaxiosResponseWithHTTP2<Schema$TranslateTextResponse>>
1902
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1667
1903
  let params = (paramsOrCallback ||
1668
1904
  {}) as Params$Resource$Projects$Translatetext;
1669
1905
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1783,6 +2019,68 @@ export namespace translate_v3 {
1783
2019
 
1784
2020
  /**
1785
2021
  * Translate text using Adaptive MT.
2022
+ * @example
2023
+ * ```js
2024
+ * // Before running the sample:
2025
+ * // - Enable the API at:
2026
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2027
+ * // - Login into gcloud by running:
2028
+ * // ```sh
2029
+ * // $ gcloud auth application-default login
2030
+ * // ```
2031
+ * // - Install the npm module by running:
2032
+ * // ```sh
2033
+ * // $ npm install googleapis
2034
+ * // ```
2035
+ *
2036
+ * const {google} = require('googleapis');
2037
+ * const translate = google.translate('v3');
2038
+ *
2039
+ * async function main() {
2040
+ * const auth = new google.auth.GoogleAuth({
2041
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2042
+ * scopes: [
2043
+ * 'https://www.googleapis.com/auth/cloud-platform',
2044
+ * 'https://www.googleapis.com/auth/cloud-translation',
2045
+ * ],
2046
+ * });
2047
+ *
2048
+ * // Acquire an auth client, and bind it to all future calls
2049
+ * const authClient = await auth.getClient();
2050
+ * google.options({auth: authClient});
2051
+ *
2052
+ * // Do the magic
2053
+ * const res = await translate.projects.locations.adaptiveMtTranslate({
2054
+ * // Required. Location to make a regional call. Format: `projects/{project-number-or-id\}/locations/{location-id\}`.
2055
+ * parent: 'projects/my-project/locations/my-location',
2056
+ *
2057
+ * // Request body metadata
2058
+ * requestBody: {
2059
+ * // request body parameters
2060
+ * // {
2061
+ * // "content": [],
2062
+ * // "dataset": "my_dataset",
2063
+ * // "glossaryConfig": {},
2064
+ * // "referenceSentenceConfig": {}
2065
+ * // }
2066
+ * },
2067
+ * });
2068
+ * console.log(res.data);
2069
+ *
2070
+ * // Example response
2071
+ * // {
2072
+ * // "glossaryTranslations": [],
2073
+ * // "languageCode": "my_languageCode",
2074
+ * // "translations": []
2075
+ * // }
2076
+ * }
2077
+ *
2078
+ * main().catch(e => {
2079
+ * console.error(e);
2080
+ * throw e;
2081
+ * });
2082
+ *
2083
+ * ```
1786
2084
  *
1787
2085
  * @param params - Parameters for request
1788
2086
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1792,11 +2090,11 @@ export namespace translate_v3 {
1792
2090
  adaptiveMtTranslate(
1793
2091
  params: Params$Resource$Projects$Locations$Adaptivemttranslate,
1794
2092
  options: StreamMethodOptions
1795
- ): GaxiosPromise<Readable>;
2093
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1796
2094
  adaptiveMtTranslate(
1797
2095
  params?: Params$Resource$Projects$Locations$Adaptivemttranslate,
1798
2096
  options?: MethodOptions
1799
- ): GaxiosPromise<Schema$AdaptiveMtTranslateResponse>;
2097
+ ): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtTranslateResponse>>;
1800
2098
  adaptiveMtTranslate(
1801
2099
  params: Params$Resource$Projects$Locations$Adaptivemttranslate,
1802
2100
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1831,8 +2129,8 @@ export namespace translate_v3 {
1831
2129
  | BodyResponseCallback<Readable>
1832
2130
  ):
1833
2131
  | void
1834
- | GaxiosPromise<Schema$AdaptiveMtTranslateResponse>
1835
- | GaxiosPromise<Readable> {
2132
+ | Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtTranslateResponse>>
2133
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1836
2134
  let params = (paramsOrCallback ||
1837
2135
  {}) as Params$Resource$Projects$Locations$Adaptivemttranslate;
1838
2136
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1878,6 +2176,76 @@ export namespace translate_v3 {
1878
2176
 
1879
2177
  /**
1880
2178
  * 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.
2179
+ * @example
2180
+ * ```js
2181
+ * // Before running the sample:
2182
+ * // - Enable the API at:
2183
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2184
+ * // - Login into gcloud by running:
2185
+ * // ```sh
2186
+ * // $ gcloud auth application-default login
2187
+ * // ```
2188
+ * // - Install the npm module by running:
2189
+ * // ```sh
2190
+ * // $ npm install googleapis
2191
+ * // ```
2192
+ *
2193
+ * const {google} = require('googleapis');
2194
+ * const translate = google.translate('v3');
2195
+ *
2196
+ * async function main() {
2197
+ * const auth = new google.auth.GoogleAuth({
2198
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2199
+ * scopes: [
2200
+ * 'https://www.googleapis.com/auth/cloud-platform',
2201
+ * 'https://www.googleapis.com/auth/cloud-translation',
2202
+ * ],
2203
+ * });
2204
+ *
2205
+ * // Acquire an auth client, and bind it to all future calls
2206
+ * const authClient = await auth.getClient();
2207
+ * google.options({auth: authClient});
2208
+ *
2209
+ * // Do the magic
2210
+ * const res = await translate.projects.locations.batchTranslateDocument({
2211
+ * // 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.
2212
+ * parent: 'projects/my-project/locations/my-location',
2213
+ *
2214
+ * // Request body metadata
2215
+ * requestBody: {
2216
+ * // request body parameters
2217
+ * // {
2218
+ * // "customizedAttribution": "my_customizedAttribution",
2219
+ * // "enableRotationCorrection": false,
2220
+ * // "enableShadowRemovalNativePdf": false,
2221
+ * // "formatConversions": {},
2222
+ * // "glossaries": {},
2223
+ * // "inputConfigs": [],
2224
+ * // "models": {},
2225
+ * // "outputConfig": {},
2226
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
2227
+ * // "targetLanguageCodes": []
2228
+ * // }
2229
+ * },
2230
+ * });
2231
+ * console.log(res.data);
2232
+ *
2233
+ * // Example response
2234
+ * // {
2235
+ * // "done": false,
2236
+ * // "error": {},
2237
+ * // "metadata": {},
2238
+ * // "name": "my_name",
2239
+ * // "response": {}
2240
+ * // }
2241
+ * }
2242
+ *
2243
+ * main().catch(e => {
2244
+ * console.error(e);
2245
+ * throw e;
2246
+ * });
2247
+ *
2248
+ * ```
1881
2249
  *
1882
2250
  * @param params - Parameters for request
1883
2251
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1887,11 +2255,11 @@ export namespace translate_v3 {
1887
2255
  batchTranslateDocument(
1888
2256
  params: Params$Resource$Projects$Locations$Batchtranslatedocument,
1889
2257
  options: StreamMethodOptions
1890
- ): GaxiosPromise<Readable>;
2258
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1891
2259
  batchTranslateDocument(
1892
2260
  params?: Params$Resource$Projects$Locations$Batchtranslatedocument,
1893
2261
  options?: MethodOptions
1894
- ): GaxiosPromise<Schema$Operation>;
2262
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
1895
2263
  batchTranslateDocument(
1896
2264
  params: Params$Resource$Projects$Locations$Batchtranslatedocument,
1897
2265
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -1922,7 +2290,10 @@ export namespace translate_v3 {
1922
2290
  callback?:
1923
2291
  | BodyResponseCallback<Schema$Operation>
1924
2292
  | BodyResponseCallback<Readable>
1925
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2293
+ ):
2294
+ | void
2295
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
2296
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
1926
2297
  let params = (paramsOrCallback ||
1927
2298
  {}) as Params$Resource$Projects$Locations$Batchtranslatedocument;
1928
2299
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -1969,6 +2340,73 @@ export namespace translate_v3 {
1969
2340
 
1970
2341
  /**
1971
2342
  * 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.
2343
+ * @example
2344
+ * ```js
2345
+ * // Before running the sample:
2346
+ * // - Enable the API at:
2347
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2348
+ * // - Login into gcloud by running:
2349
+ * // ```sh
2350
+ * // $ gcloud auth application-default login
2351
+ * // ```
2352
+ * // - Install the npm module by running:
2353
+ * // ```sh
2354
+ * // $ npm install googleapis
2355
+ * // ```
2356
+ *
2357
+ * const {google} = require('googleapis');
2358
+ * const translate = google.translate('v3');
2359
+ *
2360
+ * async function main() {
2361
+ * const auth = new google.auth.GoogleAuth({
2362
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2363
+ * scopes: [
2364
+ * 'https://www.googleapis.com/auth/cloud-platform',
2365
+ * 'https://www.googleapis.com/auth/cloud-translation',
2366
+ * ],
2367
+ * });
2368
+ *
2369
+ * // Acquire an auth client, and bind it to all future calls
2370
+ * const authClient = await auth.getClient();
2371
+ * google.options({auth: authClient});
2372
+ *
2373
+ * // Do the magic
2374
+ * const res = await translate.projects.locations.batchTranslateText({
2375
+ * // 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.
2376
+ * parent: 'projects/my-project/locations/my-location',
2377
+ *
2378
+ * // Request body metadata
2379
+ * requestBody: {
2380
+ * // request body parameters
2381
+ * // {
2382
+ * // "glossaries": {},
2383
+ * // "inputConfigs": [],
2384
+ * // "labels": {},
2385
+ * // "models": {},
2386
+ * // "outputConfig": {},
2387
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
2388
+ * // "targetLanguageCodes": []
2389
+ * // }
2390
+ * },
2391
+ * });
2392
+ * console.log(res.data);
2393
+ *
2394
+ * // Example response
2395
+ * // {
2396
+ * // "done": false,
2397
+ * // "error": {},
2398
+ * // "metadata": {},
2399
+ * // "name": "my_name",
2400
+ * // "response": {}
2401
+ * // }
2402
+ * }
2403
+ *
2404
+ * main().catch(e => {
2405
+ * console.error(e);
2406
+ * throw e;
2407
+ * });
2408
+ *
2409
+ * ```
1972
2410
  *
1973
2411
  * @param params - Parameters for request
1974
2412
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1978,11 +2416,11 @@ export namespace translate_v3 {
1978
2416
  batchTranslateText(
1979
2417
  params: Params$Resource$Projects$Locations$Batchtranslatetext,
1980
2418
  options: StreamMethodOptions
1981
- ): GaxiosPromise<Readable>;
2419
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
1982
2420
  batchTranslateText(
1983
2421
  params?: Params$Resource$Projects$Locations$Batchtranslatetext,
1984
2422
  options?: MethodOptions
1985
- ): GaxiosPromise<Schema$Operation>;
2423
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
1986
2424
  batchTranslateText(
1987
2425
  params: Params$Resource$Projects$Locations$Batchtranslatetext,
1988
2426
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2011,7 +2449,10 @@ export namespace translate_v3 {
2011
2449
  callback?:
2012
2450
  | BodyResponseCallback<Schema$Operation>
2013
2451
  | BodyResponseCallback<Readable>
2014
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
2452
+ ):
2453
+ | void
2454
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
2455
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2015
2456
  let params = (paramsOrCallback ||
2016
2457
  {}) as Params$Resource$Projects$Locations$Batchtranslatetext;
2017
2458
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2057,6 +2498,66 @@ export namespace translate_v3 {
2057
2498
 
2058
2499
  /**
2059
2500
  * Detects the language of text within a request.
2501
+ * @example
2502
+ * ```js
2503
+ * // Before running the sample:
2504
+ * // - Enable the API at:
2505
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2506
+ * // - Login into gcloud by running:
2507
+ * // ```sh
2508
+ * // $ gcloud auth application-default login
2509
+ * // ```
2510
+ * // - Install the npm module by running:
2511
+ * // ```sh
2512
+ * // $ npm install googleapis
2513
+ * // ```
2514
+ *
2515
+ * const {google} = require('googleapis');
2516
+ * const translate = google.translate('v3');
2517
+ *
2518
+ * async function main() {
2519
+ * const auth = new google.auth.GoogleAuth({
2520
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2521
+ * scopes: [
2522
+ * 'https://www.googleapis.com/auth/cloud-platform',
2523
+ * 'https://www.googleapis.com/auth/cloud-translation',
2524
+ * ],
2525
+ * });
2526
+ *
2527
+ * // Acquire an auth client, and bind it to all future calls
2528
+ * const authClient = await auth.getClient();
2529
+ * google.options({auth: authClient});
2530
+ *
2531
+ * // Do the magic
2532
+ * const res = await translate.projects.locations.detectLanguage({
2533
+ * // 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.
2534
+ * parent: 'projects/my-project/locations/my-location',
2535
+ *
2536
+ * // Request body metadata
2537
+ * requestBody: {
2538
+ * // request body parameters
2539
+ * // {
2540
+ * // "content": "my_content",
2541
+ * // "labels": {},
2542
+ * // "mimeType": "my_mimeType",
2543
+ * // "model": "my_model"
2544
+ * // }
2545
+ * },
2546
+ * });
2547
+ * console.log(res.data);
2548
+ *
2549
+ * // Example response
2550
+ * // {
2551
+ * // "languages": []
2552
+ * // }
2553
+ * }
2554
+ *
2555
+ * main().catch(e => {
2556
+ * console.error(e);
2557
+ * throw e;
2558
+ * });
2559
+ *
2560
+ * ```
2060
2561
  *
2061
2562
  * @param params - Parameters for request
2062
2563
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2066,11 +2567,11 @@ export namespace translate_v3 {
2066
2567
  detectLanguage(
2067
2568
  params: Params$Resource$Projects$Locations$Detectlanguage,
2068
2569
  options: StreamMethodOptions
2069
- ): GaxiosPromise<Readable>;
2570
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2070
2571
  detectLanguage(
2071
2572
  params?: Params$Resource$Projects$Locations$Detectlanguage,
2072
2573
  options?: MethodOptions
2073
- ): GaxiosPromise<Schema$DetectLanguageResponse>;
2574
+ ): Promise<GaxiosResponseWithHTTP2<Schema$DetectLanguageResponse>>;
2074
2575
  detectLanguage(
2075
2576
  params: Params$Resource$Projects$Locations$Detectlanguage,
2076
2577
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2105,8 +2606,8 @@ export namespace translate_v3 {
2105
2606
  | BodyResponseCallback<Readable>
2106
2607
  ):
2107
2608
  | void
2108
- | GaxiosPromise<Schema$DetectLanguageResponse>
2109
- | GaxiosPromise<Readable> {
2609
+ | Promise<GaxiosResponseWithHTTP2<Schema$DetectLanguageResponse>>
2610
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2110
2611
  let params = (paramsOrCallback ||
2111
2612
  {}) as Params$Resource$Projects$Locations$Detectlanguage;
2112
2613
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2152,6 +2653,59 @@ export namespace translate_v3 {
2152
2653
 
2153
2654
  /**
2154
2655
  * Gets information about a location.
2656
+ * @example
2657
+ * ```js
2658
+ * // Before running the sample:
2659
+ * // - Enable the API at:
2660
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2661
+ * // - Login into gcloud by running:
2662
+ * // ```sh
2663
+ * // $ gcloud auth application-default login
2664
+ * // ```
2665
+ * // - Install the npm module by running:
2666
+ * // ```sh
2667
+ * // $ npm install googleapis
2668
+ * // ```
2669
+ *
2670
+ * const {google} = require('googleapis');
2671
+ * const translate = google.translate('v3');
2672
+ *
2673
+ * async function main() {
2674
+ * const auth = new google.auth.GoogleAuth({
2675
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2676
+ * scopes: [
2677
+ * 'https://www.googleapis.com/auth/cloud-platform',
2678
+ * 'https://www.googleapis.com/auth/cloud-translation',
2679
+ * ],
2680
+ * });
2681
+ *
2682
+ * // Acquire an auth client, and bind it to all future calls
2683
+ * const authClient = await auth.getClient();
2684
+ * google.options({auth: authClient});
2685
+ *
2686
+ * // Do the magic
2687
+ * const res = await translate.projects.locations.get({
2688
+ * // Resource name for the location.
2689
+ * name: 'projects/my-project/locations/my-location',
2690
+ * });
2691
+ * console.log(res.data);
2692
+ *
2693
+ * // Example response
2694
+ * // {
2695
+ * // "displayName": "my_displayName",
2696
+ * // "labels": {},
2697
+ * // "locationId": "my_locationId",
2698
+ * // "metadata": {},
2699
+ * // "name": "my_name"
2700
+ * // }
2701
+ * }
2702
+ *
2703
+ * main().catch(e => {
2704
+ * console.error(e);
2705
+ * throw e;
2706
+ * });
2707
+ *
2708
+ * ```
2155
2709
  *
2156
2710
  * @param params - Parameters for request
2157
2711
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2161,11 +2715,11 @@ export namespace translate_v3 {
2161
2715
  get(
2162
2716
  params: Params$Resource$Projects$Locations$Get,
2163
2717
  options: StreamMethodOptions
2164
- ): GaxiosPromise<Readable>;
2718
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2165
2719
  get(
2166
2720
  params?: Params$Resource$Projects$Locations$Get,
2167
2721
  options?: MethodOptions
2168
- ): GaxiosPromise<Schema$Location>;
2722
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Location>>;
2169
2723
  get(
2170
2724
  params: Params$Resource$Projects$Locations$Get,
2171
2725
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2194,7 +2748,10 @@ export namespace translate_v3 {
2194
2748
  callback?:
2195
2749
  | BodyResponseCallback<Schema$Location>
2196
2750
  | BodyResponseCallback<Readable>
2197
- ): void | GaxiosPromise<Schema$Location> | GaxiosPromise<Readable> {
2751
+ ):
2752
+ | void
2753
+ | Promise<GaxiosResponseWithHTTP2<Schema$Location>>
2754
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2198
2755
  let params = (paramsOrCallback ||
2199
2756
  {}) as Params$Resource$Projects$Locations$Get;
2200
2757
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2237,6 +2794,59 @@ export namespace translate_v3 {
2237
2794
 
2238
2795
  /**
2239
2796
  * Returns a list of supported languages for translation.
2797
+ * @example
2798
+ * ```js
2799
+ * // Before running the sample:
2800
+ * // - Enable the API at:
2801
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2802
+ * // - Login into gcloud by running:
2803
+ * // ```sh
2804
+ * // $ gcloud auth application-default login
2805
+ * // ```
2806
+ * // - Install the npm module by running:
2807
+ * // ```sh
2808
+ * // $ npm install googleapis
2809
+ * // ```
2810
+ *
2811
+ * const {google} = require('googleapis');
2812
+ * const translate = google.translate('v3');
2813
+ *
2814
+ * async function main() {
2815
+ * const auth = new google.auth.GoogleAuth({
2816
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2817
+ * scopes: [
2818
+ * 'https://www.googleapis.com/auth/cloud-platform',
2819
+ * 'https://www.googleapis.com/auth/cloud-translation',
2820
+ * ],
2821
+ * });
2822
+ *
2823
+ * // Acquire an auth client, and bind it to all future calls
2824
+ * const authClient = await auth.getClient();
2825
+ * google.options({auth: authClient});
2826
+ *
2827
+ * // Do the magic
2828
+ * const res = await translate.projects.locations.getSupportedLanguages({
2829
+ * // 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.
2830
+ * displayLanguageCode: 'placeholder-value',
2831
+ * // 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.
2832
+ * model: 'placeholder-value',
2833
+ * // 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.
2834
+ * parent: 'projects/my-project/locations/my-location',
2835
+ * });
2836
+ * console.log(res.data);
2837
+ *
2838
+ * // Example response
2839
+ * // {
2840
+ * // "languages": []
2841
+ * // }
2842
+ * }
2843
+ *
2844
+ * main().catch(e => {
2845
+ * console.error(e);
2846
+ * throw e;
2847
+ * });
2848
+ *
2849
+ * ```
2240
2850
  *
2241
2851
  * @param params - Parameters for request
2242
2852
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2246,11 +2856,11 @@ export namespace translate_v3 {
2246
2856
  getSupportedLanguages(
2247
2857
  params: Params$Resource$Projects$Locations$Getsupportedlanguages,
2248
2858
  options: StreamMethodOptions
2249
- ): GaxiosPromise<Readable>;
2859
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2250
2860
  getSupportedLanguages(
2251
2861
  params?: Params$Resource$Projects$Locations$Getsupportedlanguages,
2252
2862
  options?: MethodOptions
2253
- ): GaxiosPromise<Schema$SupportedLanguages>;
2863
+ ): Promise<GaxiosResponseWithHTTP2<Schema$SupportedLanguages>>;
2254
2864
  getSupportedLanguages(
2255
2865
  params: Params$Resource$Projects$Locations$Getsupportedlanguages,
2256
2866
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2283,8 +2893,8 @@ export namespace translate_v3 {
2283
2893
  | BodyResponseCallback<Readable>
2284
2894
  ):
2285
2895
  | void
2286
- | GaxiosPromise<Schema$SupportedLanguages>
2287
- | GaxiosPromise<Readable> {
2896
+ | Promise<GaxiosResponseWithHTTP2<Schema$SupportedLanguages>>
2897
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2288
2898
  let params = (paramsOrCallback ||
2289
2899
  {}) as Params$Resource$Projects$Locations$Getsupportedlanguages;
2290
2900
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2330,6 +2940,64 @@ export namespace translate_v3 {
2330
2940
 
2331
2941
  /**
2332
2942
  * Lists information about the supported locations for this service.
2943
+ * @example
2944
+ * ```js
2945
+ * // Before running the sample:
2946
+ * // - Enable the API at:
2947
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
2948
+ * // - Login into gcloud by running:
2949
+ * // ```sh
2950
+ * // $ gcloud auth application-default login
2951
+ * // ```
2952
+ * // - Install the npm module by running:
2953
+ * // ```sh
2954
+ * // $ npm install googleapis
2955
+ * // ```
2956
+ *
2957
+ * const {google} = require('googleapis');
2958
+ * const translate = google.translate('v3');
2959
+ *
2960
+ * async function main() {
2961
+ * const auth = new google.auth.GoogleAuth({
2962
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
2963
+ * scopes: [
2964
+ * 'https://www.googleapis.com/auth/cloud-platform',
2965
+ * 'https://www.googleapis.com/auth/cloud-translation',
2966
+ * ],
2967
+ * });
2968
+ *
2969
+ * // Acquire an auth client, and bind it to all future calls
2970
+ * const authClient = await auth.getClient();
2971
+ * google.options({auth: authClient});
2972
+ *
2973
+ * // Do the magic
2974
+ * const res = await translate.projects.locations.list({
2975
+ * // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
2976
+ * extraLocationTypes: 'placeholder-value',
2977
+ * // 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).
2978
+ * filter: 'placeholder-value',
2979
+ * // The resource that owns the locations collection, if applicable.
2980
+ * name: 'projects/my-project',
2981
+ * // The maximum number of results to return. If not set, the service selects a default.
2982
+ * pageSize: 'placeholder-value',
2983
+ * // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
2984
+ * pageToken: 'placeholder-value',
2985
+ * });
2986
+ * console.log(res.data);
2987
+ *
2988
+ * // Example response
2989
+ * // {
2990
+ * // "locations": [],
2991
+ * // "nextPageToken": "my_nextPageToken"
2992
+ * // }
2993
+ * }
2994
+ *
2995
+ * main().catch(e => {
2996
+ * console.error(e);
2997
+ * throw e;
2998
+ * });
2999
+ *
3000
+ * ```
2333
3001
  *
2334
3002
  * @param params - Parameters for request
2335
3003
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2339,11 +3007,11 @@ export namespace translate_v3 {
2339
3007
  list(
2340
3008
  params: Params$Resource$Projects$Locations$List,
2341
3009
  options: StreamMethodOptions
2342
- ): GaxiosPromise<Readable>;
3010
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2343
3011
  list(
2344
3012
  params?: Params$Resource$Projects$Locations$List,
2345
3013
  options?: MethodOptions
2346
- ): GaxiosPromise<Schema$ListLocationsResponse>;
3014
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>;
2347
3015
  list(
2348
3016
  params: Params$Resource$Projects$Locations$List,
2349
3017
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2376,8 +3044,8 @@ export namespace translate_v3 {
2376
3044
  | BodyResponseCallback<Readable>
2377
3045
  ):
2378
3046
  | void
2379
- | GaxiosPromise<Schema$ListLocationsResponse>
2380
- | GaxiosPromise<Readable> {
3047
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListLocationsResponse>>
3048
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2381
3049
  let params = (paramsOrCallback ||
2382
3050
  {}) as Params$Resource$Projects$Locations$List;
2383
3051
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2423,6 +3091,64 @@ export namespace translate_v3 {
2423
3091
 
2424
3092
  /**
2425
3093
  * Romanize input text written in non-Latin scripts to Latin text.
3094
+ * @example
3095
+ * ```js
3096
+ * // Before running the sample:
3097
+ * // - Enable the API at:
3098
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
3099
+ * // - Login into gcloud by running:
3100
+ * // ```sh
3101
+ * // $ gcloud auth application-default login
3102
+ * // ```
3103
+ * // - Install the npm module by running:
3104
+ * // ```sh
3105
+ * // $ npm install googleapis
3106
+ * // ```
3107
+ *
3108
+ * const {google} = require('googleapis');
3109
+ * const translate = google.translate('v3');
3110
+ *
3111
+ * async function main() {
3112
+ * const auth = new google.auth.GoogleAuth({
3113
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3114
+ * scopes: [
3115
+ * 'https://www.googleapis.com/auth/cloud-platform',
3116
+ * 'https://www.googleapis.com/auth/cloud-translation',
3117
+ * ],
3118
+ * });
3119
+ *
3120
+ * // Acquire an auth client, and bind it to all future calls
3121
+ * const authClient = await auth.getClient();
3122
+ * google.options({auth: authClient});
3123
+ *
3124
+ * // Do the magic
3125
+ * const res = await translate.projects.locations.romanizeText({
3126
+ * // 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\}`.
3127
+ * parent: 'projects/my-project/locations/my-location',
3128
+ *
3129
+ * // Request body metadata
3130
+ * requestBody: {
3131
+ * // request body parameters
3132
+ * // {
3133
+ * // "contents": [],
3134
+ * // "sourceLanguageCode": "my_sourceLanguageCode"
3135
+ * // }
3136
+ * },
3137
+ * });
3138
+ * console.log(res.data);
3139
+ *
3140
+ * // Example response
3141
+ * // {
3142
+ * // "romanizations": []
3143
+ * // }
3144
+ * }
3145
+ *
3146
+ * main().catch(e => {
3147
+ * console.error(e);
3148
+ * throw e;
3149
+ * });
3150
+ *
3151
+ * ```
2426
3152
  *
2427
3153
  * @param params - Parameters for request
2428
3154
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2432,11 +3158,11 @@ export namespace translate_v3 {
2432
3158
  romanizeText(
2433
3159
  params: Params$Resource$Projects$Locations$Romanizetext,
2434
3160
  options: StreamMethodOptions
2435
- ): GaxiosPromise<Readable>;
3161
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2436
3162
  romanizeText(
2437
3163
  params?: Params$Resource$Projects$Locations$Romanizetext,
2438
3164
  options?: MethodOptions
2439
- ): GaxiosPromise<Schema$RomanizeTextResponse>;
3165
+ ): Promise<GaxiosResponseWithHTTP2<Schema$RomanizeTextResponse>>;
2440
3166
  romanizeText(
2441
3167
  params: Params$Resource$Projects$Locations$Romanizetext,
2442
3168
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2471,8 +3197,8 @@ export namespace translate_v3 {
2471
3197
  | BodyResponseCallback<Readable>
2472
3198
  ):
2473
3199
  | void
2474
- | GaxiosPromise<Schema$RomanizeTextResponse>
2475
- | GaxiosPromise<Readable> {
3200
+ | Promise<GaxiosResponseWithHTTP2<Schema$RomanizeTextResponse>>
3201
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2476
3202
  let params = (paramsOrCallback ||
2477
3203
  {}) as Params$Resource$Projects$Locations$Romanizetext;
2478
3204
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2518,6 +3244,76 @@ export namespace translate_v3 {
2518
3244
 
2519
3245
  /**
2520
3246
  * Translates documents in synchronous mode.
3247
+ * @example
3248
+ * ```js
3249
+ * // Before running the sample:
3250
+ * // - Enable the API at:
3251
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
3252
+ * // - Login into gcloud by running:
3253
+ * // ```sh
3254
+ * // $ gcloud auth application-default login
3255
+ * // ```
3256
+ * // - Install the npm module by running:
3257
+ * // ```sh
3258
+ * // $ npm install googleapis
3259
+ * // ```
3260
+ *
3261
+ * const {google} = require('googleapis');
3262
+ * const translate = google.translate('v3');
3263
+ *
3264
+ * async function main() {
3265
+ * const auth = new google.auth.GoogleAuth({
3266
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3267
+ * scopes: [
3268
+ * 'https://www.googleapis.com/auth/cloud-platform',
3269
+ * 'https://www.googleapis.com/auth/cloud-translation',
3270
+ * ],
3271
+ * });
3272
+ *
3273
+ * // Acquire an auth client, and bind it to all future calls
3274
+ * const authClient = await auth.getClient();
3275
+ * google.options({auth: authClient});
3276
+ *
3277
+ * // Do the magic
3278
+ * const res = await translate.projects.locations.translateDocument({
3279
+ * // 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.
3280
+ * parent: 'projects/my-project/locations/my-location',
3281
+ *
3282
+ * // Request body metadata
3283
+ * requestBody: {
3284
+ * // request body parameters
3285
+ * // {
3286
+ * // "customizedAttribution": "my_customizedAttribution",
3287
+ * // "documentInputConfig": {},
3288
+ * // "documentOutputConfig": {},
3289
+ * // "enableRotationCorrection": false,
3290
+ * // "enableShadowRemovalNativePdf": false,
3291
+ * // "glossaryConfig": {},
3292
+ * // "isTranslateNativePdfOnly": false,
3293
+ * // "labels": {},
3294
+ * // "model": "my_model",
3295
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
3296
+ * // "targetLanguageCode": "my_targetLanguageCode"
3297
+ * // }
3298
+ * },
3299
+ * });
3300
+ * console.log(res.data);
3301
+ *
3302
+ * // Example response
3303
+ * // {
3304
+ * // "documentTranslation": {},
3305
+ * // "glossaryConfig": {},
3306
+ * // "glossaryDocumentTranslation": {},
3307
+ * // "model": "my_model"
3308
+ * // }
3309
+ * }
3310
+ *
3311
+ * main().catch(e => {
3312
+ * console.error(e);
3313
+ * throw e;
3314
+ * });
3315
+ *
3316
+ * ```
2521
3317
  *
2522
3318
  * @param params - Parameters for request
2523
3319
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2527,11 +3323,11 @@ export namespace translate_v3 {
2527
3323
  translateDocument(
2528
3324
  params: Params$Resource$Projects$Locations$Translatedocument,
2529
3325
  options: StreamMethodOptions
2530
- ): GaxiosPromise<Readable>;
3326
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2531
3327
  translateDocument(
2532
3328
  params?: Params$Resource$Projects$Locations$Translatedocument,
2533
3329
  options?: MethodOptions
2534
- ): GaxiosPromise<Schema$TranslateDocumentResponse>;
3330
+ ): Promise<GaxiosResponseWithHTTP2<Schema$TranslateDocumentResponse>>;
2535
3331
  translateDocument(
2536
3332
  params: Params$Resource$Projects$Locations$Translatedocument,
2537
3333
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2566,8 +3362,8 @@ export namespace translate_v3 {
2566
3362
  | BodyResponseCallback<Readable>
2567
3363
  ):
2568
3364
  | void
2569
- | GaxiosPromise<Schema$TranslateDocumentResponse>
2570
- | GaxiosPromise<Readable> {
3365
+ | Promise<GaxiosResponseWithHTTP2<Schema$TranslateDocumentResponse>>
3366
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2571
3367
  let params = (paramsOrCallback ||
2572
3368
  {}) as Params$Resource$Projects$Locations$Translatedocument;
2573
3369
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2613,6 +3409,71 @@ export namespace translate_v3 {
2613
3409
 
2614
3410
  /**
2615
3411
  * Translates input text and returns translated text.
3412
+ * @example
3413
+ * ```js
3414
+ * // Before running the sample:
3415
+ * // - Enable the API at:
3416
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
3417
+ * // - Login into gcloud by running:
3418
+ * // ```sh
3419
+ * // $ gcloud auth application-default login
3420
+ * // ```
3421
+ * // - Install the npm module by running:
3422
+ * // ```sh
3423
+ * // $ npm install googleapis
3424
+ * // ```
3425
+ *
3426
+ * const {google} = require('googleapis');
3427
+ * const translate = google.translate('v3');
3428
+ *
3429
+ * async function main() {
3430
+ * const auth = new google.auth.GoogleAuth({
3431
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3432
+ * scopes: [
3433
+ * 'https://www.googleapis.com/auth/cloud-platform',
3434
+ * 'https://www.googleapis.com/auth/cloud-translation',
3435
+ * ],
3436
+ * });
3437
+ *
3438
+ * // Acquire an auth client, and bind it to all future calls
3439
+ * const authClient = await auth.getClient();
3440
+ * google.options({auth: authClient});
3441
+ *
3442
+ * // Do the magic
3443
+ * const res = await translate.projects.locations.translateText({
3444
+ * // 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.
3445
+ * parent: 'projects/my-project/locations/my-location',
3446
+ *
3447
+ * // Request body metadata
3448
+ * requestBody: {
3449
+ * // request body parameters
3450
+ * // {
3451
+ * // "contents": [],
3452
+ * // "glossaryConfig": {},
3453
+ * // "labels": {},
3454
+ * // "mimeType": "my_mimeType",
3455
+ * // "model": "my_model",
3456
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
3457
+ * // "targetLanguageCode": "my_targetLanguageCode",
3458
+ * // "transliterationConfig": {}
3459
+ * // }
3460
+ * },
3461
+ * });
3462
+ * console.log(res.data);
3463
+ *
3464
+ * // Example response
3465
+ * // {
3466
+ * // "glossaryTranslations": [],
3467
+ * // "translations": []
3468
+ * // }
3469
+ * }
3470
+ *
3471
+ * main().catch(e => {
3472
+ * console.error(e);
3473
+ * throw e;
3474
+ * });
3475
+ *
3476
+ * ```
2616
3477
  *
2617
3478
  * @param params - Parameters for request
2618
3479
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2622,11 +3483,11 @@ export namespace translate_v3 {
2622
3483
  translateText(
2623
3484
  params: Params$Resource$Projects$Locations$Translatetext,
2624
3485
  options: StreamMethodOptions
2625
- ): GaxiosPromise<Readable>;
3486
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2626
3487
  translateText(
2627
3488
  params?: Params$Resource$Projects$Locations$Translatetext,
2628
3489
  options?: MethodOptions
2629
- ): GaxiosPromise<Schema$TranslateTextResponse>;
3490
+ ): Promise<GaxiosResponseWithHTTP2<Schema$TranslateTextResponse>>;
2630
3491
  translateText(
2631
3492
  params: Params$Resource$Projects$Locations$Translatetext,
2632
3493
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2661,8 +3522,8 @@ export namespace translate_v3 {
2661
3522
  | BodyResponseCallback<Readable>
2662
3523
  ):
2663
3524
  | void
2664
- | GaxiosPromise<Schema$TranslateTextResponse>
2665
- | GaxiosPromise<Readable> {
3525
+ | Promise<GaxiosResponseWithHTTP2<Schema$TranslateTextResponse>>
3526
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2666
3527
  let params = (paramsOrCallback ||
2667
3528
  {}) as Params$Resource$Projects$Locations$Translatetext;
2668
3529
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2855,6 +3716,75 @@ export namespace translate_v3 {
2855
3716
 
2856
3717
  /**
2857
3718
  * Creates an Adaptive MT dataset.
3719
+ * @example
3720
+ * ```js
3721
+ * // Before running the sample:
3722
+ * // - Enable the API at:
3723
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
3724
+ * // - Login into gcloud by running:
3725
+ * // ```sh
3726
+ * // $ gcloud auth application-default login
3727
+ * // ```
3728
+ * // - Install the npm module by running:
3729
+ * // ```sh
3730
+ * // $ npm install googleapis
3731
+ * // ```
3732
+ *
3733
+ * const {google} = require('googleapis');
3734
+ * const translate = google.translate('v3');
3735
+ *
3736
+ * async function main() {
3737
+ * const auth = new google.auth.GoogleAuth({
3738
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3739
+ * scopes: [
3740
+ * 'https://www.googleapis.com/auth/cloud-platform',
3741
+ * 'https://www.googleapis.com/auth/cloud-translation',
3742
+ * ],
3743
+ * });
3744
+ *
3745
+ * // Acquire an auth client, and bind it to all future calls
3746
+ * const authClient = await auth.getClient();
3747
+ * google.options({auth: authClient});
3748
+ *
3749
+ * // Do the magic
3750
+ * const res = await translate.projects.locations.adaptiveMtDatasets.create({
3751
+ * // Required. Name of the parent project. In form of `projects/{project-number-or-id\}/locations/{location-id\}`
3752
+ * parent: 'projects/my-project/locations/my-location',
3753
+ *
3754
+ * // Request body metadata
3755
+ * requestBody: {
3756
+ * // request body parameters
3757
+ * // {
3758
+ * // "createTime": "my_createTime",
3759
+ * // "displayName": "my_displayName",
3760
+ * // "exampleCount": 0,
3761
+ * // "name": "my_name",
3762
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
3763
+ * // "targetLanguageCode": "my_targetLanguageCode",
3764
+ * // "updateTime": "my_updateTime"
3765
+ * // }
3766
+ * },
3767
+ * });
3768
+ * console.log(res.data);
3769
+ *
3770
+ * // Example response
3771
+ * // {
3772
+ * // "createTime": "my_createTime",
3773
+ * // "displayName": "my_displayName",
3774
+ * // "exampleCount": 0,
3775
+ * // "name": "my_name",
3776
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
3777
+ * // "targetLanguageCode": "my_targetLanguageCode",
3778
+ * // "updateTime": "my_updateTime"
3779
+ * // }
3780
+ * }
3781
+ *
3782
+ * main().catch(e => {
3783
+ * console.error(e);
3784
+ * throw e;
3785
+ * });
3786
+ *
3787
+ * ```
2858
3788
  *
2859
3789
  * @param params - Parameters for request
2860
3790
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2864,11 +3794,11 @@ export namespace translate_v3 {
2864
3794
  create(
2865
3795
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create,
2866
3796
  options: StreamMethodOptions
2867
- ): GaxiosPromise<Readable>;
3797
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2868
3798
  create(
2869
3799
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create,
2870
3800
  options?: MethodOptions
2871
- ): GaxiosPromise<Schema$AdaptiveMtDataset>;
3801
+ ): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtDataset>>;
2872
3802
  create(
2873
3803
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Create,
2874
3804
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2899,8 +3829,8 @@ export namespace translate_v3 {
2899
3829
  | BodyResponseCallback<Readable>
2900
3830
  ):
2901
3831
  | void
2902
- | GaxiosPromise<Schema$AdaptiveMtDataset>
2903
- | GaxiosPromise<Readable> {
3832
+ | Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtDataset>>
3833
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2904
3834
  let params = (paramsOrCallback ||
2905
3835
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Create;
2906
3836
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -2947,6 +3877,53 @@ export namespace translate_v3 {
2947
3877
 
2948
3878
  /**
2949
3879
  * Deletes an Adaptive MT dataset, including all its entries and associated metadata.
3880
+ * @example
3881
+ * ```js
3882
+ * // Before running the sample:
3883
+ * // - Enable the API at:
3884
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
3885
+ * // - Login into gcloud by running:
3886
+ * // ```sh
3887
+ * // $ gcloud auth application-default login
3888
+ * // ```
3889
+ * // - Install the npm module by running:
3890
+ * // ```sh
3891
+ * // $ npm install googleapis
3892
+ * // ```
3893
+ *
3894
+ * const {google} = require('googleapis');
3895
+ * const translate = google.translate('v3');
3896
+ *
3897
+ * async function main() {
3898
+ * const auth = new google.auth.GoogleAuth({
3899
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
3900
+ * scopes: [
3901
+ * 'https://www.googleapis.com/auth/cloud-platform',
3902
+ * 'https://www.googleapis.com/auth/cloud-translation',
3903
+ * ],
3904
+ * });
3905
+ *
3906
+ * // Acquire an auth client, and bind it to all future calls
3907
+ * const authClient = await auth.getClient();
3908
+ * google.options({auth: authClient});
3909
+ *
3910
+ * // Do the magic
3911
+ * const res = await translate.projects.locations.adaptiveMtDatasets.delete({
3912
+ * // Required. Name of the dataset. In the form of `projects/{project-number-or-id\}/locations/{location-id\}/adaptiveMtDatasets/{adaptive-mt-dataset-id\}`
3913
+ * name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
3914
+ * });
3915
+ * console.log(res.data);
3916
+ *
3917
+ * // Example response
3918
+ * // {}
3919
+ * }
3920
+ *
3921
+ * main().catch(e => {
3922
+ * console.error(e);
3923
+ * throw e;
3924
+ * });
3925
+ *
3926
+ * ```
2950
3927
  *
2951
3928
  * @param params - Parameters for request
2952
3929
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -2956,11 +3933,11 @@ export namespace translate_v3 {
2956
3933
  delete(
2957
3934
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete,
2958
3935
  options: StreamMethodOptions
2959
- ): GaxiosPromise<Readable>;
3936
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
2960
3937
  delete(
2961
3938
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete,
2962
3939
  options?: MethodOptions
2963
- ): GaxiosPromise<Schema$Empty>;
3940
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
2964
3941
  delete(
2965
3942
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete,
2966
3943
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -2989,7 +3966,10 @@ export namespace translate_v3 {
2989
3966
  callback?:
2990
3967
  | BodyResponseCallback<Schema$Empty>
2991
3968
  | BodyResponseCallback<Readable>
2992
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
3969
+ ):
3970
+ | void
3971
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
3972
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
2993
3973
  let params = (paramsOrCallback ||
2994
3974
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Delete;
2995
3975
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3033,6 +4013,61 @@ export namespace translate_v3 {
3033
4013
 
3034
4014
  /**
3035
4015
  * Gets the Adaptive MT dataset.
4016
+ * @example
4017
+ * ```js
4018
+ * // Before running the sample:
4019
+ * // - Enable the API at:
4020
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
4021
+ * // - Login into gcloud by running:
4022
+ * // ```sh
4023
+ * // $ gcloud auth application-default login
4024
+ * // ```
4025
+ * // - Install the npm module by running:
4026
+ * // ```sh
4027
+ * // $ npm install googleapis
4028
+ * // ```
4029
+ *
4030
+ * const {google} = require('googleapis');
4031
+ * const translate = google.translate('v3');
4032
+ *
4033
+ * async function main() {
4034
+ * const auth = new google.auth.GoogleAuth({
4035
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4036
+ * scopes: [
4037
+ * 'https://www.googleapis.com/auth/cloud-platform',
4038
+ * 'https://www.googleapis.com/auth/cloud-translation',
4039
+ * ],
4040
+ * });
4041
+ *
4042
+ * // Acquire an auth client, and bind it to all future calls
4043
+ * const authClient = await auth.getClient();
4044
+ * google.options({auth: authClient});
4045
+ *
4046
+ * // Do the magic
4047
+ * const res = await translate.projects.locations.adaptiveMtDatasets.get({
4048
+ * // Required. Name of the dataset. In the form of `projects/{project-number-or-id\}/locations/{location-id\}/adaptiveMtDatasets/{adaptive-mt-dataset-id\}`
4049
+ * name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
4050
+ * });
4051
+ * console.log(res.data);
4052
+ *
4053
+ * // Example response
4054
+ * // {
4055
+ * // "createTime": "my_createTime",
4056
+ * // "displayName": "my_displayName",
4057
+ * // "exampleCount": 0,
4058
+ * // "name": "my_name",
4059
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
4060
+ * // "targetLanguageCode": "my_targetLanguageCode",
4061
+ * // "updateTime": "my_updateTime"
4062
+ * // }
4063
+ * }
4064
+ *
4065
+ * main().catch(e => {
4066
+ * console.error(e);
4067
+ * throw e;
4068
+ * });
4069
+ *
4070
+ * ```
3036
4071
  *
3037
4072
  * @param params - Parameters for request
3038
4073
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3042,11 +4077,11 @@ export namespace translate_v3 {
3042
4077
  get(
3043
4078
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get,
3044
4079
  options: StreamMethodOptions
3045
- ): GaxiosPromise<Readable>;
4080
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3046
4081
  get(
3047
4082
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get,
3048
4083
  options?: MethodOptions
3049
- ): GaxiosPromise<Schema$AdaptiveMtDataset>;
4084
+ ): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtDataset>>;
3050
4085
  get(
3051
4086
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Get,
3052
4087
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3077,8 +4112,8 @@ export namespace translate_v3 {
3077
4112
  | BodyResponseCallback<Readable>
3078
4113
  ):
3079
4114
  | void
3080
- | GaxiosPromise<Schema$AdaptiveMtDataset>
3081
- | GaxiosPromise<Readable> {
4115
+ | Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtDataset>>
4116
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3082
4117
  let params = (paramsOrCallback ||
3083
4118
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Get;
3084
4119
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3122,6 +4157,66 @@ export namespace translate_v3 {
3122
4157
 
3123
4158
  /**
3124
4159
  * Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
4160
+ * @example
4161
+ * ```js
4162
+ * // Before running the sample:
4163
+ * // - Enable the API at:
4164
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
4165
+ * // - Login into gcloud by running:
4166
+ * // ```sh
4167
+ * // $ gcloud auth application-default login
4168
+ * // ```
4169
+ * // - Install the npm module by running:
4170
+ * // ```sh
4171
+ * // $ npm install googleapis
4172
+ * // ```
4173
+ *
4174
+ * const {google} = require('googleapis');
4175
+ * const translate = google.translate('v3');
4176
+ *
4177
+ * async function main() {
4178
+ * const auth = new google.auth.GoogleAuth({
4179
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4180
+ * scopes: [
4181
+ * 'https://www.googleapis.com/auth/cloud-platform',
4182
+ * 'https://www.googleapis.com/auth/cloud-translation',
4183
+ * ],
4184
+ * });
4185
+ *
4186
+ * // Acquire an auth client, and bind it to all future calls
4187
+ * const authClient = await auth.getClient();
4188
+ * google.options({auth: authClient});
4189
+ *
4190
+ * // Do the magic
4191
+ * const res =
4192
+ * await translate.projects.locations.adaptiveMtDatasets.importAdaptiveMtFile({
4193
+ * // Required. The resource name of the file, in form of `projects/{project-number-or-id\}/locations/{location_id\}/adaptiveMtDatasets/{dataset\}`
4194
+ * parent:
4195
+ * 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
4196
+ *
4197
+ * // Request body metadata
4198
+ * requestBody: {
4199
+ * // request body parameters
4200
+ * // {
4201
+ * // "fileInputSource": {},
4202
+ * // "gcsInputSource": {}
4203
+ * // }
4204
+ * },
4205
+ * });
4206
+ * console.log(res.data);
4207
+ *
4208
+ * // Example response
4209
+ * // {
4210
+ * // "adaptiveMtFile": {}
4211
+ * // }
4212
+ * }
4213
+ *
4214
+ * main().catch(e => {
4215
+ * console.error(e);
4216
+ * throw e;
4217
+ * });
4218
+ *
4219
+ * ```
3125
4220
  *
3126
4221
  * @param params - Parameters for request
3127
4222
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3131,11 +4226,11 @@ export namespace translate_v3 {
3131
4226
  importAdaptiveMtFile(
3132
4227
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile,
3133
4228
  options: StreamMethodOptions
3134
- ): GaxiosPromise<Readable>;
4229
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3135
4230
  importAdaptiveMtFile(
3136
4231
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile,
3137
4232
  options?: MethodOptions
3138
- ): GaxiosPromise<Schema$ImportAdaptiveMtFileResponse>;
4233
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ImportAdaptiveMtFileResponse>>;
3139
4234
  importAdaptiveMtFile(
3140
4235
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile,
3141
4236
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3170,8 +4265,8 @@ export namespace translate_v3 {
3170
4265
  | BodyResponseCallback<Readable>
3171
4266
  ):
3172
4267
  | void
3173
- | GaxiosPromise<Schema$ImportAdaptiveMtFileResponse>
3174
- | GaxiosPromise<Readable> {
4268
+ | Promise<GaxiosResponseWithHTTP2<Schema$ImportAdaptiveMtFileResponse>>
4269
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3175
4270
  let params = (paramsOrCallback ||
3176
4271
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Importadaptivemtfile;
3177
4272
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3220,6 +4315,62 @@ export namespace translate_v3 {
3220
4315
 
3221
4316
  /**
3222
4317
  * Lists all Adaptive MT datasets for which the caller has read permission.
4318
+ * @example
4319
+ * ```js
4320
+ * // Before running the sample:
4321
+ * // - Enable the API at:
4322
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
4323
+ * // - Login into gcloud by running:
4324
+ * // ```sh
4325
+ * // $ gcloud auth application-default login
4326
+ * // ```
4327
+ * // - Install the npm module by running:
4328
+ * // ```sh
4329
+ * // $ npm install googleapis
4330
+ * // ```
4331
+ *
4332
+ * const {google} = require('googleapis');
4333
+ * const translate = google.translate('v3');
4334
+ *
4335
+ * async function main() {
4336
+ * const auth = new google.auth.GoogleAuth({
4337
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4338
+ * scopes: [
4339
+ * 'https://www.googleapis.com/auth/cloud-platform',
4340
+ * 'https://www.googleapis.com/auth/cloud-translation',
4341
+ * ],
4342
+ * });
4343
+ *
4344
+ * // Acquire an auth client, and bind it to all future calls
4345
+ * const authClient = await auth.getClient();
4346
+ * google.options({auth: authClient});
4347
+ *
4348
+ * // Do the magic
4349
+ * const res = await translate.projects.locations.adaptiveMtDatasets.list({
4350
+ * // Optional. An expression for filtering the results of the request. Filter is not supported yet.
4351
+ * filter: 'placeholder-value',
4352
+ * // Optional. Requested page size. The server may return fewer results than requested. If unspecified, the server picks an appropriate default.
4353
+ * pageSize: 'placeholder-value',
4354
+ * // 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.
4355
+ * pageToken: 'placeholder-value',
4356
+ * // Required. The resource name of the project from which to list the Adaptive MT datasets. `projects/{project-number-or-id\}/locations/{location-id\}`
4357
+ * parent: 'projects/my-project/locations/my-location',
4358
+ * });
4359
+ * console.log(res.data);
4360
+ *
4361
+ * // Example response
4362
+ * // {
4363
+ * // "adaptiveMtDatasets": [],
4364
+ * // "nextPageToken": "my_nextPageToken"
4365
+ * // }
4366
+ * }
4367
+ *
4368
+ * main().catch(e => {
4369
+ * console.error(e);
4370
+ * throw e;
4371
+ * });
4372
+ *
4373
+ * ```
3223
4374
  *
3224
4375
  * @param params - Parameters for request
3225
4376
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3229,11 +4380,11 @@ export namespace translate_v3 {
3229
4380
  list(
3230
4381
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List,
3231
4382
  options: StreamMethodOptions
3232
- ): GaxiosPromise<Readable>;
4383
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3233
4384
  list(
3234
4385
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$List,
3235
4386
  options?: MethodOptions
3236
- ): GaxiosPromise<Schema$ListAdaptiveMtDatasetsResponse>;
4387
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtDatasetsResponse>>;
3237
4388
  list(
3238
4389
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$List,
3239
4390
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3268,8 +4419,8 @@ export namespace translate_v3 {
3268
4419
  | BodyResponseCallback<Readable>
3269
4420
  ):
3270
4421
  | void
3271
- | GaxiosPromise<Schema$ListAdaptiveMtDatasetsResponse>
3272
- | GaxiosPromise<Readable> {
4422
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtDatasetsResponse>>
4423
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3273
4424
  let params = (paramsOrCallback ||
3274
4425
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$List;
3275
4426
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3388,6 +4539,56 @@ export namespace translate_v3 {
3388
4539
 
3389
4540
  /**
3390
4541
  * Deletes an AdaptiveMtFile along with its sentences.
4542
+ * @example
4543
+ * ```js
4544
+ * // Before running the sample:
4545
+ * // - Enable the API at:
4546
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
4547
+ * // - Login into gcloud by running:
4548
+ * // ```sh
4549
+ * // $ gcloud auth application-default login
4550
+ * // ```
4551
+ * // - Install the npm module by running:
4552
+ * // ```sh
4553
+ * // $ npm install googleapis
4554
+ * // ```
4555
+ *
4556
+ * const {google} = require('googleapis');
4557
+ * const translate = google.translate('v3');
4558
+ *
4559
+ * async function main() {
4560
+ * const auth = new google.auth.GoogleAuth({
4561
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4562
+ * scopes: [
4563
+ * 'https://www.googleapis.com/auth/cloud-platform',
4564
+ * 'https://www.googleapis.com/auth/cloud-translation',
4565
+ * ],
4566
+ * });
4567
+ *
4568
+ * // Acquire an auth client, and bind it to all future calls
4569
+ * const authClient = await auth.getClient();
4570
+ * google.options({auth: authClient});
4571
+ *
4572
+ * // Do the magic
4573
+ * const res =
4574
+ * await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.delete(
4575
+ * {
4576
+ * // Required. The resource name of the file to delete, in form of `projects/{project-number-or-id\}/locations/{location_id\}/adaptiveMtDatasets/{dataset\}/adaptiveMtFiles/{file\}`
4577
+ * name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset/adaptiveMtFiles/my-adaptiveMtFile',
4578
+ * },
4579
+ * );
4580
+ * console.log(res.data);
4581
+ *
4582
+ * // Example response
4583
+ * // {}
4584
+ * }
4585
+ *
4586
+ * main().catch(e => {
4587
+ * console.error(e);
4588
+ * throw e;
4589
+ * });
4590
+ *
4591
+ * ```
3391
4592
  *
3392
4593
  * @param params - Parameters for request
3393
4594
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3397,11 +4598,11 @@ export namespace translate_v3 {
3397
4598
  delete(
3398
4599
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete,
3399
4600
  options: StreamMethodOptions
3400
- ): GaxiosPromise<Readable>;
4601
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3401
4602
  delete(
3402
4603
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete,
3403
4604
  options?: MethodOptions
3404
- ): GaxiosPromise<Schema$Empty>;
4605
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
3405
4606
  delete(
3406
4607
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete,
3407
4608
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3430,7 +4631,10 @@ export namespace translate_v3 {
3430
4631
  callback?:
3431
4632
  | BodyResponseCallback<Schema$Empty>
3432
4633
  | BodyResponseCallback<Readable>
3433
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
4634
+ ):
4635
+ | void
4636
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
4637
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3434
4638
  let params = (paramsOrCallback ||
3435
4639
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Delete;
3436
4640
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3474,6 +4678,60 @@ export namespace translate_v3 {
3474
4678
 
3475
4679
  /**
3476
4680
  * Gets and AdaptiveMtFile
4681
+ * @example
4682
+ * ```js
4683
+ * // Before running the sample:
4684
+ * // - Enable the API at:
4685
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
4686
+ * // - Login into gcloud by running:
4687
+ * // ```sh
4688
+ * // $ gcloud auth application-default login
4689
+ * // ```
4690
+ * // - Install the npm module by running:
4691
+ * // ```sh
4692
+ * // $ npm install googleapis
4693
+ * // ```
4694
+ *
4695
+ * const {google} = require('googleapis');
4696
+ * const translate = google.translate('v3');
4697
+ *
4698
+ * async function main() {
4699
+ * const auth = new google.auth.GoogleAuth({
4700
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4701
+ * scopes: [
4702
+ * 'https://www.googleapis.com/auth/cloud-platform',
4703
+ * 'https://www.googleapis.com/auth/cloud-translation',
4704
+ * ],
4705
+ * });
4706
+ *
4707
+ * // Acquire an auth client, and bind it to all future calls
4708
+ * const authClient = await auth.getClient();
4709
+ * google.options({auth: authClient});
4710
+ *
4711
+ * // Do the magic
4712
+ * const res =
4713
+ * await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.get({
4714
+ * // Required. The resource name of the file, in form of `projects/{project-number-or-id\}/locations/{location_id\}/adaptiveMtDatasets/{dataset\}/adaptiveMtFiles/{file\}`
4715
+ * name: 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset/adaptiveMtFiles/my-adaptiveMtFile',
4716
+ * });
4717
+ * console.log(res.data);
4718
+ *
4719
+ * // Example response
4720
+ * // {
4721
+ * // "createTime": "my_createTime",
4722
+ * // "displayName": "my_displayName",
4723
+ * // "entryCount": 0,
4724
+ * // "name": "my_name",
4725
+ * // "updateTime": "my_updateTime"
4726
+ * // }
4727
+ * }
4728
+ *
4729
+ * main().catch(e => {
4730
+ * console.error(e);
4731
+ * throw e;
4732
+ * });
4733
+ *
4734
+ * ```
3477
4735
  *
3478
4736
  * @param params - Parameters for request
3479
4737
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3483,11 +4741,11 @@ export namespace translate_v3 {
3483
4741
  get(
3484
4742
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get,
3485
4743
  options: StreamMethodOptions
3486
- ): GaxiosPromise<Readable>;
4744
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3487
4745
  get(
3488
4746
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get,
3489
4747
  options?: MethodOptions
3490
- ): GaxiosPromise<Schema$AdaptiveMtFile>;
4748
+ ): Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtFile>>;
3491
4749
  get(
3492
4750
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get,
3493
4751
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3516,7 +4774,10 @@ export namespace translate_v3 {
3516
4774
  callback?:
3517
4775
  | BodyResponseCallback<Schema$AdaptiveMtFile>
3518
4776
  | BodyResponseCallback<Readable>
3519
- ): void | GaxiosPromise<Schema$AdaptiveMtFile> | GaxiosPromise<Readable> {
4777
+ ):
4778
+ | void
4779
+ | Promise<GaxiosResponseWithHTTP2<Schema$AdaptiveMtFile>>
4780
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3520
4781
  let params = (paramsOrCallback ||
3521
4782
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Get;
3522
4783
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3560,6 +4821,62 @@ export namespace translate_v3 {
3560
4821
 
3561
4822
  /**
3562
4823
  * Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
4824
+ * @example
4825
+ * ```js
4826
+ * // Before running the sample:
4827
+ * // - Enable the API at:
4828
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
4829
+ * // - Login into gcloud by running:
4830
+ * // ```sh
4831
+ * // $ gcloud auth application-default login
4832
+ * // ```
4833
+ * // - Install the npm module by running:
4834
+ * // ```sh
4835
+ * // $ npm install googleapis
4836
+ * // ```
4837
+ *
4838
+ * const {google} = require('googleapis');
4839
+ * const translate = google.translate('v3');
4840
+ *
4841
+ * async function main() {
4842
+ * const auth = new google.auth.GoogleAuth({
4843
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
4844
+ * scopes: [
4845
+ * 'https://www.googleapis.com/auth/cloud-platform',
4846
+ * 'https://www.googleapis.com/auth/cloud-translation',
4847
+ * ],
4848
+ * });
4849
+ *
4850
+ * // Acquire an auth client, and bind it to all future calls
4851
+ * const authClient = await auth.getClient();
4852
+ * google.options({auth: authClient});
4853
+ *
4854
+ * // Do the magic
4855
+ * const res =
4856
+ * await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.list({
4857
+ * // Optional.
4858
+ * pageSize: 'placeholder-value',
4859
+ * // 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.
4860
+ * pageToken: 'placeholder-value',
4861
+ * // Required. The resource name of the project from which to list the Adaptive MT files. `projects/{project\}/locations/{location\}/adaptiveMtDatasets/{dataset\}`
4862
+ * parent:
4863
+ * 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
4864
+ * });
4865
+ * console.log(res.data);
4866
+ *
4867
+ * // Example response
4868
+ * // {
4869
+ * // "adaptiveMtFiles": [],
4870
+ * // "nextPageToken": "my_nextPageToken"
4871
+ * // }
4872
+ * }
4873
+ *
4874
+ * main().catch(e => {
4875
+ * console.error(e);
4876
+ * throw e;
4877
+ * });
4878
+ *
4879
+ * ```
3563
4880
  *
3564
4881
  * @param params - Parameters for request
3565
4882
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3569,11 +4886,11 @@ export namespace translate_v3 {
3569
4886
  list(
3570
4887
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List,
3571
4888
  options: StreamMethodOptions
3572
- ): GaxiosPromise<Readable>;
4889
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3573
4890
  list(
3574
4891
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List,
3575
4892
  options?: MethodOptions
3576
- ): GaxiosPromise<Schema$ListAdaptiveMtFilesResponse>;
4893
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtFilesResponse>>;
3577
4894
  list(
3578
4895
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List,
3579
4896
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3608,8 +4925,8 @@ export namespace translate_v3 {
3608
4925
  | BodyResponseCallback<Readable>
3609
4926
  ):
3610
4927
  | void
3611
- | GaxiosPromise<Schema$ListAdaptiveMtFilesResponse>
3612
- | GaxiosPromise<Readable> {
4928
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtFilesResponse>>
4929
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3613
4930
  let params = (paramsOrCallback ||
3614
4931
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$List;
3615
4932
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3693,6 +5010,63 @@ export namespace translate_v3 {
3693
5010
 
3694
5011
  /**
3695
5012
  * Lists all AdaptiveMtSentences under a given file/dataset.
5013
+ * @example
5014
+ * ```js
5015
+ * // Before running the sample:
5016
+ * // - Enable the API at:
5017
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5018
+ * // - Login into gcloud by running:
5019
+ * // ```sh
5020
+ * // $ gcloud auth application-default login
5021
+ * // ```
5022
+ * // - Install the npm module by running:
5023
+ * // ```sh
5024
+ * // $ npm install googleapis
5025
+ * // ```
5026
+ *
5027
+ * const {google} = require('googleapis');
5028
+ * const translate = google.translate('v3');
5029
+ *
5030
+ * async function main() {
5031
+ * const auth = new google.auth.GoogleAuth({
5032
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5033
+ * scopes: [
5034
+ * 'https://www.googleapis.com/auth/cloud-platform',
5035
+ * 'https://www.googleapis.com/auth/cloud-translation',
5036
+ * ],
5037
+ * });
5038
+ *
5039
+ * // Acquire an auth client, and bind it to all future calls
5040
+ * const authClient = await auth.getClient();
5041
+ * google.options({auth: authClient});
5042
+ *
5043
+ * // Do the magic
5044
+ * const res =
5045
+ * await translate.projects.locations.adaptiveMtDatasets.adaptiveMtFiles.adaptiveMtSentences.list(
5046
+ * {
5047
+ * pageSize: 'placeholder-value',
5048
+ * // 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.
5049
+ * pageToken: 'placeholder-value',
5050
+ * // 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\}`
5051
+ * parent:
5052
+ * 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset/adaptiveMtFiles/my-adaptiveMtFile',
5053
+ * },
5054
+ * );
5055
+ * console.log(res.data);
5056
+ *
5057
+ * // Example response
5058
+ * // {
5059
+ * // "adaptiveMtSentences": [],
5060
+ * // "nextPageToken": "my_nextPageToken"
5061
+ * // }
5062
+ * }
5063
+ *
5064
+ * main().catch(e => {
5065
+ * console.error(e);
5066
+ * throw e;
5067
+ * });
5068
+ *
5069
+ * ```
3696
5070
  *
3697
5071
  * @param params - Parameters for request
3698
5072
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3702,11 +5076,11 @@ export namespace translate_v3 {
3702
5076
  list(
3703
5077
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List,
3704
5078
  options: StreamMethodOptions
3705
- ): GaxiosPromise<Readable>;
5079
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3706
5080
  list(
3707
5081
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List,
3708
5082
  options?: MethodOptions
3709
- ): GaxiosPromise<Schema$ListAdaptiveMtSentencesResponse>;
5083
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtSentencesResponse>>;
3710
5084
  list(
3711
5085
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List,
3712
5086
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3741,8 +5115,8 @@ export namespace translate_v3 {
3741
5115
  | BodyResponseCallback<Readable>
3742
5116
  ):
3743
5117
  | void
3744
- | GaxiosPromise<Schema$ListAdaptiveMtSentencesResponse>
3745
- | GaxiosPromise<Readable> {
5118
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtSentencesResponse>>
5119
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3746
5120
  let params = (paramsOrCallback ||
3747
5121
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtfiles$Adaptivemtsentences$List;
3748
5122
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3814,6 +5188,63 @@ export namespace translate_v3 {
3814
5188
 
3815
5189
  /**
3816
5190
  * Lists all AdaptiveMtSentences under a given file/dataset.
5191
+ * @example
5192
+ * ```js
5193
+ * // Before running the sample:
5194
+ * // - Enable the API at:
5195
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5196
+ * // - Login into gcloud by running:
5197
+ * // ```sh
5198
+ * // $ gcloud auth application-default login
5199
+ * // ```
5200
+ * // - Install the npm module by running:
5201
+ * // ```sh
5202
+ * // $ npm install googleapis
5203
+ * // ```
5204
+ *
5205
+ * const {google} = require('googleapis');
5206
+ * const translate = google.translate('v3');
5207
+ *
5208
+ * async function main() {
5209
+ * const auth = new google.auth.GoogleAuth({
5210
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5211
+ * scopes: [
5212
+ * 'https://www.googleapis.com/auth/cloud-platform',
5213
+ * 'https://www.googleapis.com/auth/cloud-translation',
5214
+ * ],
5215
+ * });
5216
+ *
5217
+ * // Acquire an auth client, and bind it to all future calls
5218
+ * const authClient = await auth.getClient();
5219
+ * google.options({auth: authClient});
5220
+ *
5221
+ * // Do the magic
5222
+ * const res =
5223
+ * await translate.projects.locations.adaptiveMtDatasets.adaptiveMtSentences.list(
5224
+ * {
5225
+ * pageSize: 'placeholder-value',
5226
+ * // 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.
5227
+ * pageToken: 'placeholder-value',
5228
+ * // 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\}`
5229
+ * parent:
5230
+ * 'projects/my-project/locations/my-location/adaptiveMtDatasets/my-adaptiveMtDataset',
5231
+ * },
5232
+ * );
5233
+ * console.log(res.data);
5234
+ *
5235
+ * // Example response
5236
+ * // {
5237
+ * // "adaptiveMtSentences": [],
5238
+ * // "nextPageToken": "my_nextPageToken"
5239
+ * // }
5240
+ * }
5241
+ *
5242
+ * main().catch(e => {
5243
+ * console.error(e);
5244
+ * throw e;
5245
+ * });
5246
+ *
5247
+ * ```
3817
5248
  *
3818
5249
  * @param params - Parameters for request
3819
5250
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3823,11 +5254,11 @@ export namespace translate_v3 {
3823
5254
  list(
3824
5255
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List,
3825
5256
  options: StreamMethodOptions
3826
- ): GaxiosPromise<Readable>;
5257
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3827
5258
  list(
3828
5259
  params?: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List,
3829
5260
  options?: MethodOptions
3830
- ): GaxiosPromise<Schema$ListAdaptiveMtSentencesResponse>;
5261
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtSentencesResponse>>;
3831
5262
  list(
3832
5263
  params: Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List,
3833
5264
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3862,8 +5293,8 @@ export namespace translate_v3 {
3862
5293
  | BodyResponseCallback<Readable>
3863
5294
  ):
3864
5295
  | void
3865
- | GaxiosPromise<Schema$ListAdaptiveMtSentencesResponse>
3866
- | GaxiosPromise<Readable> {
5296
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListAdaptiveMtSentencesResponse>>
5297
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3867
5298
  let params = (paramsOrCallback ||
3868
5299
  {}) as Params$Resource$Projects$Locations$Adaptivemtdatasets$Adaptivemtsentences$List;
3869
5300
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -3939,6 +5370,76 @@ export namespace translate_v3 {
3939
5370
 
3940
5371
  /**
3941
5372
  * Creates a Dataset.
5373
+ * @example
5374
+ * ```js
5375
+ * // Before running the sample:
5376
+ * // - Enable the API at:
5377
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5378
+ * // - Login into gcloud by running:
5379
+ * // ```sh
5380
+ * // $ gcloud auth application-default login
5381
+ * // ```
5382
+ * // - Install the npm module by running:
5383
+ * // ```sh
5384
+ * // $ npm install googleapis
5385
+ * // ```
5386
+ *
5387
+ * const {google} = require('googleapis');
5388
+ * const translate = google.translate('v3');
5389
+ *
5390
+ * async function main() {
5391
+ * const auth = new google.auth.GoogleAuth({
5392
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5393
+ * scopes: [
5394
+ * 'https://www.googleapis.com/auth/cloud-platform',
5395
+ * 'https://www.googleapis.com/auth/cloud-translation',
5396
+ * ],
5397
+ * });
5398
+ *
5399
+ * // Acquire an auth client, and bind it to all future calls
5400
+ * const authClient = await auth.getClient();
5401
+ * google.options({auth: authClient});
5402
+ *
5403
+ * // Do the magic
5404
+ * const res = await translate.projects.locations.datasets.create({
5405
+ * // Required. The project name.
5406
+ * parent: 'projects/my-project/locations/my-location',
5407
+ *
5408
+ * // Request body metadata
5409
+ * requestBody: {
5410
+ * // request body parameters
5411
+ * // {
5412
+ * // "createTime": "my_createTime",
5413
+ * // "displayName": "my_displayName",
5414
+ * // "exampleCount": 0,
5415
+ * // "name": "my_name",
5416
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
5417
+ * // "targetLanguageCode": "my_targetLanguageCode",
5418
+ * // "testExampleCount": 0,
5419
+ * // "trainExampleCount": 0,
5420
+ * // "updateTime": "my_updateTime",
5421
+ * // "validateExampleCount": 0
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
+ * ```
3942
5443
  *
3943
5444
  * @param params - Parameters for request
3944
5445
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -3948,11 +5449,11 @@ export namespace translate_v3 {
3948
5449
  create(
3949
5450
  params: Params$Resource$Projects$Locations$Datasets$Create,
3950
5451
  options: StreamMethodOptions
3951
- ): GaxiosPromise<Readable>;
5452
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
3952
5453
  create(
3953
5454
  params?: Params$Resource$Projects$Locations$Datasets$Create,
3954
5455
  options?: MethodOptions
3955
- ): GaxiosPromise<Schema$Operation>;
5456
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
3956
5457
  create(
3957
5458
  params: Params$Resource$Projects$Locations$Datasets$Create,
3958
5459
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -3981,7 +5482,10 @@ export namespace translate_v3 {
3981
5482
  callback?:
3982
5483
  | BodyResponseCallback<Schema$Operation>
3983
5484
  | BodyResponseCallback<Readable>
3984
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
5485
+ ):
5486
+ | void
5487
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
5488
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
3985
5489
  let params = (paramsOrCallback ||
3986
5490
  {}) as Params$Resource$Projects$Locations$Datasets$Create;
3987
5491
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4027,6 +5531,59 @@ export namespace translate_v3 {
4027
5531
 
4028
5532
  /**
4029
5533
  * Deletes a dataset and all of its contents.
5534
+ * @example
5535
+ * ```js
5536
+ * // Before running the sample:
5537
+ * // - Enable the API at:
5538
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5539
+ * // - Login into gcloud by running:
5540
+ * // ```sh
5541
+ * // $ gcloud auth application-default login
5542
+ * // ```
5543
+ * // - Install the npm module by running:
5544
+ * // ```sh
5545
+ * // $ npm install googleapis
5546
+ * // ```
5547
+ *
5548
+ * const {google} = require('googleapis');
5549
+ * const translate = google.translate('v3');
5550
+ *
5551
+ * async function main() {
5552
+ * const auth = new google.auth.GoogleAuth({
5553
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5554
+ * scopes: [
5555
+ * 'https://www.googleapis.com/auth/cloud-platform',
5556
+ * 'https://www.googleapis.com/auth/cloud-translation',
5557
+ * ],
5558
+ * });
5559
+ *
5560
+ * // Acquire an auth client, and bind it to all future calls
5561
+ * const authClient = await auth.getClient();
5562
+ * google.options({auth: authClient});
5563
+ *
5564
+ * // Do the magic
5565
+ * const res = await translate.projects.locations.datasets.delete({
5566
+ * // Required. The name of the dataset to delete.
5567
+ * name: 'projects/my-project/locations/my-location/datasets/my-dataset',
5568
+ * });
5569
+ * console.log(res.data);
5570
+ *
5571
+ * // Example response
5572
+ * // {
5573
+ * // "done": false,
5574
+ * // "error": {},
5575
+ * // "metadata": {},
5576
+ * // "name": "my_name",
5577
+ * // "response": {}
5578
+ * // }
5579
+ * }
5580
+ *
5581
+ * main().catch(e => {
5582
+ * console.error(e);
5583
+ * throw e;
5584
+ * });
5585
+ *
5586
+ * ```
4030
5587
  *
4031
5588
  * @param params - Parameters for request
4032
5589
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4036,11 +5593,11 @@ export namespace translate_v3 {
4036
5593
  delete(
4037
5594
  params: Params$Resource$Projects$Locations$Datasets$Delete,
4038
5595
  options: StreamMethodOptions
4039
- ): GaxiosPromise<Readable>;
5596
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4040
5597
  delete(
4041
5598
  params?: Params$Resource$Projects$Locations$Datasets$Delete,
4042
5599
  options?: MethodOptions
4043
- ): GaxiosPromise<Schema$Operation>;
5600
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
4044
5601
  delete(
4045
5602
  params: Params$Resource$Projects$Locations$Datasets$Delete,
4046
5603
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4069,7 +5626,10 @@ export namespace translate_v3 {
4069
5626
  callback?:
4070
5627
  | BodyResponseCallback<Schema$Operation>
4071
5628
  | BodyResponseCallback<Readable>
4072
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
5629
+ ):
5630
+ | void
5631
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
5632
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4073
5633
  let params = (paramsOrCallback ||
4074
5634
  {}) as Params$Resource$Projects$Locations$Datasets$Delete;
4075
5635
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4112,6 +5672,67 @@ export namespace translate_v3 {
4112
5672
 
4113
5673
  /**
4114
5674
  * Exports dataset's data to the provided output location.
5675
+ * @example
5676
+ * ```js
5677
+ * // Before running the sample:
5678
+ * // - Enable the API at:
5679
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5680
+ * // - Login into gcloud by running:
5681
+ * // ```sh
5682
+ * // $ gcloud auth application-default login
5683
+ * // ```
5684
+ * // - Install the npm module by running:
5685
+ * // ```sh
5686
+ * // $ npm install googleapis
5687
+ * // ```
5688
+ *
5689
+ * const {google} = require('googleapis');
5690
+ * const translate = google.translate('v3');
5691
+ *
5692
+ * async function main() {
5693
+ * const auth = new google.auth.GoogleAuth({
5694
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5695
+ * scopes: [
5696
+ * 'https://www.googleapis.com/auth/cloud-platform',
5697
+ * 'https://www.googleapis.com/auth/cloud-translation',
5698
+ * ],
5699
+ * });
5700
+ *
5701
+ * // Acquire an auth client, and bind it to all future calls
5702
+ * const authClient = await auth.getClient();
5703
+ * google.options({auth: authClient});
5704
+ *
5705
+ * // Do the magic
5706
+ * const res = await translate.projects.locations.datasets.exportData({
5707
+ * // Required. Name of the dataset. In form of `projects/{project-number-or-id\}/locations/{location-id\}/datasets/{dataset-id\}`
5708
+ * dataset: 'projects/my-project/locations/my-location/datasets/my-dataset',
5709
+ *
5710
+ * // Request body metadata
5711
+ * requestBody: {
5712
+ * // request body parameters
5713
+ * // {
5714
+ * // "outputConfig": {}
5715
+ * // }
5716
+ * },
5717
+ * });
5718
+ * console.log(res.data);
5719
+ *
5720
+ * // Example response
5721
+ * // {
5722
+ * // "done": false,
5723
+ * // "error": {},
5724
+ * // "metadata": {},
5725
+ * // "name": "my_name",
5726
+ * // "response": {}
5727
+ * // }
5728
+ * }
5729
+ *
5730
+ * main().catch(e => {
5731
+ * console.error(e);
5732
+ * throw e;
5733
+ * });
5734
+ *
5735
+ * ```
4115
5736
  *
4116
5737
  * @param params - Parameters for request
4117
5738
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4121,11 +5742,11 @@ export namespace translate_v3 {
4121
5742
  exportData(
4122
5743
  params: Params$Resource$Projects$Locations$Datasets$Exportdata,
4123
5744
  options: StreamMethodOptions
4124
- ): GaxiosPromise<Readable>;
5745
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4125
5746
  exportData(
4126
5747
  params?: Params$Resource$Projects$Locations$Datasets$Exportdata,
4127
5748
  options?: MethodOptions
4128
- ): GaxiosPromise<Schema$Operation>;
5749
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
4129
5750
  exportData(
4130
5751
  params: Params$Resource$Projects$Locations$Datasets$Exportdata,
4131
5752
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4154,7 +5775,10 @@ export namespace translate_v3 {
4154
5775
  callback?:
4155
5776
  | BodyResponseCallback<Schema$Operation>
4156
5777
  | BodyResponseCallback<Readable>
4157
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
5778
+ ):
5779
+ | void
5780
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
5781
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4158
5782
  let params = (paramsOrCallback ||
4159
5783
  {}) as Params$Resource$Projects$Locations$Datasets$Exportdata;
4160
5784
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4200,6 +5824,64 @@ export namespace translate_v3 {
4200
5824
 
4201
5825
  /**
4202
5826
  * Gets a Dataset.
5827
+ * @example
5828
+ * ```js
5829
+ * // Before running the sample:
5830
+ * // - Enable the API at:
5831
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5832
+ * // - Login into gcloud by running:
5833
+ * // ```sh
5834
+ * // $ gcloud auth application-default login
5835
+ * // ```
5836
+ * // - Install the npm module by running:
5837
+ * // ```sh
5838
+ * // $ npm install googleapis
5839
+ * // ```
5840
+ *
5841
+ * const {google} = require('googleapis');
5842
+ * const translate = google.translate('v3');
5843
+ *
5844
+ * async function main() {
5845
+ * const auth = new google.auth.GoogleAuth({
5846
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5847
+ * scopes: [
5848
+ * 'https://www.googleapis.com/auth/cloud-platform',
5849
+ * 'https://www.googleapis.com/auth/cloud-translation',
5850
+ * ],
5851
+ * });
5852
+ *
5853
+ * // Acquire an auth client, and bind it to all future calls
5854
+ * const authClient = await auth.getClient();
5855
+ * google.options({auth: authClient});
5856
+ *
5857
+ * // Do the magic
5858
+ * const res = await translate.projects.locations.datasets.get({
5859
+ * // Required. The resource name of the dataset to retrieve.
5860
+ * name: 'projects/my-project/locations/my-location/datasets/my-dataset',
5861
+ * });
5862
+ * console.log(res.data);
5863
+ *
5864
+ * // Example response
5865
+ * // {
5866
+ * // "createTime": "my_createTime",
5867
+ * // "displayName": "my_displayName",
5868
+ * // "exampleCount": 0,
5869
+ * // "name": "my_name",
5870
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
5871
+ * // "targetLanguageCode": "my_targetLanguageCode",
5872
+ * // "testExampleCount": 0,
5873
+ * // "trainExampleCount": 0,
5874
+ * // "updateTime": "my_updateTime",
5875
+ * // "validateExampleCount": 0
5876
+ * // }
5877
+ * }
5878
+ *
5879
+ * main().catch(e => {
5880
+ * console.error(e);
5881
+ * throw e;
5882
+ * });
5883
+ *
5884
+ * ```
4203
5885
  *
4204
5886
  * @param params - Parameters for request
4205
5887
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4209,11 +5891,11 @@ export namespace translate_v3 {
4209
5891
  get(
4210
5892
  params: Params$Resource$Projects$Locations$Datasets$Get,
4211
5893
  options: StreamMethodOptions
4212
- ): GaxiosPromise<Readable>;
5894
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4213
5895
  get(
4214
5896
  params?: Params$Resource$Projects$Locations$Datasets$Get,
4215
5897
  options?: MethodOptions
4216
- ): GaxiosPromise<Schema$Dataset>;
5898
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Dataset>>;
4217
5899
  get(
4218
5900
  params: Params$Resource$Projects$Locations$Datasets$Get,
4219
5901
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4242,7 +5924,10 @@ export namespace translate_v3 {
4242
5924
  callback?:
4243
5925
  | BodyResponseCallback<Schema$Dataset>
4244
5926
  | BodyResponseCallback<Readable>
4245
- ): void | GaxiosPromise<Schema$Dataset> | GaxiosPromise<Readable> {
5927
+ ):
5928
+ | void
5929
+ | Promise<GaxiosResponseWithHTTP2<Schema$Dataset>>
5930
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4246
5931
  let params = (paramsOrCallback ||
4247
5932
  {}) as Params$Resource$Projects$Locations$Datasets$Get;
4248
5933
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4285,6 +5970,67 @@ export namespace translate_v3 {
4285
5970
 
4286
5971
  /**
4287
5972
  * Import sentence pairs into translation Dataset.
5973
+ * @example
5974
+ * ```js
5975
+ * // Before running the sample:
5976
+ * // - Enable the API at:
5977
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
5978
+ * // - Login into gcloud by running:
5979
+ * // ```sh
5980
+ * // $ gcloud auth application-default login
5981
+ * // ```
5982
+ * // - Install the npm module by running:
5983
+ * // ```sh
5984
+ * // $ npm install googleapis
5985
+ * // ```
5986
+ *
5987
+ * const {google} = require('googleapis');
5988
+ * const translate = google.translate('v3');
5989
+ *
5990
+ * async function main() {
5991
+ * const auth = new google.auth.GoogleAuth({
5992
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
5993
+ * scopes: [
5994
+ * 'https://www.googleapis.com/auth/cloud-platform',
5995
+ * 'https://www.googleapis.com/auth/cloud-translation',
5996
+ * ],
5997
+ * });
5998
+ *
5999
+ * // Acquire an auth client, and bind it to all future calls
6000
+ * const authClient = await auth.getClient();
6001
+ * google.options({auth: authClient});
6002
+ *
6003
+ * // Do the magic
6004
+ * const res = await translate.projects.locations.datasets.importData({
6005
+ * // Required. Name of the dataset. In form of `projects/{project-number-or-id\}/locations/{location-id\}/datasets/{dataset-id\}`
6006
+ * dataset: 'projects/my-project/locations/my-location/datasets/my-dataset',
6007
+ *
6008
+ * // Request body metadata
6009
+ * requestBody: {
6010
+ * // request body parameters
6011
+ * // {
6012
+ * // "inputConfig": {}
6013
+ * // }
6014
+ * },
6015
+ * });
6016
+ * console.log(res.data);
6017
+ *
6018
+ * // Example response
6019
+ * // {
6020
+ * // "done": false,
6021
+ * // "error": {},
6022
+ * // "metadata": {},
6023
+ * // "name": "my_name",
6024
+ * // "response": {}
6025
+ * // }
6026
+ * }
6027
+ *
6028
+ * main().catch(e => {
6029
+ * console.error(e);
6030
+ * throw e;
6031
+ * });
6032
+ *
6033
+ * ```
4288
6034
  *
4289
6035
  * @param params - Parameters for request
4290
6036
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4294,11 +6040,11 @@ export namespace translate_v3 {
4294
6040
  importData(
4295
6041
  params: Params$Resource$Projects$Locations$Datasets$Importdata,
4296
6042
  options: StreamMethodOptions
4297
- ): GaxiosPromise<Readable>;
6043
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4298
6044
  importData(
4299
6045
  params?: Params$Resource$Projects$Locations$Datasets$Importdata,
4300
6046
  options?: MethodOptions
4301
- ): GaxiosPromise<Schema$Operation>;
6047
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
4302
6048
  importData(
4303
6049
  params: Params$Resource$Projects$Locations$Datasets$Importdata,
4304
6050
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4327,7 +6073,10 @@ export namespace translate_v3 {
4327
6073
  callback?:
4328
6074
  | BodyResponseCallback<Schema$Operation>
4329
6075
  | BodyResponseCallback<Readable>
4330
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
6076
+ ):
6077
+ | void
6078
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
6079
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4331
6080
  let params = (paramsOrCallback ||
4332
6081
  {}) as Params$Resource$Projects$Locations$Datasets$Importdata;
4333
6082
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4373,6 +6122,60 @@ export namespace translate_v3 {
4373
6122
 
4374
6123
  /**
4375
6124
  * Lists datasets.
6125
+ * @example
6126
+ * ```js
6127
+ * // Before running the sample:
6128
+ * // - Enable the API at:
6129
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
6130
+ * // - Login into gcloud by running:
6131
+ * // ```sh
6132
+ * // $ gcloud auth application-default login
6133
+ * // ```
6134
+ * // - Install the npm module by running:
6135
+ * // ```sh
6136
+ * // $ npm install googleapis
6137
+ * // ```
6138
+ *
6139
+ * const {google} = require('googleapis');
6140
+ * const translate = google.translate('v3');
6141
+ *
6142
+ * async function main() {
6143
+ * const auth = new google.auth.GoogleAuth({
6144
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6145
+ * scopes: [
6146
+ * 'https://www.googleapis.com/auth/cloud-platform',
6147
+ * 'https://www.googleapis.com/auth/cloud-translation',
6148
+ * ],
6149
+ * });
6150
+ *
6151
+ * // Acquire an auth client, and bind it to all future calls
6152
+ * const authClient = await auth.getClient();
6153
+ * google.options({auth: authClient});
6154
+ *
6155
+ * // Do the magic
6156
+ * const res = await translate.projects.locations.datasets.list({
6157
+ * // Optional. Requested page size. The server can return fewer results than requested.
6158
+ * pageSize: 'placeholder-value',
6159
+ * // 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.
6160
+ * pageToken: 'placeholder-value',
6161
+ * // Required. Name of the parent project. In form of `projects/{project-number-or-id\}/locations/{location-id\}`
6162
+ * parent: 'projects/my-project/locations/my-location',
6163
+ * });
6164
+ * console.log(res.data);
6165
+ *
6166
+ * // Example response
6167
+ * // {
6168
+ * // "datasets": [],
6169
+ * // "nextPageToken": "my_nextPageToken"
6170
+ * // }
6171
+ * }
6172
+ *
6173
+ * main().catch(e => {
6174
+ * console.error(e);
6175
+ * throw e;
6176
+ * });
6177
+ *
6178
+ * ```
4376
6179
  *
4377
6180
  * @param params - Parameters for request
4378
6181
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4382,11 +6185,11 @@ export namespace translate_v3 {
4382
6185
  list(
4383
6186
  params: Params$Resource$Projects$Locations$Datasets$List,
4384
6187
  options: StreamMethodOptions
4385
- ): GaxiosPromise<Readable>;
6188
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4386
6189
  list(
4387
6190
  params?: Params$Resource$Projects$Locations$Datasets$List,
4388
6191
  options?: MethodOptions
4389
- ): GaxiosPromise<Schema$ListDatasetsResponse>;
6192
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListDatasetsResponse>>;
4390
6193
  list(
4391
6194
  params: Params$Resource$Projects$Locations$Datasets$List,
4392
6195
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4419,8 +6222,8 @@ export namespace translate_v3 {
4419
6222
  | BodyResponseCallback<Readable>
4420
6223
  ):
4421
6224
  | void
4422
- | GaxiosPromise<Schema$ListDatasetsResponse>
4423
- | GaxiosPromise<Readable> {
6225
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListDatasetsResponse>>
6226
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4424
6227
  let params = (paramsOrCallback ||
4425
6228
  {}) as Params$Resource$Projects$Locations$Datasets$List;
4426
6229
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4539,6 +6342,62 @@ export namespace translate_v3 {
4539
6342
 
4540
6343
  /**
4541
6344
  * Lists sentence pairs in the dataset.
6345
+ * @example
6346
+ * ```js
6347
+ * // Before running the sample:
6348
+ * // - Enable the API at:
6349
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
6350
+ * // - Login into gcloud by running:
6351
+ * // ```sh
6352
+ * // $ gcloud auth application-default login
6353
+ * // ```
6354
+ * // - Install the npm module by running:
6355
+ * // ```sh
6356
+ * // $ npm install googleapis
6357
+ * // ```
6358
+ *
6359
+ * const {google} = require('googleapis');
6360
+ * const translate = google.translate('v3');
6361
+ *
6362
+ * async function main() {
6363
+ * const auth = new google.auth.GoogleAuth({
6364
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6365
+ * scopes: [
6366
+ * 'https://www.googleapis.com/auth/cloud-platform',
6367
+ * 'https://www.googleapis.com/auth/cloud-translation',
6368
+ * ],
6369
+ * });
6370
+ *
6371
+ * // Acquire an auth client, and bind it to all future calls
6372
+ * const authClient = await auth.getClient();
6373
+ * google.options({auth: authClient});
6374
+ *
6375
+ * // Do the magic
6376
+ * const res = await translate.projects.locations.datasets.examples.list({
6377
+ * // Optional. An expression for filtering the examples that will be returned. Example filter: * `usage=TRAIN`
6378
+ * filter: 'placeholder-value',
6379
+ * // Optional. Requested page size. The server can return fewer results than requested.
6380
+ * pageSize: 'placeholder-value',
6381
+ * // 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.
6382
+ * pageToken: 'placeholder-value',
6383
+ * // Required. Name of the parent dataset. In form of `projects/{project-number-or-id\}/locations/{location-id\}/datasets/{dataset-id\}`
6384
+ * parent: 'projects/my-project/locations/my-location/datasets/my-dataset',
6385
+ * });
6386
+ * console.log(res.data);
6387
+ *
6388
+ * // Example response
6389
+ * // {
6390
+ * // "examples": [],
6391
+ * // "nextPageToken": "my_nextPageToken"
6392
+ * // }
6393
+ * }
6394
+ *
6395
+ * main().catch(e => {
6396
+ * console.error(e);
6397
+ * throw e;
6398
+ * });
6399
+ *
6400
+ * ```
4542
6401
  *
4543
6402
  * @param params - Parameters for request
4544
6403
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4548,11 +6407,11 @@ export namespace translate_v3 {
4548
6407
  list(
4549
6408
  params: Params$Resource$Projects$Locations$Datasets$Examples$List,
4550
6409
  options: StreamMethodOptions
4551
- ): GaxiosPromise<Readable>;
6410
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4552
6411
  list(
4553
6412
  params?: Params$Resource$Projects$Locations$Datasets$Examples$List,
4554
6413
  options?: MethodOptions
4555
- ): GaxiosPromise<Schema$ListExamplesResponse>;
6414
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListExamplesResponse>>;
4556
6415
  list(
4557
6416
  params: Params$Resource$Projects$Locations$Datasets$Examples$List,
4558
6417
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4585,8 +6444,8 @@ export namespace translate_v3 {
4585
6444
  | BodyResponseCallback<Readable>
4586
6445
  ):
4587
6446
  | void
4588
- | GaxiosPromise<Schema$ListExamplesResponse>
4589
- | GaxiosPromise<Readable> {
6447
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListExamplesResponse>>
6448
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4590
6449
  let params = (paramsOrCallback ||
4591
6450
  {}) as Params$Resource$Projects$Locations$Datasets$Examples$List;
4592
6451
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4665,6 +6524,74 @@ export namespace translate_v3 {
4665
6524
 
4666
6525
  /**
4667
6526
  * Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
6527
+ * @example
6528
+ * ```js
6529
+ * // Before running the sample:
6530
+ * // - Enable the API at:
6531
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
6532
+ * // - Login into gcloud by running:
6533
+ * // ```sh
6534
+ * // $ gcloud auth application-default login
6535
+ * // ```
6536
+ * // - Install the npm module by running:
6537
+ * // ```sh
6538
+ * // $ npm install googleapis
6539
+ * // ```
6540
+ *
6541
+ * const {google} = require('googleapis');
6542
+ * const translate = google.translate('v3');
6543
+ *
6544
+ * async function main() {
6545
+ * const auth = new google.auth.GoogleAuth({
6546
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6547
+ * scopes: [
6548
+ * 'https://www.googleapis.com/auth/cloud-platform',
6549
+ * 'https://www.googleapis.com/auth/cloud-translation',
6550
+ * ],
6551
+ * });
6552
+ *
6553
+ * // Acquire an auth client, and bind it to all future calls
6554
+ * const authClient = await auth.getClient();
6555
+ * google.options({auth: authClient});
6556
+ *
6557
+ * // Do the magic
6558
+ * const res = await translate.projects.locations.glossaries.create({
6559
+ * // Required. The project name.
6560
+ * parent: 'projects/my-project/locations/my-location',
6561
+ *
6562
+ * // Request body metadata
6563
+ * requestBody: {
6564
+ * // request body parameters
6565
+ * // {
6566
+ * // "displayName": "my_displayName",
6567
+ * // "endTime": "my_endTime",
6568
+ * // "entryCount": 0,
6569
+ * // "inputConfig": {},
6570
+ * // "languageCodesSet": {},
6571
+ * // "languagePair": {},
6572
+ * // "name": "my_name",
6573
+ * // "submitTime": "my_submitTime"
6574
+ * // }
6575
+ * },
6576
+ * });
6577
+ * console.log(res.data);
6578
+ *
6579
+ * // Example response
6580
+ * // {
6581
+ * // "done": false,
6582
+ * // "error": {},
6583
+ * // "metadata": {},
6584
+ * // "name": "my_name",
6585
+ * // "response": {}
6586
+ * // }
6587
+ * }
6588
+ *
6589
+ * main().catch(e => {
6590
+ * console.error(e);
6591
+ * throw e;
6592
+ * });
6593
+ *
6594
+ * ```
4668
6595
  *
4669
6596
  * @param params - Parameters for request
4670
6597
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4674,11 +6601,11 @@ export namespace translate_v3 {
4674
6601
  create(
4675
6602
  params: Params$Resource$Projects$Locations$Glossaries$Create,
4676
6603
  options: StreamMethodOptions
4677
- ): GaxiosPromise<Readable>;
6604
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4678
6605
  create(
4679
6606
  params?: Params$Resource$Projects$Locations$Glossaries$Create,
4680
6607
  options?: MethodOptions
4681
- ): GaxiosPromise<Schema$Operation>;
6608
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
4682
6609
  create(
4683
6610
  params: Params$Resource$Projects$Locations$Glossaries$Create,
4684
6611
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4707,7 +6634,10 @@ export namespace translate_v3 {
4707
6634
  callback?:
4708
6635
  | BodyResponseCallback<Schema$Operation>
4709
6636
  | BodyResponseCallback<Readable>
4710
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
6637
+ ):
6638
+ | void
6639
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
6640
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4711
6641
  let params = (paramsOrCallback ||
4712
6642
  {}) as Params$Resource$Projects$Locations$Glossaries$Create;
4713
6643
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4753,6 +6683,59 @@ export namespace translate_v3 {
4753
6683
 
4754
6684
  /**
4755
6685
  * Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
6686
+ * @example
6687
+ * ```js
6688
+ * // Before running the sample:
6689
+ * // - Enable the API at:
6690
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
6691
+ * // - Login into gcloud by running:
6692
+ * // ```sh
6693
+ * // $ gcloud auth application-default login
6694
+ * // ```
6695
+ * // - Install the npm module by running:
6696
+ * // ```sh
6697
+ * // $ npm install googleapis
6698
+ * // ```
6699
+ *
6700
+ * const {google} = require('googleapis');
6701
+ * const translate = google.translate('v3');
6702
+ *
6703
+ * async function main() {
6704
+ * const auth = new google.auth.GoogleAuth({
6705
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6706
+ * scopes: [
6707
+ * 'https://www.googleapis.com/auth/cloud-platform',
6708
+ * 'https://www.googleapis.com/auth/cloud-translation',
6709
+ * ],
6710
+ * });
6711
+ *
6712
+ * // Acquire an auth client, and bind it to all future calls
6713
+ * const authClient = await auth.getClient();
6714
+ * google.options({auth: authClient});
6715
+ *
6716
+ * // Do the magic
6717
+ * const res = await translate.projects.locations.glossaries.delete({
6718
+ * // Required. The name of the glossary to delete.
6719
+ * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
6720
+ * });
6721
+ * console.log(res.data);
6722
+ *
6723
+ * // Example response
6724
+ * // {
6725
+ * // "done": false,
6726
+ * // "error": {},
6727
+ * // "metadata": {},
6728
+ * // "name": "my_name",
6729
+ * // "response": {}
6730
+ * // }
6731
+ * }
6732
+ *
6733
+ * main().catch(e => {
6734
+ * console.error(e);
6735
+ * throw e;
6736
+ * });
6737
+ *
6738
+ * ```
4756
6739
  *
4757
6740
  * @param params - Parameters for request
4758
6741
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4762,11 +6745,11 @@ export namespace translate_v3 {
4762
6745
  delete(
4763
6746
  params: Params$Resource$Projects$Locations$Glossaries$Delete,
4764
6747
  options: StreamMethodOptions
4765
- ): GaxiosPromise<Readable>;
6748
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4766
6749
  delete(
4767
6750
  params?: Params$Resource$Projects$Locations$Glossaries$Delete,
4768
6751
  options?: MethodOptions
4769
- ): GaxiosPromise<Schema$Operation>;
6752
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
4770
6753
  delete(
4771
6754
  params: Params$Resource$Projects$Locations$Glossaries$Delete,
4772
6755
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4795,7 +6778,10 @@ export namespace translate_v3 {
4795
6778
  callback?:
4796
6779
  | BodyResponseCallback<Schema$Operation>
4797
6780
  | BodyResponseCallback<Readable>
4798
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
6781
+ ):
6782
+ | void
6783
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
6784
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4799
6785
  let params = (paramsOrCallback ||
4800
6786
  {}) as Params$Resource$Projects$Locations$Glossaries$Delete;
4801
6787
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4838,6 +6824,62 @@ export namespace translate_v3 {
4838
6824
 
4839
6825
  /**
4840
6826
  * Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
6827
+ * @example
6828
+ * ```js
6829
+ * // Before running the sample:
6830
+ * // - Enable the API at:
6831
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
6832
+ * // - Login into gcloud by running:
6833
+ * // ```sh
6834
+ * // $ gcloud auth application-default login
6835
+ * // ```
6836
+ * // - Install the npm module by running:
6837
+ * // ```sh
6838
+ * // $ npm install googleapis
6839
+ * // ```
6840
+ *
6841
+ * const {google} = require('googleapis');
6842
+ * const translate = google.translate('v3');
6843
+ *
6844
+ * async function main() {
6845
+ * const auth = new google.auth.GoogleAuth({
6846
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6847
+ * scopes: [
6848
+ * 'https://www.googleapis.com/auth/cloud-platform',
6849
+ * 'https://www.googleapis.com/auth/cloud-translation',
6850
+ * ],
6851
+ * });
6852
+ *
6853
+ * // Acquire an auth client, and bind it to all future calls
6854
+ * const authClient = await auth.getClient();
6855
+ * google.options({auth: authClient});
6856
+ *
6857
+ * // Do the magic
6858
+ * const res = await translate.projects.locations.glossaries.get({
6859
+ * // Required. The name of the glossary to retrieve.
6860
+ * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
6861
+ * });
6862
+ * console.log(res.data);
6863
+ *
6864
+ * // Example response
6865
+ * // {
6866
+ * // "displayName": "my_displayName",
6867
+ * // "endTime": "my_endTime",
6868
+ * // "entryCount": 0,
6869
+ * // "inputConfig": {},
6870
+ * // "languageCodesSet": {},
6871
+ * // "languagePair": {},
6872
+ * // "name": "my_name",
6873
+ * // "submitTime": "my_submitTime"
6874
+ * // }
6875
+ * }
6876
+ *
6877
+ * main().catch(e => {
6878
+ * console.error(e);
6879
+ * throw e;
6880
+ * });
6881
+ *
6882
+ * ```
4841
6883
  *
4842
6884
  * @param params - Parameters for request
4843
6885
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4847,11 +6889,11 @@ export namespace translate_v3 {
4847
6889
  get(
4848
6890
  params: Params$Resource$Projects$Locations$Glossaries$Get,
4849
6891
  options: StreamMethodOptions
4850
- ): GaxiosPromise<Readable>;
6892
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4851
6893
  get(
4852
6894
  params?: Params$Resource$Projects$Locations$Glossaries$Get,
4853
6895
  options?: MethodOptions
4854
- ): GaxiosPromise<Schema$Glossary>;
6896
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Glossary>>;
4855
6897
  get(
4856
6898
  params: Params$Resource$Projects$Locations$Glossaries$Get,
4857
6899
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4880,7 +6922,10 @@ export namespace translate_v3 {
4880
6922
  callback?:
4881
6923
  | BodyResponseCallback<Schema$Glossary>
4882
6924
  | BodyResponseCallback<Readable>
4883
- ): void | GaxiosPromise<Schema$Glossary> | GaxiosPromise<Readable> {
6925
+ ):
6926
+ | void
6927
+ | Promise<GaxiosResponseWithHTTP2<Schema$Glossary>>
6928
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4884
6929
  let params = (paramsOrCallback ||
4885
6930
  {}) as Params$Resource$Projects$Locations$Glossaries$Get;
4886
6931
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -4923,6 +6968,62 @@ export namespace translate_v3 {
4923
6968
 
4924
6969
  /**
4925
6970
  * Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
6971
+ * @example
6972
+ * ```js
6973
+ * // Before running the sample:
6974
+ * // - Enable the API at:
6975
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
6976
+ * // - Login into gcloud by running:
6977
+ * // ```sh
6978
+ * // $ gcloud auth application-default login
6979
+ * // ```
6980
+ * // - Install the npm module by running:
6981
+ * // ```sh
6982
+ * // $ npm install googleapis
6983
+ * // ```
6984
+ *
6985
+ * const {google} = require('googleapis');
6986
+ * const translate = google.translate('v3');
6987
+ *
6988
+ * async function main() {
6989
+ * const auth = new google.auth.GoogleAuth({
6990
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
6991
+ * scopes: [
6992
+ * 'https://www.googleapis.com/auth/cloud-platform',
6993
+ * 'https://www.googleapis.com/auth/cloud-translation',
6994
+ * ],
6995
+ * });
6996
+ *
6997
+ * // Acquire an auth client, and bind it to all future calls
6998
+ * const authClient = await auth.getClient();
6999
+ * google.options({auth: authClient});
7000
+ *
7001
+ * // Do the magic
7002
+ * const res = await translate.projects.locations.glossaries.list({
7003
+ * // 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.
7004
+ * filter: 'placeholder-value',
7005
+ * // Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.
7006
+ * pageSize: 'placeholder-value',
7007
+ * // 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.
7008
+ * pageToken: 'placeholder-value',
7009
+ * // Required. The name of the project from which to list all of the glossaries.
7010
+ * parent: 'projects/my-project/locations/my-location',
7011
+ * });
7012
+ * console.log(res.data);
7013
+ *
7014
+ * // Example response
7015
+ * // {
7016
+ * // "glossaries": [],
7017
+ * // "nextPageToken": "my_nextPageToken"
7018
+ * // }
7019
+ * }
7020
+ *
7021
+ * main().catch(e => {
7022
+ * console.error(e);
7023
+ * throw e;
7024
+ * });
7025
+ *
7026
+ * ```
4926
7027
  *
4927
7028
  * @param params - Parameters for request
4928
7029
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -4932,11 +7033,11 @@ export namespace translate_v3 {
4932
7033
  list(
4933
7034
  params: Params$Resource$Projects$Locations$Glossaries$List,
4934
7035
  options: StreamMethodOptions
4935
- ): GaxiosPromise<Readable>;
7036
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
4936
7037
  list(
4937
7038
  params?: Params$Resource$Projects$Locations$Glossaries$List,
4938
7039
  options?: MethodOptions
4939
- ): GaxiosPromise<Schema$ListGlossariesResponse>;
7040
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListGlossariesResponse>>;
4940
7041
  list(
4941
7042
  params: Params$Resource$Projects$Locations$Glossaries$List,
4942
7043
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -4969,8 +7070,8 @@ export namespace translate_v3 {
4969
7070
  | BodyResponseCallback<Readable>
4970
7071
  ):
4971
7072
  | void
4972
- | GaxiosPromise<Schema$ListGlossariesResponse>
4973
- | GaxiosPromise<Readable> {
7073
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListGlossariesResponse>>
7074
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
4974
7075
  let params = (paramsOrCallback ||
4975
7076
  {}) as Params$Resource$Projects$Locations$Glossaries$List;
4976
7077
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5016,6 +7117,76 @@ export namespace translate_v3 {
5016
7117
 
5017
7118
  /**
5018
7119
  * Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.
7120
+ * @example
7121
+ * ```js
7122
+ * // Before running the sample:
7123
+ * // - Enable the API at:
7124
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
7125
+ * // - Login into gcloud by running:
7126
+ * // ```sh
7127
+ * // $ gcloud auth application-default login
7128
+ * // ```
7129
+ * // - Install the npm module by running:
7130
+ * // ```sh
7131
+ * // $ npm install googleapis
7132
+ * // ```
7133
+ *
7134
+ * const {google} = require('googleapis');
7135
+ * const translate = google.translate('v3');
7136
+ *
7137
+ * async function main() {
7138
+ * const auth = new google.auth.GoogleAuth({
7139
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7140
+ * scopes: [
7141
+ * 'https://www.googleapis.com/auth/cloud-platform',
7142
+ * 'https://www.googleapis.com/auth/cloud-translation',
7143
+ * ],
7144
+ * });
7145
+ *
7146
+ * // Acquire an auth client, and bind it to all future calls
7147
+ * const authClient = await auth.getClient();
7148
+ * google.options({auth: authClient});
7149
+ *
7150
+ * // Do the magic
7151
+ * const res = await translate.projects.locations.glossaries.patch({
7152
+ * // Required. The resource name of the glossary. Glossary names have the form `projects/{project-number-or-id\}/locations/{location-id\}/glossaries/{glossary-id\}`.
7153
+ * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
7154
+ * // The list of fields to be updated. Currently only `display_name` and 'input_config'
7155
+ * updateMask: 'placeholder-value',
7156
+ *
7157
+ * // Request body metadata
7158
+ * requestBody: {
7159
+ * // request body parameters
7160
+ * // {
7161
+ * // "displayName": "my_displayName",
7162
+ * // "endTime": "my_endTime",
7163
+ * // "entryCount": 0,
7164
+ * // "inputConfig": {},
7165
+ * // "languageCodesSet": {},
7166
+ * // "languagePair": {},
7167
+ * // "name": "my_name",
7168
+ * // "submitTime": "my_submitTime"
7169
+ * // }
7170
+ * },
7171
+ * });
7172
+ * console.log(res.data);
7173
+ *
7174
+ * // Example response
7175
+ * // {
7176
+ * // "done": false,
7177
+ * // "error": {},
7178
+ * // "metadata": {},
7179
+ * // "name": "my_name",
7180
+ * // "response": {}
7181
+ * // }
7182
+ * }
7183
+ *
7184
+ * main().catch(e => {
7185
+ * console.error(e);
7186
+ * throw e;
7187
+ * });
7188
+ *
7189
+ * ```
5019
7190
  *
5020
7191
  * @param params - Parameters for request
5021
7192
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5025,11 +7196,11 @@ export namespace translate_v3 {
5025
7196
  patch(
5026
7197
  params: Params$Resource$Projects$Locations$Glossaries$Patch,
5027
7198
  options: StreamMethodOptions
5028
- ): GaxiosPromise<Readable>;
7199
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5029
7200
  patch(
5030
7201
  params?: Params$Resource$Projects$Locations$Glossaries$Patch,
5031
7202
  options?: MethodOptions
5032
- ): GaxiosPromise<Schema$Operation>;
7203
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5033
7204
  patch(
5034
7205
  params: Params$Resource$Projects$Locations$Glossaries$Patch,
5035
7206
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5058,7 +7229,10 @@ export namespace translate_v3 {
5058
7229
  callback?:
5059
7230
  | BodyResponseCallback<Schema$Operation>
5060
7231
  | BodyResponseCallback<Readable>
5061
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
7232
+ ):
7233
+ | void
7234
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
7235
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5062
7236
  let params = (paramsOrCallback ||
5063
7237
  {}) as Params$Resource$Projects$Locations$Glossaries$Patch;
5064
7238
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5170,6 +7344,71 @@ export namespace translate_v3 {
5170
7344
 
5171
7345
  /**
5172
7346
  * Creates a glossary entry.
7347
+ * @example
7348
+ * ```js
7349
+ * // Before running the sample:
7350
+ * // - Enable the API at:
7351
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
7352
+ * // - Login into gcloud by running:
7353
+ * // ```sh
7354
+ * // $ gcloud auth application-default login
7355
+ * // ```
7356
+ * // - Install the npm module by running:
7357
+ * // ```sh
7358
+ * // $ npm install googleapis
7359
+ * // ```
7360
+ *
7361
+ * const {google} = require('googleapis');
7362
+ * const translate = google.translate('v3');
7363
+ *
7364
+ * async function main() {
7365
+ * const auth = new google.auth.GoogleAuth({
7366
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7367
+ * scopes: [
7368
+ * 'https://www.googleapis.com/auth/cloud-platform',
7369
+ * 'https://www.googleapis.com/auth/cloud-translation',
7370
+ * ],
7371
+ * });
7372
+ *
7373
+ * // Acquire an auth client, and bind it to all future calls
7374
+ * const authClient = await auth.getClient();
7375
+ * google.options({auth: authClient});
7376
+ *
7377
+ * // Do the magic
7378
+ * const res =
7379
+ * await translate.projects.locations.glossaries.glossaryEntries.create({
7380
+ * // Required. The resource name of the glossary to create the entry under.
7381
+ * parent:
7382
+ * 'projects/my-project/locations/my-location/glossaries/my-glossarie',
7383
+ *
7384
+ * // Request body metadata
7385
+ * requestBody: {
7386
+ * // request body parameters
7387
+ * // {
7388
+ * // "description": "my_description",
7389
+ * // "name": "my_name",
7390
+ * // "termsPair": {},
7391
+ * // "termsSet": {}
7392
+ * // }
7393
+ * },
7394
+ * });
7395
+ * console.log(res.data);
7396
+ *
7397
+ * // Example response
7398
+ * // {
7399
+ * // "description": "my_description",
7400
+ * // "name": "my_name",
7401
+ * // "termsPair": {},
7402
+ * // "termsSet": {}
7403
+ * // }
7404
+ * }
7405
+ *
7406
+ * main().catch(e => {
7407
+ * console.error(e);
7408
+ * throw e;
7409
+ * });
7410
+ *
7411
+ * ```
5173
7412
  *
5174
7413
  * @param params - Parameters for request
5175
7414
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5179,11 +7418,11 @@ export namespace translate_v3 {
5179
7418
  create(
5180
7419
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create,
5181
7420
  options: StreamMethodOptions
5182
- ): GaxiosPromise<Readable>;
7421
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5183
7422
  create(
5184
7423
  params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create,
5185
7424
  options?: MethodOptions
5186
- ): GaxiosPromise<Schema$GlossaryEntry>;
7425
+ ): Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>;
5187
7426
  create(
5188
7427
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create,
5189
7428
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5212,7 +7451,10 @@ export namespace translate_v3 {
5212
7451
  callback?:
5213
7452
  | BodyResponseCallback<Schema$GlossaryEntry>
5214
7453
  | BodyResponseCallback<Readable>
5215
- ): void | GaxiosPromise<Schema$GlossaryEntry> | GaxiosPromise<Readable> {
7454
+ ):
7455
+ | void
7456
+ | Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>
7457
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5216
7458
  let params = (paramsOrCallback ||
5217
7459
  {}) as Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Create;
5218
7460
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5259,6 +7501,54 @@ export namespace translate_v3 {
5259
7501
 
5260
7502
  /**
5261
7503
  * Deletes a single entry from the glossary
7504
+ * @example
7505
+ * ```js
7506
+ * // Before running the sample:
7507
+ * // - Enable the API at:
7508
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
7509
+ * // - Login into gcloud by running:
7510
+ * // ```sh
7511
+ * // $ gcloud auth application-default login
7512
+ * // ```
7513
+ * // - Install the npm module by running:
7514
+ * // ```sh
7515
+ * // $ npm install googleapis
7516
+ * // ```
7517
+ *
7518
+ * const {google} = require('googleapis');
7519
+ * const translate = google.translate('v3');
7520
+ *
7521
+ * async function main() {
7522
+ * const auth = new google.auth.GoogleAuth({
7523
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7524
+ * scopes: [
7525
+ * 'https://www.googleapis.com/auth/cloud-platform',
7526
+ * 'https://www.googleapis.com/auth/cloud-translation',
7527
+ * ],
7528
+ * });
7529
+ *
7530
+ * // Acquire an auth client, and bind it to all future calls
7531
+ * const authClient = await auth.getClient();
7532
+ * google.options({auth: authClient});
7533
+ *
7534
+ * // Do the magic
7535
+ * const res =
7536
+ * await translate.projects.locations.glossaries.glossaryEntries.delete({
7537
+ * // Required. The resource name of the glossary entry to delete
7538
+ * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie/glossaryEntries/my-glossaryEntrie',
7539
+ * });
7540
+ * console.log(res.data);
7541
+ *
7542
+ * // Example response
7543
+ * // {}
7544
+ * }
7545
+ *
7546
+ * main().catch(e => {
7547
+ * console.error(e);
7548
+ * throw e;
7549
+ * });
7550
+ *
7551
+ * ```
5262
7552
  *
5263
7553
  * @param params - Parameters for request
5264
7554
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5268,11 +7558,11 @@ export namespace translate_v3 {
5268
7558
  delete(
5269
7559
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete,
5270
7560
  options: StreamMethodOptions
5271
- ): GaxiosPromise<Readable>;
7561
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5272
7562
  delete(
5273
7563
  params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete,
5274
7564
  options?: MethodOptions
5275
- ): GaxiosPromise<Schema$Empty>;
7565
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
5276
7566
  delete(
5277
7567
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete,
5278
7568
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5301,7 +7591,10 @@ export namespace translate_v3 {
5301
7591
  callback?:
5302
7592
  | BodyResponseCallback<Schema$Empty>
5303
7593
  | BodyResponseCallback<Readable>
5304
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
7594
+ ):
7595
+ | void
7596
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
7597
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5305
7598
  let params = (paramsOrCallback ||
5306
7599
  {}) as Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Delete;
5307
7600
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5345,6 +7638,60 @@ export namespace translate_v3 {
5345
7638
 
5346
7639
  /**
5347
7640
  * Gets a single glossary entry by the given id.
7641
+ * @example
7642
+ * ```js
7643
+ * // Before running the sample:
7644
+ * // - Enable the API at:
7645
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
7646
+ * // - Login into gcloud by running:
7647
+ * // ```sh
7648
+ * // $ gcloud auth application-default login
7649
+ * // ```
7650
+ * // - Install the npm module by running:
7651
+ * // ```sh
7652
+ * // $ npm install googleapis
7653
+ * // ```
7654
+ *
7655
+ * const {google} = require('googleapis');
7656
+ * const translate = google.translate('v3');
7657
+ *
7658
+ * async function main() {
7659
+ * const auth = new google.auth.GoogleAuth({
7660
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7661
+ * scopes: [
7662
+ * 'https://www.googleapis.com/auth/cloud-platform',
7663
+ * 'https://www.googleapis.com/auth/cloud-translation',
7664
+ * ],
7665
+ * });
7666
+ *
7667
+ * // Acquire an auth client, and bind it to all future calls
7668
+ * const authClient = await auth.getClient();
7669
+ * google.options({auth: authClient});
7670
+ *
7671
+ * // Do the magic
7672
+ * const res = await translate.projects.locations.glossaries.glossaryEntries.get(
7673
+ * {
7674
+ * // Required. The resource name of the glossary entry to get
7675
+ * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie/glossaryEntries/my-glossaryEntrie',
7676
+ * },
7677
+ * );
7678
+ * console.log(res.data);
7679
+ *
7680
+ * // Example response
7681
+ * // {
7682
+ * // "description": "my_description",
7683
+ * // "name": "my_name",
7684
+ * // "termsPair": {},
7685
+ * // "termsSet": {}
7686
+ * // }
7687
+ * }
7688
+ *
7689
+ * main().catch(e => {
7690
+ * console.error(e);
7691
+ * throw e;
7692
+ * });
7693
+ *
7694
+ * ```
5348
7695
  *
5349
7696
  * @param params - Parameters for request
5350
7697
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5354,11 +7701,11 @@ export namespace translate_v3 {
5354
7701
  get(
5355
7702
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get,
5356
7703
  options: StreamMethodOptions
5357
- ): GaxiosPromise<Readable>;
7704
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5358
7705
  get(
5359
7706
  params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get,
5360
7707
  options?: MethodOptions
5361
- ): GaxiosPromise<Schema$GlossaryEntry>;
7708
+ ): Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>;
5362
7709
  get(
5363
7710
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get,
5364
7711
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5387,7 +7734,10 @@ export namespace translate_v3 {
5387
7734
  callback?:
5388
7735
  | BodyResponseCallback<Schema$GlossaryEntry>
5389
7736
  | BodyResponseCallback<Readable>
5390
- ): void | GaxiosPromise<Schema$GlossaryEntry> | GaxiosPromise<Readable> {
7737
+ ):
7738
+ | void
7739
+ | Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>
7740
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5391
7741
  let params = (paramsOrCallback ||
5392
7742
  {}) as Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Get;
5393
7743
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5431,6 +7781,62 @@ export namespace translate_v3 {
5431
7781
 
5432
7782
  /**
5433
7783
  * List the entries for the glossary.
7784
+ * @example
7785
+ * ```js
7786
+ * // Before running the sample:
7787
+ * // - Enable the API at:
7788
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
7789
+ * // - Login into gcloud by running:
7790
+ * // ```sh
7791
+ * // $ gcloud auth application-default login
7792
+ * // ```
7793
+ * // - Install the npm module by running:
7794
+ * // ```sh
7795
+ * // $ npm install googleapis
7796
+ * // ```
7797
+ *
7798
+ * const {google} = require('googleapis');
7799
+ * const translate = google.translate('v3');
7800
+ *
7801
+ * async function main() {
7802
+ * const auth = new google.auth.GoogleAuth({
7803
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7804
+ * scopes: [
7805
+ * 'https://www.googleapis.com/auth/cloud-platform',
7806
+ * 'https://www.googleapis.com/auth/cloud-translation',
7807
+ * ],
7808
+ * });
7809
+ *
7810
+ * // Acquire an auth client, and bind it to all future calls
7811
+ * const authClient = await auth.getClient();
7812
+ * google.options({auth: authClient});
7813
+ *
7814
+ * // Do the magic
7815
+ * const res =
7816
+ * await translate.projects.locations.glossaries.glossaryEntries.list({
7817
+ * // Optional. Requested page size. The server may return fewer glossary entries than requested. If unspecified, the server picks an appropriate default.
7818
+ * pageSize: 'placeholder-value',
7819
+ * // 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.
7820
+ * pageToken: 'placeholder-value',
7821
+ * // Required. The parent glossary resource name for listing the glossary's entries.
7822
+ * parent:
7823
+ * 'projects/my-project/locations/my-location/glossaries/my-glossarie',
7824
+ * });
7825
+ * console.log(res.data);
7826
+ *
7827
+ * // Example response
7828
+ * // {
7829
+ * // "glossaryEntries": [],
7830
+ * // "nextPageToken": "my_nextPageToken"
7831
+ * // }
7832
+ * }
7833
+ *
7834
+ * main().catch(e => {
7835
+ * console.error(e);
7836
+ * throw e;
7837
+ * });
7838
+ *
7839
+ * ```
5434
7840
  *
5435
7841
  * @param params - Parameters for request
5436
7842
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5440,11 +7846,11 @@ export namespace translate_v3 {
5440
7846
  list(
5441
7847
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List,
5442
7848
  options: StreamMethodOptions
5443
- ): GaxiosPromise<Readable>;
7849
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5444
7850
  list(
5445
7851
  params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List,
5446
7852
  options?: MethodOptions
5447
- ): GaxiosPromise<Schema$ListGlossaryEntriesResponse>;
7853
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListGlossaryEntriesResponse>>;
5448
7854
  list(
5449
7855
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List,
5450
7856
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5479,8 +7885,8 @@ export namespace translate_v3 {
5479
7885
  | BodyResponseCallback<Readable>
5480
7886
  ):
5481
7887
  | void
5482
- | GaxiosPromise<Schema$ListGlossaryEntriesResponse>
5483
- | GaxiosPromise<Readable> {
7888
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListGlossaryEntriesResponse>>
7889
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5484
7890
  let params = (paramsOrCallback ||
5485
7891
  {}) as Params$Resource$Projects$Locations$Glossaries$Glossaryentries$List;
5486
7892
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5527,6 +7933,70 @@ export namespace translate_v3 {
5527
7933
 
5528
7934
  /**
5529
7935
  * Updates a glossary entry.
7936
+ * @example
7937
+ * ```js
7938
+ * // Before running the sample:
7939
+ * // - Enable the API at:
7940
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
7941
+ * // - Login into gcloud by running:
7942
+ * // ```sh
7943
+ * // $ gcloud auth application-default login
7944
+ * // ```
7945
+ * // - Install the npm module by running:
7946
+ * // ```sh
7947
+ * // $ npm install googleapis
7948
+ * // ```
7949
+ *
7950
+ * const {google} = require('googleapis');
7951
+ * const translate = google.translate('v3');
7952
+ *
7953
+ * async function main() {
7954
+ * const auth = new google.auth.GoogleAuth({
7955
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
7956
+ * scopes: [
7957
+ * 'https://www.googleapis.com/auth/cloud-platform',
7958
+ * 'https://www.googleapis.com/auth/cloud-translation',
7959
+ * ],
7960
+ * });
7961
+ *
7962
+ * // Acquire an auth client, and bind it to all future calls
7963
+ * const authClient = await auth.getClient();
7964
+ * google.options({auth: authClient});
7965
+ *
7966
+ * // Do the magic
7967
+ * const res =
7968
+ * await translate.projects.locations.glossaries.glossaryEntries.patch({
7969
+ * // Identifier. The resource name of the entry. Format: `projects/x/locations/x/glossaries/x/glossaryEntries/x`
7970
+ * name: 'projects/my-project/locations/my-location/glossaries/my-glossarie/glossaryEntries/my-glossaryEntrie',
7971
+ *
7972
+ * // Request body metadata
7973
+ * requestBody: {
7974
+ * // request body parameters
7975
+ * // {
7976
+ * // "description": "my_description",
7977
+ * // "name": "my_name",
7978
+ * // "termsPair": {},
7979
+ * // "termsSet": {}
7980
+ * // }
7981
+ * },
7982
+ * });
7983
+ * console.log(res.data);
7984
+ *
7985
+ * // Example response
7986
+ * // {
7987
+ * // "description": "my_description",
7988
+ * // "name": "my_name",
7989
+ * // "termsPair": {},
7990
+ * // "termsSet": {}
7991
+ * // }
7992
+ * }
7993
+ *
7994
+ * main().catch(e => {
7995
+ * console.error(e);
7996
+ * throw e;
7997
+ * });
7998
+ *
7999
+ * ```
5530
8000
  *
5531
8001
  * @param params - Parameters for request
5532
8002
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5536,11 +8006,11 @@ export namespace translate_v3 {
5536
8006
  patch(
5537
8007
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch,
5538
8008
  options: StreamMethodOptions
5539
- ): GaxiosPromise<Readable>;
8009
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5540
8010
  patch(
5541
8011
  params?: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch,
5542
8012
  options?: MethodOptions
5543
- ): GaxiosPromise<Schema$GlossaryEntry>;
8013
+ ): Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>;
5544
8014
  patch(
5545
8015
  params: Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch,
5546
8016
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5569,7 +8039,10 @@ export namespace translate_v3 {
5569
8039
  callback?:
5570
8040
  | BodyResponseCallback<Schema$GlossaryEntry>
5571
8041
  | BodyResponseCallback<Readable>
5572
- ): void | GaxiosPromise<Schema$GlossaryEntry> | GaxiosPromise<Readable> {
8042
+ ):
8043
+ | void
8044
+ | Promise<GaxiosResponseWithHTTP2<Schema$GlossaryEntry>>
8045
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5573
8046
  let params = (paramsOrCallback ||
5574
8047
  {}) as Params$Resource$Projects$Locations$Glossaries$Glossaryentries$Patch;
5575
8048
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5674,6 +8147,76 @@ export namespace translate_v3 {
5674
8147
 
5675
8148
  /**
5676
8149
  * Creates a Model.
8150
+ * @example
8151
+ * ```js
8152
+ * // Before running the sample:
8153
+ * // - Enable the API at:
8154
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
8155
+ * // - Login into gcloud by running:
8156
+ * // ```sh
8157
+ * // $ gcloud auth application-default login
8158
+ * // ```
8159
+ * // - Install the npm module by running:
8160
+ * // ```sh
8161
+ * // $ npm install googleapis
8162
+ * // ```
8163
+ *
8164
+ * const {google} = require('googleapis');
8165
+ * const translate = google.translate('v3');
8166
+ *
8167
+ * async function main() {
8168
+ * const auth = new google.auth.GoogleAuth({
8169
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
8170
+ * scopes: [
8171
+ * 'https://www.googleapis.com/auth/cloud-platform',
8172
+ * 'https://www.googleapis.com/auth/cloud-translation',
8173
+ * ],
8174
+ * });
8175
+ *
8176
+ * // Acquire an auth client, and bind it to all future calls
8177
+ * const authClient = await auth.getClient();
8178
+ * google.options({auth: authClient});
8179
+ *
8180
+ * // Do the magic
8181
+ * const res = await translate.projects.locations.models.create({
8182
+ * // Required. The project name, in form of `projects/{project\}/locations/{location\}`
8183
+ * parent: 'projects/my-project/locations/my-location',
8184
+ *
8185
+ * // Request body metadata
8186
+ * requestBody: {
8187
+ * // request body parameters
8188
+ * // {
8189
+ * // "createTime": "my_createTime",
8190
+ * // "dataset": "my_dataset",
8191
+ * // "displayName": "my_displayName",
8192
+ * // "name": "my_name",
8193
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
8194
+ * // "targetLanguageCode": "my_targetLanguageCode",
8195
+ * // "testExampleCount": 0,
8196
+ * // "trainExampleCount": 0,
8197
+ * // "updateTime": "my_updateTime",
8198
+ * // "validateExampleCount": 0
8199
+ * // }
8200
+ * },
8201
+ * });
8202
+ * console.log(res.data);
8203
+ *
8204
+ * // Example response
8205
+ * // {
8206
+ * // "done": false,
8207
+ * // "error": {},
8208
+ * // "metadata": {},
8209
+ * // "name": "my_name",
8210
+ * // "response": {}
8211
+ * // }
8212
+ * }
8213
+ *
8214
+ * main().catch(e => {
8215
+ * console.error(e);
8216
+ * throw e;
8217
+ * });
8218
+ *
8219
+ * ```
5677
8220
  *
5678
8221
  * @param params - Parameters for request
5679
8222
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5683,11 +8226,11 @@ export namespace translate_v3 {
5683
8226
  create(
5684
8227
  params: Params$Resource$Projects$Locations$Models$Create,
5685
8228
  options: StreamMethodOptions
5686
- ): GaxiosPromise<Readable>;
8229
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5687
8230
  create(
5688
8231
  params?: Params$Resource$Projects$Locations$Models$Create,
5689
8232
  options?: MethodOptions
5690
- ): GaxiosPromise<Schema$Operation>;
8233
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5691
8234
  create(
5692
8235
  params: Params$Resource$Projects$Locations$Models$Create,
5693
8236
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5716,7 +8259,10 @@ export namespace translate_v3 {
5716
8259
  callback?:
5717
8260
  | BodyResponseCallback<Schema$Operation>
5718
8261
  | BodyResponseCallback<Readable>
5719
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
8262
+ ):
8263
+ | void
8264
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
8265
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5720
8266
  let params = (paramsOrCallback ||
5721
8267
  {}) as Params$Resource$Projects$Locations$Models$Create;
5722
8268
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5762,6 +8308,59 @@ export namespace translate_v3 {
5762
8308
 
5763
8309
  /**
5764
8310
  * Deletes a model.
8311
+ * @example
8312
+ * ```js
8313
+ * // Before running the sample:
8314
+ * // - Enable the API at:
8315
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
8316
+ * // - Login into gcloud by running:
8317
+ * // ```sh
8318
+ * // $ gcloud auth application-default login
8319
+ * // ```
8320
+ * // - Install the npm module by running:
8321
+ * // ```sh
8322
+ * // $ npm install googleapis
8323
+ * // ```
8324
+ *
8325
+ * const {google} = require('googleapis');
8326
+ * const translate = google.translate('v3');
8327
+ *
8328
+ * async function main() {
8329
+ * const auth = new google.auth.GoogleAuth({
8330
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
8331
+ * scopes: [
8332
+ * 'https://www.googleapis.com/auth/cloud-platform',
8333
+ * 'https://www.googleapis.com/auth/cloud-translation',
8334
+ * ],
8335
+ * });
8336
+ *
8337
+ * // Acquire an auth client, and bind it to all future calls
8338
+ * const authClient = await auth.getClient();
8339
+ * google.options({auth: authClient});
8340
+ *
8341
+ * // Do the magic
8342
+ * const res = await translate.projects.locations.models.delete({
8343
+ * // Required. The name of the model to delete.
8344
+ * name: 'projects/my-project/locations/my-location/models/my-model',
8345
+ * });
8346
+ * console.log(res.data);
8347
+ *
8348
+ * // Example response
8349
+ * // {
8350
+ * // "done": false,
8351
+ * // "error": {},
8352
+ * // "metadata": {},
8353
+ * // "name": "my_name",
8354
+ * // "response": {}
8355
+ * // }
8356
+ * }
8357
+ *
8358
+ * main().catch(e => {
8359
+ * console.error(e);
8360
+ * throw e;
8361
+ * });
8362
+ *
8363
+ * ```
5765
8364
  *
5766
8365
  * @param params - Parameters for request
5767
8366
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5771,11 +8370,11 @@ export namespace translate_v3 {
5771
8370
  delete(
5772
8371
  params: Params$Resource$Projects$Locations$Models$Delete,
5773
8372
  options: StreamMethodOptions
5774
- ): GaxiosPromise<Readable>;
8373
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5775
8374
  delete(
5776
8375
  params?: Params$Resource$Projects$Locations$Models$Delete,
5777
8376
  options?: MethodOptions
5778
- ): GaxiosPromise<Schema$Operation>;
8377
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
5779
8378
  delete(
5780
8379
  params: Params$Resource$Projects$Locations$Models$Delete,
5781
8380
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5804,7 +8403,10 @@ export namespace translate_v3 {
5804
8403
  callback?:
5805
8404
  | BodyResponseCallback<Schema$Operation>
5806
8405
  | BodyResponseCallback<Readable>
5807
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
8406
+ ):
8407
+ | void
8408
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
8409
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5808
8410
  let params = (paramsOrCallback ||
5809
8411
  {}) as Params$Resource$Projects$Locations$Models$Delete;
5810
8412
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5847,6 +8449,64 @@ export namespace translate_v3 {
5847
8449
 
5848
8450
  /**
5849
8451
  * Gets a model.
8452
+ * @example
8453
+ * ```js
8454
+ * // Before running the sample:
8455
+ * // - Enable the API at:
8456
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
8457
+ * // - Login into gcloud by running:
8458
+ * // ```sh
8459
+ * // $ gcloud auth application-default login
8460
+ * // ```
8461
+ * // - Install the npm module by running:
8462
+ * // ```sh
8463
+ * // $ npm install googleapis
8464
+ * // ```
8465
+ *
8466
+ * const {google} = require('googleapis');
8467
+ * const translate = google.translate('v3');
8468
+ *
8469
+ * async function main() {
8470
+ * const auth = new google.auth.GoogleAuth({
8471
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
8472
+ * scopes: [
8473
+ * 'https://www.googleapis.com/auth/cloud-platform',
8474
+ * 'https://www.googleapis.com/auth/cloud-translation',
8475
+ * ],
8476
+ * });
8477
+ *
8478
+ * // Acquire an auth client, and bind it to all future calls
8479
+ * const authClient = await auth.getClient();
8480
+ * google.options({auth: authClient});
8481
+ *
8482
+ * // Do the magic
8483
+ * const res = await translate.projects.locations.models.get({
8484
+ * // Required. The resource name of the model to retrieve.
8485
+ * name: 'projects/my-project/locations/my-location/models/my-model',
8486
+ * });
8487
+ * console.log(res.data);
8488
+ *
8489
+ * // Example response
8490
+ * // {
8491
+ * // "createTime": "my_createTime",
8492
+ * // "dataset": "my_dataset",
8493
+ * // "displayName": "my_displayName",
8494
+ * // "name": "my_name",
8495
+ * // "sourceLanguageCode": "my_sourceLanguageCode",
8496
+ * // "targetLanguageCode": "my_targetLanguageCode",
8497
+ * // "testExampleCount": 0,
8498
+ * // "trainExampleCount": 0,
8499
+ * // "updateTime": "my_updateTime",
8500
+ * // "validateExampleCount": 0
8501
+ * // }
8502
+ * }
8503
+ *
8504
+ * main().catch(e => {
8505
+ * console.error(e);
8506
+ * throw e;
8507
+ * });
8508
+ *
8509
+ * ```
5850
8510
  *
5851
8511
  * @param params - Parameters for request
5852
8512
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5856,11 +8516,11 @@ export namespace translate_v3 {
5856
8516
  get(
5857
8517
  params: Params$Resource$Projects$Locations$Models$Get,
5858
8518
  options: StreamMethodOptions
5859
- ): GaxiosPromise<Readable>;
8519
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5860
8520
  get(
5861
8521
  params?: Params$Resource$Projects$Locations$Models$Get,
5862
8522
  options?: MethodOptions
5863
- ): GaxiosPromise<Schema$Model>;
8523
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Model>>;
5864
8524
  get(
5865
8525
  params: Params$Resource$Projects$Locations$Models$Get,
5866
8526
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5889,7 +8549,10 @@ export namespace translate_v3 {
5889
8549
  callback?:
5890
8550
  | BodyResponseCallback<Schema$Model>
5891
8551
  | BodyResponseCallback<Readable>
5892
- ): void | GaxiosPromise<Schema$Model> | GaxiosPromise<Readable> {
8552
+ ):
8553
+ | void
8554
+ | Promise<GaxiosResponseWithHTTP2<Schema$Model>>
8555
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5893
8556
  let params = (paramsOrCallback ||
5894
8557
  {}) as Params$Resource$Projects$Locations$Models$Get;
5895
8558
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -5932,6 +8595,62 @@ export namespace translate_v3 {
5932
8595
 
5933
8596
  /**
5934
8597
  * Lists models.
8598
+ * @example
8599
+ * ```js
8600
+ * // Before running the sample:
8601
+ * // - Enable the API at:
8602
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
8603
+ * // - Login into gcloud by running:
8604
+ * // ```sh
8605
+ * // $ gcloud auth application-default login
8606
+ * // ```
8607
+ * // - Install the npm module by running:
8608
+ * // ```sh
8609
+ * // $ npm install googleapis
8610
+ * // ```
8611
+ *
8612
+ * const {google} = require('googleapis');
8613
+ * const translate = google.translate('v3');
8614
+ *
8615
+ * async function main() {
8616
+ * const auth = new google.auth.GoogleAuth({
8617
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
8618
+ * scopes: [
8619
+ * 'https://www.googleapis.com/auth/cloud-platform',
8620
+ * 'https://www.googleapis.com/auth/cloud-translation',
8621
+ * ],
8622
+ * });
8623
+ *
8624
+ * // Acquire an auth client, and bind it to all future calls
8625
+ * const authClient = await auth.getClient();
8626
+ * google.options({auth: authClient});
8627
+ *
8628
+ * // Do the magic
8629
+ * const res = await translate.projects.locations.models.list({
8630
+ * // Optional. An expression for filtering the models that will be returned. Supported filter: `dataset_id=${dataset_id\}`
8631
+ * filter: 'placeholder-value',
8632
+ * // Optional. Requested page size. The server can return fewer results than requested.
8633
+ * pageSize: 'placeholder-value',
8634
+ * // 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.
8635
+ * pageToken: 'placeholder-value',
8636
+ * // Required. Name of the parent project. In form of `projects/{project-number-or-id\}/locations/{location-id\}`
8637
+ * parent: 'projects/my-project/locations/my-location',
8638
+ * });
8639
+ * console.log(res.data);
8640
+ *
8641
+ * // Example response
8642
+ * // {
8643
+ * // "models": [],
8644
+ * // "nextPageToken": "my_nextPageToken"
8645
+ * // }
8646
+ * }
8647
+ *
8648
+ * main().catch(e => {
8649
+ * console.error(e);
8650
+ * throw e;
8651
+ * });
8652
+ *
8653
+ * ```
5935
8654
  *
5936
8655
  * @param params - Parameters for request
5937
8656
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -5941,11 +8660,11 @@ export namespace translate_v3 {
5941
8660
  list(
5942
8661
  params: Params$Resource$Projects$Locations$Models$List,
5943
8662
  options: StreamMethodOptions
5944
- ): GaxiosPromise<Readable>;
8663
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
5945
8664
  list(
5946
8665
  params?: Params$Resource$Projects$Locations$Models$List,
5947
8666
  options?: MethodOptions
5948
- ): GaxiosPromise<Schema$ListModelsResponse>;
8667
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListModelsResponse>>;
5949
8668
  list(
5950
8669
  params: Params$Resource$Projects$Locations$Models$List,
5951
8670
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -5976,8 +8695,8 @@ export namespace translate_v3 {
5976
8695
  | BodyResponseCallback<Readable>
5977
8696
  ):
5978
8697
  | void
5979
- | GaxiosPromise<Schema$ListModelsResponse>
5980
- | GaxiosPromise<Readable> {
8698
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListModelsResponse>>
8699
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
5981
8700
  let params = (paramsOrCallback ||
5982
8701
  {}) as Params$Resource$Projects$Locations$Models$List;
5983
8702
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6076,6 +8795,59 @@ export namespace translate_v3 {
6076
8795
 
6077
8796
  /**
6078
8797
  * 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`.
8798
+ * @example
8799
+ * ```js
8800
+ * // Before running the sample:
8801
+ * // - Enable the API at:
8802
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
8803
+ * // - Login into gcloud by running:
8804
+ * // ```sh
8805
+ * // $ gcloud auth application-default login
8806
+ * // ```
8807
+ * // - Install the npm module by running:
8808
+ * // ```sh
8809
+ * // $ npm install googleapis
8810
+ * // ```
8811
+ *
8812
+ * const {google} = require('googleapis');
8813
+ * const translate = google.translate('v3');
8814
+ *
8815
+ * async function main() {
8816
+ * const auth = new google.auth.GoogleAuth({
8817
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
8818
+ * scopes: [
8819
+ * 'https://www.googleapis.com/auth/cloud-platform',
8820
+ * 'https://www.googleapis.com/auth/cloud-translation',
8821
+ * ],
8822
+ * });
8823
+ *
8824
+ * // Acquire an auth client, and bind it to all future calls
8825
+ * const authClient = await auth.getClient();
8826
+ * google.options({auth: authClient});
8827
+ *
8828
+ * // Do the magic
8829
+ * const res = await translate.projects.locations.operations.cancel({
8830
+ * // The name of the operation resource to be cancelled.
8831
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
8832
+ *
8833
+ * // Request body metadata
8834
+ * requestBody: {
8835
+ * // request body parameters
8836
+ * // {}
8837
+ * },
8838
+ * });
8839
+ * console.log(res.data);
8840
+ *
8841
+ * // Example response
8842
+ * // {}
8843
+ * }
8844
+ *
8845
+ * main().catch(e => {
8846
+ * console.error(e);
8847
+ * throw e;
8848
+ * });
8849
+ *
8850
+ * ```
6079
8851
  *
6080
8852
  * @param params - Parameters for request
6081
8853
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6085,11 +8857,11 @@ export namespace translate_v3 {
6085
8857
  cancel(
6086
8858
  params: Params$Resource$Projects$Locations$Operations$Cancel,
6087
8859
  options: StreamMethodOptions
6088
- ): GaxiosPromise<Readable>;
8860
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6089
8861
  cancel(
6090
8862
  params?: Params$Resource$Projects$Locations$Operations$Cancel,
6091
8863
  options?: MethodOptions
6092
- ): GaxiosPromise<Schema$Empty>;
8864
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
6093
8865
  cancel(
6094
8866
  params: Params$Resource$Projects$Locations$Operations$Cancel,
6095
8867
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6118,7 +8890,10 @@ export namespace translate_v3 {
6118
8890
  callback?:
6119
8891
  | BodyResponseCallback<Schema$Empty>
6120
8892
  | BodyResponseCallback<Readable>
6121
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
8893
+ ):
8894
+ | void
8895
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
8896
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6122
8897
  let params = (paramsOrCallback ||
6123
8898
  {}) as Params$Resource$Projects$Locations$Operations$Cancel;
6124
8899
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6161,6 +8936,53 @@ export namespace translate_v3 {
6161
8936
 
6162
8937
  /**
6163
8938
  * 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`.
8939
+ * @example
8940
+ * ```js
8941
+ * // Before running the sample:
8942
+ * // - Enable the API at:
8943
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
8944
+ * // - Login into gcloud by running:
8945
+ * // ```sh
8946
+ * // $ gcloud auth application-default login
8947
+ * // ```
8948
+ * // - Install the npm module by running:
8949
+ * // ```sh
8950
+ * // $ npm install googleapis
8951
+ * // ```
8952
+ *
8953
+ * const {google} = require('googleapis');
8954
+ * const translate = google.translate('v3');
8955
+ *
8956
+ * async function main() {
8957
+ * const auth = new google.auth.GoogleAuth({
8958
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
8959
+ * scopes: [
8960
+ * 'https://www.googleapis.com/auth/cloud-platform',
8961
+ * 'https://www.googleapis.com/auth/cloud-translation',
8962
+ * ],
8963
+ * });
8964
+ *
8965
+ * // Acquire an auth client, and bind it to all future calls
8966
+ * const authClient = await auth.getClient();
8967
+ * google.options({auth: authClient});
8968
+ *
8969
+ * // Do the magic
8970
+ * const res = await translate.projects.locations.operations.delete({
8971
+ * // The name of the operation resource to be deleted.
8972
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
8973
+ * });
8974
+ * console.log(res.data);
8975
+ *
8976
+ * // Example response
8977
+ * // {}
8978
+ * }
8979
+ *
8980
+ * main().catch(e => {
8981
+ * console.error(e);
8982
+ * throw e;
8983
+ * });
8984
+ *
8985
+ * ```
6164
8986
  *
6165
8987
  * @param params - Parameters for request
6166
8988
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6170,11 +8992,11 @@ export namespace translate_v3 {
6170
8992
  delete(
6171
8993
  params: Params$Resource$Projects$Locations$Operations$Delete,
6172
8994
  options: StreamMethodOptions
6173
- ): GaxiosPromise<Readable>;
8995
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6174
8996
  delete(
6175
8997
  params?: Params$Resource$Projects$Locations$Operations$Delete,
6176
8998
  options?: MethodOptions
6177
- ): GaxiosPromise<Schema$Empty>;
8999
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Empty>>;
6178
9000
  delete(
6179
9001
  params: Params$Resource$Projects$Locations$Operations$Delete,
6180
9002
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6203,7 +9025,10 @@ export namespace translate_v3 {
6203
9025
  callback?:
6204
9026
  | BodyResponseCallback<Schema$Empty>
6205
9027
  | BodyResponseCallback<Readable>
6206
- ): void | GaxiosPromise<Schema$Empty> | GaxiosPromise<Readable> {
9028
+ ):
9029
+ | void
9030
+ | Promise<GaxiosResponseWithHTTP2<Schema$Empty>>
9031
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6207
9032
  let params = (paramsOrCallback ||
6208
9033
  {}) as Params$Resource$Projects$Locations$Operations$Delete;
6209
9034
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6246,6 +9071,59 @@ export namespace translate_v3 {
6246
9071
 
6247
9072
  /**
6248
9073
  * 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.
9074
+ * @example
9075
+ * ```js
9076
+ * // Before running the sample:
9077
+ * // - Enable the API at:
9078
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
9079
+ * // - Login into gcloud by running:
9080
+ * // ```sh
9081
+ * // $ gcloud auth application-default login
9082
+ * // ```
9083
+ * // - Install the npm module by running:
9084
+ * // ```sh
9085
+ * // $ npm install googleapis
9086
+ * // ```
9087
+ *
9088
+ * const {google} = require('googleapis');
9089
+ * const translate = google.translate('v3');
9090
+ *
9091
+ * async function main() {
9092
+ * const auth = new google.auth.GoogleAuth({
9093
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
9094
+ * scopes: [
9095
+ * 'https://www.googleapis.com/auth/cloud-platform',
9096
+ * 'https://www.googleapis.com/auth/cloud-translation',
9097
+ * ],
9098
+ * });
9099
+ *
9100
+ * // Acquire an auth client, and bind it to all future calls
9101
+ * const authClient = await auth.getClient();
9102
+ * google.options({auth: authClient});
9103
+ *
9104
+ * // Do the magic
9105
+ * const res = await translate.projects.locations.operations.get({
9106
+ * // The name of the operation resource.
9107
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
9108
+ * });
9109
+ * console.log(res.data);
9110
+ *
9111
+ * // Example response
9112
+ * // {
9113
+ * // "done": false,
9114
+ * // "error": {},
9115
+ * // "metadata": {},
9116
+ * // "name": "my_name",
9117
+ * // "response": {}
9118
+ * // }
9119
+ * }
9120
+ *
9121
+ * main().catch(e => {
9122
+ * console.error(e);
9123
+ * throw e;
9124
+ * });
9125
+ *
9126
+ * ```
6249
9127
  *
6250
9128
  * @param params - Parameters for request
6251
9129
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6255,11 +9133,11 @@ export namespace translate_v3 {
6255
9133
  get(
6256
9134
  params: Params$Resource$Projects$Locations$Operations$Get,
6257
9135
  options: StreamMethodOptions
6258
- ): GaxiosPromise<Readable>;
9136
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6259
9137
  get(
6260
9138
  params?: Params$Resource$Projects$Locations$Operations$Get,
6261
9139
  options?: MethodOptions
6262
- ): GaxiosPromise<Schema$Operation>;
9140
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
6263
9141
  get(
6264
9142
  params: Params$Resource$Projects$Locations$Operations$Get,
6265
9143
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6288,7 +9166,10 @@ export namespace translate_v3 {
6288
9166
  callback?:
6289
9167
  | BodyResponseCallback<Schema$Operation>
6290
9168
  | BodyResponseCallback<Readable>
6291
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
9169
+ ):
9170
+ | void
9171
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
9172
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6292
9173
  let params = (paramsOrCallback ||
6293
9174
  {}) as Params$Resource$Projects$Locations$Operations$Get;
6294
9175
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6331,6 +9212,62 @@ export namespace translate_v3 {
6331
9212
 
6332
9213
  /**
6333
9214
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
9215
+ * @example
9216
+ * ```js
9217
+ * // Before running the sample:
9218
+ * // - Enable the API at:
9219
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
9220
+ * // - Login into gcloud by running:
9221
+ * // ```sh
9222
+ * // $ gcloud auth application-default login
9223
+ * // ```
9224
+ * // - Install the npm module by running:
9225
+ * // ```sh
9226
+ * // $ npm install googleapis
9227
+ * // ```
9228
+ *
9229
+ * const {google} = require('googleapis');
9230
+ * const translate = google.translate('v3');
9231
+ *
9232
+ * async function main() {
9233
+ * const auth = new google.auth.GoogleAuth({
9234
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
9235
+ * scopes: [
9236
+ * 'https://www.googleapis.com/auth/cloud-platform',
9237
+ * 'https://www.googleapis.com/auth/cloud-translation',
9238
+ * ],
9239
+ * });
9240
+ *
9241
+ * // Acquire an auth client, and bind it to all future calls
9242
+ * const authClient = await auth.getClient();
9243
+ * google.options({auth: authClient});
9244
+ *
9245
+ * // Do the magic
9246
+ * const res = await translate.projects.locations.operations.list({
9247
+ * // The standard list filter.
9248
+ * filter: 'placeholder-value',
9249
+ * // The name of the operation's parent resource.
9250
+ * name: 'projects/my-project/locations/my-location',
9251
+ * // The standard list page size.
9252
+ * pageSize: 'placeholder-value',
9253
+ * // The standard list page token.
9254
+ * pageToken: 'placeholder-value',
9255
+ * });
9256
+ * console.log(res.data);
9257
+ *
9258
+ * // Example response
9259
+ * // {
9260
+ * // "nextPageToken": "my_nextPageToken",
9261
+ * // "operations": []
9262
+ * // }
9263
+ * }
9264
+ *
9265
+ * main().catch(e => {
9266
+ * console.error(e);
9267
+ * throw e;
9268
+ * });
9269
+ *
9270
+ * ```
6334
9271
  *
6335
9272
  * @param params - Parameters for request
6336
9273
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6340,11 +9277,11 @@ export namespace translate_v3 {
6340
9277
  list(
6341
9278
  params: Params$Resource$Projects$Locations$Operations$List,
6342
9279
  options: StreamMethodOptions
6343
- ): GaxiosPromise<Readable>;
9280
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6344
9281
  list(
6345
9282
  params?: Params$Resource$Projects$Locations$Operations$List,
6346
9283
  options?: MethodOptions
6347
- ): GaxiosPromise<Schema$ListOperationsResponse>;
9284
+ ): Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>;
6348
9285
  list(
6349
9286
  params: Params$Resource$Projects$Locations$Operations$List,
6350
9287
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6377,8 +9314,8 @@ export namespace translate_v3 {
6377
9314
  | BodyResponseCallback<Readable>
6378
9315
  ):
6379
9316
  | void
6380
- | GaxiosPromise<Schema$ListOperationsResponse>
6381
- | GaxiosPromise<Readable> {
9317
+ | Promise<GaxiosResponseWithHTTP2<Schema$ListOperationsResponse>>
9318
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6382
9319
  let params = (paramsOrCallback ||
6383
9320
  {}) as Params$Resource$Projects$Locations$Operations$List;
6384
9321
  let options = (optionsOrCallback || {}) as MethodOptions;
@@ -6424,6 +9361,67 @@ export namespace translate_v3 {
6424
9361
 
6425
9362
  /**
6426
9363
  * 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.
9364
+ * @example
9365
+ * ```js
9366
+ * // Before running the sample:
9367
+ * // - Enable the API at:
9368
+ * // https://console.developers.google.com/apis/api/translate.googleapis.com
9369
+ * // - Login into gcloud by running:
9370
+ * // ```sh
9371
+ * // $ gcloud auth application-default login
9372
+ * // ```
9373
+ * // - Install the npm module by running:
9374
+ * // ```sh
9375
+ * // $ npm install googleapis
9376
+ * // ```
9377
+ *
9378
+ * const {google} = require('googleapis');
9379
+ * const translate = google.translate('v3');
9380
+ *
9381
+ * async function main() {
9382
+ * const auth = new google.auth.GoogleAuth({
9383
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
9384
+ * scopes: [
9385
+ * 'https://www.googleapis.com/auth/cloud-platform',
9386
+ * 'https://www.googleapis.com/auth/cloud-translation',
9387
+ * ],
9388
+ * });
9389
+ *
9390
+ * // Acquire an auth client, and bind it to all future calls
9391
+ * const authClient = await auth.getClient();
9392
+ * google.options({auth: authClient});
9393
+ *
9394
+ * // Do the magic
9395
+ * const res = await translate.projects.locations.operations.wait({
9396
+ * // The name of the operation resource to wait on.
9397
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
9398
+ *
9399
+ * // Request body metadata
9400
+ * requestBody: {
9401
+ * // request body parameters
9402
+ * // {
9403
+ * // "timeout": "my_timeout"
9404
+ * // }
9405
+ * },
9406
+ * });
9407
+ * console.log(res.data);
9408
+ *
9409
+ * // Example response
9410
+ * // {
9411
+ * // "done": false,
9412
+ * // "error": {},
9413
+ * // "metadata": {},
9414
+ * // "name": "my_name",
9415
+ * // "response": {}
9416
+ * // }
9417
+ * }
9418
+ *
9419
+ * main().catch(e => {
9420
+ * console.error(e);
9421
+ * throw e;
9422
+ * });
9423
+ *
9424
+ * ```
6427
9425
  *
6428
9426
  * @param params - Parameters for request
6429
9427
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -6433,11 +9431,11 @@ export namespace translate_v3 {
6433
9431
  wait(
6434
9432
  params: Params$Resource$Projects$Locations$Operations$Wait,
6435
9433
  options: StreamMethodOptions
6436
- ): GaxiosPromise<Readable>;
9434
+ ): Promise<GaxiosResponseWithHTTP2<Readable>>;
6437
9435
  wait(
6438
9436
  params?: Params$Resource$Projects$Locations$Operations$Wait,
6439
9437
  options?: MethodOptions
6440
- ): GaxiosPromise<Schema$Operation>;
9438
+ ): Promise<GaxiosResponseWithHTTP2<Schema$Operation>>;
6441
9439
  wait(
6442
9440
  params: Params$Resource$Projects$Locations$Operations$Wait,
6443
9441
  options: StreamMethodOptions | BodyResponseCallback<Readable>,
@@ -6466,7 +9464,10 @@ export namespace translate_v3 {
6466
9464
  callback?:
6467
9465
  | BodyResponseCallback<Schema$Operation>
6468
9466
  | BodyResponseCallback<Readable>
6469
- ): void | GaxiosPromise<Schema$Operation> | GaxiosPromise<Readable> {
9467
+ ):
9468
+ | void
9469
+ | Promise<GaxiosResponseWithHTTP2<Schema$Operation>>
9470
+ | Promise<GaxiosResponseWithHTTP2<Readable>> {
6470
9471
  let params = (paramsOrCallback ||
6471
9472
  {}) as Params$Resource$Projects$Locations$Operations$Wait;
6472
9473
  let options = (optionsOrCallback || {}) as MethodOptions;