google-cloud-text_to_speech-v1beta1 0.7.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +12 -7
- data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/client.rb +421 -0
- data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb +51 -0
- data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/operations.rb +770 -0
- data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/paths.rb +52 -0
- data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize.rb +50 -0
- data/lib/google/cloud/text_to_speech/v1beta1/version.rb +1 -1
- data/lib/google/cloud/text_to_speech/v1beta1.rb +3 -0
- data/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb.rb +42 -0
- data/lib/google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb.rb +45 -0
- data/lib/google/cloud/texttospeech/v1beta1/cloud_tts_pb.rb +2 -1
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts.rb +5 -5
- data/proto_docs/google/cloud/texttospeech/v1beta1/cloud_tts_lrs.rb +72 -0
- data/proto_docs/google/longrunning/operations.rb +164 -0
- data/proto_docs/google/protobuf/any.rb +141 -0
- data/proto_docs/google/protobuf/duration.rb +98 -0
- data/proto_docs/google/protobuf/empty.rb +34 -0
- data/proto_docs/google/protobuf/timestamp.rb +129 -0
- data/proto_docs/google/rpc/status.rb +46 -0
- metadata +28 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5018bbb60d6fd7ada1a0b5ebc9d986743953c40efdc5c14b9acf38243119ff41
|
4
|
+
data.tar.gz: c1263b630288b117ae1817a0333950686fd0e025b06bf3b88c58e156e1e38d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f18772db436f4c53a6a37734eaeaaf6d353a70dd855bb7ed6a01f5f9458d4febd03bdce26d7701afb5841ee7b7284de719edd81aceceed05756d44143507674a
|
7
|
+
data.tar.gz: cd76ff5a5aa9996a3dbddcb9e1adcab6b0abb870aa9ee118707e27ad6e08a63e4bb1a3a79b7c77776dc11e476facf6dcc0e1a10d2313ae1bfd4747531c07360b
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::TextToSpeech::V1beta1::ListVoicesRequest.new # (reque
|
|
37
37
|
response = client.list_voices request
|
38
38
|
```
|
39
39
|
|
40
|
-
View the [Client Library Documentation](https://
|
40
|
+
View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-text_to_speech-v1beta1/latest)
|
41
41
|
for class and method documentation.
|
42
42
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/text-to-speech)
|
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -69,16 +69,21 @@ module GRPC
|
|
69
69
|
end
|
70
70
|
```
|
71
71
|
|
72
|
+
|
73
|
+
## Google Cloud Samples
|
74
|
+
|
75
|
+
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
76
|
+
|
72
77
|
## Supported Ruby Versions
|
73
78
|
|
74
|
-
This library is supported on Ruby 2.
|
79
|
+
This library is supported on Ruby 2.6+.
|
75
80
|
|
76
81
|
Google provides official support for Ruby versions that are actively supported
|
77
82
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
78
|
-
in security maintenance, and not end of life.
|
79
|
-
|
80
|
-
|
81
|
-
|
83
|
+
in security maintenance, and not end of life. Older versions of Ruby _may_
|
84
|
+
still work, but are unsupported and not recommended. See
|
85
|
+
https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
|
86
|
+
support schedule.
|
82
87
|
|
83
88
|
## Which client should I use?
|
84
89
|
|
@@ -0,0 +1,421 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/texttospeech/v1beta1/cloud_tts_lrs_pb"
|
21
|
+
|
22
|
+
module Google
|
23
|
+
module Cloud
|
24
|
+
module TextToSpeech
|
25
|
+
module V1beta1
|
26
|
+
module TextToSpeechLongAudioSynthesize
|
27
|
+
##
|
28
|
+
# Client for the TextToSpeechLongAudioSynthesize service.
|
29
|
+
#
|
30
|
+
# Service that implements Google Cloud Text-to-Speech API.
|
31
|
+
#
|
32
|
+
class Client
|
33
|
+
include Paths
|
34
|
+
|
35
|
+
# @private
|
36
|
+
attr_reader :text_to_speech_long_audio_synthesize_stub
|
37
|
+
|
38
|
+
##
|
39
|
+
# Configure the TextToSpeechLongAudioSynthesize Client class.
|
40
|
+
#
|
41
|
+
# See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration}
|
42
|
+
# for a description of the configuration fields.
|
43
|
+
#
|
44
|
+
# @example
|
45
|
+
#
|
46
|
+
# # Modify the configuration for all TextToSpeechLongAudioSynthesize clients
|
47
|
+
# ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
50
|
+
#
|
51
|
+
# @yield [config] Configure the Client client.
|
52
|
+
# @yieldparam config [Client::Configuration]
|
53
|
+
#
|
54
|
+
# @return [Client::Configuration]
|
55
|
+
#
|
56
|
+
def self.configure
|
57
|
+
@configure ||= begin
|
58
|
+
namespace = ["Google", "Cloud", "TextToSpeech", "V1beta1"]
|
59
|
+
parent_config = while namespace.any?
|
60
|
+
parent_name = namespace.join "::"
|
61
|
+
parent_const = const_get parent_name
|
62
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
63
|
+
namespace.pop
|
64
|
+
end
|
65
|
+
default_config = Client::Configuration.new parent_config
|
66
|
+
|
67
|
+
default_config.rpcs.synthesize_long_audio.timeout = 5000.0
|
68
|
+
|
69
|
+
default_config
|
70
|
+
end
|
71
|
+
yield @configure if block_given?
|
72
|
+
@configure
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# Configure the TextToSpeechLongAudioSynthesize Client instance.
|
77
|
+
#
|
78
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
79
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
80
|
+
# should be made on {Client.configure}.
|
81
|
+
#
|
82
|
+
# See {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration}
|
83
|
+
# for a description of the configuration fields.
|
84
|
+
#
|
85
|
+
# @yield [config] Configure the Client client.
|
86
|
+
# @yieldparam config [Client::Configuration]
|
87
|
+
#
|
88
|
+
# @return [Client::Configuration]
|
89
|
+
#
|
90
|
+
def configure
|
91
|
+
yield @config if block_given?
|
92
|
+
@config
|
93
|
+
end
|
94
|
+
|
95
|
+
##
|
96
|
+
# Create a new TextToSpeechLongAudioSynthesize client object.
|
97
|
+
#
|
98
|
+
# @example
|
99
|
+
#
|
100
|
+
# # Create a client using the default configuration
|
101
|
+
# client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new
|
102
|
+
#
|
103
|
+
# # Create a client using a custom configuration
|
104
|
+
# client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config|
|
105
|
+
# config.timeout = 10.0
|
106
|
+
# end
|
107
|
+
#
|
108
|
+
# @yield [config] Configure the TextToSpeechLongAudioSynthesize client.
|
109
|
+
# @yieldparam config [Client::Configuration]
|
110
|
+
#
|
111
|
+
def initialize
|
112
|
+
# These require statements are intentionally placed here to initialize
|
113
|
+
# the gRPC module only when it's required.
|
114
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
115
|
+
require "gapic/grpc"
|
116
|
+
require "google/cloud/texttospeech/v1beta1/cloud_tts_lrs_services_pb"
|
117
|
+
|
118
|
+
# Create the configuration object
|
119
|
+
@config = Configuration.new Client.configure
|
120
|
+
|
121
|
+
# Yield the configuration if needed
|
122
|
+
yield @config if block_given?
|
123
|
+
|
124
|
+
# Create credentials
|
125
|
+
credentials = @config.credentials
|
126
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
127
|
+
# but only if the default endpoint does not have a region prefix.
|
128
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
129
|
+
!@config.endpoint.split(".").first.include?("-")
|
130
|
+
credentials ||= Credentials.default scope: @config.scope,
|
131
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
132
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
133
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
134
|
+
end
|
135
|
+
@quota_project_id = @config.quota_project
|
136
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
137
|
+
|
138
|
+
@operations_client = Operations.new do |config|
|
139
|
+
config.credentials = credentials
|
140
|
+
config.quota_project = @quota_project_id
|
141
|
+
config.endpoint = @config.endpoint
|
142
|
+
end
|
143
|
+
|
144
|
+
@text_to_speech_long_audio_synthesize_stub = ::Gapic::ServiceStub.new(
|
145
|
+
::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Stub,
|
146
|
+
credentials: credentials,
|
147
|
+
endpoint: @config.endpoint,
|
148
|
+
channel_args: @config.channel_args,
|
149
|
+
interceptors: @config.interceptors
|
150
|
+
)
|
151
|
+
end
|
152
|
+
|
153
|
+
##
|
154
|
+
# Get the associated client for long-running operations.
|
155
|
+
#
|
156
|
+
# @return [::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Operations]
|
157
|
+
#
|
158
|
+
attr_reader :operations_client
|
159
|
+
|
160
|
+
# Service calls
|
161
|
+
|
162
|
+
##
|
163
|
+
# Synthesizes long form text asynchronously.
|
164
|
+
#
|
165
|
+
# @overload synthesize_long_audio(request, options = nil)
|
166
|
+
# Pass arguments to `synthesize_long_audio` via a request object, either of type
|
167
|
+
# {::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest} or an equivalent Hash.
|
168
|
+
#
|
169
|
+
# @param request [::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest, ::Hash]
|
170
|
+
# A request object representing the call parameters. Required. To specify no
|
171
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
172
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
173
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
174
|
+
#
|
175
|
+
# @overload synthesize_long_audio(parent: nil, input: nil, audio_config: nil, output_gcs_uri: nil, voice: nil)
|
176
|
+
# Pass arguments to `synthesize_long_audio` via keyword arguments. Note that at
|
177
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
178
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
179
|
+
#
|
180
|
+
# @param parent [::String]
|
181
|
+
# The resource states of the request in the form of
|
182
|
+
# projects/*/locations/*/voices/*.
|
183
|
+
# @param input [::Google::Cloud::TextToSpeech::V1beta1::SynthesisInput, ::Hash]
|
184
|
+
# Required. The Synthesizer requires either plain text or SSML as input.
|
185
|
+
# @param audio_config [::Google::Cloud::TextToSpeech::V1beta1::AudioConfig, ::Hash]
|
186
|
+
# Required. The configuration of the synthesized audio.
|
187
|
+
# @param output_gcs_uri [::String]
|
188
|
+
# Specifies a Cloud Storage URI for the synthesis results. Must be
|
189
|
+
# specified in the format: `gs://bucket_name/object_name`, and the bucket
|
190
|
+
# must already exist.
|
191
|
+
# @param voice [::Google::Cloud::TextToSpeech::V1beta1::VoiceSelectionParams, ::Hash]
|
192
|
+
# The desired voice of the synthesized audio.
|
193
|
+
#
|
194
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
195
|
+
# @yieldparam response [::Gapic::Operation]
|
196
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
197
|
+
#
|
198
|
+
# @return [::Gapic::Operation]
|
199
|
+
#
|
200
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
201
|
+
#
|
202
|
+
# @example Basic example
|
203
|
+
# require "google/cloud/text_to_speech/v1beta1"
|
204
|
+
#
|
205
|
+
# # Create a client object. The client can be reused for multiple calls.
|
206
|
+
# client = Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new
|
207
|
+
#
|
208
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
209
|
+
# request = Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest.new
|
210
|
+
#
|
211
|
+
# # Call the synthesize_long_audio method.
|
212
|
+
# result = client.synthesize_long_audio request
|
213
|
+
#
|
214
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
215
|
+
# # object to check the status of an operation, cancel it, or wait
|
216
|
+
# # for results. Here is how to block until completion:
|
217
|
+
# result.wait_until_done! timeout: 60
|
218
|
+
# if result.response?
|
219
|
+
# p result.response
|
220
|
+
# else
|
221
|
+
# puts "Error!"
|
222
|
+
# end
|
223
|
+
#
|
224
|
+
def synthesize_long_audio request, options = nil
|
225
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
226
|
+
|
227
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::TextToSpeech::V1beta1::SynthesizeLongAudioRequest
|
228
|
+
|
229
|
+
# Converts hash and nil to an options object
|
230
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
231
|
+
|
232
|
+
# Customize the options with defaults
|
233
|
+
metadata = @config.rpcs.synthesize_long_audio.metadata.to_h
|
234
|
+
|
235
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
236
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
237
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
238
|
+
gapic_version: ::Google::Cloud::TextToSpeech::V1beta1::VERSION
|
239
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
240
|
+
|
241
|
+
header_params = {}
|
242
|
+
if request.parent
|
243
|
+
header_params["parent"] = request.parent
|
244
|
+
end
|
245
|
+
|
246
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
247
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
248
|
+
|
249
|
+
options.apply_defaults timeout: @config.rpcs.synthesize_long_audio.timeout,
|
250
|
+
metadata: metadata,
|
251
|
+
retry_policy: @config.rpcs.synthesize_long_audio.retry_policy
|
252
|
+
|
253
|
+
options.apply_defaults timeout: @config.timeout,
|
254
|
+
metadata: @config.metadata,
|
255
|
+
retry_policy: @config.retry_policy
|
256
|
+
|
257
|
+
@text_to_speech_long_audio_synthesize_stub.call_rpc :synthesize_long_audio, request, options: options do |response, operation|
|
258
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
259
|
+
yield response, operation if block_given?
|
260
|
+
return response
|
261
|
+
end
|
262
|
+
rescue ::GRPC::BadStatus => e
|
263
|
+
raise ::Google::Cloud::Error.from_error(e)
|
264
|
+
end
|
265
|
+
|
266
|
+
##
|
267
|
+
# Configuration class for the TextToSpeechLongAudioSynthesize API.
|
268
|
+
#
|
269
|
+
# This class represents the configuration for TextToSpeechLongAudioSynthesize,
|
270
|
+
# providing control over timeouts, retry behavior, logging, transport
|
271
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
272
|
+
# applied individually to specific RPCs. See
|
273
|
+
# {::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client::Configuration::Rpcs}
|
274
|
+
# for a list of RPCs that can be configured independently.
|
275
|
+
#
|
276
|
+
# Configuration can be applied globally to all clients, or to a single client
|
277
|
+
# on construction.
|
278
|
+
#
|
279
|
+
# @example
|
280
|
+
#
|
281
|
+
# # Modify the global config, setting the timeout for
|
282
|
+
# # synthesize_long_audio to 20 seconds,
|
283
|
+
# # and all remaining timeouts to 10 seconds.
|
284
|
+
# ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.configure do |config|
|
285
|
+
# config.timeout = 10.0
|
286
|
+
# config.rpcs.synthesize_long_audio.timeout = 20.0
|
287
|
+
# end
|
288
|
+
#
|
289
|
+
# # Apply the above configuration only to a new client.
|
290
|
+
# client = ::Google::Cloud::TextToSpeech::V1beta1::TextToSpeechLongAudioSynthesize::Client.new do |config|
|
291
|
+
# config.timeout = 10.0
|
292
|
+
# config.rpcs.synthesize_long_audio.timeout = 20.0
|
293
|
+
# end
|
294
|
+
#
|
295
|
+
# @!attribute [rw] endpoint
|
296
|
+
# The hostname or hostname:port of the service endpoint.
|
297
|
+
# Defaults to `"texttospeech.googleapis.com"`.
|
298
|
+
# @return [::String]
|
299
|
+
# @!attribute [rw] credentials
|
300
|
+
# Credentials to send with calls. You may provide any of the following types:
|
301
|
+
# * (`String`) The path to a service account key file in JSON format
|
302
|
+
# * (`Hash`) A service account key as a Hash
|
303
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
304
|
+
# (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
|
305
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
306
|
+
# (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
|
307
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
308
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
309
|
+
# * (`nil`) indicating no credentials
|
310
|
+
# @return [::Object]
|
311
|
+
# @!attribute [rw] scope
|
312
|
+
# The OAuth scopes
|
313
|
+
# @return [::Array<::String>]
|
314
|
+
# @!attribute [rw] lib_name
|
315
|
+
# The library name as recorded in instrumentation and logging
|
316
|
+
# @return [::String]
|
317
|
+
# @!attribute [rw] lib_version
|
318
|
+
# The library version as recorded in instrumentation and logging
|
319
|
+
# @return [::String]
|
320
|
+
# @!attribute [rw] channel_args
|
321
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
322
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
323
|
+
# @return [::Hash]
|
324
|
+
# @!attribute [rw] interceptors
|
325
|
+
# An array of interceptors that are run before calls are executed.
|
326
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
327
|
+
# @!attribute [rw] timeout
|
328
|
+
# The call timeout in seconds.
|
329
|
+
# @return [::Numeric]
|
330
|
+
# @!attribute [rw] metadata
|
331
|
+
# Additional gRPC headers to be sent with the call.
|
332
|
+
# @return [::Hash{::Symbol=>::String}]
|
333
|
+
# @!attribute [rw] retry_policy
|
334
|
+
# The retry policy. The value is a hash with the following keys:
|
335
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
336
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
337
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
338
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
339
|
+
# trigger a retry.
|
340
|
+
# @return [::Hash]
|
341
|
+
# @!attribute [rw] quota_project
|
342
|
+
# A separate project against which to charge quota.
|
343
|
+
# @return [::String]
|
344
|
+
#
|
345
|
+
class Configuration
|
346
|
+
extend ::Gapic::Config
|
347
|
+
|
348
|
+
config_attr :endpoint, "texttospeech.googleapis.com", ::String
|
349
|
+
config_attr :credentials, nil do |value|
|
350
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
351
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
352
|
+
allowed.any? { |klass| klass === value }
|
353
|
+
end
|
354
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
355
|
+
config_attr :lib_name, nil, ::String, nil
|
356
|
+
config_attr :lib_version, nil, ::String, nil
|
357
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
358
|
+
config_attr :interceptors, nil, ::Array, nil
|
359
|
+
config_attr :timeout, nil, ::Numeric, nil
|
360
|
+
config_attr :metadata, nil, ::Hash, nil
|
361
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
362
|
+
config_attr :quota_project, nil, ::String, nil
|
363
|
+
|
364
|
+
# @private
|
365
|
+
def initialize parent_config = nil
|
366
|
+
@parent_config = parent_config unless parent_config.nil?
|
367
|
+
|
368
|
+
yield self if block_given?
|
369
|
+
end
|
370
|
+
|
371
|
+
##
|
372
|
+
# Configurations for individual RPCs
|
373
|
+
# @return [Rpcs]
|
374
|
+
#
|
375
|
+
def rpcs
|
376
|
+
@rpcs ||= begin
|
377
|
+
parent_rpcs = nil
|
378
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
379
|
+
Rpcs.new parent_rpcs
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
##
|
384
|
+
# Configuration RPC class for the TextToSpeechLongAudioSynthesize API.
|
385
|
+
#
|
386
|
+
# Includes fields providing the configuration for each RPC in this service.
|
387
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
388
|
+
# the following configuration fields:
|
389
|
+
#
|
390
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
391
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
392
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
393
|
+
# include the following keys:
|
394
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
395
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
396
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
397
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
398
|
+
# trigger a retry.
|
399
|
+
#
|
400
|
+
class Rpcs
|
401
|
+
##
|
402
|
+
# RPC-specific configuration for `synthesize_long_audio`
|
403
|
+
# @return [::Gapic::Config::Method]
|
404
|
+
#
|
405
|
+
attr_reader :synthesize_long_audio
|
406
|
+
|
407
|
+
# @private
|
408
|
+
def initialize parent_rpcs = nil
|
409
|
+
synthesize_long_audio_config = parent_rpcs.synthesize_long_audio if parent_rpcs.respond_to? :synthesize_long_audio
|
410
|
+
@synthesize_long_audio = ::Gapic::Config::Method.new synthesize_long_audio_config
|
411
|
+
|
412
|
+
yield self if block_given?
|
413
|
+
end
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|
419
|
+
end
|
420
|
+
end
|
421
|
+
end
|
data/lib/google/cloud/text_to_speech/v1beta1/text_to_speech_long_audio_synthesize/credentials.rb
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "googleauth"
|
20
|
+
|
21
|
+
module Google
|
22
|
+
module Cloud
|
23
|
+
module TextToSpeech
|
24
|
+
module V1beta1
|
25
|
+
module TextToSpeechLongAudioSynthesize
|
26
|
+
# Credentials for the TextToSpeechLongAudioSynthesize API.
|
27
|
+
class Credentials < ::Google::Auth::Credentials
|
28
|
+
self.scope = [
|
29
|
+
"https://www.googleapis.com/auth/cloud-platform"
|
30
|
+
]
|
31
|
+
self.env_vars = [
|
32
|
+
"TEXTTOSPEECH_CREDENTIALS",
|
33
|
+
"TEXTTOSPEECH_KEYFILE",
|
34
|
+
"GOOGLE_CLOUD_CREDENTIALS",
|
35
|
+
"GOOGLE_CLOUD_KEYFILE",
|
36
|
+
"GCLOUD_KEYFILE",
|
37
|
+
"TEXTTOSPEECH_CREDENTIALS_JSON",
|
38
|
+
"TEXTTOSPEECH_KEYFILE_JSON",
|
39
|
+
"GOOGLE_CLOUD_CREDENTIALS_JSON",
|
40
|
+
"GOOGLE_CLOUD_KEYFILE_JSON",
|
41
|
+
"GCLOUD_KEYFILE_JSON"
|
42
|
+
]
|
43
|
+
self.paths = [
|
44
|
+
"~/.config/google_cloud/application_default_credentials.json"
|
45
|
+
]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|