@googleapis/texttospeech 3.0.1 → 4.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/v1.ts CHANGED
@@ -475,6 +475,56 @@ export namespace texttospeech_v1 {
475
475
 
476
476
  /**
477
477
  * 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`.
478
+ * @example
479
+ * ```js
480
+ * // Before running the sample:
481
+ * // - Enable the API at:
482
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
483
+ * // - Login into gcloud by running:
484
+ * // ```sh
485
+ * // $ gcloud auth application-default login
486
+ * // ```
487
+ * // - Install the npm module by running:
488
+ * // ```sh
489
+ * // $ npm install googleapis
490
+ * // ```
491
+ *
492
+ * const {google} = require('googleapis');
493
+ * const texttospeech = google.texttospeech('v1');
494
+ *
495
+ * async function main() {
496
+ * const auth = new google.auth.GoogleAuth({
497
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
498
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
499
+ * });
500
+ *
501
+ * // Acquire an auth client, and bind it to all future calls
502
+ * const authClient = await auth.getClient();
503
+ * google.options({auth: authClient});
504
+ *
505
+ * // Do the magic
506
+ * const res = await texttospeech.operations.cancel({
507
+ * // The name of the operation resource to be cancelled.
508
+ * name: 'operations/.*',
509
+ *
510
+ * // Request body metadata
511
+ * requestBody: {
512
+ * // request body parameters
513
+ * // {}
514
+ * },
515
+ * });
516
+ * console.log(res.data);
517
+ *
518
+ * // Example response
519
+ * // {}
520
+ * }
521
+ *
522
+ * main().catch(e => {
523
+ * console.error(e);
524
+ * throw e;
525
+ * });
526
+ *
527
+ * ```
478
528
  *
479
529
  * @param params - Parameters for request
480
530
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -563,6 +613,50 @@ export namespace texttospeech_v1 {
563
613
 
564
614
  /**
565
615
  * 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`.
616
+ * @example
617
+ * ```js
618
+ * // Before running the sample:
619
+ * // - Enable the API at:
620
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
621
+ * // - Login into gcloud by running:
622
+ * // ```sh
623
+ * // $ gcloud auth application-default login
624
+ * // ```
625
+ * // - Install the npm module by running:
626
+ * // ```sh
627
+ * // $ npm install googleapis
628
+ * // ```
629
+ *
630
+ * const {google} = require('googleapis');
631
+ * const texttospeech = google.texttospeech('v1');
632
+ *
633
+ * async function main() {
634
+ * const auth = new google.auth.GoogleAuth({
635
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
636
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
637
+ * });
638
+ *
639
+ * // Acquire an auth client, and bind it to all future calls
640
+ * const authClient = await auth.getClient();
641
+ * google.options({auth: authClient});
642
+ *
643
+ * // Do the magic
644
+ * const res = await texttospeech.operations.delete({
645
+ * // The name of the operation resource to be deleted.
646
+ * name: 'operations/.*',
647
+ * });
648
+ * console.log(res.data);
649
+ *
650
+ * // Example response
651
+ * // {}
652
+ * }
653
+ *
654
+ * main().catch(e => {
655
+ * console.error(e);
656
+ * throw e;
657
+ * });
658
+ *
659
+ * ```
566
660
  *
567
661
  * @param params - Parameters for request
568
662
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -691,6 +785,67 @@ export namespace texttospeech_v1 {
691
785
 
692
786
  /**
693
787
  * Synthesizes long form text asynchronously.
788
+ * @example
789
+ * ```js
790
+ * // Before running the sample:
791
+ * // - Enable the API at:
792
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
793
+ * // - Login into gcloud by running:
794
+ * // ```sh
795
+ * // $ gcloud auth application-default login
796
+ * // ```
797
+ * // - Install the npm module by running:
798
+ * // ```sh
799
+ * // $ npm install googleapis
800
+ * // ```
801
+ *
802
+ * const {google} = require('googleapis');
803
+ * const texttospeech = google.texttospeech('v1');
804
+ *
805
+ * async function main() {
806
+ * const auth = new google.auth.GoogleAuth({
807
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
808
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
809
+ * });
810
+ *
811
+ * // Acquire an auth client, and bind it to all future calls
812
+ * const authClient = await auth.getClient();
813
+ * google.options({auth: authClient});
814
+ *
815
+ * // Do the magic
816
+ * const res = await texttospeech.projects.locations.synthesizeLongAudio({
817
+ * // The resource states of the request in the form of `projects/x/locations/x`.
818
+ * parent: 'projects/my-project/locations/my-location',
819
+ *
820
+ * // Request body metadata
821
+ * requestBody: {
822
+ * // request body parameters
823
+ * // {
824
+ * // "audioConfig": {},
825
+ * // "input": {},
826
+ * // "outputGcsUri": "my_outputGcsUri",
827
+ * // "voice": {}
828
+ * // }
829
+ * },
830
+ * });
831
+ * console.log(res.data);
832
+ *
833
+ * // Example response
834
+ * // {
835
+ * // "done": false,
836
+ * // "error": {},
837
+ * // "metadata": {},
838
+ * // "name": "my_name",
839
+ * // "response": {}
840
+ * // }
841
+ * }
842
+ *
843
+ * main().catch(e => {
844
+ * console.error(e);
845
+ * throw e;
846
+ * });
847
+ *
848
+ * ```
694
849
  *
695
850
  * @param params - Parameters for request
696
851
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -802,6 +957,56 @@ export namespace texttospeech_v1 {
802
957
 
803
958
  /**
804
959
  * 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.
960
+ * @example
961
+ * ```js
962
+ * // Before running the sample:
963
+ * // - Enable the API at:
964
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
965
+ * // - Login into gcloud by running:
966
+ * // ```sh
967
+ * // $ gcloud auth application-default login
968
+ * // ```
969
+ * // - Install the npm module by running:
970
+ * // ```sh
971
+ * // $ npm install googleapis
972
+ * // ```
973
+ *
974
+ * const {google} = require('googleapis');
975
+ * const texttospeech = google.texttospeech('v1');
976
+ *
977
+ * async function main() {
978
+ * const auth = new google.auth.GoogleAuth({
979
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
980
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
981
+ * });
982
+ *
983
+ * // Acquire an auth client, and bind it to all future calls
984
+ * const authClient = await auth.getClient();
985
+ * google.options({auth: authClient});
986
+ *
987
+ * // Do the magic
988
+ * const res = await texttospeech.projects.locations.operations.get({
989
+ * // The name of the operation resource.
990
+ * name: 'projects/my-project/locations/my-location/operations/my-operation',
991
+ * });
992
+ * console.log(res.data);
993
+ *
994
+ * // Example response
995
+ * // {
996
+ * // "done": false,
997
+ * // "error": {},
998
+ * // "metadata": {},
999
+ * // "name": "my_name",
1000
+ * // "response": {}
1001
+ * // }
1002
+ * }
1003
+ *
1004
+ * main().catch(e => {
1005
+ * console.error(e);
1006
+ * throw e;
1007
+ * });
1008
+ *
1009
+ * ```
805
1010
  *
806
1011
  * @param params - Parameters for request
807
1012
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -890,6 +1095,59 @@ export namespace texttospeech_v1 {
890
1095
 
891
1096
  /**
892
1097
  * Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns `UNIMPLEMENTED`.
1098
+ * @example
1099
+ * ```js
1100
+ * // Before running the sample:
1101
+ * // - Enable the API at:
1102
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1103
+ * // - Login into gcloud by running:
1104
+ * // ```sh
1105
+ * // $ gcloud auth application-default login
1106
+ * // ```
1107
+ * // - Install the npm module by running:
1108
+ * // ```sh
1109
+ * // $ npm install googleapis
1110
+ * // ```
1111
+ *
1112
+ * const {google} = require('googleapis');
1113
+ * const texttospeech = google.texttospeech('v1');
1114
+ *
1115
+ * async function main() {
1116
+ * const auth = new google.auth.GoogleAuth({
1117
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1118
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1119
+ * });
1120
+ *
1121
+ * // Acquire an auth client, and bind it to all future calls
1122
+ * const authClient = await auth.getClient();
1123
+ * google.options({auth: authClient});
1124
+ *
1125
+ * // Do the magic
1126
+ * const res = await texttospeech.projects.locations.operations.list({
1127
+ * // The standard list filter.
1128
+ * filter: 'placeholder-value',
1129
+ * // The name of the operation's parent resource.
1130
+ * name: 'projects/my-project/locations/my-location',
1131
+ * // The standard list page size.
1132
+ * pageSize: 'placeholder-value',
1133
+ * // The standard list page token.
1134
+ * pageToken: 'placeholder-value',
1135
+ * });
1136
+ * console.log(res.data);
1137
+ *
1138
+ * // Example response
1139
+ * // {
1140
+ * // "nextPageToken": "my_nextPageToken",
1141
+ * // "operations": []
1142
+ * // }
1143
+ * }
1144
+ *
1145
+ * main().catch(e => {
1146
+ * console.error(e);
1147
+ * throw e;
1148
+ * });
1149
+ *
1150
+ * ```
893
1151
  *
894
1152
  * @param params - Parameters for request
895
1153
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1017,6 +1275,60 @@ export namespace texttospeech_v1 {
1017
1275
 
1018
1276
  /**
1019
1277
  * Synthesizes speech synchronously: receive results after all text input has been processed.
1278
+ * @example
1279
+ * ```js
1280
+ * // Before running the sample:
1281
+ * // - Enable the API at:
1282
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1283
+ * // - Login into gcloud by running:
1284
+ * // ```sh
1285
+ * // $ gcloud auth application-default login
1286
+ * // ```
1287
+ * // - Install the npm module by running:
1288
+ * // ```sh
1289
+ * // $ npm install googleapis
1290
+ * // ```
1291
+ *
1292
+ * const {google} = require('googleapis');
1293
+ * const texttospeech = google.texttospeech('v1');
1294
+ *
1295
+ * async function main() {
1296
+ * const auth = new google.auth.GoogleAuth({
1297
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1298
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1299
+ * });
1300
+ *
1301
+ * // Acquire an auth client, and bind it to all future calls
1302
+ * const authClient = await auth.getClient();
1303
+ * google.options({auth: authClient});
1304
+ *
1305
+ * // Do the magic
1306
+ * const res = await texttospeech.text.synthesize({
1307
+ * // Request body metadata
1308
+ * requestBody: {
1309
+ * // request body parameters
1310
+ * // {
1311
+ * // "advancedVoiceOptions": {},
1312
+ * // "audioConfig": {},
1313
+ * // "input": {},
1314
+ * // "voice": {}
1315
+ * // }
1316
+ * },
1317
+ * });
1318
+ * console.log(res.data);
1319
+ *
1320
+ * // Example response
1321
+ * // {
1322
+ * // "audioContent": "my_audioContent"
1323
+ * // }
1324
+ * }
1325
+ *
1326
+ * main().catch(e => {
1327
+ * console.error(e);
1328
+ * throw e;
1329
+ * });
1330
+ *
1331
+ * ```
1020
1332
  *
1021
1333
  * @param params - Parameters for request
1022
1334
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.
@@ -1125,6 +1437,52 @@ export namespace texttospeech_v1 {
1125
1437
 
1126
1438
  /**
1127
1439
  * Returns a list of Voice supported for synthesis.
1440
+ * @example
1441
+ * ```js
1442
+ * // Before running the sample:
1443
+ * // - Enable the API at:
1444
+ * // https://console.developers.google.com/apis/api/texttospeech.googleapis.com
1445
+ * // - Login into gcloud by running:
1446
+ * // ```sh
1447
+ * // $ gcloud auth application-default login
1448
+ * // ```
1449
+ * // - Install the npm module by running:
1450
+ * // ```sh
1451
+ * // $ npm install googleapis
1452
+ * // ```
1453
+ *
1454
+ * const {google} = require('googleapis');
1455
+ * const texttospeech = google.texttospeech('v1');
1456
+ *
1457
+ * async function main() {
1458
+ * const auth = new google.auth.GoogleAuth({
1459
+ * // Scopes can be specified either as an array or as a single, space-delimited string.
1460
+ * scopes: ['https://www.googleapis.com/auth/cloud-platform'],
1461
+ * });
1462
+ *
1463
+ * // Acquire an auth client, and bind it to all future calls
1464
+ * const authClient = await auth.getClient();
1465
+ * google.options({auth: authClient});
1466
+ *
1467
+ * // Do the magic
1468
+ * const res = await texttospeech.voices.list({
1469
+ * // Optional. Recommended. [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If not specified, the API will return all supported voices. If specified, the ListVoices call will only return voices that can be used to synthesize this language_code. For example, if you specify `"en-NZ"`, all `"en-NZ"` voices will be returned. If you specify `"no"`, both `"no-\*"` (Norwegian) and `"nb-\*"` (Norwegian Bokmal) voices will be returned.
1470
+ * languageCode: 'placeholder-value',
1471
+ * });
1472
+ * console.log(res.data);
1473
+ *
1474
+ * // Example response
1475
+ * // {
1476
+ * // "voices": []
1477
+ * // }
1478
+ * }
1479
+ *
1480
+ * main().catch(e => {
1481
+ * console.error(e);
1482
+ * throw e;
1483
+ * });
1484
+ *
1485
+ * ```
1128
1486
  *
1129
1487
  * @param params - Parameters for request
1130
1488
  * @param options - Optionally override request options, such as `url`, `method`, and `encoding`.