From c300ca4a860b42f4584a1b1007bacdc8d44543cf Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 22 Jun 2021 00:44:19 +0000 Subject: [PATCH 1/2] chore: remove all monolith Bazel deps chore: release gapic-generator-csharp v1.3.7 chore: release gapic-generator-go 0.20.5 chore: release gapic-generator-java 1.0.14 chore: release gapic-generator-php 1.0.1 chore: release gapic-generator-python 0.50.0 chore: update gapic-generator-ruby to the latest commit chore: release gapic-generator-typescript 1.5.0 Committer: @miraleung PiperOrigin-RevId: 380641501 Source-Link: https://github.com/googleapis/googleapis/commit/076f7e9f0b258bdb54338895d7251b202e8f0de3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/27e4c88b4048e5f56508d4e1aa417d60a3380892 --- owl-bot-staging/v1/.eslintignore | 6 + owl-bot-staging/v1/.eslintrc.json | 3 + owl-bot-staging/v1/.gitignore | 14 + owl-bot-staging/v1/.jsdoc.js | 55 +++ owl-bot-staging/v1/.mocharc.js | 33 ++ owl-bot-staging/v1/.prettierrc.js | 22 + owl-bot-staging/v1/README.md | 1 + owl-bot-staging/v1/linkinator.config.json | 10 + owl-bot-staging/v1/package.json | 64 +++ .../cloud/texttospeech/v1/cloud_tts.proto | 254 +++++++++++ owl-bot-staging/v1/src/index.ts | 25 ++ owl-bot-staging/v1/src/v1/gapic_metadata.json | 43 ++ owl-bot-staging/v1/src/v1/index.ts | 19 + .../v1/src/v1/text_to_speech_client.ts | 422 +++++++++++++++++ .../src/v1/text_to_speech_client_config.json | 36 ++ .../v1/src/v1/text_to_speech_proto_list.json | 3 + .../system-test/fixtures/sample/src/index.js | 27 ++ .../system-test/fixtures/sample/src/index.ts | 32 ++ owl-bot-staging/v1/system-test/install.ts | 49 ++ .../v1/test/gapic_text_to_speech_v1.ts | 240 ++++++++++ owl-bot-staging/v1/tsconfig.json | 19 + owl-bot-staging/v1/webpack.config.js | 64 +++ owl-bot-staging/v1beta1/.eslintignore | 6 + owl-bot-staging/v1beta1/.eslintrc.json | 3 + owl-bot-staging/v1beta1/.gitignore | 14 + owl-bot-staging/v1beta1/.jsdoc.js | 55 +++ owl-bot-staging/v1beta1/.mocharc.js | 33 ++ owl-bot-staging/v1beta1/.prettierrc.js | 22 + owl-bot-staging/v1beta1/README.md | 1 + .../v1beta1/linkinator.config.json | 10 + owl-bot-staging/v1beta1/package.json | 64 +++ .../texttospeech/v1beta1/cloud_tts.proto | 294 ++++++++++++ owl-bot-staging/v1beta1/src/index.ts | 25 ++ .../v1beta1/src/v1beta1/gapic_metadata.json | 43 ++ owl-bot-staging/v1beta1/src/v1beta1/index.ts | 19 + .../src/v1beta1/text_to_speech_client.ts | 425 ++++++++++++++++++ .../v1beta1/text_to_speech_client_config.json | 36 ++ .../v1beta1/text_to_speech_proto_list.json | 3 + .../system-test/fixtures/sample/src/index.js | 27 ++ .../system-test/fixtures/sample/src/index.ts | 32 ++ .../v1beta1/system-test/install.ts | 49 ++ .../test/gapic_text_to_speech_v1beta1.ts | 240 ++++++++++ owl-bot-staging/v1beta1/tsconfig.json | 19 + owl-bot-staging/v1beta1/webpack.config.js | 64 +++ 44 files changed, 2925 insertions(+) create mode 100644 owl-bot-staging/v1/.eslintignore create mode 100644 owl-bot-staging/v1/.eslintrc.json create mode 100644 owl-bot-staging/v1/.gitignore create mode 100644 owl-bot-staging/v1/.jsdoc.js create mode 100644 owl-bot-staging/v1/.mocharc.js create mode 100644 owl-bot-staging/v1/.prettierrc.js create mode 100644 owl-bot-staging/v1/README.md create mode 100644 owl-bot-staging/v1/linkinator.config.json create mode 100644 owl-bot-staging/v1/package.json create mode 100644 owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto create mode 100644 owl-bot-staging/v1/src/index.ts create mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/v1/src/v1/index.ts create mode 100644 owl-bot-staging/v1/src/v1/text_to_speech_client.ts create mode 100644 owl-bot-staging/v1/src/v1/text_to_speech_client_config.json create mode 100644 owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json create mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1/system-test/install.ts create mode 100644 owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts create mode 100644 owl-bot-staging/v1/tsconfig.json create mode 100644 owl-bot-staging/v1/webpack.config.js create mode 100644 owl-bot-staging/v1beta1/.eslintignore create mode 100644 owl-bot-staging/v1beta1/.eslintrc.json create mode 100644 owl-bot-staging/v1beta1/.gitignore create mode 100644 owl-bot-staging/v1beta1/.jsdoc.js create mode 100644 owl-bot-staging/v1beta1/.mocharc.js create mode 100644 owl-bot-staging/v1beta1/.prettierrc.js create mode 100644 owl-bot-staging/v1beta1/README.md create mode 100644 owl-bot-staging/v1beta1/linkinator.config.json create mode 100644 owl-bot-staging/v1beta1/package.json create mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto create mode 100644 owl-bot-staging/v1beta1/src/index.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json create mode 100644 owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json create mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/v1beta1/system-test/install.ts create mode 100644 owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts create mode 100644 owl-bot-staging/v1beta1/tsconfig.json create mode 100644 owl-bot-staging/v1beta1/webpack.config.js diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore new file mode 100644 index 00000000..521dc25a --- /dev/null +++ b/owl-bot-staging/v1/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json new file mode 100644 index 00000000..78215349 --- /dev/null +++ b/owl-bot-staging/v1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore new file mode 100644 index 00000000..5d32b237 --- /dev/null +++ b/owl-bot-staging/v1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js new file mode 100644 index 00000000..6e584fdd --- /dev/null +++ b/owl-bot-staging/v1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/text-to-speech', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js new file mode 100644 index 00000000..50bc7f79 --- /dev/null +++ b/owl-bot-staging/v1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js new file mode 100644 index 00000000..84f4713a --- /dev/null +++ b/owl-bot-staging/v1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md new file mode 100644 index 00000000..3eaadd6a --- /dev/null +++ b/owl-bot-staging/v1/README.md @@ -0,0 +1 @@ +Texttospeech: Nodejs Client diff --git a/owl-bot-staging/v1/linkinator.config.json b/owl-bot-staging/v1/linkinator.config.json new file mode 100644 index 00000000..29a223b6 --- /dev/null +++ b/owl-bot-staging/v1/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json new file mode 100644 index 00000000..33fbbf45 --- /dev/null +++ b/owl-bot-staging/v1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/text-to-speech", + "version": "0.1.0", + "description": "Texttospeech client for Node.js", + "repository": "googleapis/nodejs-texttospeech", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google texttospeech", + "texttospeech", + "text to speech" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.15.0" + }, + "devDependencies": { + "@types/mocha": "^8.2.2", + "@types/node": "^14.17.3", + "@types/sinon": "^10.0.2", + "c8": "^7.7.3", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.0", + "jsdoc-region-tag": "^1.1.0", + "linkinator": "^2.13.6", + "mocha": "^8.4.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^11.1.1", + "ts-loader": "^9.2.3", + "typescript": "^4.3.4", + "webpack": "^5.39.1", + "webpack-cli": "^4.7.2" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto b/owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto new file mode 100644 index 00000000..ebcf44d8 --- /dev/null +++ b/owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto @@ -0,0 +1,254 @@ +// Copyright 2019 Google LLC. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +syntax = "proto3"; + +package google.cloud.texttospeech.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.TextToSpeech.V1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech"; +option java_multiple_files = true; +option java_outer_classname = "TextToSpeechProto"; +option java_package = "com.google.cloud.texttospeech.v1"; +option php_namespace = "Google\\Cloud\\TextToSpeech\\V1"; +option ruby_package = "Google::Cloud::TextToSpeech::V1"; + +// Service that implements Google Cloud Text-to-Speech API. +service TextToSpeech { + option (google.api.default_host) = "texttospeech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of Voice supported for synthesis. + rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { + option (google.api.http) = { + get: "/v1/voices" + }; + option (google.api.method_signature) = "language_code"; + } + + // Synthesizes speech synchronously: receive results after all text input + // has been processed. + rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { + option (google.api.http) = { + post: "/v1/text:synthesize" + body: "*" + }; + option (google.api.method_signature) = "input,voice,audio_config"; + } +} + +// The top-level message sent by the client for the `ListVoices` method. +message ListVoicesRequest { + // Optional. Recommended. + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + // specified, the ListVoices call will only return voices that can be used to + // synthesize this language_code. E.g. when specifying "en-NZ", you will get + // supported "en-\*" voices; when specifying "no", you will get supported + // "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" + // will also get supported "cmn-\*" voices; specifying "zh-hk" will also get + // supported "yue-\*" voices. + string language_code = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender. + // In VoiceSelectionParams, this means that the client doesn't care which + // gender the selected voice will have. In the Voice field of + // ListVoicesResponse, this may mean that the voice doesn't fit any of the + // other categories in this enum, or that the gender of the voice isn't known. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + MALE = 1; + + // A female voice. + FEMALE = 2; + + // A gender-neutral voice. + NEUTRAL = 3; +} + +// Configuration to set up audio encoder. The encoding determines the output +// audio format that we'd like. +enum AudioEncoding { + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + LINEAR16 = 1; + + // MP3 audio at 32kbps. + MP3 = 2; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OGG_OPUS = 3; +} + +// The message returned to the client by the `ListVoices` method. +message ListVoicesResponse { + // The list of voices. + repeated Voice voices = 1; +} + +// Description of a voice supported by the TTS service. +message Voice { + // The languages that this voice supports, expressed as + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + // "en-US", "es-419", "cmn-tw"). + repeated string language_codes = 1; + + // The name of this voice. Each distinct voice has a unique name. + string name = 2; + + // The gender of this voice. + SsmlVoiceGender ssml_gender = 3; + + // The natural sample rate (in hertz) for this voice. + int32 natural_sample_rate_hertz = 4; +} + +// The top-level message sent by the client for the `SynthesizeSpeech` method. +message SynthesizeSpeechRequest { + // Required. The Synthesizer requires either plain text or SSML as input. + SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The configuration of the synthesized audio. + AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Contains text input to be synthesized. Either `text` or `ssml` must be +// supplied. Supplying both or neither returns +// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 +// characters. +message SynthesisInput { + // The input source, which is either plain text or SSML. + oneof input_source { + // The raw text to be synthesized. + string text = 1; + + // The SSML document to be synthesized. The SSML document must be valid + // and well-formed. Otherwise the RPC will fail and return + // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see + // [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + string ssml = 2; + } +} + +// Description of which voice to use for a synthesis request. +message VoiceSelectionParams { + // Required. The language (and potentially also the region) of the voice expressed as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. + // "en-US". This should not include a script tag (e.g. use + // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + // from the input provided in the SynthesisInput. The TTS service + // will use this parameter to help choose an appropriate voice. Note that + // the TTS service may choose a voice with a slightly different language code + // than the one selected; it may substitute a different region + // (e.g. using en-US rather than en-CA if there isn't a Canadian voice + // available), or even a different language, e.g. using "nb" (Norwegian + // Bokmal) instead of "no" (Norwegian)". + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and gender. + string name = 2; + + // The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // name. Note that this is only a preference, not requirement; if a + // voice of the appropriate gender is not available, the synthesizer should + // substitute a voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 3; +} + +// Description of audio data to be synthesized. +message AudioConfig { + // Required. The format of the audio byte stream. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is + // the normal native speed supported by the specific voice. 2.0 is twice as + // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + // speed. Any other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 2 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + // increase 20 semitones from the original pitch. -20 means decrease 20 + // semitones from the original pitch. + double pitch = 3 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Volume gain (in dB) of the normal native volume + // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + // set to a value of 0.0 (dB), will play at normal native signal amplitude. A + // value of -6.0 (dB) will play at approximately half the amplitude of the + // normal native signal amplitude. A value of +6.0 (dB) will play at + // approximately twice the amplitude of the normal native signal amplitude. + // Strongly recommend not to exceed +10 (dB) as there's usually no effective + // increase in loudness for any value greater than that. + double volume_gain_db = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The synthesis sample rate (in hertz) for this audio. When this is + // specified in SynthesizeSpeechRequest, if this is different from the voice's + // natural sample rate, then the synthesizer will honor this request by + // converting to the desired sample rate (which might result in worse audio + // quality), unless the specified sample rate is not supported for the + // encoding chosen, in which case it will fail the request and return + // [google.rpc.Code.INVALID_ARGUMENT][]. + int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. An identifier which selects 'audio effects' profiles + // that are applied on (post synthesized) text to speech. Effects are applied + // on top of each other in the order they are given. See + // [audio + // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + // current supported profile ids. + repeated string effects_profile_id = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The message returned to the client by the `SynthesizeSpeech` method. +message SynthesizeSpeechResponse { + // The audio data bytes encoded as specified in the request, including the + // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + // For LINEAR16 audio, we include the WAV header. Note: as + // with all bytes fields, protobuffers use a pure binary representation, + // whereas JSON representations use base64. + bytes audio_content = 1; +} diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts new file mode 100644 index 00000000..1e12e038 --- /dev/null +++ b/owl-bot-staging/v1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1 from './v1'; +const TextToSpeechClient = v1.TextToSpeechClient; +type TextToSpeechClient = v1.TextToSpeechClient; +export {v1, TextToSpeechClient}; +export default {v1, TextToSpeechClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json new file mode 100644 index 00000000..301ecb6d --- /dev/null +++ b/owl-bot-staging/v1/src/v1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.texttospeech.v1", + "libraryPackage": "@google-cloud/text-to-speech", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TextToSpeechClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts new file mode 100644 index 00000000..49558f42 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {TextToSpeechClient} from './text_to_speech_client'; diff --git a/owl-bot-staging/v1/src/v1/text_to_speech_client.ts b/owl-bot-staging/v1/src/v1/text_to_speech_client.ts new file mode 100644 index 00000000..ed8ebc3a --- /dev/null +++ b/owl-bot-staging/v1/src/v1/text_to_speech_client.ts @@ -0,0 +1,422 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1/text_to_speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './text_to_speech_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Text-to-Speech API. + * @class + * @memberof v1 + */ +export class TextToSpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + textToSpeechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TextToSpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TextToSpeechClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.texttospeech.v1.TextToSpeech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.textToSpeechStub) { + return this.textToSpeechStub; + } + + // Put together the "service stub" for + // google.cloud.texttospeech.v1.TextToSpeech. + this.textToSpeechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.texttospeech.v1.TextToSpeech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.texttospeech.v1.TextToSpeech, + this._opts) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const textToSpeechStubMethods = + ['listVoices', 'synthesizeSpeech']; + for (const methodName of textToSpeechStubMethods) { + const callPromise = this.textToSpeechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.textToSpeechStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'texttospeech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'texttospeech.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + listVoices( + request?: protos.google.cloud.texttospeech.v1.IListVoicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.texttospeech.v1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1.IListVoicesRequest|undefined, {}|undefined + ]>; + listVoices( + request: protos.google.cloud.texttospeech.v1.IListVoicesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.texttospeech.v1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, + {}|null|undefined>): void; + listVoices( + request: protos.google.cloud.texttospeech.v1.IListVoicesRequest, + callback: Callback< + protos.google.cloud.texttospeech.v1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, + {}|null|undefined>): void; +/** + * Returns a list of Voice supported for synthesis. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.languageCode] + * Optional. Recommended. + * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If + * specified, the ListVoices call will only return voices that can be used to + * synthesize this language_code. E.g. when specifying "en-NZ", you will get + * supported "en-\*" voices; when specifying "no", you will get supported + * "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" + * will also get supported "cmn-\*" voices; specifying "zh-hk" will also get + * supported "yue-\*" voices. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListVoicesResponse]{@link google.cloud.texttospeech.v1.ListVoicesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.listVoices(request); + */ + listVoices( + request?: protos.google.cloud.texttospeech.v1.IListVoicesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.texttospeech.v1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.texttospeech.v1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.texttospeech.v1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1.IListVoicesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.listVoices(request, options, callback); + } + synthesizeSpeech( + request?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|undefined, {}|undefined + ]>; + synthesizeSpeech( + request: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>): void; + synthesizeSpeech( + request: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, + callback: Callback< + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>): void; +/** + * Synthesizes speech synchronously: receive results after all text input + * has been processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.texttospeech.v1.SynthesisInput} request.input + * Required. The Synthesizer requires either plain text or SSML as input. + * @param {google.cloud.texttospeech.v1.VoiceSelectionParams} request.voice + * Required. The desired voice of the synthesized audio. + * @param {google.cloud.texttospeech.v1.AudioConfig} request.audioConfig + * Required. The configuration of the synthesized audio. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SynthesizeSpeechResponse]{@link google.cloud.texttospeech.v1.SynthesizeSpeechResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.synthesizeSpeech(request); + */ + synthesizeSpeech( + request?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.synthesizeSpeech(request, options, callback); + } + + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.textToSpeechStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1/src/v1/text_to_speech_client_config.json b/owl-bot-staging/v1/src/v1/text_to_speech_client_config.json new file mode 100644 index 00000000..e460d954 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/text_to_speech_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1.TextToSpeech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListVoices": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SynthesizeSpeech": { + "timeout_millis": 600000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json b/owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json new file mode 100644 index 00000000..a2b3f234 --- /dev/null +++ b/owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/texttospeech/v1/cloud_tts.proto" +] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..3cc8aa8c --- /dev/null +++ b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const texttospeech = require('@google-cloud/text-to-speech'); + +function main() { + const textToSpeechClient = new texttospeech.TextToSpeechClient(); +} + +main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..919e5672 --- /dev/null +++ b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {TextToSpeechClient} from '@google-cloud/text-to-speech'; + +// check that the client class type name can be used +function doStuffWithTextToSpeechClient(client: TextToSpeechClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const textToSpeechClient = new TextToSpeechClient(); + doStuffWithTextToSpeechClient(textToSpeechClient); +} + +main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts new file mode 100644 index 00000000..1f850b52 --- /dev/null +++ b/owl-bot-staging/v1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts b/owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts new file mode 100644 index 00000000..07f5ac9e --- /dev/null +++ b/owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts @@ -0,0 +1,240 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as texttospeechModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1.TextToSpeechClient', () => { + it('has servicePath', () => { + const servicePath = texttospeechModule.v1.TextToSpeechClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = texttospeechModule.v1.TextToSpeechClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = texttospeechModule.v1.TextToSpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new texttospeechModule.v1.TextToSpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.textToSpeechStub, undefined); + await client.initialize(); + assert(client.textToSpeechStub); + }); + + it('has close method', () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('listVoices', () => { + it('invokes listVoices without error', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesResponse()); + client.innerApiCalls.listVoices = stubSimpleCall(expectedResponse); + const [response] = await client.listVoices(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listVoices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listVoices without error using callback', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesResponse()); + client.innerApiCalls.listVoices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVoices( + request, + (err?: Error|null, result?: protos.google.cloud.texttospeech.v1.IListVoicesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listVoices as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listVoices with error', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesRequest()); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.listVoices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listVoices(request), expectedError); + assert((client.innerApiCalls.listVoices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('synthesizeSpeech', () => { + it('invokes synthesizeSpeech without error', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechResponse()); + client.innerApiCalls.synthesizeSpeech = stubSimpleCall(expectedResponse); + const [response] = await client.synthesizeSpeech(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.synthesizeSpeech as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes synthesizeSpeech without error using callback', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechResponse()); + client.innerApiCalls.synthesizeSpeech = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.synthesizeSpeech( + request, + (err?: Error|null, result?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.synthesizeSpeech as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes synthesizeSpeech with error', async () => { + const client = new texttospeechModule.v1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechRequest()); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.synthesizeSpeech = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.synthesizeSpeech(request), expectedError); + assert((client.innerApiCalls.synthesizeSpeech as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); +}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json new file mode 100644 index 00000000..c78f1c88 --- /dev/null +++ b/owl-bot-staging/v1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js new file mode 100644 index 00000000..25f059a0 --- /dev/null +++ b/owl-bot-staging/v1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'TextToSpeech', + filename: './text-to-speech.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; diff --git a/owl-bot-staging/v1beta1/.eslintignore b/owl-bot-staging/v1beta1/.eslintignore new file mode 100644 index 00000000..521dc25a --- /dev/null +++ b/owl-bot-staging/v1beta1/.eslintignore @@ -0,0 +1,6 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ diff --git a/owl-bot-staging/v1beta1/.eslintrc.json b/owl-bot-staging/v1beta1/.eslintrc.json new file mode 100644 index 00000000..78215349 --- /dev/null +++ b/owl-bot-staging/v1beta1/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/v1beta1/.gitignore b/owl-bot-staging/v1beta1/.gitignore new file mode 100644 index 00000000..5d32b237 --- /dev/null +++ b/owl-bot-staging/v1beta1/.gitignore @@ -0,0 +1,14 @@ +**/*.log +**/node_modules +.coverage +coverage +.nyc_output +docs/ +out/ +build/ +system-test/secrets.js +system-test/*key.json +*.lock +.DS_Store +package-lock.json +__pycache__ diff --git a/owl-bot-staging/v1beta1/.jsdoc.js b/owl-bot-staging/v1beta1/.jsdoc.js new file mode 100644 index 00000000..6e584fdd --- /dev/null +++ b/owl-bot-staging/v1beta1/.jsdoc.js @@ -0,0 +1,55 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +'use strict'; + +module.exports = { + opts: { + readme: './README.md', + package: './package.json', + template: './node_modules/jsdoc-fresh', + recurse: true, + verbose: true, + destination: './docs/' + }, + plugins: [ + 'plugins/markdown', + 'jsdoc-region-tag' + ], + source: { + excludePattern: '(^|\\/|\\\\)[._]', + include: [ + 'build/src', + 'protos' + ], + includePattern: '\\.js$' + }, + templates: { + copyright: 'Copyright 2021 Google LLC', + includeDate: false, + sourceFiles: false, + systemName: '@google-cloud/text-to-speech', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/v1beta1/.mocharc.js b/owl-bot-staging/v1beta1/.mocharc.js new file mode 100644 index 00000000..50bc7f79 --- /dev/null +++ b/owl-bot-staging/v1beta1/.mocharc.js @@ -0,0 +1,33 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +const config = { + "enable-source-maps": true, + "throw-deprecation": true, + "timeout": 10000 +} +if (process.env.MOCHA_THROW_DEPRECATION === 'false') { + delete config['throw-deprecation']; +} +if (process.env.MOCHA_REPORTER) { + config.reporter = process.env.MOCHA_REPORTER; +} +if (process.env.MOCHA_REPORTER_OUTPUT) { + config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; +} +module.exports = config diff --git a/owl-bot-staging/v1beta1/.prettierrc.js b/owl-bot-staging/v1beta1/.prettierrc.js new file mode 100644 index 00000000..84f4713a --- /dev/null +++ b/owl-bot-staging/v1beta1/.prettierrc.js @@ -0,0 +1,22 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +module.exports = { + ...require('gts/.prettierrc.json') +} diff --git a/owl-bot-staging/v1beta1/README.md b/owl-bot-staging/v1beta1/README.md new file mode 100644 index 00000000..3eaadd6a --- /dev/null +++ b/owl-bot-staging/v1beta1/README.md @@ -0,0 +1 @@ +Texttospeech: Nodejs Client diff --git a/owl-bot-staging/v1beta1/linkinator.config.json b/owl-bot-staging/v1beta1/linkinator.config.json new file mode 100644 index 00000000..29a223b6 --- /dev/null +++ b/owl-bot-staging/v1beta1/linkinator.config.json @@ -0,0 +1,10 @@ +{ + "recurse": true, + "skip": [ + "https://codecov.io/gh/googleapis/", + "www.googleapis.com", + "img.shields.io" + ], + "silent": true, + "concurrency": 10 +} diff --git a/owl-bot-staging/v1beta1/package.json b/owl-bot-staging/v1beta1/package.json new file mode 100644 index 00000000..33fbbf45 --- /dev/null +++ b/owl-bot-staging/v1beta1/package.json @@ -0,0 +1,64 @@ +{ + "name": "@google-cloud/text-to-speech", + "version": "0.1.0", + "description": "Texttospeech client for Node.js", + "repository": "googleapis/nodejs-texttospeech", + "license": "Apache-2.0", + "author": "Google LLC", + "main": "build/src/index.js", + "files": [ + "build/src", + "build/protos" + ], + "keywords": [ + "google apis client", + "google api client", + "google apis", + "google api", + "google", + "google cloud platform", + "google cloud", + "cloud", + "google texttospeech", + "texttospeech", + "text to speech" + ], + "scripts": { + "clean": "gts clean", + "compile": "tsc -p . && cp -r protos build/", + "compile-protos": "compileProtos src", + "docs": "jsdoc -c .jsdoc.js", + "predocs-test": "npm run docs", + "docs-test": "linkinator docs", + "fix": "gts fix", + "lint": "gts check", + "prepare": "npm run compile-protos && npm run compile", + "system-test": "c8 mocha build/system-test", + "test": "c8 mocha build/test" + }, + "dependencies": { + "google-gax": "^2.15.0" + }, + "devDependencies": { + "@types/mocha": "^8.2.2", + "@types/node": "^14.17.3", + "@types/sinon": "^10.0.2", + "c8": "^7.7.3", + "gts": "^3.1.0", + "jsdoc": "^3.6.7", + "jsdoc-fresh": "^1.1.0", + "jsdoc-region-tag": "^1.1.0", + "linkinator": "^2.13.6", + "mocha": "^8.4.0", + "null-loader": "^4.0.1", + "pack-n-play": "^1.0.0-2", + "sinon": "^11.1.1", + "ts-loader": "^9.2.3", + "typescript": "^4.3.4", + "webpack": "^5.39.1", + "webpack-cli": "^4.7.2" + }, + "engines": { + "node": ">=v10.24.0" + } +} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto b/owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto new file mode 100644 index 00000000..a70773d7 --- /dev/null +++ b/owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto @@ -0,0 +1,294 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.texttospeech.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.TextToSpeech.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech"; +option java_multiple_files = true; +option java_outer_classname = "TextToSpeechProto"; +option java_package = "com.google.cloud.texttospeech.v1beta1"; +option php_namespace = "Google\\Cloud\\TextToSpeech\\V1beta1"; +option ruby_package = "Google::Cloud::TextToSpeech::V1beta1"; + +// Service that implements Google Cloud Text-to-Speech API. +service TextToSpeech { + option (google.api.default_host) = "texttospeech.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Returns a list of Voice supported for synthesis. + rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { + option (google.api.http) = { + get: "/v1beta1/voices" + }; + option (google.api.method_signature) = "language_code"; + } + + // Synthesizes speech synchronously: receive results after all text input + // has been processed. + rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { + option (google.api.http) = { + post: "/v1beta1/text:synthesize" + body: "*" + }; + option (google.api.method_signature) = "input,voice,audio_config"; + } +} + +// The top-level message sent by the client for the `ListVoices` method. +message ListVoicesRequest { + // 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. E.g. when specifying "en-NZ", you will + // get supported "en-NZ" voices; when specifying "no", you will get supported + // "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" + // will also get supported "cmn-\*" voices; specifying "zh-hk" will also get + // supported "yue-hk" voices. + string language_code = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// Gender of the voice as described in +// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). +enum SsmlVoiceGender { + // An unspecified gender. + // In VoiceSelectionParams, this means that the client doesn't care which + // gender the selected voice will have. In the Voice field of + // ListVoicesResponse, this may mean that the voice doesn't fit any of the + // other categories in this enum, or that the gender of the voice isn't known. + SSML_VOICE_GENDER_UNSPECIFIED = 0; + + // A male voice. + MALE = 1; + + // A female voice. + FEMALE = 2; + + // A gender-neutral voice. This voice is not yet supported. + NEUTRAL = 3; +} + +// Configuration to set up audio encoder. The encoding determines the output +// audio format that we'd like. +enum AudioEncoding { + // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. + AUDIO_ENCODING_UNSPECIFIED = 0; + + // Uncompressed 16-bit signed little-endian samples (Linear PCM). + // Audio content returned as LINEAR16 also contains a WAV header. + LINEAR16 = 1; + + // MP3 audio at 32kbps. + MP3 = 2; + + // MP3 at 64kbps. + MP3_64_KBPS = 4; + + // Opus encoded audio wrapped in an ogg container. The result will be a + // file which can be played natively on Android, and in browsers (at least + // Chrome and Firefox). The quality of the encoding is considerably higher + // than MP3 while using approximately the same bitrate. + OGG_OPUS = 3; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. + // Audio content returned as MULAW also contains a WAV header. + MULAW = 5; + + // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. + // Audio content returned as ALAW also contains a WAV header. + ALAW = 6; +} + +// The message returned to the client by the `ListVoices` method. +message ListVoicesResponse { + // The list of voices. + repeated Voice voices = 1; +} + +// Description of a voice supported by the TTS service. +message Voice { + // The languages that this voice supports, expressed as + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. + // "en-US", "es-419", "cmn-tw"). + repeated string language_codes = 1; + + // The name of this voice. Each distinct voice has a unique name. + string name = 2; + + // The gender of this voice. + SsmlVoiceGender ssml_gender = 3; + + // The natural sample rate (in hertz) for this voice. + int32 natural_sample_rate_hertz = 4; +} + +// The top-level message sent by the client for the `SynthesizeSpeech` method. +message SynthesizeSpeechRequest { + // The type of timepoint information that is returned in the response. + enum TimepointType { + // Not specified. No timepoint information will be returned. + TIMEPOINT_TYPE_UNSPECIFIED = 0; + + // Timepoint information of `` tags in SSML input will be returned. + SSML_MARK = 1; + } + + // Required. The Synthesizer requires either plain text or SSML as input. + SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The desired voice of the synthesized audio. + VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The configuration of the synthesized audio. + AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; + + // Whether and what timepoints are returned in the response. + repeated TimepointType enable_time_pointing = 4; +} + +// Contains text input to be synthesized. Either `text` or `ssml` must be +// supplied. Supplying both or neither returns +// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 +// characters. +message SynthesisInput { + // The input source, which is either plain text or SSML. + oneof input_source { + // The raw text to be synthesized. + string text = 1; + + // The SSML document to be synthesized. The SSML document must be valid + // and well-formed. Otherwise the RPC will fail and return + // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see + // [SSML](https://cloud.google.com/text-to-speech/docs/ssml). + string ssml = 2; + } +} + +// Description of which voice to use for a synthesis request. +message VoiceSelectionParams { + // Required. The language (and potentially also the region) of the voice expressed as a + // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. + // "en-US". This should not include a script tag (e.g. use + // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred + // from the input provided in the SynthesisInput. The TTS service + // will use this parameter to help choose an appropriate voice. Note that + // the TTS service may choose a voice with a slightly different language code + // than the one selected; it may substitute a different region + // (e.g. using en-US rather than en-CA if there isn't a Canadian voice + // available), or even a different language, e.g. using "nb" (Norwegian + // Bokmal) instead of "no" (Norwegian)". + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; + + // The name of the voice. If not set, the service will choose a + // voice based on the other parameters such as language_code and gender. + string name = 2; + + // The preferred gender of the voice. If not set, the service will + // choose a voice based on the other parameters such as language_code and + // name. Note that this is only a preference, not requirement; if a + // voice of the appropriate gender is not available, the synthesizer should + // substitute a voice with a different gender rather than failing the request. + SsmlVoiceGender ssml_gender = 3; +} + +// Description of audio data to be synthesized. +message AudioConfig { + // Required. The format of the audio byte stream. + AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is + // the normal native speed supported by the specific voice. 2.0 is twice as + // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 + // speed. Any other values < 0.25 or > 4.0 will return an error. + double speaking_rate = 2 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means + // increase 20 semitones from the original pitch. -20 means decrease 20 + // semitones from the original pitch. + double pitch = 3 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Input only. Volume gain (in dB) of the normal native volume + // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or + // set to a value of 0.0 (dB), will play at normal native signal amplitude. A + // value of -6.0 (dB) will play at approximately half the amplitude of the + // normal native signal amplitude. A value of +6.0 (dB) will play at + // approximately twice the amplitude of the normal native signal amplitude. + // Strongly recommend not to exceed +10 (dB) as there's usually no effective + // increase in loudness for any value greater than that. + double volume_gain_db = 4 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The synthesis sample rate (in hertz) for this audio. When this is + // specified in SynthesizeSpeechRequest, if this is different from the voice's + // natural sample rate, then the synthesizer will honor this request by + // converting to the desired sample rate (which might result in worse audio + // quality), unless the specified sample rate is not supported for the + // encoding chosen, in which case it will fail the request and return + // [google.rpc.Code.INVALID_ARGUMENT][]. + int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Input only. An identifier which selects 'audio effects' profiles + // that are applied on (post synthesized) text to speech. Effects are applied + // on top of each other in the order they are given. See + // [audio + // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for + // current supported profile ids. + repeated string effects_profile_id = 6 [ + (google.api.field_behavior) = INPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The message returned to the client by the `SynthesizeSpeech` method. +message SynthesizeSpeechResponse { + // The audio data bytes encoded as specified in the request, including the + // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). + // For LINEAR16 audio, we include the WAV header. Note: as + // with all bytes fields, protobuffers use a pure binary representation, + // whereas JSON representations use base64. + bytes audio_content = 1; + + // A link between a position in the original request input and a corresponding + // time in the output audio. It's only supported via `` of SSML input. + repeated Timepoint timepoints = 2; + + // The audio metadata of `audio_content`. + AudioConfig audio_config = 4; +} + +// This contains a mapping between a certain point in the input text and a +// corresponding time in the output audio. +message Timepoint { + // Timepoint name as received from the client within `` tag. + string mark_name = 4; + + // Time offset in seconds from the start of the synthesized audio. + double time_seconds = 3; +} diff --git a/owl-bot-staging/v1beta1/src/index.ts b/owl-bot-staging/v1beta1/src/index.ts new file mode 100644 index 00000000..a1137afc --- /dev/null +++ b/owl-bot-staging/v1beta1/src/index.ts @@ -0,0 +1,25 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as v1beta1 from './v1beta1'; +const TextToSpeechClient = v1beta1.TextToSpeechClient; +type TextToSpeechClient = v1beta1.TextToSpeechClient; +export {v1beta1, TextToSpeechClient}; +export default {v1beta1, TextToSpeechClient}; +import * as protos from '../protos/protos'; +export {protos} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json new file mode 100644 index 00000000..33652e5b --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.texttospeech.v1beta1", + "libraryPackage": "@google-cloud/text-to-speech", + "services": { + "TextToSpeech": { + "clients": { + "grpc": { + "libraryClient": "TextToSpeechClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "TextToSpeechClient", + "rpcs": { + "ListVoices": { + "methods": [ + "listVoices" + ] + }, + "SynthesizeSpeech": { + "methods": [ + "synthesizeSpeech" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/v1beta1/src/v1beta1/index.ts new file mode 100644 index 00000000..49558f42 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/index.ts @@ -0,0 +1,19 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +export {TextToSpeechClient} from './text_to_speech_client'; diff --git a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts new file mode 100644 index 00000000..b5285a57 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts @@ -0,0 +1,425 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; + +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +/** + * Client JSON configuration object, loaded from + * `src/v1beta1/text_to_speech_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './text_to_speech_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service that implements Google Cloud Text-to-Speech API. + * @class + * @memberof v1beta1 + */ +export class TextToSpeechClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + textToSpeechStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of TextToSpeechClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof TextToSpeechClient; + const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else if (opts.fallback === 'rest' ) { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.texttospeech.v1beta1.TextToSpeech', gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.textToSpeechStub) { + return this.textToSpeechStub; + } + + // Put together the "service stub" for + // google.cloud.texttospeech.v1beta1.TextToSpeech. + this.textToSpeechStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.texttospeech.v1beta1.TextToSpeech') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.texttospeech.v1beta1.TextToSpeech, + this._opts) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const textToSpeechStubMethods = + ['listVoices', 'synthesizeSpeech']; + for (const methodName of textToSpeechStubMethods) { + const callPromise = this.textToSpeechStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error|null|undefined) => () => { + throw err; + }); + + const descriptor = + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.textToSpeechStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'texttospeech.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'texttospeech.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform' + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId(callback?: Callback): + Promise|void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + listVoices( + request?: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|undefined, {}|undefined + ]>; + listVoices( + request: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, + {}|null|undefined>): void; + listVoices( + request: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, + callback: Callback< + protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, + {}|null|undefined>): void; +/** + * Returns a list of Voice supported for synthesis. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} [request.languageCode] + * 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. E.g. when specifying "en-NZ", you will + * get supported "en-NZ" voices; when specifying "no", you will get supported + * "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" + * will also get supported "cmn-\*" voices; specifying "zh-hk" will also get + * supported "yue-hk" voices. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ListVoicesResponse]{@link google.cloud.texttospeech.v1beta1.ListVoicesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.listVoices(request); + */ + listVoices( + request?: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, + protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.listVoices(request, options, callback); + } + synthesizeSpeech( + request?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|undefined, {}|undefined + ]>; + synthesizeSpeech( + request: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>): void; + synthesizeSpeech( + request: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, + callback: Callback< + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>): void; +/** + * Synthesizes speech synchronously: receive results after all text input + * has been processed. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.texttospeech.v1beta1.SynthesisInput} request.input + * Required. The Synthesizer requires either plain text or SSML as input. + * @param {google.cloud.texttospeech.v1beta1.VoiceSelectionParams} request.voice + * Required. The desired voice of the synthesized audio. + * @param {google.cloud.texttospeech.v1beta1.AudioConfig} request.audioConfig + * Required. The configuration of the synthesized audio. + * @param {number[]} request.enableTimePointing + * Whether and what timepoints are returned in the response. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SynthesizeSpeechResponse]{@link google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.synthesizeSpeech(request); + */ + synthesizeSpeech( + request?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, + protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|undefined, {}|undefined + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } + else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + this.initialize(); + return this.innerApiCalls.synthesizeSpeech(request, options, callback); + } + + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.textToSpeechStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json new file mode 100644 index 00000000..9c26e72b --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json @@ -0,0 +1,36 @@ +{ + "interfaces": { + "google.cloud.texttospeech.v1beta1.TextToSpeech": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListVoices": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + }, + "SynthesizeSpeech": { + "timeout_millis": 300000, + "retry_codes_name": "idempotent", + "retry_params_name": "default" + } + } + } + } +} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json new file mode 100644 index 00000000..c159e9a3 --- /dev/null +++ b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json @@ -0,0 +1,3 @@ +[ + "../../protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto" +] diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000..3cc8aa8c --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js @@ -0,0 +1,27 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + +/* eslint-disable node/no-missing-require, no-unused-vars */ +const texttospeech = require('@google-cloud/text-to-speech'); + +function main() { + const textToSpeechClient = new texttospeech.TextToSpeechClient(); +} + +main(); diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000..919e5672 --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,32 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {TextToSpeechClient} from '@google-cloud/text-to-speech'; + +// check that the client class type name can be used +function doStuffWithTextToSpeechClient(client: TextToSpeechClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const textToSpeechClient = new TextToSpeechClient(); + doStuffWithTextToSpeechClient(textToSpeechClient); +} + +main(); diff --git a/owl-bot-staging/v1beta1/system-test/install.ts b/owl-bot-staging/v1beta1/system-test/install.ts new file mode 100644 index 00000000..1f850b52 --- /dev/null +++ b/owl-bot-staging/v1beta1/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import { packNTest } from 'pack-n-play'; +import { readFileSync } from 'fs'; +import { describe, it } from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts new file mode 100644 index 00000000..adb71765 --- /dev/null +++ b/owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts @@ -0,0 +1,240 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import { describe, it } from 'mocha'; +import * as texttospeechModule from '../src'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +describe('v1beta1.TextToSpeechClient', () => { + it('has servicePath', () => { + const servicePath = texttospeechModule.v1beta1.TextToSpeechClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = texttospeechModule.v1beta1.TextToSpeechClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = texttospeechModule.v1beta1.TextToSpeechClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + assert.strictEqual(client.textToSpeechStub, undefined); + await client.initialize(); + assert(client.textToSpeechStub); + }); + + it('has close method', () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: { client_email: 'bogus', private_key: 'bogus' }, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error|null, projectId?: string|null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('listVoices', () => { + it('invokes listVoices without error', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesResponse()); + client.innerApiCalls.listVoices = stubSimpleCall(expectedResponse); + const [response] = await client.listVoices(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listVoices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes listVoices without error using callback', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesResponse()); + client.innerApiCalls.listVoices = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listVoices( + request, + (err?: Error|null, result?: protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.listVoices as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes listVoices with error', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesRequest()); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.listVoices = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listVoices(request), expectedError); + assert((client.innerApiCalls.listVoices as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + + describe('synthesizeSpeech', () => { + it('invokes synthesizeSpeech without error', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse()); + client.innerApiCalls.synthesizeSpeech = stubSimpleCall(expectedResponse); + const [response] = await client.synthesizeSpeech(request); + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.synthesizeSpeech as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + + it('invokes synthesizeSpeech without error using callback', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest()); + const expectedOptions = {}; + const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse()); + client.innerApiCalls.synthesizeSpeech = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.synthesizeSpeech( + request, + (err?: Error|null, result?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.innerApiCalls.synthesizeSpeech as SinonStub) + .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); + }); + + it('invokes synthesizeSpeech with error', async () => { + const client = new texttospeechModule.v1beta1.TextToSpeechClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest()); + const expectedOptions = {}; + const expectedError = new Error('expected'); + client.innerApiCalls.synthesizeSpeech = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.synthesizeSpeech(request), expectedError); + assert((client.innerApiCalls.synthesizeSpeech as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); +}); diff --git a/owl-bot-staging/v1beta1/tsconfig.json b/owl-bot-staging/v1beta1/tsconfig.json new file mode 100644 index 00000000..c78f1c88 --- /dev/null +++ b/owl-bot-staging/v1beta1/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "./node_modules/gts/tsconfig-google.json", + "compilerOptions": { + "rootDir": ".", + "outDir": "build", + "resolveJsonModule": true, + "lib": [ + "es2018", + "dom" + ] + }, + "include": [ + "src/*.ts", + "src/**/*.ts", + "test/*.ts", + "test/**/*.ts", + "system-test/*.ts" + ] +} diff --git a/owl-bot-staging/v1beta1/webpack.config.js b/owl-bot-staging/v1beta1/webpack.config.js new file mode 100644 index 00000000..25f059a0 --- /dev/null +++ b/owl-bot-staging/v1beta1/webpack.config.js @@ -0,0 +1,64 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +const path = require('path'); + +module.exports = { + entry: './src/index.ts', + output: { + library: 'TextToSpeech', + filename: './text-to-speech.js', + }, + node: { + child_process: 'empty', + fs: 'empty', + crypto: 'empty', + }, + resolve: { + alias: { + '../../../package.json': path.resolve(__dirname, 'package.json'), + }, + extensions: ['.js', '.json', '.ts'], + }, + module: { + rules: [ + { + test: /\.tsx?$/, + use: 'ts-loader', + exclude: /node_modules/ + }, + { + test: /node_modules[\\/]@grpc[\\/]grpc-js/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]grpc/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]retry-request/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]https?-proxy-agent/, + use: 'null-loader' + }, + { + test: /node_modules[\\/]gtoken/, + use: 'null-loader' + }, + ], + }, + mode: 'production', +}; From 4f8fc196b954f3943bf6d3be77e71d8d66bcfdf3 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 22 Jun 2021 00:45:28 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/master/packages/owl-bot/README.md --- owl-bot-staging/v1/.eslintignore | 6 - owl-bot-staging/v1/.eslintrc.json | 3 - owl-bot-staging/v1/.gitignore | 14 - owl-bot-staging/v1/.jsdoc.js | 55 --- owl-bot-staging/v1/.mocharc.js | 33 -- owl-bot-staging/v1/.prettierrc.js | 22 - owl-bot-staging/v1/README.md | 1 - owl-bot-staging/v1/linkinator.config.json | 10 - owl-bot-staging/v1/package.json | 64 --- .../cloud/texttospeech/v1/cloud_tts.proto | 254 ----------- owl-bot-staging/v1/src/index.ts | 25 -- owl-bot-staging/v1/src/v1/gapic_metadata.json | 43 -- owl-bot-staging/v1/src/v1/index.ts | 19 - .../v1/src/v1/text_to_speech_client.ts | 422 ----------------- .../src/v1/text_to_speech_client_config.json | 36 -- .../v1/src/v1/text_to_speech_proto_list.json | 3 - .../system-test/fixtures/sample/src/index.js | 27 -- .../system-test/fixtures/sample/src/index.ts | 32 -- owl-bot-staging/v1/system-test/install.ts | 49 -- .../v1/test/gapic_text_to_speech_v1.ts | 240 ---------- owl-bot-staging/v1/tsconfig.json | 19 - owl-bot-staging/v1/webpack.config.js | 64 --- owl-bot-staging/v1beta1/.eslintignore | 6 - owl-bot-staging/v1beta1/.eslintrc.json | 3 - owl-bot-staging/v1beta1/.gitignore | 14 - owl-bot-staging/v1beta1/.jsdoc.js | 55 --- owl-bot-staging/v1beta1/.mocharc.js | 33 -- owl-bot-staging/v1beta1/.prettierrc.js | 22 - owl-bot-staging/v1beta1/README.md | 1 - .../v1beta1/linkinator.config.json | 10 - owl-bot-staging/v1beta1/package.json | 64 --- .../texttospeech/v1beta1/cloud_tts.proto | 294 ------------ owl-bot-staging/v1beta1/src/index.ts | 25 -- .../v1beta1/src/v1beta1/gapic_metadata.json | 43 -- owl-bot-staging/v1beta1/src/v1beta1/index.ts | 19 - .../src/v1beta1/text_to_speech_client.ts | 425 ------------------ .../v1beta1/text_to_speech_client_config.json | 36 -- .../v1beta1/text_to_speech_proto_list.json | 3 - .../system-test/fixtures/sample/src/index.js | 27 -- .../system-test/fixtures/sample/src/index.ts | 32 -- .../v1beta1/system-test/install.ts | 49 -- .../test/gapic_text_to_speech_v1beta1.ts | 240 ---------- owl-bot-staging/v1beta1/tsconfig.json | 19 - owl-bot-staging/v1beta1/webpack.config.js | 64 --- src/v1/text_to_speech_client.ts | 8 +- src/v1beta1/text_to_speech_client.ts | 8 +- 46 files changed, 8 insertions(+), 2933 deletions(-) delete mode 100644 owl-bot-staging/v1/.eslintignore delete mode 100644 owl-bot-staging/v1/.eslintrc.json delete mode 100644 owl-bot-staging/v1/.gitignore delete mode 100644 owl-bot-staging/v1/.jsdoc.js delete mode 100644 owl-bot-staging/v1/.mocharc.js delete mode 100644 owl-bot-staging/v1/.prettierrc.js delete mode 100644 owl-bot-staging/v1/README.md delete mode 100644 owl-bot-staging/v1/linkinator.config.json delete mode 100644 owl-bot-staging/v1/package.json delete mode 100644 owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto delete mode 100644 owl-bot-staging/v1/src/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1/src/v1/index.ts delete mode 100644 owl-bot-staging/v1/src/v1/text_to_speech_client.ts delete mode 100644 owl-bot-staging/v1/src/v1/text_to_speech_client_config.json delete mode 100644 owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1/system-test/install.ts delete mode 100644 owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts delete mode 100644 owl-bot-staging/v1/tsconfig.json delete mode 100644 owl-bot-staging/v1/webpack.config.js delete mode 100644 owl-bot-staging/v1beta1/.eslintignore delete mode 100644 owl-bot-staging/v1beta1/.eslintrc.json delete mode 100644 owl-bot-staging/v1beta1/.gitignore delete mode 100644 owl-bot-staging/v1beta1/.jsdoc.js delete mode 100644 owl-bot-staging/v1beta1/.mocharc.js delete mode 100644 owl-bot-staging/v1beta1/.prettierrc.js delete mode 100644 owl-bot-staging/v1beta1/README.md delete mode 100644 owl-bot-staging/v1beta1/linkinator.config.json delete mode 100644 owl-bot-staging/v1beta1/package.json delete mode 100644 owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto delete mode 100644 owl-bot-staging/v1beta1/src/index.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/index.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json delete mode 100644 owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json delete mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/v1beta1/system-test/install.ts delete mode 100644 owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts delete mode 100644 owl-bot-staging/v1beta1/tsconfig.json delete mode 100644 owl-bot-staging/v1beta1/webpack.config.js diff --git a/owl-bot-staging/v1/.eslintignore b/owl-bot-staging/v1/.eslintignore deleted file mode 100644 index 521dc25a..00000000 --- a/owl-bot-staging/v1/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ diff --git a/owl-bot-staging/v1/.eslintrc.json b/owl-bot-staging/v1/.eslintrc.json deleted file mode 100644 index 78215349..00000000 --- a/owl-bot-staging/v1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1/.gitignore b/owl-bot-staging/v1/.gitignore deleted file mode 100644 index 5d32b237..00000000 --- a/owl-bot-staging/v1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1/.jsdoc.js b/owl-bot-staging/v1/.jsdoc.js deleted file mode 100644 index 6e584fdd..00000000 --- a/owl-bot-staging/v1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2021 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/text-to-speech', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1/.mocharc.js b/owl-bot-staging/v1/.mocharc.js deleted file mode 100644 index 50bc7f79..00000000 --- a/owl-bot-staging/v1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1/.prettierrc.js b/owl-bot-staging/v1/.prettierrc.js deleted file mode 100644 index 84f4713a..00000000 --- a/owl-bot-staging/v1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1/README.md b/owl-bot-staging/v1/README.md deleted file mode 100644 index 3eaadd6a..00000000 --- a/owl-bot-staging/v1/README.md +++ /dev/null @@ -1 +0,0 @@ -Texttospeech: Nodejs Client diff --git a/owl-bot-staging/v1/linkinator.config.json b/owl-bot-staging/v1/linkinator.config.json deleted file mode 100644 index 29a223b6..00000000 --- a/owl-bot-staging/v1/linkinator.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io" - ], - "silent": true, - "concurrency": 10 -} diff --git a/owl-bot-staging/v1/package.json b/owl-bot-staging/v1/package.json deleted file mode 100644 index 33fbbf45..00000000 --- a/owl-bot-staging/v1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/text-to-speech", - "version": "0.1.0", - "description": "Texttospeech client for Node.js", - "repository": "googleapis/nodejs-texttospeech", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google texttospeech", - "texttospeech", - "text to speech" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.15.0" - }, - "devDependencies": { - "@types/mocha": "^8.2.2", - "@types/node": "^14.17.3", - "@types/sinon": "^10.0.2", - "c8": "^7.7.3", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.0", - "jsdoc-region-tag": "^1.1.0", - "linkinator": "^2.13.6", - "mocha": "^8.4.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^11.1.1", - "ts-loader": "^9.2.3", - "typescript": "^4.3.4", - "webpack": "^5.39.1", - "webpack-cli": "^4.7.2" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto b/owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto deleted file mode 100644 index ebcf44d8..00000000 --- a/owl-bot-staging/v1/protos/google/cloud/texttospeech/v1/cloud_tts.proto +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -syntax = "proto3"; - -package google.cloud.texttospeech.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.TextToSpeech.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1;texttospeech"; -option java_multiple_files = true; -option java_outer_classname = "TextToSpeechProto"; -option java_package = "com.google.cloud.texttospeech.v1"; -option php_namespace = "Google\\Cloud\\TextToSpeech\\V1"; -option ruby_package = "Google::Cloud::TextToSpeech::V1"; - -// Service that implements Google Cloud Text-to-Speech API. -service TextToSpeech { - option (google.api.default_host) = "texttospeech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Returns a list of Voice supported for synthesis. - rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { - option (google.api.http) = { - get: "/v1/voices" - }; - option (google.api.method_signature) = "language_code"; - } - - // Synthesizes speech synchronously: receive results after all text input - // has been processed. - rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { - option (google.api.http) = { - post: "/v1/text:synthesize" - body: "*" - }; - option (google.api.method_signature) = "input,voice,audio_config"; - } -} - -// The top-level message sent by the client for the `ListVoices` method. -message ListVoicesRequest { - // Optional. Recommended. - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - // specified, the ListVoices call will only return voices that can be used to - // synthesize this language_code. E.g. when specifying "en-NZ", you will get - // supported "en-\*" voices; when specifying "no", you will get supported - // "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" - // will also get supported "cmn-\*" voices; specifying "zh-hk" will also get - // supported "yue-\*" voices. - string language_code = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Gender of the voice as described in -// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). -enum SsmlVoiceGender { - // An unspecified gender. - // In VoiceSelectionParams, this means that the client doesn't care which - // gender the selected voice will have. In the Voice field of - // ListVoicesResponse, this may mean that the voice doesn't fit any of the - // other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0; - - // A male voice. - MALE = 1; - - // A female voice. - FEMALE = 2; - - // A gender-neutral voice. - NEUTRAL = 3; -} - -// Configuration to set up audio encoder. The encoding determines the output -// audio format that we'd like. -enum AudioEncoding { - // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1; - - // MP3 audio at 32kbps. - MP3 = 2; - - // Opus encoded audio wrapped in an ogg container. The result will be a - // file which can be played natively on Android, and in browsers (at least - // Chrome and Firefox). The quality of the encoding is considerably higher - // than MP3 while using approximately the same bitrate. - OGG_OPUS = 3; -} - -// The message returned to the client by the `ListVoices` method. -message ListVoicesResponse { - // The list of voices. - repeated Voice voices = 1; -} - -// Description of a voice supported by the TTS service. -message Voice { - // The languages that this voice supports, expressed as - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - // "en-US", "es-419", "cmn-tw"). - repeated string language_codes = 1; - - // The name of this voice. Each distinct voice has a unique name. - string name = 2; - - // The gender of this voice. - SsmlVoiceGender ssml_gender = 3; - - // The natural sample rate (in hertz) for this voice. - int32 natural_sample_rate_hertz = 4; -} - -// The top-level message sent by the client for the `SynthesizeSpeech` method. -message SynthesizeSpeechRequest { - // Required. The Synthesizer requires either plain text or SSML as input. - SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired voice of the synthesized audio. - VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The configuration of the synthesized audio. - AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Contains text input to be synthesized. Either `text` or `ssml` must be -// supplied. Supplying both or neither returns -// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 -// characters. -message SynthesisInput { - // The input source, which is either plain text or SSML. - oneof input_source { - // The raw text to be synthesized. - string text = 1; - - // The SSML document to be synthesized. The SSML document must be valid - // and well-formed. Otherwise the RPC will fail and return - // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see - // [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - string ssml = 2; - } -} - -// Description of which voice to use for a synthesis request. -message VoiceSelectionParams { - // Required. The language (and potentially also the region) of the voice expressed as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - // "en-US". This should not include a script tag (e.g. use - // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - // from the input provided in the SynthesisInput. The TTS service - // will use this parameter to help choose an appropriate voice. Note that - // the TTS service may choose a voice with a slightly different language code - // than the one selected; it may substitute a different region - // (e.g. using en-US rather than en-CA if there isn't a Canadian voice - // available), or even a different language, e.g. using "nb" (Norwegian - // Bokmal) instead of "no" (Norwegian)". - string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // The name of the voice. If not set, the service will choose a - // voice based on the other parameters such as language_code and gender. - string name = 2; - - // The preferred gender of the voice. If not set, the service will - // choose a voice based on the other parameters such as language_code and - // name. Note that this is only a preference, not requirement; if a - // voice of the appropriate gender is not available, the synthesizer should - // substitute a voice with a different gender rather than failing the request. - SsmlVoiceGender ssml_gender = 3; -} - -// Description of audio data to be synthesized. -message AudioConfig { - // Required. The format of the audio byte stream. - AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is - // the normal native speed supported by the specific voice. 2.0 is twice as - // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - // speed. Any other values < 0.25 or > 4.0 will return an error. - double speaking_rate = 2 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - // increase 20 semitones from the original pitch. -20 means decrease 20 - // semitones from the original pitch. - double pitch = 3 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Volume gain (in dB) of the normal native volume - // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - // set to a value of 0.0 (dB), will play at normal native signal amplitude. A - // value of -6.0 (dB) will play at approximately half the amplitude of the - // normal native signal amplitude. A value of +6.0 (dB) will play at - // approximately twice the amplitude of the normal native signal amplitude. - // Strongly recommend not to exceed +10 (dB) as there's usually no effective - // increase in loudness for any value greater than that. - double volume_gain_db = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. The synthesis sample rate (in hertz) for this audio. When this is - // specified in SynthesizeSpeechRequest, if this is different from the voice's - // natural sample rate, then the synthesizer will honor this request by - // converting to the desired sample rate (which might result in worse audio - // quality), unless the specified sample rate is not supported for the - // encoding chosen, in which case it will fail the request and return - // [google.rpc.Code.INVALID_ARGUMENT][]. - int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Input only. An identifier which selects 'audio effects' profiles - // that are applied on (post synthesized) text to speech. Effects are applied - // on top of each other in the order they are given. See - // [audio - // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - // current supported profile ids. - repeated string effects_profile_id = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// The message returned to the client by the `SynthesizeSpeech` method. -message SynthesizeSpeechResponse { - // The audio data bytes encoded as specified in the request, including the - // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - // For LINEAR16 audio, we include the WAV header. Note: as - // with all bytes fields, protobuffers use a pure binary representation, - // whereas JSON representations use base64. - bytes audio_content = 1; -} diff --git a/owl-bot-staging/v1/src/index.ts b/owl-bot-staging/v1/src/index.ts deleted file mode 100644 index 1e12e038..00000000 --- a/owl-bot-staging/v1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1 from './v1'; -const TextToSpeechClient = v1.TextToSpeechClient; -type TextToSpeechClient = v1.TextToSpeechClient; -export {v1, TextToSpeechClient}; -export default {v1, TextToSpeechClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1/src/v1/gapic_metadata.json b/owl-bot-staging/v1/src/v1/gapic_metadata.json deleted file mode 100644 index 301ecb6d..00000000 --- a/owl-bot-staging/v1/src/v1/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.texttospeech.v1", - "libraryPackage": "@google-cloud/text-to-speech", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TextToSpeechClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/index.ts b/owl-bot-staging/v1/src/v1/index.ts deleted file mode 100644 index 49558f42..00000000 --- a/owl-bot-staging/v1/src/v1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {TextToSpeechClient} from './text_to_speech_client'; diff --git a/owl-bot-staging/v1/src/v1/text_to_speech_client.ts b/owl-bot-staging/v1/src/v1/text_to_speech_client.ts deleted file mode 100644 index ed8ebc3a..00000000 --- a/owl-bot-staging/v1/src/v1/text_to_speech_client.ts +++ /dev/null @@ -1,422 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1/text_to_speech_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './text_to_speech_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Service that implements Google Cloud Text-to-Speech API. - * @class - * @memberof v1 - */ -export class TextToSpeechClient { - private _terminated = false; - private _opts: ClientOptions; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - innerApiCalls: {[name: string]: Function}; - textToSpeechStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TextToSpeechClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof TextToSpeechClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.texttospeech.v1.TextToSpeech', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.textToSpeechStub) { - return this.textToSpeechStub; - } - - // Put together the "service stub" for - // google.cloud.texttospeech.v1.TextToSpeech. - this.textToSpeechStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.texttospeech.v1.TextToSpeech') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.texttospeech.v1.TextToSpeech, - this._opts) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const textToSpeechStubMethods = - ['listVoices', 'synthesizeSpeech']; - for (const methodName of textToSpeechStubMethods) { - const callPromise = this.textToSpeechStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.textToSpeechStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'texttospeech.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'texttospeech.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - listVoices( - request?: protos.google.cloud.texttospeech.v1.IListVoicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.texttospeech.v1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1.IListVoicesRequest|undefined, {}|undefined - ]>; - listVoices( - request: protos.google.cloud.texttospeech.v1.IListVoicesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.texttospeech.v1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, - {}|null|undefined>): void; - listVoices( - request: protos.google.cloud.texttospeech.v1.IListVoicesRequest, - callback: Callback< - protos.google.cloud.texttospeech.v1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, - {}|null|undefined>): void; -/** - * Returns a list of Voice supported for synthesis. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.languageCode] - * Optional. Recommended. - * [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. If - * specified, the ListVoices call will only return voices that can be used to - * synthesize this language_code. E.g. when specifying "en-NZ", you will get - * supported "en-\*" voices; when specifying "no", you will get supported - * "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" - * will also get supported "cmn-\*" voices; specifying "zh-hk" will also get - * supported "yue-\*" voices. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListVoicesResponse]{@link google.cloud.texttospeech.v1.ListVoicesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.listVoices(request); - */ - listVoices( - request?: protos.google.cloud.texttospeech.v1.IListVoicesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.texttospeech.v1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.texttospeech.v1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1.IListVoicesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.texttospeech.v1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1.IListVoicesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - this.initialize(); - return this.innerApiCalls.listVoices(request, options, callback); - } - synthesizeSpeech( - request?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|undefined, {}|undefined - ]>; - synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>): void; - synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, - callback: Callback< - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>): void; -/** - * Synthesizes speech synchronously: receive results after all text input - * has been processed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.texttospeech.v1.SynthesisInput} request.input - * Required. The Synthesizer requires either plain text or SSML as input. - * @param {google.cloud.texttospeech.v1.VoiceSelectionParams} request.voice - * Required. The desired voice of the synthesized audio. - * @param {google.cloud.texttospeech.v1.AudioConfig} request.audioConfig - * Required. The configuration of the synthesized audio. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SynthesizeSpeechResponse]{@link google.cloud.texttospeech.v1.SynthesizeSpeechResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.synthesizeSpeech(request); - */ - synthesizeSpeech( - request?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - this.initialize(); - return this.innerApiCalls.synthesizeSpeech(request, options, callback); - } - - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.textToSpeechStub!.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1/src/v1/text_to_speech_client_config.json b/owl-bot-staging/v1/src/v1/text_to_speech_client_config.json deleted file mode 100644 index e460d954..00000000 --- a/owl-bot-staging/v1/src/v1/text_to_speech_client_config.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1.TextToSpeech": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SynthesizeSpeech": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json b/owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json deleted file mode 100644 index a2b3f234..00000000 --- a/owl-bot-staging/v1/src/v1/text_to_speech_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/cloud/texttospeech/v1/cloud_tts.proto" -] diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 3cc8aa8c..00000000 --- a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const texttospeech = require('@google-cloud/text-to-speech'); - -function main() { - const textToSpeechClient = new texttospeech.TextToSpeechClient(); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 919e5672..00000000 --- a/owl-bot-staging/v1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {TextToSpeechClient} from '@google-cloud/text-to-speech'; - -// check that the client class type name can be used -function doStuffWithTextToSpeechClient(client: TextToSpeechClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const textToSpeechClient = new TextToSpeechClient(); - doStuffWithTextToSpeechClient(textToSpeechClient); -} - -main(); diff --git a/owl-bot-staging/v1/system-test/install.ts b/owl-bot-staging/v1/system-test/install.ts deleted file mode 100644 index 1f850b52..00000000 --- a/owl-bot-staging/v1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts b/owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts deleted file mode 100644 index 07f5ac9e..00000000 --- a/owl-bot-staging/v1/test/gapic_text_to_speech_v1.ts +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as texttospeechModule from '../src'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1.TextToSpeechClient', () => { - it('has servicePath', () => { - const servicePath = texttospeechModule.v1.TextToSpeechClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = texttospeechModule.v1.TextToSpeechClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = texttospeechModule.v1.TextToSpeechClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new texttospeechModule.v1.TextToSpeechClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.textToSpeechStub, undefined); - await client.initialize(); - assert(client.textToSpeechStub); - }); - - it('has close method', () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('listVoices', () => { - it('invokes listVoices without error', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesResponse()); - client.innerApiCalls.listVoices = stubSimpleCall(expectedResponse); - const [response] = await client.listVoices(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listVoices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listVoices without error using callback', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesResponse()); - client.innerApiCalls.listVoices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listVoices( - request, - (err?: Error|null, result?: protos.google.cloud.texttospeech.v1.IListVoicesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listVoices as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listVoices with error', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.ListVoicesRequest()); - const expectedOptions = {}; - const expectedError = new Error('expected'); - client.innerApiCalls.listVoices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listVoices(request), expectedError); - assert((client.innerApiCalls.listVoices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('synthesizeSpeech', () => { - it('invokes synthesizeSpeech without error', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechResponse()); - client.innerApiCalls.synthesizeSpeech = stubSimpleCall(expectedResponse); - const [response] = await client.synthesizeSpeech(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.synthesizeSpeech as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes synthesizeSpeech without error using callback', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechResponse()); - client.innerApiCalls.synthesizeSpeech = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.synthesizeSpeech( - request, - (err?: Error|null, result?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.synthesizeSpeech as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes synthesizeSpeech with error', async () => { - const client = new texttospeechModule.v1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1.SynthesizeSpeechRequest()); - const expectedOptions = {}; - const expectedError = new Error('expected'); - client.innerApiCalls.synthesizeSpeech = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.synthesizeSpeech(request), expectedError); - assert((client.innerApiCalls.synthesizeSpeech as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); -}); diff --git a/owl-bot-staging/v1/tsconfig.json b/owl-bot-staging/v1/tsconfig.json deleted file mode 100644 index c78f1c88..00000000 --- a/owl-bot-staging/v1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1/webpack.config.js b/owl-bot-staging/v1/webpack.config.js deleted file mode 100644 index 25f059a0..00000000 --- a/owl-bot-staging/v1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'TextToSpeech', - filename: './text-to-speech.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/owl-bot-staging/v1beta1/.eslintignore b/owl-bot-staging/v1beta1/.eslintignore deleted file mode 100644 index 521dc25a..00000000 --- a/owl-bot-staging/v1beta1/.eslintignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/.coverage -build/ -docs/ -protos/ -system-test/ diff --git a/owl-bot-staging/v1beta1/.eslintrc.json b/owl-bot-staging/v1beta1/.eslintrc.json deleted file mode 100644 index 78215349..00000000 --- a/owl-bot-staging/v1beta1/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/v1beta1/.gitignore b/owl-bot-staging/v1beta1/.gitignore deleted file mode 100644 index 5d32b237..00000000 --- a/owl-bot-staging/v1beta1/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -**/*.log -**/node_modules -.coverage -coverage -.nyc_output -docs/ -out/ -build/ -system-test/secrets.js -system-test/*key.json -*.lock -.DS_Store -package-lock.json -__pycache__ diff --git a/owl-bot-staging/v1beta1/.jsdoc.js b/owl-bot-staging/v1beta1/.jsdoc.js deleted file mode 100644 index 6e584fdd..00000000 --- a/owl-bot-staging/v1beta1/.jsdoc.js +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -'use strict'; - -module.exports = { - opts: { - readme: './README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2021 Google LLC', - includeDate: false, - sourceFiles: false, - systemName: '@google-cloud/text-to-speech', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/v1beta1/.mocharc.js b/owl-bot-staging/v1beta1/.mocharc.js deleted file mode 100644 index 50bc7f79..00000000 --- a/owl-bot-staging/v1beta1/.mocharc.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -const config = { - "enable-source-maps": true, - "throw-deprecation": true, - "timeout": 10000 -} -if (process.env.MOCHA_THROW_DEPRECATION === 'false') { - delete config['throw-deprecation']; -} -if (process.env.MOCHA_REPORTER) { - config.reporter = process.env.MOCHA_REPORTER; -} -if (process.env.MOCHA_REPORTER_OUTPUT) { - config['reporter-option'] = `output=${process.env.MOCHA_REPORTER_OUTPUT}`; -} -module.exports = config diff --git a/owl-bot-staging/v1beta1/.prettierrc.js b/owl-bot-staging/v1beta1/.prettierrc.js deleted file mode 100644 index 84f4713a..00000000 --- a/owl-bot-staging/v1beta1/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/v1beta1/README.md b/owl-bot-staging/v1beta1/README.md deleted file mode 100644 index 3eaadd6a..00000000 --- a/owl-bot-staging/v1beta1/README.md +++ /dev/null @@ -1 +0,0 @@ -Texttospeech: Nodejs Client diff --git a/owl-bot-staging/v1beta1/linkinator.config.json b/owl-bot-staging/v1beta1/linkinator.config.json deleted file mode 100644 index 29a223b6..00000000 --- a/owl-bot-staging/v1beta1/linkinator.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "recurse": true, - "skip": [ - "https://codecov.io/gh/googleapis/", - "www.googleapis.com", - "img.shields.io" - ], - "silent": true, - "concurrency": 10 -} diff --git a/owl-bot-staging/v1beta1/package.json b/owl-bot-staging/v1beta1/package.json deleted file mode 100644 index 33fbbf45..00000000 --- a/owl-bot-staging/v1beta1/package.json +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "@google-cloud/text-to-speech", - "version": "0.1.0", - "description": "Texttospeech client for Node.js", - "repository": "googleapis/nodejs-texttospeech", - "license": "Apache-2.0", - "author": "Google LLC", - "main": "build/src/index.js", - "files": [ - "build/src", - "build/protos" - ], - "keywords": [ - "google apis client", - "google api client", - "google apis", - "google api", - "google", - "google cloud platform", - "google cloud", - "cloud", - "google texttospeech", - "texttospeech", - "text to speech" - ], - "scripts": { - "clean": "gts clean", - "compile": "tsc -p . && cp -r protos build/", - "compile-protos": "compileProtos src", - "docs": "jsdoc -c .jsdoc.js", - "predocs-test": "npm run docs", - "docs-test": "linkinator docs", - "fix": "gts fix", - "lint": "gts check", - "prepare": "npm run compile-protos && npm run compile", - "system-test": "c8 mocha build/system-test", - "test": "c8 mocha build/test" - }, - "dependencies": { - "google-gax": "^2.15.0" - }, - "devDependencies": { - "@types/mocha": "^8.2.2", - "@types/node": "^14.17.3", - "@types/sinon": "^10.0.2", - "c8": "^7.7.3", - "gts": "^3.1.0", - "jsdoc": "^3.6.7", - "jsdoc-fresh": "^1.1.0", - "jsdoc-region-tag": "^1.1.0", - "linkinator": "^2.13.6", - "mocha": "^8.4.0", - "null-loader": "^4.0.1", - "pack-n-play": "^1.0.0-2", - "sinon": "^11.1.1", - "ts-loader": "^9.2.3", - "typescript": "^4.3.4", - "webpack": "^5.39.1", - "webpack-cli": "^4.7.2" - }, - "engines": { - "node": ">=v10.24.0" - } -} diff --git a/owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto b/owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto deleted file mode 100644 index a70773d7..00000000 --- a/owl-bot-staging/v1beta1/protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.texttospeech.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.TextToSpeech.V1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/texttospeech/v1beta1;texttospeech"; -option java_multiple_files = true; -option java_outer_classname = "TextToSpeechProto"; -option java_package = "com.google.cloud.texttospeech.v1beta1"; -option php_namespace = "Google\\Cloud\\TextToSpeech\\V1beta1"; -option ruby_package = "Google::Cloud::TextToSpeech::V1beta1"; - -// Service that implements Google Cloud Text-to-Speech API. -service TextToSpeech { - option (google.api.default_host) = "texttospeech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Returns a list of Voice supported for synthesis. - rpc ListVoices(ListVoicesRequest) returns (ListVoicesResponse) { - option (google.api.http) = { - get: "/v1beta1/voices" - }; - option (google.api.method_signature) = "language_code"; - } - - // Synthesizes speech synchronously: receive results after all text input - // has been processed. - rpc SynthesizeSpeech(SynthesizeSpeechRequest) returns (SynthesizeSpeechResponse) { - option (google.api.http) = { - post: "/v1beta1/text:synthesize" - body: "*" - }; - option (google.api.method_signature) = "input,voice,audio_config"; - } -} - -// The top-level message sent by the client for the `ListVoices` method. -message ListVoicesRequest { - // 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. E.g. when specifying "en-NZ", you will - // get supported "en-NZ" voices; when specifying "no", you will get supported - // "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" - // will also get supported "cmn-\*" voices; specifying "zh-hk" will also get - // supported "yue-hk" voices. - string language_code = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// Gender of the voice as described in -// [SSML voice element](https://www.w3.org/TR/speech-synthesis11/#edef_voice). -enum SsmlVoiceGender { - // An unspecified gender. - // In VoiceSelectionParams, this means that the client doesn't care which - // gender the selected voice will have. In the Voice field of - // ListVoicesResponse, this may mean that the voice doesn't fit any of the - // other categories in this enum, or that the gender of the voice isn't known. - SSML_VOICE_GENDER_UNSPECIFIED = 0; - - // A male voice. - MALE = 1; - - // A female voice. - FEMALE = 2; - - // A gender-neutral voice. This voice is not yet supported. - NEUTRAL = 3; -} - -// Configuration to set up audio encoder. The encoding determines the output -// audio format that we'd like. -enum AudioEncoding { - // Not specified. Will return result [google.rpc.Code.INVALID_ARGUMENT][]. - AUDIO_ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - // Audio content returned as LINEAR16 also contains a WAV header. - LINEAR16 = 1; - - // MP3 audio at 32kbps. - MP3 = 2; - - // MP3 at 64kbps. - MP3_64_KBPS = 4; - - // Opus encoded audio wrapped in an ogg container. The result will be a - // file which can be played natively on Android, and in browsers (at least - // Chrome and Firefox). The quality of the encoding is considerably higher - // than MP3 while using approximately the same bitrate. - OGG_OPUS = 3; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - // Audio content returned as MULAW also contains a WAV header. - MULAW = 5; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/A-law. - // Audio content returned as ALAW also contains a WAV header. - ALAW = 6; -} - -// The message returned to the client by the `ListVoices` method. -message ListVoicesResponse { - // The list of voices. - repeated Voice voices = 1; -} - -// Description of a voice supported by the TTS service. -message Voice { - // The languages that this voice supports, expressed as - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags (e.g. - // "en-US", "es-419", "cmn-tw"). - repeated string language_codes = 1; - - // The name of this voice. Each distinct voice has a unique name. - string name = 2; - - // The gender of this voice. - SsmlVoiceGender ssml_gender = 3; - - // The natural sample rate (in hertz) for this voice. - int32 natural_sample_rate_hertz = 4; -} - -// The top-level message sent by the client for the `SynthesizeSpeech` method. -message SynthesizeSpeechRequest { - // The type of timepoint information that is returned in the response. - enum TimepointType { - // Not specified. No timepoint information will be returned. - TIMEPOINT_TYPE_UNSPECIFIED = 0; - - // Timepoint information of `` tags in SSML input will be returned. - SSML_MARK = 1; - } - - // Required. The Synthesizer requires either plain text or SSML as input. - SynthesisInput input = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired voice of the synthesized audio. - VoiceSelectionParams voice = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The configuration of the synthesized audio. - AudioConfig audio_config = 3 [(google.api.field_behavior) = REQUIRED]; - - // Whether and what timepoints are returned in the response. - repeated TimepointType enable_time_pointing = 4; -} - -// Contains text input to be synthesized. Either `text` or `ssml` must be -// supplied. Supplying both or neither returns -// [google.rpc.Code.INVALID_ARGUMENT][]. The input size is limited to 5000 -// characters. -message SynthesisInput { - // The input source, which is either plain text or SSML. - oneof input_source { - // The raw text to be synthesized. - string text = 1; - - // The SSML document to be synthesized. The SSML document must be valid - // and well-formed. Otherwise the RPC will fail and return - // [google.rpc.Code.INVALID_ARGUMENT][]. For more information, see - // [SSML](https://cloud.google.com/text-to-speech/docs/ssml). - string ssml = 2; - } -} - -// Description of which voice to use for a synthesis request. -message VoiceSelectionParams { - // Required. The language (and potentially also the region) of the voice expressed as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag, e.g. - // "en-US". This should not include a script tag (e.g. use - // "cmn-cn" rather than "cmn-Hant-cn"), because the script will be inferred - // from the input provided in the SynthesisInput. The TTS service - // will use this parameter to help choose an appropriate voice. Note that - // the TTS service may choose a voice with a slightly different language code - // than the one selected; it may substitute a different region - // (e.g. using en-US rather than en-CA if there isn't a Canadian voice - // available), or even a different language, e.g. using "nb" (Norwegian - // Bokmal) instead of "no" (Norwegian)". - string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // The name of the voice. If not set, the service will choose a - // voice based on the other parameters such as language_code and gender. - string name = 2; - - // The preferred gender of the voice. If not set, the service will - // choose a voice based on the other parameters such as language_code and - // name. Note that this is only a preference, not requirement; if a - // voice of the appropriate gender is not available, the synthesizer should - // substitute a voice with a different gender rather than failing the request. - SsmlVoiceGender ssml_gender = 3; -} - -// Description of audio data to be synthesized. -message AudioConfig { - // Required. The format of the audio byte stream. - AudioEncoding audio_encoding = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Input only. Speaking rate/speed, in the range [0.25, 4.0]. 1.0 is - // the normal native speed supported by the specific voice. 2.0 is twice as - // fast, and 0.5 is half as fast. If unset(0.0), defaults to the native 1.0 - // speed. Any other values < 0.25 or > 4.0 will return an error. - double speaking_rate = 2 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Speaking pitch, in the range [-20.0, 20.0]. 20 means - // increase 20 semitones from the original pitch. -20 means decrease 20 - // semitones from the original pitch. - double pitch = 3 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Input only. Volume gain (in dB) of the normal native volume - // supported by the specific voice, in the range [-96.0, 16.0]. If unset, or - // set to a value of 0.0 (dB), will play at normal native signal amplitude. A - // value of -6.0 (dB) will play at approximately half the amplitude of the - // normal native signal amplitude. A value of +6.0 (dB) will play at - // approximately twice the amplitude of the normal native signal amplitude. - // Strongly recommend not to exceed +10 (dB) as there's usually no effective - // increase in loudness for any value greater than that. - double volume_gain_db = 4 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. The synthesis sample rate (in hertz) for this audio. When this is - // specified in SynthesizeSpeechRequest, if this is different from the voice's - // natural sample rate, then the synthesizer will honor this request by - // converting to the desired sample rate (which might result in worse audio - // quality), unless the specified sample rate is not supported for the - // encoding chosen, in which case it will fail the request and return - // [google.rpc.Code.INVALID_ARGUMENT][]. - int32 sample_rate_hertz = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Input only. An identifier which selects 'audio effects' profiles - // that are applied on (post synthesized) text to speech. Effects are applied - // on top of each other in the order they are given. See - // [audio - // profiles](https://cloud.google.com/text-to-speech/docs/audio-profiles) for - // current supported profile ids. - repeated string effects_profile_id = 6 [ - (google.api.field_behavior) = INPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// The message returned to the client by the `SynthesizeSpeech` method. -message SynthesizeSpeechResponse { - // The audio data bytes encoded as specified in the request, including the - // header for encodings that are wrapped in containers (e.g. MP3, OGG_OPUS). - // For LINEAR16 audio, we include the WAV header. Note: as - // with all bytes fields, protobuffers use a pure binary representation, - // whereas JSON representations use base64. - bytes audio_content = 1; - - // A link between a position in the original request input and a corresponding - // time in the output audio. It's only supported via `` of SSML input. - repeated Timepoint timepoints = 2; - - // The audio metadata of `audio_content`. - AudioConfig audio_config = 4; -} - -// This contains a mapping between a certain point in the input text and a -// corresponding time in the output audio. -message Timepoint { - // Timepoint name as received from the client within `` tag. - string mark_name = 4; - - // Time offset in seconds from the start of the synthesized audio. - double time_seconds = 3; -} diff --git a/owl-bot-staging/v1beta1/src/index.ts b/owl-bot-staging/v1beta1/src/index.ts deleted file mode 100644 index a1137afc..00000000 --- a/owl-bot-staging/v1beta1/src/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as v1beta1 from './v1beta1'; -const TextToSpeechClient = v1beta1.TextToSpeechClient; -type TextToSpeechClient = v1beta1.TextToSpeechClient; -export {v1beta1, TextToSpeechClient}; -export default {v1beta1, TextToSpeechClient}; -import * as protos from '../protos/protos'; -export {protos} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json b/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json deleted file mode 100644 index 33652e5b..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.texttospeech.v1beta1", - "libraryPackage": "@google-cloud/text-to-speech", - "services": { - "TextToSpeech": { - "clients": { - "grpc": { - "libraryClient": "TextToSpeechClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "TextToSpeechClient", - "rpcs": { - "ListVoices": { - "methods": [ - "listVoices" - ] - }, - "SynthesizeSpeech": { - "methods": [ - "synthesizeSpeech" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/index.ts b/owl-bot-staging/v1beta1/src/v1beta1/index.ts deleted file mode 100644 index 49558f42..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -export {TextToSpeechClient} from './text_to_speech_client'; diff --git a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts deleted file mode 100644 index b5285a57..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client.ts +++ /dev/null @@ -1,425 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -/* global window */ -import * as gax from 'google-gax'; -import {Callback, CallOptions, Descriptors, ClientOptions} from 'google-gax'; - -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -/** - * Client JSON configuration object, loaded from - * `src/v1beta1/text_to_speech_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './text_to_speech_client_config.json'; - -const version = require('../../../package.json').version; - -/** - * Service that implements Google Cloud Text-to-Speech API. - * @class - * @memberof v1beta1 - */ -export class TextToSpeechClient { - private _terminated = false; - private _opts: ClientOptions; - private _gaxModule: typeof gax | typeof gax.fallback; - private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; - private _protos: {}; - private _defaults: {[method: string]: gax.CallSettings}; - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - innerApiCalls: {[name: string]: Function}; - textToSpeechStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of TextToSpeechClient. - * - * @param {object} [options] - The configuration object. - * The options accepted by the constructor are described in detail - * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). - * The common options are: - * @param {object} [options.credentials] - Credentials object. - * @param {string} [options.credentials.client_email] - * @param {string} [options.credentials.private_key] - * @param {string} [options.email] - Account email address. Required when - * using a .pem or .p12 keyFilename. - * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or - * .p12 key downloaded from the Google Developers Console. If you provide - * a path to a JSON file, the projectId option below is not necessary. - * NOTE: .pem and .p12 require you to specify options.email as well. - * @param {number} [options.port] - The port on which to connect to - * the remote host. - * @param {string} [options.projectId] - The project ID from the Google - * Developer's Console, e.g. 'grape-spaceship-123'. We will also check - * the environment variable GCLOUD_PROJECT for your project ID. If your - * app is running in an environment which supports - * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, - * your project ID will be detected automatically. - * @param {string} [options.apiEndpoint] - The domain name of the - * API remote host. - * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. - * Follows the structure of {@link gapicConfig}. - * @param {boolean} [options.fallback] - Use HTTP fallback mode. - * In fallback mode, a special browser-compatible transport implementation is used - * instead of gRPC transport. In browser context (if the `window` object is defined) - * the fallback mode is enabled automatically; set `options.fallback` to `false` - * if you need to override this behavior. - */ - constructor(opts?: ClientOptions) { - // Ensure that options include all the required fields. - const staticMembers = this.constructor as typeof TextToSpeechClient; - const servicePath = opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; - const port = opts?.port || staticMembers.port; - const clientConfig = opts?.clientConfig ?? {}; - const fallback = opts?.fallback ?? (typeof window !== 'undefined' && typeof window?.fetch === 'function'); - opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); - - // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. - if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { - opts['scopes'] = staticMembers.scopes; - } - - // Choose either gRPC or proto-over-HTTP implementation of google-gax. - this._gaxModule = opts.fallback ? gax.fallback : gax; - - // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. - this._gaxGrpc = new this._gaxModule.GrpcClient(opts); - - // Save options to use in initialize() method. - this._opts = opts; - - // Save the auth object to the client, for use by other methods. - this.auth = (this._gaxGrpc.auth as gax.GoogleAuth); - - // Set the default scopes in auth client if needed. - if (servicePath === staticMembers.servicePath) { - this.auth.defaultScopes = staticMembers.scopes; - } - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process !== 'undefined' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else if (opts.fallback === 'rest' ) { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.texttospeech.v1beta1.TextToSpeech', gapicConfig as gax.ClientConfig, - opts.clientConfig || {}, {'x-goog-api-client': clientHeader.join(' ')}); - - // Set up a dictionary of "inner API calls"; the core implementation - // of calling the API is handled in `google-gax`, with this code - // merely providing the destination and request information. - this.innerApiCalls = {}; - } - - /** - * Initialize the client. - * Performs asynchronous operations (such as authentication) and prepares the client. - * This function will be called automatically when any class method is called for the - * first time, but if you need to initialize it before calling an actual method, - * feel free to call initialize() directly. - * - * You can await on this method if you want to make sure the client is initialized. - * - * @returns {Promise} A promise that resolves to an authenticated service stub. - */ - initialize() { - // If the client stub promise is already initialized, return immediately. - if (this.textToSpeechStub) { - return this.textToSpeechStub; - } - - // Put together the "service stub" for - // google.cloud.texttospeech.v1beta1.TextToSpeech. - this.textToSpeechStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.texttospeech.v1beta1.TextToSpeech') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.texttospeech.v1beta1.TextToSpeech, - this._opts) as Promise<{[method: string]: Function}>; - - // Iterate over each of the methods that the service provides - // and create an API call method for each. - const textToSpeechStubMethods = - ['listVoices', 'synthesizeSpeech']; - for (const methodName of textToSpeechStubMethods) { - const callPromise = this.textToSpeechStub.then( - stub => (...args: Array<{}>) => { - if (this._terminated) { - return Promise.reject('The client has already been closed.'); - } - const func = stub[methodName]; - return func.apply(stub, args); - }, - (err: Error|null|undefined) => () => { - throw err; - }); - - const descriptor = - undefined; - const apiCall = this._gaxModule.createApiCall( - callPromise, - this._defaults[methodName], - descriptor - ); - - this.innerApiCalls[methodName] = apiCall; - } - - return this.textToSpeechStub; - } - - /** - * The DNS address for this API service. - * @returns {string} The DNS address for this service. - */ - static get servicePath() { - return 'texttospeech.googleapis.com'; - } - - /** - * The DNS address for this API service - same as servicePath(), - * exists for compatibility reasons. - * @returns {string} The DNS address for this service. - */ - static get apiEndpoint() { - return 'texttospeech.googleapis.com'; - } - - /** - * The port for this API service. - * @returns {number} The default port for this service. - */ - static get port() { - return 443; - } - - /** - * The scopes needed to make gRPC calls for every method defined - * in this service. - * @returns {string[]} List of default scopes. - */ - static get scopes() { - return [ - 'https://www.googleapis.com/auth/cloud-platform' - ]; - } - - getProjectId(): Promise; - getProjectId(callback: Callback): void; - /** - * Return the project ID used by this class. - * @returns {Promise} A promise that resolves to string containing the project ID. - */ - getProjectId(callback?: Callback): - Promise|void { - if (callback) { - this.auth.getProjectId(callback); - return; - } - return this.auth.getProjectId(); - } - - // ------------------- - // -- Service calls -- - // ------------------- - listVoices( - request?: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|undefined, {}|undefined - ]>; - listVoices( - request: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, - {}|null|undefined>): void; - listVoices( - request: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, - callback: Callback< - protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, - {}|null|undefined>): void; -/** - * Returns a list of Voice supported for synthesis. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} [request.languageCode] - * 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. E.g. when specifying "en-NZ", you will - * get supported "en-NZ" voices; when specifying "no", you will get supported - * "no-\*" (Norwegian) and "nb-\*" (Norwegian Bokmal) voices; specifying "zh" - * will also get supported "cmn-\*" voices; specifying "zh-hk" will also get - * supported "yue-hk" voices. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [ListVoicesResponse]{@link google.cloud.texttospeech.v1beta1.ListVoicesResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.listVoices(request); - */ - listVoices( - request?: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse, - protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - this.initialize(); - return this.innerApiCalls.listVoices(request, options, callback); - } - synthesizeSpeech( - request?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|undefined, {}|undefined - ]>; - synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>): void; - synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, - callback: Callback< - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>): void; -/** - * Synthesizes speech synchronously: receive results after all text input - * has been processed. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.texttospeech.v1beta1.SynthesisInput} request.input - * Required. The Synthesizer requires either plain text or SSML as input. - * @param {google.cloud.texttospeech.v1beta1.VoiceSelectionParams} request.voice - * Required. The desired voice of the synthesized audio. - * @param {google.cloud.texttospeech.v1beta1.AudioConfig} request.audioConfig - * Required. The configuration of the synthesized audio. - * @param {number[]} request.enableTimePointing - * Whether and what timepoints are returned in the response. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing [SynthesizeSpeechResponse]{@link google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse}. - * Please see the - * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) - * for more details and examples. - * @example - * const [response] = await client.synthesizeSpeech(request); - */ - synthesizeSpeech( - request?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse, - protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest|undefined, {}|undefined - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } - else { - options = optionsOrCallback as CallOptions; - } - options = options || {}; - this.initialize(); - return this.innerApiCalls.synthesizeSpeech(request, options, callback); - } - - - /** - * Terminate the gRPC channel and close the client. - * - * The client will no longer be usable and all future behavior is undefined. - * @returns {Promise} A promise that resolves when the client is closed. - */ - close(): Promise { - this.initialize(); - if (!this._terminated) { - return this.textToSpeechStub!.then(stub => { - this._terminated = true; - stub.close(); - }); - } - return Promise.resolve(); - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json deleted file mode 100644 index 9c26e72b..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_client_config.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "interfaces": { - "google.cloud.texttospeech.v1beta1.TextToSpeech": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListVoices": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - }, - "SynthesizeSpeech": { - "timeout_millis": 300000, - "retry_codes_name": "idempotent", - "retry_params_name": "default" - } - } - } - } -} diff --git a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json b/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json deleted file mode 100644 index c159e9a3..00000000 --- a/owl-bot-staging/v1beta1/src/v1beta1/text_to_speech_proto_list.json +++ /dev/null @@ -1,3 +0,0 @@ -[ - "../../protos/google/cloud/texttospeech/v1beta1/cloud_tts.proto" -] diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 3cc8aa8c..00000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -/* eslint-disable node/no-missing-require, no-unused-vars */ -const texttospeech = require('@google-cloud/text-to-speech'); - -function main() { - const textToSpeechClient = new texttospeech.TextToSpeechClient(); -} - -main(); diff --git a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index 919e5672..00000000 --- a/owl-bot-staging/v1beta1/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {TextToSpeechClient} from '@google-cloud/text-to-speech'; - -// check that the client class type name can be used -function doStuffWithTextToSpeechClient(client: TextToSpeechClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const textToSpeechClient = new TextToSpeechClient(); - doStuffWithTextToSpeechClient(textToSpeechClient); -} - -main(); diff --git a/owl-bot-staging/v1beta1/system-test/install.ts b/owl-bot-staging/v1beta1/system-test/install.ts deleted file mode 100644 index 1f850b52..00000000 --- a/owl-bot-staging/v1beta1/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import { packNTest } from 'pack-n-play'; -import { readFileSync } from 'fs'; -import { describe, it } from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts b/owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts deleted file mode 100644 index adb71765..00000000 --- a/owl-bot-staging/v1beta1/test/gapic_text_to_speech_v1beta1.ts +++ /dev/null @@ -1,240 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import * as protos from '../protos/protos'; -import * as assert from 'assert'; -import * as sinon from 'sinon'; -import {SinonStub} from 'sinon'; -import { describe, it } from 'mocha'; -import * as texttospeechModule from '../src'; - -import {protobuf} from 'google-gax'; - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -describe('v1beta1.TextToSpeechClient', () => { - it('has servicePath', () => { - const servicePath = texttospeechModule.v1beta1.TextToSpeechClient.servicePath; - assert(servicePath); - }); - - it('has apiEndpoint', () => { - const apiEndpoint = texttospeechModule.v1beta1.TextToSpeechClient.apiEndpoint; - assert(apiEndpoint); - }); - - it('has port', () => { - const port = texttospeechModule.v1beta1.TextToSpeechClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - assert.strictEqual(client.textToSpeechStub, undefined); - await client.initialize(); - assert(client.textToSpeechStub); - }); - - it('has close method', () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.close(); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); - const result = await client.getProjectId(); - assert.strictEqual(result, fakeProjectId); - assert((client.auth.getProjectId as SinonStub).calledWithExactly()); - }); - - it('has getProjectId method with callback', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: { client_email: 'bogus', private_key: 'bogus' }, - projectId: 'bogus', - }); - client.auth.getProjectId = sinon.stub().callsArgWith(0, null, fakeProjectId); - const promise = new Promise((resolve, reject) => { - client.getProjectId((err?: Error|null, projectId?: string|null) => { - if (err) { - reject(err); - } else { - resolve(projectId); - } - }); - }); - const result = await promise; - assert.strictEqual(result, fakeProjectId); - }); - - describe('listVoices', () => { - it('invokes listVoices without error', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesResponse()); - client.innerApiCalls.listVoices = stubSimpleCall(expectedResponse); - const [response] = await client.listVoices(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listVoices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes listVoices without error using callback', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesResponse()); - client.innerApiCalls.listVoices = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listVoices( - request, - (err?: Error|null, result?: protos.google.cloud.texttospeech.v1beta1.IListVoicesResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.listVoices as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes listVoices with error', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.ListVoicesRequest()); - const expectedOptions = {}; - const expectedError = new Error('expected'); - client.innerApiCalls.listVoices = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listVoices(request), expectedError); - assert((client.innerApiCalls.listVoices as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - - describe('synthesizeSpeech', () => { - it('invokes synthesizeSpeech without error', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse()); - client.innerApiCalls.synthesizeSpeech = stubSimpleCall(expectedResponse); - const [response] = await client.synthesizeSpeech(request); - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.synthesizeSpeech as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - - it('invokes synthesizeSpeech without error using callback', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest()); - const expectedOptions = {}; - const expectedResponse = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechResponse()); - client.innerApiCalls.synthesizeSpeech = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.synthesizeSpeech( - request, - (err?: Error|null, result?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechResponse|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.innerApiCalls.synthesizeSpeech as SinonStub) - .getCall(0).calledWith(request, expectedOptions /*, callback defined above */)); - }); - - it('invokes synthesizeSpeech with error', async () => { - const client = new texttospeechModule.v1beta1.TextToSpeechClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize(); - const request = generateSampleMessage(new protos.google.cloud.texttospeech.v1beta1.SynthesizeSpeechRequest()); - const expectedOptions = {}; - const expectedError = new Error('expected'); - client.innerApiCalls.synthesizeSpeech = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.synthesizeSpeech(request), expectedError); - assert((client.innerApiCalls.synthesizeSpeech as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); -}); diff --git a/owl-bot-staging/v1beta1/tsconfig.json b/owl-bot-staging/v1beta1/tsconfig.json deleted file mode 100644 index c78f1c88..00000000 --- a/owl-bot-staging/v1beta1/tsconfig.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extends": "./node_modules/gts/tsconfig-google.json", - "compilerOptions": { - "rootDir": ".", - "outDir": "build", - "resolveJsonModule": true, - "lib": [ - "es2018", - "dom" - ] - }, - "include": [ - "src/*.ts", - "src/**/*.ts", - "test/*.ts", - "test/**/*.ts", - "system-test/*.ts" - ] -} diff --git a/owl-bot-staging/v1beta1/webpack.config.js b/owl-bot-staging/v1beta1/webpack.config.js deleted file mode 100644 index 25f059a0..00000000 --- a/owl-bot-staging/v1beta1/webpack.config.js +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const path = require('path'); - -module.exports = { - entry: './src/index.ts', - output: { - library: 'TextToSpeech', - filename: './text-to-speech.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/src/v1/text_to_speech_client.ts b/src/v1/text_to_speech_client.ts index b7d655e6..81afe573 100644 --- a/src/v1/text_to_speech_client.ts +++ b/src/v1/text_to_speech_client.ts @@ -267,7 +267,7 @@ export class TextToSpeechClient { // -- Service calls -- // ------------------- listVoices( - request: protos.google.cloud.texttospeech.v1.IListVoicesRequest, + request?: protos.google.cloud.texttospeech.v1.IListVoicesRequest, options?: CallOptions ): Promise< [ @@ -318,7 +318,7 @@ export class TextToSpeechClient { * const [response] = await client.listVoices(request); */ listVoices( - request: protos.google.cloud.texttospeech.v1.IListVoicesRequest, + request?: protos.google.cloud.texttospeech.v1.IListVoicesRequest, optionsOrCallback?: | CallOptions | Callback< @@ -353,7 +353,7 @@ export class TextToSpeechClient { return this.innerApiCalls.listVoices(request, options, callback); } synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, + request?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, options?: CallOptions ): Promise< [ @@ -406,7 +406,7 @@ export class TextToSpeechClient { * const [response] = await client.synthesizeSpeech(request); */ synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, + request?: protos.google.cloud.texttospeech.v1.ISynthesizeSpeechRequest, optionsOrCallback?: | CallOptions | Callback< diff --git a/src/v1beta1/text_to_speech_client.ts b/src/v1beta1/text_to_speech_client.ts index 56094247..ef11f945 100644 --- a/src/v1beta1/text_to_speech_client.ts +++ b/src/v1beta1/text_to_speech_client.ts @@ -267,7 +267,7 @@ export class TextToSpeechClient { // -- Service calls -- // ------------------- listVoices( - request: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, + request?: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, options?: CallOptions ): Promise< [ @@ -323,7 +323,7 @@ export class TextToSpeechClient { * const [response] = await client.listVoices(request); */ listVoices( - request: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, + request?: protos.google.cloud.texttospeech.v1beta1.IListVoicesRequest, optionsOrCallback?: | CallOptions | Callback< @@ -360,7 +360,7 @@ export class TextToSpeechClient { return this.innerApiCalls.listVoices(request, options, callback); } synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, + request?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, options?: CallOptions ): Promise< [ @@ -418,7 +418,7 @@ export class TextToSpeechClient { * const [response] = await client.synthesizeSpeech(request); */ synthesizeSpeech( - request: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, + request?: protos.google.cloud.texttospeech.v1beta1.ISynthesizeSpeechRequest, optionsOrCallback?: | CallOptions | Callback<