lib/google/ads/googleads/v0/services/customer_service_client.rb in google-ads-googleads-0.2.0 vs lib/google/ads/googleads/v0/services/customer_service_client.rb in google-ads-googleads-0.3.0
- old
+ new
@@ -23,11 +23,11 @@
require "pathname"
require "google/gax"
require "google/ads/googleads/v0/services/customer_service_pb"
-require "google/ads/googleads/credentials"
+require "google/ads/googleads/v0/services/credentials"
module Google
module Ads
module Googleads
module V0
@@ -43,10 +43,13 @@
SERVICE_ADDRESS = "googleads.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 = [
@@ -110,14 +113,14 @@
# the gRPC module only when it's required.
# See https://github.com/googleapis/toolkit/issues/446
require "google/gax/grpc"
require "google/ads/googleads/v0/services/customer_service_services_pb"
- credentials ||= Google::Ads::Googleads::Credentials.default
+ credentials ||= Google::Ads::Googleads::V0::Services::Credentials.default
if credentials.is_a?(String) || credentials.is_a?(Hash)
- updater_proc = Google::Ads::Googleads::Credentials.new(credentials).updater_proc
+ updater_proc = Google::Ads::Googleads::V0::Services::Credentials.new(credentials).updater_proc
end
if credentials.is_a?(GRPC::Core::Channel)
channel = credentials
end
if credentials.is_a?(GRPC::Core::ChannelCredentials)
@@ -156,16 +159,18 @@
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
@customer_service_stub = Google::Gax::Grpc.create_stub(
service_path,
port,
chan_creds: chan_creds,
channel: channel,
updater_proc: updater_proc,
scopes: scopes,
+ interceptors: interceptors,
&Google::Ads::Googleads::V0::Services::CustomerService::Stub.method(:new)
)
@get_customer = Google::Gax.create_api_call(
@customer_service_stub.method(:get_customer),