lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb in google-cloud-speech-v1p1beta1-0.21.0 vs lib/google/cloud/speech/v1p1beta1/speech/rest/client.rb in google-cloud-speech-v1p1beta1-0.21.1
- old
+ new
@@ -31,10 +31,13 @@
#
# Service that implements Google Cloud Speech API.
#
class Client
# @private
+ API_VERSION = ""
+
+ # @private
DEFAULT_ENDPOINT_TEMPLATE = "speech.$UNIVERSE_DOMAIN$"
include Paths
# @private
@@ -230,16 +233,17 @@
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
# Customize the options with defaults
call_metadata = @config.rpcs.recognize.metadata.to_h
- # Set x-goog-api-client and x-goog-user-project headers
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION,
transports_version_send: [:rest]
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
options.apply_defaults timeout: @config.rpcs.recognize.timeout,
metadata: call_metadata,
retry_policy: @config.rpcs.recognize.retry_policy
@@ -325,15 +329,16 @@
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
# Customize the options with defaults
call_metadata = @config.rpcs.long_running_recognize.metadata.to_h
- # Set x-goog-api-client and x-goog-user-project headers
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
lib_name: @config.lib_name, lib_version: @config.lib_version,
gapic_version: ::Google::Cloud::Speech::V1p1beta1::VERSION,
transports_version_send: [:rest]
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
options.apply_defaults timeout: @config.rpcs.long_running_recognize.timeout,
metadata: call_metadata,
retry_policy: @config.rpcs.long_running_recognize.retry_policy