@googleapis/translate 4.0.1 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/v2.d.ts +280 -1
- package/build/v2.js +8 -1
- package/build/v2.js.map +1 -1
- package/build/v3.d.ts +2923 -1
- package/build/v3.js +26 -1
- package/build/v3.js.map +1 -1
- package/build/v3beta1.d.ts +1173 -1
- package/build/v3beta1.js +10 -1
- package/build/v3beta1.js.map +1 -1
- package/package.json +4 -4
- package/v2.ts +280 -0
- package/v3.ts +2923 -0
- package/v3beta1.ts +1173 -0
package/v3beta1.ts
CHANGED
|
@@ -729,6 +729,66 @@ export namespace translate_v3beta1 {
|
|
|
729
729
|
|
|
730
730
|
/**
|
|
731
731
|
* Detects the language of text within a request.
|
|
732
|
+
* @example
|
|
733
|
+
* ```js
|
|
734
|
+
* // Before running the sample:
|
|
735
|
+
* // - Enable the API at:
|
|
736
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
737
|
+
* // - Login into gcloud by running:
|
|
738
|
+
* // ```sh
|
|
739
|
+
* // $ gcloud auth application-default login
|
|
740
|
+
* // ```
|
|
741
|
+
* // - Install the npm module by running:
|
|
742
|
+
* // ```sh
|
|
743
|
+
* // $ npm install googleapis
|
|
744
|
+
* // ```
|
|
745
|
+
*
|
|
746
|
+
* const {google} = require('googleapis');
|
|
747
|
+
* const translate = google.translate('v3beta1');
|
|
748
|
+
*
|
|
749
|
+
* async function main() {
|
|
750
|
+
* const auth = new google.auth.GoogleAuth({
|
|
751
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
752
|
+
* scopes: [
|
|
753
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
754
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
755
|
+
* ],
|
|
756
|
+
* });
|
|
757
|
+
*
|
|
758
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
759
|
+
* const authClient = await auth.getClient();
|
|
760
|
+
* google.options({auth: authClient});
|
|
761
|
+
*
|
|
762
|
+
* // Do the magic
|
|
763
|
+
* const res = await translate.projects.detectLanguage({
|
|
764
|
+
* // 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.
|
|
765
|
+
* parent: 'projects/my-project',
|
|
766
|
+
*
|
|
767
|
+
* // Request body metadata
|
|
768
|
+
* requestBody: {
|
|
769
|
+
* // request body parameters
|
|
770
|
+
* // {
|
|
771
|
+
* // "content": "my_content",
|
|
772
|
+
* // "labels": {},
|
|
773
|
+
* // "mimeType": "my_mimeType",
|
|
774
|
+
* // "model": "my_model"
|
|
775
|
+
* // }
|
|
776
|
+
* },
|
|
777
|
+
* });
|
|
778
|
+
* console.log(res.data);
|
|
779
|
+
*
|
|
780
|
+
* // Example response
|
|
781
|
+
* // {
|
|
782
|
+
* // "languages": []
|
|
783
|
+
* // }
|
|
784
|
+
* }
|
|
785
|
+
*
|
|
786
|
+
* main().catch(e => {
|
|
787
|
+
* console.error(e);
|
|
788
|
+
* throw e;
|
|
789
|
+
* });
|
|
790
|
+
*
|
|
791
|
+
* ```
|
|
732
792
|
*
|
|
733
793
|
* @param params - Parameters for request
|
|
734
794
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -824,6 +884,59 @@ export namespace translate_v3beta1 {
|
|
|
824
884
|
|
|
825
885
|
/**
|
|
826
886
|
* Returns a list of supported languages for translation.
|
|
887
|
+
* @example
|
|
888
|
+
* ```js
|
|
889
|
+
* // Before running the sample:
|
|
890
|
+
* // - Enable the API at:
|
|
891
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
892
|
+
* // - Login into gcloud by running:
|
|
893
|
+
* // ```sh
|
|
894
|
+
* // $ gcloud auth application-default login
|
|
895
|
+
* // ```
|
|
896
|
+
* // - Install the npm module by running:
|
|
897
|
+
* // ```sh
|
|
898
|
+
* // $ npm install googleapis
|
|
899
|
+
* // ```
|
|
900
|
+
*
|
|
901
|
+
* const {google} = require('googleapis');
|
|
902
|
+
* const translate = google.translate('v3beta1');
|
|
903
|
+
*
|
|
904
|
+
* async function main() {
|
|
905
|
+
* const auth = new google.auth.GoogleAuth({
|
|
906
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
907
|
+
* scopes: [
|
|
908
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
909
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
910
|
+
* ],
|
|
911
|
+
* });
|
|
912
|
+
*
|
|
913
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
914
|
+
* const authClient = await auth.getClient();
|
|
915
|
+
* google.options({auth: authClient});
|
|
916
|
+
*
|
|
917
|
+
* // Do the magic
|
|
918
|
+
* const res = await translate.projects.getSupportedLanguages({
|
|
919
|
+
* // 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.
|
|
920
|
+
* displayLanguageCode: 'placeholder-value',
|
|
921
|
+
* // 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.
|
|
922
|
+
* model: 'placeholder-value',
|
|
923
|
+
* // 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.
|
|
924
|
+
* parent: 'projects/my-project',
|
|
925
|
+
* });
|
|
926
|
+
* console.log(res.data);
|
|
927
|
+
*
|
|
928
|
+
* // Example response
|
|
929
|
+
* // {
|
|
930
|
+
* // "languages": []
|
|
931
|
+
* // }
|
|
932
|
+
* }
|
|
933
|
+
*
|
|
934
|
+
* main().catch(e => {
|
|
935
|
+
* console.error(e);
|
|
936
|
+
* throw e;
|
|
937
|
+
* });
|
|
938
|
+
*
|
|
939
|
+
* ```
|
|
827
940
|
*
|
|
828
941
|
* @param params - Parameters for request
|
|
829
942
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -917,6 +1030,70 @@ export namespace translate_v3beta1 {
|
|
|
917
1030
|
|
|
918
1031
|
/**
|
|
919
1032
|
* Translates input text and returns translated text.
|
|
1033
|
+
* @example
|
|
1034
|
+
* ```js
|
|
1035
|
+
* // Before running the sample:
|
|
1036
|
+
* // - Enable the API at:
|
|
1037
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1038
|
+
* // - Login into gcloud by running:
|
|
1039
|
+
* // ```sh
|
|
1040
|
+
* // $ gcloud auth application-default login
|
|
1041
|
+
* // ```
|
|
1042
|
+
* // - Install the npm module by running:
|
|
1043
|
+
* // ```sh
|
|
1044
|
+
* // $ npm install googleapis
|
|
1045
|
+
* // ```
|
|
1046
|
+
*
|
|
1047
|
+
* const {google} = require('googleapis');
|
|
1048
|
+
* const translate = google.translate('v3beta1');
|
|
1049
|
+
*
|
|
1050
|
+
* async function main() {
|
|
1051
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1052
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1053
|
+
* scopes: [
|
|
1054
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1055
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1056
|
+
* ],
|
|
1057
|
+
* });
|
|
1058
|
+
*
|
|
1059
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1060
|
+
* const authClient = await auth.getClient();
|
|
1061
|
+
* google.options({auth: authClient});
|
|
1062
|
+
*
|
|
1063
|
+
* // Do the magic
|
|
1064
|
+
* const res = await translate.projects.translateText({
|
|
1065
|
+
* // 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.
|
|
1066
|
+
* parent: 'projects/my-project',
|
|
1067
|
+
*
|
|
1068
|
+
* // Request body metadata
|
|
1069
|
+
* requestBody: {
|
|
1070
|
+
* // request body parameters
|
|
1071
|
+
* // {
|
|
1072
|
+
* // "contents": [],
|
|
1073
|
+
* // "glossaryConfig": {},
|
|
1074
|
+
* // "labels": {},
|
|
1075
|
+
* // "mimeType": "my_mimeType",
|
|
1076
|
+
* // "model": "my_model",
|
|
1077
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
1078
|
+
* // "targetLanguageCode": "my_targetLanguageCode"
|
|
1079
|
+
* // }
|
|
1080
|
+
* },
|
|
1081
|
+
* });
|
|
1082
|
+
* console.log(res.data);
|
|
1083
|
+
*
|
|
1084
|
+
* // Example response
|
|
1085
|
+
* // {
|
|
1086
|
+
* // "glossaryTranslations": [],
|
|
1087
|
+
* // "translations": []
|
|
1088
|
+
* // }
|
|
1089
|
+
* }
|
|
1090
|
+
*
|
|
1091
|
+
* main().catch(e => {
|
|
1092
|
+
* console.error(e);
|
|
1093
|
+
* throw e;
|
|
1094
|
+
* });
|
|
1095
|
+
*
|
|
1096
|
+
* ```
|
|
920
1097
|
*
|
|
921
1098
|
* @param params - Parameters for request
|
|
922
1099
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1067,6 +1244,76 @@ export namespace translate_v3beta1 {
|
|
|
1067
1244
|
|
|
1068
1245
|
/**
|
|
1069
1246
|
* 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.
|
|
1247
|
+
* @example
|
|
1248
|
+
* ```js
|
|
1249
|
+
* // Before running the sample:
|
|
1250
|
+
* // - Enable the API at:
|
|
1251
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1252
|
+
* // - Login into gcloud by running:
|
|
1253
|
+
* // ```sh
|
|
1254
|
+
* // $ gcloud auth application-default login
|
|
1255
|
+
* // ```
|
|
1256
|
+
* // - Install the npm module by running:
|
|
1257
|
+
* // ```sh
|
|
1258
|
+
* // $ npm install googleapis
|
|
1259
|
+
* // ```
|
|
1260
|
+
*
|
|
1261
|
+
* const {google} = require('googleapis');
|
|
1262
|
+
* const translate = google.translate('v3beta1');
|
|
1263
|
+
*
|
|
1264
|
+
* async function main() {
|
|
1265
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1266
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1267
|
+
* scopes: [
|
|
1268
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1269
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1270
|
+
* ],
|
|
1271
|
+
* });
|
|
1272
|
+
*
|
|
1273
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1274
|
+
* const authClient = await auth.getClient();
|
|
1275
|
+
* google.options({auth: authClient});
|
|
1276
|
+
*
|
|
1277
|
+
* // Do the magic
|
|
1278
|
+
* const res = await translate.projects.locations.batchTranslateDocument({
|
|
1279
|
+
* // 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.
|
|
1280
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1281
|
+
*
|
|
1282
|
+
* // Request body metadata
|
|
1283
|
+
* requestBody: {
|
|
1284
|
+
* // request body parameters
|
|
1285
|
+
* // {
|
|
1286
|
+
* // "customizedAttribution": "my_customizedAttribution",
|
|
1287
|
+
* // "enableRotationCorrection": false,
|
|
1288
|
+
* // "enableShadowRemovalNativePdf": false,
|
|
1289
|
+
* // "formatConversions": {},
|
|
1290
|
+
* // "glossaries": {},
|
|
1291
|
+
* // "inputConfigs": [],
|
|
1292
|
+
* // "models": {},
|
|
1293
|
+
* // "outputConfig": {},
|
|
1294
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
1295
|
+
* // "targetLanguageCodes": []
|
|
1296
|
+
* // }
|
|
1297
|
+
* },
|
|
1298
|
+
* });
|
|
1299
|
+
* console.log(res.data);
|
|
1300
|
+
*
|
|
1301
|
+
* // Example response
|
|
1302
|
+
* // {
|
|
1303
|
+
* // "done": false,
|
|
1304
|
+
* // "error": {},
|
|
1305
|
+
* // "metadata": {},
|
|
1306
|
+
* // "name": "my_name",
|
|
1307
|
+
* // "response": {}
|
|
1308
|
+
* // }
|
|
1309
|
+
* }
|
|
1310
|
+
*
|
|
1311
|
+
* main().catch(e => {
|
|
1312
|
+
* console.error(e);
|
|
1313
|
+
* throw e;
|
|
1314
|
+
* });
|
|
1315
|
+
*
|
|
1316
|
+
* ```
|
|
1070
1317
|
*
|
|
1071
1318
|
* @param params - Parameters for request
|
|
1072
1319
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1160,6 +1407,73 @@ export namespace translate_v3beta1 {
|
|
|
1160
1407
|
|
|
1161
1408
|
/**
|
|
1162
1409
|
* 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.
|
|
1410
|
+
* @example
|
|
1411
|
+
* ```js
|
|
1412
|
+
* // Before running the sample:
|
|
1413
|
+
* // - Enable the API at:
|
|
1414
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1415
|
+
* // - Login into gcloud by running:
|
|
1416
|
+
* // ```sh
|
|
1417
|
+
* // $ gcloud auth application-default login
|
|
1418
|
+
* // ```
|
|
1419
|
+
* // - Install the npm module by running:
|
|
1420
|
+
* // ```sh
|
|
1421
|
+
* // $ npm install googleapis
|
|
1422
|
+
* // ```
|
|
1423
|
+
*
|
|
1424
|
+
* const {google} = require('googleapis');
|
|
1425
|
+
* const translate = google.translate('v3beta1');
|
|
1426
|
+
*
|
|
1427
|
+
* async function main() {
|
|
1428
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1429
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1430
|
+
* scopes: [
|
|
1431
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1432
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1433
|
+
* ],
|
|
1434
|
+
* });
|
|
1435
|
+
*
|
|
1436
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1437
|
+
* const authClient = await auth.getClient();
|
|
1438
|
+
* google.options({auth: authClient});
|
|
1439
|
+
*
|
|
1440
|
+
* // Do the magic
|
|
1441
|
+
* const res = await translate.projects.locations.batchTranslateText({
|
|
1442
|
+
* // 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.
|
|
1443
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1444
|
+
*
|
|
1445
|
+
* // Request body metadata
|
|
1446
|
+
* requestBody: {
|
|
1447
|
+
* // request body parameters
|
|
1448
|
+
* // {
|
|
1449
|
+
* // "glossaries": {},
|
|
1450
|
+
* // "inputConfigs": [],
|
|
1451
|
+
* // "labels": {},
|
|
1452
|
+
* // "models": {},
|
|
1453
|
+
* // "outputConfig": {},
|
|
1454
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
1455
|
+
* // "targetLanguageCodes": []
|
|
1456
|
+
* // }
|
|
1457
|
+
* },
|
|
1458
|
+
* });
|
|
1459
|
+
* console.log(res.data);
|
|
1460
|
+
*
|
|
1461
|
+
* // Example response
|
|
1462
|
+
* // {
|
|
1463
|
+
* // "done": false,
|
|
1464
|
+
* // "error": {},
|
|
1465
|
+
* // "metadata": {},
|
|
1466
|
+
* // "name": "my_name",
|
|
1467
|
+
* // "response": {}
|
|
1468
|
+
* // }
|
|
1469
|
+
* }
|
|
1470
|
+
*
|
|
1471
|
+
* main().catch(e => {
|
|
1472
|
+
* console.error(e);
|
|
1473
|
+
* throw e;
|
|
1474
|
+
* });
|
|
1475
|
+
*
|
|
1476
|
+
* ```
|
|
1163
1477
|
*
|
|
1164
1478
|
* @param params - Parameters for request
|
|
1165
1479
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1251,6 +1565,66 @@ export namespace translate_v3beta1 {
|
|
|
1251
1565
|
|
|
1252
1566
|
/**
|
|
1253
1567
|
* Detects the language of text within a request.
|
|
1568
|
+
* @example
|
|
1569
|
+
* ```js
|
|
1570
|
+
* // Before running the sample:
|
|
1571
|
+
* // - Enable the API at:
|
|
1572
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1573
|
+
* // - Login into gcloud by running:
|
|
1574
|
+
* // ```sh
|
|
1575
|
+
* // $ gcloud auth application-default login
|
|
1576
|
+
* // ```
|
|
1577
|
+
* // - Install the npm module by running:
|
|
1578
|
+
* // ```sh
|
|
1579
|
+
* // $ npm install googleapis
|
|
1580
|
+
* // ```
|
|
1581
|
+
*
|
|
1582
|
+
* const {google} = require('googleapis');
|
|
1583
|
+
* const translate = google.translate('v3beta1');
|
|
1584
|
+
*
|
|
1585
|
+
* async function main() {
|
|
1586
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1587
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1588
|
+
* scopes: [
|
|
1589
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1590
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1591
|
+
* ],
|
|
1592
|
+
* });
|
|
1593
|
+
*
|
|
1594
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1595
|
+
* const authClient = await auth.getClient();
|
|
1596
|
+
* google.options({auth: authClient});
|
|
1597
|
+
*
|
|
1598
|
+
* // Do the magic
|
|
1599
|
+
* const res = await translate.projects.locations.detectLanguage({
|
|
1600
|
+
* // 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.
|
|
1601
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1602
|
+
*
|
|
1603
|
+
* // Request body metadata
|
|
1604
|
+
* requestBody: {
|
|
1605
|
+
* // request body parameters
|
|
1606
|
+
* // {
|
|
1607
|
+
* // "content": "my_content",
|
|
1608
|
+
* // "labels": {},
|
|
1609
|
+
* // "mimeType": "my_mimeType",
|
|
1610
|
+
* // "model": "my_model"
|
|
1611
|
+
* // }
|
|
1612
|
+
* },
|
|
1613
|
+
* });
|
|
1614
|
+
* console.log(res.data);
|
|
1615
|
+
*
|
|
1616
|
+
* // Example response
|
|
1617
|
+
* // {
|
|
1618
|
+
* // "languages": []
|
|
1619
|
+
* // }
|
|
1620
|
+
* }
|
|
1621
|
+
*
|
|
1622
|
+
* main().catch(e => {
|
|
1623
|
+
* console.error(e);
|
|
1624
|
+
* throw e;
|
|
1625
|
+
* });
|
|
1626
|
+
*
|
|
1627
|
+
* ```
|
|
1254
1628
|
*
|
|
1255
1629
|
* @param params - Parameters for request
|
|
1256
1630
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1346,6 +1720,59 @@ export namespace translate_v3beta1 {
|
|
|
1346
1720
|
|
|
1347
1721
|
/**
|
|
1348
1722
|
* Gets information about a location.
|
|
1723
|
+
* @example
|
|
1724
|
+
* ```js
|
|
1725
|
+
* // Before running the sample:
|
|
1726
|
+
* // - Enable the API at:
|
|
1727
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1728
|
+
* // - Login into gcloud by running:
|
|
1729
|
+
* // ```sh
|
|
1730
|
+
* // $ gcloud auth application-default login
|
|
1731
|
+
* // ```
|
|
1732
|
+
* // - Install the npm module by running:
|
|
1733
|
+
* // ```sh
|
|
1734
|
+
* // $ npm install googleapis
|
|
1735
|
+
* // ```
|
|
1736
|
+
*
|
|
1737
|
+
* const {google} = require('googleapis');
|
|
1738
|
+
* const translate = google.translate('v3beta1');
|
|
1739
|
+
*
|
|
1740
|
+
* async function main() {
|
|
1741
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1742
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1743
|
+
* scopes: [
|
|
1744
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1745
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1746
|
+
* ],
|
|
1747
|
+
* });
|
|
1748
|
+
*
|
|
1749
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1750
|
+
* const authClient = await auth.getClient();
|
|
1751
|
+
* google.options({auth: authClient});
|
|
1752
|
+
*
|
|
1753
|
+
* // Do the magic
|
|
1754
|
+
* const res = await translate.projects.locations.get({
|
|
1755
|
+
* // Resource name for the location.
|
|
1756
|
+
* name: 'projects/my-project/locations/my-location',
|
|
1757
|
+
* });
|
|
1758
|
+
* console.log(res.data);
|
|
1759
|
+
*
|
|
1760
|
+
* // Example response
|
|
1761
|
+
* // {
|
|
1762
|
+
* // "displayName": "my_displayName",
|
|
1763
|
+
* // "labels": {},
|
|
1764
|
+
* // "locationId": "my_locationId",
|
|
1765
|
+
* // "metadata": {},
|
|
1766
|
+
* // "name": "my_name"
|
|
1767
|
+
* // }
|
|
1768
|
+
* }
|
|
1769
|
+
*
|
|
1770
|
+
* main().catch(e => {
|
|
1771
|
+
* console.error(e);
|
|
1772
|
+
* throw e;
|
|
1773
|
+
* });
|
|
1774
|
+
*
|
|
1775
|
+
* ```
|
|
1349
1776
|
*
|
|
1350
1777
|
* @param params - Parameters for request
|
|
1351
1778
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1434,6 +1861,59 @@ export namespace translate_v3beta1 {
|
|
|
1434
1861
|
|
|
1435
1862
|
/**
|
|
1436
1863
|
* Returns a list of supported languages for translation.
|
|
1864
|
+
* @example
|
|
1865
|
+
* ```js
|
|
1866
|
+
* // Before running the sample:
|
|
1867
|
+
* // - Enable the API at:
|
|
1868
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
1869
|
+
* // - Login into gcloud by running:
|
|
1870
|
+
* // ```sh
|
|
1871
|
+
* // $ gcloud auth application-default login
|
|
1872
|
+
* // ```
|
|
1873
|
+
* // - Install the npm module by running:
|
|
1874
|
+
* // ```sh
|
|
1875
|
+
* // $ npm install googleapis
|
|
1876
|
+
* // ```
|
|
1877
|
+
*
|
|
1878
|
+
* const {google} = require('googleapis');
|
|
1879
|
+
* const translate = google.translate('v3beta1');
|
|
1880
|
+
*
|
|
1881
|
+
* async function main() {
|
|
1882
|
+
* const auth = new google.auth.GoogleAuth({
|
|
1883
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
1884
|
+
* scopes: [
|
|
1885
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
1886
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
1887
|
+
* ],
|
|
1888
|
+
* });
|
|
1889
|
+
*
|
|
1890
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
1891
|
+
* const authClient = await auth.getClient();
|
|
1892
|
+
* google.options({auth: authClient});
|
|
1893
|
+
*
|
|
1894
|
+
* // Do the magic
|
|
1895
|
+
* const res = await translate.projects.locations.getSupportedLanguages({
|
|
1896
|
+
* // 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.
|
|
1897
|
+
* displayLanguageCode: 'placeholder-value',
|
|
1898
|
+
* // 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.
|
|
1899
|
+
* model: 'placeholder-value',
|
|
1900
|
+
* // 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.
|
|
1901
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
1902
|
+
* });
|
|
1903
|
+
* console.log(res.data);
|
|
1904
|
+
*
|
|
1905
|
+
* // Example response
|
|
1906
|
+
* // {
|
|
1907
|
+
* // "languages": []
|
|
1908
|
+
* // }
|
|
1909
|
+
* }
|
|
1910
|
+
*
|
|
1911
|
+
* main().catch(e => {
|
|
1912
|
+
* console.error(e);
|
|
1913
|
+
* throw e;
|
|
1914
|
+
* });
|
|
1915
|
+
*
|
|
1916
|
+
* ```
|
|
1437
1917
|
*
|
|
1438
1918
|
* @param params - Parameters for request
|
|
1439
1919
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1527,6 +2007,64 @@ export namespace translate_v3beta1 {
|
|
|
1527
2007
|
|
|
1528
2008
|
/**
|
|
1529
2009
|
* Lists information about the supported locations for this service.
|
|
2010
|
+
* @example
|
|
2011
|
+
* ```js
|
|
2012
|
+
* // Before running the sample:
|
|
2013
|
+
* // - Enable the API at:
|
|
2014
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2015
|
+
* // - Login into gcloud by running:
|
|
2016
|
+
* // ```sh
|
|
2017
|
+
* // $ gcloud auth application-default login
|
|
2018
|
+
* // ```
|
|
2019
|
+
* // - Install the npm module by running:
|
|
2020
|
+
* // ```sh
|
|
2021
|
+
* // $ npm install googleapis
|
|
2022
|
+
* // ```
|
|
2023
|
+
*
|
|
2024
|
+
* const {google} = require('googleapis');
|
|
2025
|
+
* const translate = google.translate('v3beta1');
|
|
2026
|
+
*
|
|
2027
|
+
* async function main() {
|
|
2028
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2029
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2030
|
+
* scopes: [
|
|
2031
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2032
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2033
|
+
* ],
|
|
2034
|
+
* });
|
|
2035
|
+
*
|
|
2036
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2037
|
+
* const authClient = await auth.getClient();
|
|
2038
|
+
* google.options({auth: authClient});
|
|
2039
|
+
*
|
|
2040
|
+
* // Do the magic
|
|
2041
|
+
* const res = await translate.projects.locations.list({
|
|
2042
|
+
* // Optional. A list of extra location types that should be used as conditions for controlling the visibility of the locations.
|
|
2043
|
+
* extraLocationTypes: 'placeholder-value',
|
|
2044
|
+
* // 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).
|
|
2045
|
+
* filter: 'placeholder-value',
|
|
2046
|
+
* // The resource that owns the locations collection, if applicable.
|
|
2047
|
+
* name: 'projects/my-project',
|
|
2048
|
+
* // The maximum number of results to return. If not set, the service selects a default.
|
|
2049
|
+
* pageSize: 'placeholder-value',
|
|
2050
|
+
* // A page token received from the `next_page_token` field in the response. Send that page token to receive the subsequent page.
|
|
2051
|
+
* pageToken: 'placeholder-value',
|
|
2052
|
+
* });
|
|
2053
|
+
* console.log(res.data);
|
|
2054
|
+
*
|
|
2055
|
+
* // Example response
|
|
2056
|
+
* // {
|
|
2057
|
+
* // "locations": [],
|
|
2058
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
2059
|
+
* // }
|
|
2060
|
+
* }
|
|
2061
|
+
*
|
|
2062
|
+
* main().catch(e => {
|
|
2063
|
+
* console.error(e);
|
|
2064
|
+
* throw e;
|
|
2065
|
+
* });
|
|
2066
|
+
*
|
|
2067
|
+
* ```
|
|
1530
2068
|
*
|
|
1531
2069
|
* @param params - Parameters for request
|
|
1532
2070
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1620,6 +2158,76 @@ export namespace translate_v3beta1 {
|
|
|
1620
2158
|
|
|
1621
2159
|
/**
|
|
1622
2160
|
* Translates documents in synchronous mode.
|
|
2161
|
+
* @example
|
|
2162
|
+
* ```js
|
|
2163
|
+
* // Before running the sample:
|
|
2164
|
+
* // - Enable the API at:
|
|
2165
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2166
|
+
* // - Login into gcloud by running:
|
|
2167
|
+
* // ```sh
|
|
2168
|
+
* // $ gcloud auth application-default login
|
|
2169
|
+
* // ```
|
|
2170
|
+
* // - Install the npm module by running:
|
|
2171
|
+
* // ```sh
|
|
2172
|
+
* // $ npm install googleapis
|
|
2173
|
+
* // ```
|
|
2174
|
+
*
|
|
2175
|
+
* const {google} = require('googleapis');
|
|
2176
|
+
* const translate = google.translate('v3beta1');
|
|
2177
|
+
*
|
|
2178
|
+
* async function main() {
|
|
2179
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2180
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2181
|
+
* scopes: [
|
|
2182
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2183
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2184
|
+
* ],
|
|
2185
|
+
* });
|
|
2186
|
+
*
|
|
2187
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2188
|
+
* const authClient = await auth.getClient();
|
|
2189
|
+
* google.options({auth: authClient});
|
|
2190
|
+
*
|
|
2191
|
+
* // Do the magic
|
|
2192
|
+
* const res = await translate.projects.locations.translateDocument({
|
|
2193
|
+
* // 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`. 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.
|
|
2194
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2195
|
+
*
|
|
2196
|
+
* // Request body metadata
|
|
2197
|
+
* requestBody: {
|
|
2198
|
+
* // request body parameters
|
|
2199
|
+
* // {
|
|
2200
|
+
* // "customizedAttribution": "my_customizedAttribution",
|
|
2201
|
+
* // "documentInputConfig": {},
|
|
2202
|
+
* // "documentOutputConfig": {},
|
|
2203
|
+
* // "enableRotationCorrection": false,
|
|
2204
|
+
* // "enableShadowRemovalNativePdf": false,
|
|
2205
|
+
* // "glossaryConfig": {},
|
|
2206
|
+
* // "isTranslateNativePdfOnly": false,
|
|
2207
|
+
* // "labels": {},
|
|
2208
|
+
* // "model": "my_model",
|
|
2209
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2210
|
+
* // "targetLanguageCode": "my_targetLanguageCode"
|
|
2211
|
+
* // }
|
|
2212
|
+
* },
|
|
2213
|
+
* });
|
|
2214
|
+
* console.log(res.data);
|
|
2215
|
+
*
|
|
2216
|
+
* // Example response
|
|
2217
|
+
* // {
|
|
2218
|
+
* // "documentTranslation": {},
|
|
2219
|
+
* // "glossaryConfig": {},
|
|
2220
|
+
* // "glossaryDocumentTranslation": {},
|
|
2221
|
+
* // "model": "my_model"
|
|
2222
|
+
* // }
|
|
2223
|
+
* }
|
|
2224
|
+
*
|
|
2225
|
+
* main().catch(e => {
|
|
2226
|
+
* console.error(e);
|
|
2227
|
+
* throw e;
|
|
2228
|
+
* });
|
|
2229
|
+
*
|
|
2230
|
+
* ```
|
|
1623
2231
|
*
|
|
1624
2232
|
* @param params - Parameters for request
|
|
1625
2233
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1715,6 +2323,70 @@ export namespace translate_v3beta1 {
|
|
|
1715
2323
|
|
|
1716
2324
|
/**
|
|
1717
2325
|
* Translates input text and returns translated text.
|
|
2326
|
+
* @example
|
|
2327
|
+
* ```js
|
|
2328
|
+
* // Before running the sample:
|
|
2329
|
+
* // - Enable the API at:
|
|
2330
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2331
|
+
* // - Login into gcloud by running:
|
|
2332
|
+
* // ```sh
|
|
2333
|
+
* // $ gcloud auth application-default login
|
|
2334
|
+
* // ```
|
|
2335
|
+
* // - Install the npm module by running:
|
|
2336
|
+
* // ```sh
|
|
2337
|
+
* // $ npm install googleapis
|
|
2338
|
+
* // ```
|
|
2339
|
+
*
|
|
2340
|
+
* const {google} = require('googleapis');
|
|
2341
|
+
* const translate = google.translate('v3beta1');
|
|
2342
|
+
*
|
|
2343
|
+
* async function main() {
|
|
2344
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2345
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2346
|
+
* scopes: [
|
|
2347
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2348
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2349
|
+
* ],
|
|
2350
|
+
* });
|
|
2351
|
+
*
|
|
2352
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2353
|
+
* const authClient = await auth.getClient();
|
|
2354
|
+
* google.options({auth: authClient});
|
|
2355
|
+
*
|
|
2356
|
+
* // Do the magic
|
|
2357
|
+
* const res = await translate.projects.locations.translateText({
|
|
2358
|
+
* // 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.
|
|
2359
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2360
|
+
*
|
|
2361
|
+
* // Request body metadata
|
|
2362
|
+
* requestBody: {
|
|
2363
|
+
* // request body parameters
|
|
2364
|
+
* // {
|
|
2365
|
+
* // "contents": [],
|
|
2366
|
+
* // "glossaryConfig": {},
|
|
2367
|
+
* // "labels": {},
|
|
2368
|
+
* // "mimeType": "my_mimeType",
|
|
2369
|
+
* // "model": "my_model",
|
|
2370
|
+
* // "sourceLanguageCode": "my_sourceLanguageCode",
|
|
2371
|
+
* // "targetLanguageCode": "my_targetLanguageCode"
|
|
2372
|
+
* // }
|
|
2373
|
+
* },
|
|
2374
|
+
* });
|
|
2375
|
+
* console.log(res.data);
|
|
2376
|
+
*
|
|
2377
|
+
* // Example response
|
|
2378
|
+
* // {
|
|
2379
|
+
* // "glossaryTranslations": [],
|
|
2380
|
+
* // "translations": []
|
|
2381
|
+
* // }
|
|
2382
|
+
* }
|
|
2383
|
+
*
|
|
2384
|
+
* main().catch(e => {
|
|
2385
|
+
* console.error(e);
|
|
2386
|
+
* throw e;
|
|
2387
|
+
* });
|
|
2388
|
+
*
|
|
2389
|
+
* ```
|
|
1718
2390
|
*
|
|
1719
2391
|
* @param params - Parameters for request
|
|
1720
2392
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -1923,6 +2595,73 @@ export namespace translate_v3beta1 {
|
|
|
1923
2595
|
|
|
1924
2596
|
/**
|
|
1925
2597
|
* Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
|
|
2598
|
+
* @example
|
|
2599
|
+
* ```js
|
|
2600
|
+
* // Before running the sample:
|
|
2601
|
+
* // - Enable the API at:
|
|
2602
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2603
|
+
* // - Login into gcloud by running:
|
|
2604
|
+
* // ```sh
|
|
2605
|
+
* // $ gcloud auth application-default login
|
|
2606
|
+
* // ```
|
|
2607
|
+
* // - Install the npm module by running:
|
|
2608
|
+
* // ```sh
|
|
2609
|
+
* // $ npm install googleapis
|
|
2610
|
+
* // ```
|
|
2611
|
+
*
|
|
2612
|
+
* const {google} = require('googleapis');
|
|
2613
|
+
* const translate = google.translate('v3beta1');
|
|
2614
|
+
*
|
|
2615
|
+
* async function main() {
|
|
2616
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2617
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2618
|
+
* scopes: [
|
|
2619
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2620
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2621
|
+
* ],
|
|
2622
|
+
* });
|
|
2623
|
+
*
|
|
2624
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2625
|
+
* const authClient = await auth.getClient();
|
|
2626
|
+
* google.options({auth: authClient});
|
|
2627
|
+
*
|
|
2628
|
+
* // Do the magic
|
|
2629
|
+
* const res = await translate.projects.locations.glossaries.create({
|
|
2630
|
+
* // Required. The project name.
|
|
2631
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
2632
|
+
*
|
|
2633
|
+
* // Request body metadata
|
|
2634
|
+
* requestBody: {
|
|
2635
|
+
* // request body parameters
|
|
2636
|
+
* // {
|
|
2637
|
+
* // "endTime": "my_endTime",
|
|
2638
|
+
* // "entryCount": 0,
|
|
2639
|
+
* // "inputConfig": {},
|
|
2640
|
+
* // "languageCodesSet": {},
|
|
2641
|
+
* // "languagePair": {},
|
|
2642
|
+
* // "name": "my_name",
|
|
2643
|
+
* // "submitTime": "my_submitTime"
|
|
2644
|
+
* // }
|
|
2645
|
+
* },
|
|
2646
|
+
* });
|
|
2647
|
+
* console.log(res.data);
|
|
2648
|
+
*
|
|
2649
|
+
* // Example response
|
|
2650
|
+
* // {
|
|
2651
|
+
* // "done": false,
|
|
2652
|
+
* // "error": {},
|
|
2653
|
+
* // "metadata": {},
|
|
2654
|
+
* // "name": "my_name",
|
|
2655
|
+
* // "response": {}
|
|
2656
|
+
* // }
|
|
2657
|
+
* }
|
|
2658
|
+
*
|
|
2659
|
+
* main().catch(e => {
|
|
2660
|
+
* console.error(e);
|
|
2661
|
+
* throw e;
|
|
2662
|
+
* });
|
|
2663
|
+
*
|
|
2664
|
+
* ```
|
|
1926
2665
|
*
|
|
1927
2666
|
* @param params - Parameters for request
|
|
1928
2667
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2014,6 +2753,59 @@ export namespace translate_v3beta1 {
|
|
|
2014
2753
|
|
|
2015
2754
|
/**
|
|
2016
2755
|
* Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
|
|
2756
|
+
* @example
|
|
2757
|
+
* ```js
|
|
2758
|
+
* // Before running the sample:
|
|
2759
|
+
* // - Enable the API at:
|
|
2760
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2761
|
+
* // - Login into gcloud by running:
|
|
2762
|
+
* // ```sh
|
|
2763
|
+
* // $ gcloud auth application-default login
|
|
2764
|
+
* // ```
|
|
2765
|
+
* // - Install the npm module by running:
|
|
2766
|
+
* // ```sh
|
|
2767
|
+
* // $ npm install googleapis
|
|
2768
|
+
* // ```
|
|
2769
|
+
*
|
|
2770
|
+
* const {google} = require('googleapis');
|
|
2771
|
+
* const translate = google.translate('v3beta1');
|
|
2772
|
+
*
|
|
2773
|
+
* async function main() {
|
|
2774
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2775
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2776
|
+
* scopes: [
|
|
2777
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2778
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2779
|
+
* ],
|
|
2780
|
+
* });
|
|
2781
|
+
*
|
|
2782
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2783
|
+
* const authClient = await auth.getClient();
|
|
2784
|
+
* google.options({auth: authClient});
|
|
2785
|
+
*
|
|
2786
|
+
* // Do the magic
|
|
2787
|
+
* const res = await translate.projects.locations.glossaries.delete({
|
|
2788
|
+
* // Required. The name of the glossary to delete.
|
|
2789
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
2790
|
+
* });
|
|
2791
|
+
* console.log(res.data);
|
|
2792
|
+
*
|
|
2793
|
+
* // Example response
|
|
2794
|
+
* // {
|
|
2795
|
+
* // "done": false,
|
|
2796
|
+
* // "error": {},
|
|
2797
|
+
* // "metadata": {},
|
|
2798
|
+
* // "name": "my_name",
|
|
2799
|
+
* // "response": {}
|
|
2800
|
+
* // }
|
|
2801
|
+
* }
|
|
2802
|
+
*
|
|
2803
|
+
* main().catch(e => {
|
|
2804
|
+
* console.error(e);
|
|
2805
|
+
* throw e;
|
|
2806
|
+
* });
|
|
2807
|
+
*
|
|
2808
|
+
* ```
|
|
2017
2809
|
*
|
|
2018
2810
|
* @param params - Parameters for request
|
|
2019
2811
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2102,6 +2894,61 @@ export namespace translate_v3beta1 {
|
|
|
2102
2894
|
|
|
2103
2895
|
/**
|
|
2104
2896
|
* Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
|
|
2897
|
+
* @example
|
|
2898
|
+
* ```js
|
|
2899
|
+
* // Before running the sample:
|
|
2900
|
+
* // - Enable the API at:
|
|
2901
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
2902
|
+
* // - Login into gcloud by running:
|
|
2903
|
+
* // ```sh
|
|
2904
|
+
* // $ gcloud auth application-default login
|
|
2905
|
+
* // ```
|
|
2906
|
+
* // - Install the npm module by running:
|
|
2907
|
+
* // ```sh
|
|
2908
|
+
* // $ npm install googleapis
|
|
2909
|
+
* // ```
|
|
2910
|
+
*
|
|
2911
|
+
* const {google} = require('googleapis');
|
|
2912
|
+
* const translate = google.translate('v3beta1');
|
|
2913
|
+
*
|
|
2914
|
+
* async function main() {
|
|
2915
|
+
* const auth = new google.auth.GoogleAuth({
|
|
2916
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
2917
|
+
* scopes: [
|
|
2918
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
2919
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
2920
|
+
* ],
|
|
2921
|
+
* });
|
|
2922
|
+
*
|
|
2923
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
2924
|
+
* const authClient = await auth.getClient();
|
|
2925
|
+
* google.options({auth: authClient});
|
|
2926
|
+
*
|
|
2927
|
+
* // Do the magic
|
|
2928
|
+
* const res = await translate.projects.locations.glossaries.get({
|
|
2929
|
+
* // Required. The name of the glossary to retrieve.
|
|
2930
|
+
* name: 'projects/my-project/locations/my-location/glossaries/my-glossarie',
|
|
2931
|
+
* });
|
|
2932
|
+
* console.log(res.data);
|
|
2933
|
+
*
|
|
2934
|
+
* // Example response
|
|
2935
|
+
* // {
|
|
2936
|
+
* // "endTime": "my_endTime",
|
|
2937
|
+
* // "entryCount": 0,
|
|
2938
|
+
* // "inputConfig": {},
|
|
2939
|
+
* // "languageCodesSet": {},
|
|
2940
|
+
* // "languagePair": {},
|
|
2941
|
+
* // "name": "my_name",
|
|
2942
|
+
* // "submitTime": "my_submitTime"
|
|
2943
|
+
* // }
|
|
2944
|
+
* }
|
|
2945
|
+
*
|
|
2946
|
+
* main().catch(e => {
|
|
2947
|
+
* console.error(e);
|
|
2948
|
+
* throw e;
|
|
2949
|
+
* });
|
|
2950
|
+
*
|
|
2951
|
+
* ```
|
|
2105
2952
|
*
|
|
2106
2953
|
* @param params - Parameters for request
|
|
2107
2954
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2190,6 +3037,62 @@ export namespace translate_v3beta1 {
|
|
|
2190
3037
|
|
|
2191
3038
|
/**
|
|
2192
3039
|
* Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
|
|
3040
|
+
* @example
|
|
3041
|
+
* ```js
|
|
3042
|
+
* // Before running the sample:
|
|
3043
|
+
* // - Enable the API at:
|
|
3044
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3045
|
+
* // - Login into gcloud by running:
|
|
3046
|
+
* // ```sh
|
|
3047
|
+
* // $ gcloud auth application-default login
|
|
3048
|
+
* // ```
|
|
3049
|
+
* // - Install the npm module by running:
|
|
3050
|
+
* // ```sh
|
|
3051
|
+
* // $ npm install googleapis
|
|
3052
|
+
* // ```
|
|
3053
|
+
*
|
|
3054
|
+
* const {google} = require('googleapis');
|
|
3055
|
+
* const translate = google.translate('v3beta1');
|
|
3056
|
+
*
|
|
3057
|
+
* async function main() {
|
|
3058
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3059
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3060
|
+
* scopes: [
|
|
3061
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3062
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3063
|
+
* ],
|
|
3064
|
+
* });
|
|
3065
|
+
*
|
|
3066
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3067
|
+
* const authClient = await auth.getClient();
|
|
3068
|
+
* google.options({auth: authClient});
|
|
3069
|
+
*
|
|
3070
|
+
* // Do the magic
|
|
3071
|
+
* const res = await translate.projects.locations.glossaries.list({
|
|
3072
|
+
* // 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.
|
|
3073
|
+
* filter: 'placeholder-value',
|
|
3074
|
+
* // Optional. Requested page size. The server may return fewer glossaries than requested. If unspecified, the server picks an appropriate default.
|
|
3075
|
+
* pageSize: 'placeholder-value',
|
|
3076
|
+
* // 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.
|
|
3077
|
+
* pageToken: 'placeholder-value',
|
|
3078
|
+
* // Required. The name of the project from which to list all of the glossaries.
|
|
3079
|
+
* parent: 'projects/my-project/locations/my-location',
|
|
3080
|
+
* });
|
|
3081
|
+
* console.log(res.data);
|
|
3082
|
+
*
|
|
3083
|
+
* // Example response
|
|
3084
|
+
* // {
|
|
3085
|
+
* // "glossaries": [],
|
|
3086
|
+
* // "nextPageToken": "my_nextPageToken"
|
|
3087
|
+
* // }
|
|
3088
|
+
* }
|
|
3089
|
+
*
|
|
3090
|
+
* main().catch(e => {
|
|
3091
|
+
* console.error(e);
|
|
3092
|
+
* throw e;
|
|
3093
|
+
* });
|
|
3094
|
+
*
|
|
3095
|
+
* ```
|
|
2193
3096
|
*
|
|
2194
3097
|
* @param params - Parameters for request
|
|
2195
3098
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2336,6 +3239,59 @@ export namespace translate_v3beta1 {
|
|
|
2336
3239
|
|
|
2337
3240
|
/**
|
|
2338
3241
|
* 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`.
|
|
3242
|
+
* @example
|
|
3243
|
+
* ```js
|
|
3244
|
+
* // Before running the sample:
|
|
3245
|
+
* // - Enable the API at:
|
|
3246
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3247
|
+
* // - Login into gcloud by running:
|
|
3248
|
+
* // ```sh
|
|
3249
|
+
* // $ gcloud auth application-default login
|
|
3250
|
+
* // ```
|
|
3251
|
+
* // - Install the npm module by running:
|
|
3252
|
+
* // ```sh
|
|
3253
|
+
* // $ npm install googleapis
|
|
3254
|
+
* // ```
|
|
3255
|
+
*
|
|
3256
|
+
* const {google} = require('googleapis');
|
|
3257
|
+
* const translate = google.translate('v3beta1');
|
|
3258
|
+
*
|
|
3259
|
+
* async function main() {
|
|
3260
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3261
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3262
|
+
* scopes: [
|
|
3263
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3264
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3265
|
+
* ],
|
|
3266
|
+
* });
|
|
3267
|
+
*
|
|
3268
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3269
|
+
* const authClient = await auth.getClient();
|
|
3270
|
+
* google.options({auth: authClient});
|
|
3271
|
+
*
|
|
3272
|
+
* // Do the magic
|
|
3273
|
+
* const res = await translate.projects.locations.operations.cancel({
|
|
3274
|
+
* // The name of the operation resource to be cancelled.
|
|
3275
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3276
|
+
*
|
|
3277
|
+
* // Request body metadata
|
|
3278
|
+
* requestBody: {
|
|
3279
|
+
* // request body parameters
|
|
3280
|
+
* // {}
|
|
3281
|
+
* },
|
|
3282
|
+
* });
|
|
3283
|
+
* console.log(res.data);
|
|
3284
|
+
*
|
|
3285
|
+
* // Example response
|
|
3286
|
+
* // {}
|
|
3287
|
+
* }
|
|
3288
|
+
*
|
|
3289
|
+
* main().catch(e => {
|
|
3290
|
+
* console.error(e);
|
|
3291
|
+
* throw e;
|
|
3292
|
+
* });
|
|
3293
|
+
*
|
|
3294
|
+
* ```
|
|
2339
3295
|
*
|
|
2340
3296
|
* @param params - Parameters for request
|
|
2341
3297
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2427,6 +3383,53 @@ export namespace translate_v3beta1 {
|
|
|
2427
3383
|
|
|
2428
3384
|
/**
|
|
2429
3385
|
* 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`.
|
|
3386
|
+
* @example
|
|
3387
|
+
* ```js
|
|
3388
|
+
* // Before running the sample:
|
|
3389
|
+
* // - Enable the API at:
|
|
3390
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3391
|
+
* // - Login into gcloud by running:
|
|
3392
|
+
* // ```sh
|
|
3393
|
+
* // $ gcloud auth application-default login
|
|
3394
|
+
* // ```
|
|
3395
|
+
* // - Install the npm module by running:
|
|
3396
|
+
* // ```sh
|
|
3397
|
+
* // $ npm install googleapis
|
|
3398
|
+
* // ```
|
|
3399
|
+
*
|
|
3400
|
+
* const {google} = require('googleapis');
|
|
3401
|
+
* const translate = google.translate('v3beta1');
|
|
3402
|
+
*
|
|
3403
|
+
* async function main() {
|
|
3404
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3405
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3406
|
+
* scopes: [
|
|
3407
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3408
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3409
|
+
* ],
|
|
3410
|
+
* });
|
|
3411
|
+
*
|
|
3412
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3413
|
+
* const authClient = await auth.getClient();
|
|
3414
|
+
* google.options({auth: authClient});
|
|
3415
|
+
*
|
|
3416
|
+
* // Do the magic
|
|
3417
|
+
* const res = await translate.projects.locations.operations.delete({
|
|
3418
|
+
* // The name of the operation resource to be deleted.
|
|
3419
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3420
|
+
* });
|
|
3421
|
+
* console.log(res.data);
|
|
3422
|
+
*
|
|
3423
|
+
* // Example response
|
|
3424
|
+
* // {}
|
|
3425
|
+
* }
|
|
3426
|
+
*
|
|
3427
|
+
* main().catch(e => {
|
|
3428
|
+
* console.error(e);
|
|
3429
|
+
* throw e;
|
|
3430
|
+
* });
|
|
3431
|
+
*
|
|
3432
|
+
* ```
|
|
2430
3433
|
*
|
|
2431
3434
|
* @param params - Parameters for request
|
|
2432
3435
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2515,6 +3518,59 @@ export namespace translate_v3beta1 {
|
|
|
2515
3518
|
|
|
2516
3519
|
/**
|
|
2517
3520
|
* 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.
|
|
3521
|
+
* @example
|
|
3522
|
+
* ```js
|
|
3523
|
+
* // Before running the sample:
|
|
3524
|
+
* // - Enable the API at:
|
|
3525
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3526
|
+
* // - Login into gcloud by running:
|
|
3527
|
+
* // ```sh
|
|
3528
|
+
* // $ gcloud auth application-default login
|
|
3529
|
+
* // ```
|
|
3530
|
+
* // - Install the npm module by running:
|
|
3531
|
+
* // ```sh
|
|
3532
|
+
* // $ npm install googleapis
|
|
3533
|
+
* // ```
|
|
3534
|
+
*
|
|
3535
|
+
* const {google} = require('googleapis');
|
|
3536
|
+
* const translate = google.translate('v3beta1');
|
|
3537
|
+
*
|
|
3538
|
+
* async function main() {
|
|
3539
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3540
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3541
|
+
* scopes: [
|
|
3542
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3543
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3544
|
+
* ],
|
|
3545
|
+
* });
|
|
3546
|
+
*
|
|
3547
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3548
|
+
* const authClient = await auth.getClient();
|
|
3549
|
+
* google.options({auth: authClient});
|
|
3550
|
+
*
|
|
3551
|
+
* // Do the magic
|
|
3552
|
+
* const res = await translate.projects.locations.operations.get({
|
|
3553
|
+
* // The name of the operation resource.
|
|
3554
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3555
|
+
* });
|
|
3556
|
+
* console.log(res.data);
|
|
3557
|
+
*
|
|
3558
|
+
* // Example response
|
|
3559
|
+
* // {
|
|
3560
|
+
* // "done": false,
|
|
3561
|
+
* // "error": {},
|
|
3562
|
+
* // "metadata": {},
|
|
3563
|
+
* // "name": "my_name",
|
|
3564
|
+
* // "response": {}
|
|
3565
|
+
* // }
|
|
3566
|
+
* }
|
|
3567
|
+
*
|
|
3568
|
+
* main().catch(e => {
|
|
3569
|
+
* console.error(e);
|
|
3570
|
+
* throw e;
|
|
3571
|
+
* });
|
|
3572
|
+
*
|
|
3573
|
+
* ```
|
|
2518
3574
|
*
|
|
2519
3575
|
* @param params - Parameters for request
|
|
2520
3576
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2603,6 +3659,62 @@ export namespace translate_v3beta1 {
|
|
|
2603
3659
|
|
|
2604
3660
|
/**
|
|
2605
3661
|
* Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
|
|
3662
|
+
* @example
|
|
3663
|
+
* ```js
|
|
3664
|
+
* // Before running the sample:
|
|
3665
|
+
* // - Enable the API at:
|
|
3666
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3667
|
+
* // - Login into gcloud by running:
|
|
3668
|
+
* // ```sh
|
|
3669
|
+
* // $ gcloud auth application-default login
|
|
3670
|
+
* // ```
|
|
3671
|
+
* // - Install the npm module by running:
|
|
3672
|
+
* // ```sh
|
|
3673
|
+
* // $ npm install googleapis
|
|
3674
|
+
* // ```
|
|
3675
|
+
*
|
|
3676
|
+
* const {google} = require('googleapis');
|
|
3677
|
+
* const translate = google.translate('v3beta1');
|
|
3678
|
+
*
|
|
3679
|
+
* async function main() {
|
|
3680
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3681
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3682
|
+
* scopes: [
|
|
3683
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3684
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3685
|
+
* ],
|
|
3686
|
+
* });
|
|
3687
|
+
*
|
|
3688
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3689
|
+
* const authClient = await auth.getClient();
|
|
3690
|
+
* google.options({auth: authClient});
|
|
3691
|
+
*
|
|
3692
|
+
* // Do the magic
|
|
3693
|
+
* const res = await translate.projects.locations.operations.list({
|
|
3694
|
+
* // The standard list filter.
|
|
3695
|
+
* filter: 'placeholder-value',
|
|
3696
|
+
* // The name of the operation's parent resource.
|
|
3697
|
+
* name: 'projects/my-project/locations/my-location',
|
|
3698
|
+
* // The standard list page size.
|
|
3699
|
+
* pageSize: 'placeholder-value',
|
|
3700
|
+
* // The standard list page token.
|
|
3701
|
+
* pageToken: 'placeholder-value',
|
|
3702
|
+
* });
|
|
3703
|
+
* console.log(res.data);
|
|
3704
|
+
*
|
|
3705
|
+
* // Example response
|
|
3706
|
+
* // {
|
|
3707
|
+
* // "nextPageToken": "my_nextPageToken",
|
|
3708
|
+
* // "operations": []
|
|
3709
|
+
* // }
|
|
3710
|
+
* }
|
|
3711
|
+
*
|
|
3712
|
+
* main().catch(e => {
|
|
3713
|
+
* console.error(e);
|
|
3714
|
+
* throw e;
|
|
3715
|
+
* });
|
|
3716
|
+
*
|
|
3717
|
+
* ```
|
|
2606
3718
|
*
|
|
2607
3719
|
* @param params - Parameters for request
|
|
2608
3720
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|
|
@@ -2696,6 +3808,67 @@ export namespace translate_v3beta1 {
|
|
|
2696
3808
|
|
|
2697
3809
|
/**
|
|
2698
3810
|
* 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.
|
|
3811
|
+
* @example
|
|
3812
|
+
* ```js
|
|
3813
|
+
* // Before running the sample:
|
|
3814
|
+
* // - Enable the API at:
|
|
3815
|
+
* // https://console.developers.google.com/apis/api/translate.googleapis.com
|
|
3816
|
+
* // - Login into gcloud by running:
|
|
3817
|
+
* // ```sh
|
|
3818
|
+
* // $ gcloud auth application-default login
|
|
3819
|
+
* // ```
|
|
3820
|
+
* // - Install the npm module by running:
|
|
3821
|
+
* // ```sh
|
|
3822
|
+
* // $ npm install googleapis
|
|
3823
|
+
* // ```
|
|
3824
|
+
*
|
|
3825
|
+
* const {google} = require('googleapis');
|
|
3826
|
+
* const translate = google.translate('v3beta1');
|
|
3827
|
+
*
|
|
3828
|
+
* async function main() {
|
|
3829
|
+
* const auth = new google.auth.GoogleAuth({
|
|
3830
|
+
* // Scopes can be specified either as an array or as a single, space-delimited string.
|
|
3831
|
+
* scopes: [
|
|
3832
|
+
* 'https://www.googleapis.com/auth/cloud-platform',
|
|
3833
|
+
* 'https://www.googleapis.com/auth/cloud-translation',
|
|
3834
|
+
* ],
|
|
3835
|
+
* });
|
|
3836
|
+
*
|
|
3837
|
+
* // Acquire an auth client, and bind it to all future calls
|
|
3838
|
+
* const authClient = await auth.getClient();
|
|
3839
|
+
* google.options({auth: authClient});
|
|
3840
|
+
*
|
|
3841
|
+
* // Do the magic
|
|
3842
|
+
* const res = await translate.projects.locations.operations.wait({
|
|
3843
|
+
* // The name of the operation resource to wait on.
|
|
3844
|
+
* name: 'projects/my-project/locations/my-location/operations/my-operation',
|
|
3845
|
+
*
|
|
3846
|
+
* // Request body metadata
|
|
3847
|
+
* requestBody: {
|
|
3848
|
+
* // request body parameters
|
|
3849
|
+
* // {
|
|
3850
|
+
* // "timeout": "my_timeout"
|
|
3851
|
+
* // }
|
|
3852
|
+
* },
|
|
3853
|
+
* });
|
|
3854
|
+
* console.log(res.data);
|
|
3855
|
+
*
|
|
3856
|
+
* // Example response
|
|
3857
|
+
* // {
|
|
3858
|
+
* // "done": false,
|
|
3859
|
+
* // "error": {},
|
|
3860
|
+
* // "metadata": {},
|
|
3861
|
+
* // "name": "my_name",
|
|
3862
|
+
* // "response": {}
|
|
3863
|
+
* // }
|
|
3864
|
+
* }
|
|
3865
|
+
*
|
|
3866
|
+
* main().catch(e => {
|
|
3867
|
+
* console.error(e);
|
|
3868
|
+
* throw e;
|
|
3869
|
+
* });
|
|
3870
|
+
*
|
|
3871
|
+
* ```
|
|
2699
3872
|
*
|
|
2700
3873
|
* @param params - Parameters for request
|
|
2701
3874
|
* @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
|