lib/google/cloud/speech/v1p1beta1/speech_client.rb in google-cloud-speech-0.30.0 vs lib/google/cloud/speech/v1p1beta1/speech_client.rb in google-cloud-speech-0.30.1
- old
+ new
@@ -44,20 +44,25 @@
SERVICE_ADDRESS = "speech.googleapis.com".freeze
# The default port of the service.
DEFAULT_SERVICE_PORT = 443
+ # The default set of gRPC interceptors.
+ GRPC_INTERCEPTORS = []
+
DEFAULT_TIMEOUT = 30
# The scopes needed to make gRPC calls to all of the methods defined in
# this service.
ALL_SCOPES = [
"https://www.googleapis.com/auth/cloud-platform"
].freeze
+ # @private
class OperationsClient < Google::Longrunning::OperationsClient
self::SERVICE_ADDRESS = SpeechClient::SERVICE_ADDRESS
+ self::GRPC_INTERCEPTORS = SpeechClient::GRPC_INTERCEPTORS
end
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
# Provides the means for authenticating requests made by the client. This parameter can
# be many types.
@@ -155,17 +160,19 @@
end
# Allow overriding the service path/port in subclasses.
service_path = self.class::SERVICE_ADDRESS
port = self.class::DEFAULT_SERVICE_PORT
+ interceptors = self.class::GRPC_INTERCEPTORS
@speech_stub = Google::Gax::Grpc.create_stub(
service_path,
port,
chan_creds: chan_creds,
channel: channel,
updater_proc: updater_proc,
scopes: scopes,
+ interceptors: interceptors,
&Google::Cloud::Speech::V1p1beta1::Speech::Stub.method(:new)
)
@recognize = Google::Gax.create_api_call(
@speech_stub.method(:recognize),
@@ -205,13 +212,13 @@
# @yieldparam result [Google::Cloud::Speech::V1p1beta1::RecognizeResponse]
# @yieldparam operation [GRPC::ActiveCall::Operation]
# @return [Google::Cloud::Speech::V1p1beta1::RecognizeResponse]
# @raise [Google::Gax::GaxError] if the RPC is aborted.
# @example
- # require "google/cloud/speech/v1p1beta1"
+ # require "google/cloud/speech"
#
- # speech_client = Google::Cloud::Speech::V1p1beta1.new
+ # speech_client = Google::Cloud::Speech.new(version: :v1p1beta1)
# encoding = :FLAC
# sample_rate_hertz = 44100
# language_code = "en-US"
# config = {
# encoding: encoding,
@@ -253,12 +260,12 @@
# Overrides the default settings for this call, e.g, timeout,
# retries, etc.
# @return [Google::Gax::Operation]
# @raise [Google::Gax::GaxError] if the RPC is aborted.
# @example
- # require "google/cloud/speech/v1p1beta1"
+ # require "google/cloud/speech"
#
- # speech_client = Google::Cloud::Speech::V1p1beta1.new
+ # speech_client = Google::Cloud::Speech.new(version: :v1p1beta1)
# encoding = :FLAC
# sample_rate_hertz = 44100
# language_code = "en-US"
# config = {
# encoding: encoding,