google-shopping-merchant-accounts-v1beta 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/client.rb +28 -2
  4. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/client.rb +28 -2
  5. data/lib/google/shopping/merchant/accounts/v1beta/account_issue_service/rest/service_stub.rb +22 -8
  6. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/client.rb +28 -4
  7. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/client.rb +28 -4
  8. data/lib/google/shopping/merchant/accounts/v1beta/account_tax_service/rest/service_stub.rb +38 -20
  9. data/lib/google/shopping/merchant/accounts/v1beta/accounts_pb.rb +1 -1
  10. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/client.rb +38 -9
  11. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/client.rb +38 -9
  12. data/lib/google/shopping/merchant/accounts/v1beta/accounts_service/rest/service_stub.rb +62 -38
  13. data/lib/google/shopping/merchant/accounts/v1beta/accounts_services_pb.rb +5 -1
  14. data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/client.rb +27 -3
  15. data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/rest/client.rb +27 -3
  16. data/lib/google/shopping/merchant/accounts/v1beta/autofeed_settings_service/rest/service_stub.rb +30 -14
  17. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/client.rb +27 -3
  18. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/client.rb +27 -3
  19. data/lib/google/shopping/merchant/accounts/v1beta/business_identity_service/rest/service_stub.rb +30 -14
  20. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/client.rb +27 -3
  21. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/client.rb +27 -3
  22. data/lib/google/shopping/merchant/accounts/v1beta/business_info_service/rest/service_stub.rb +30 -14
  23. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/client.rb +27 -3
  24. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/client.rb +27 -3
  25. data/lib/google/shopping/merchant/accounts/v1beta/email_preferences_service/rest/service_stub.rb +30 -14
  26. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/client.rb +27 -5
  27. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/client.rb +27 -5
  28. data/lib/google/shopping/merchant/accounts/v1beta/homepage_service/rest/service_stub.rb +46 -26
  29. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/client.rb +28 -3
  30. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/client.rb +28 -3
  31. data/lib/google/shopping/merchant/accounts/v1beta/online_return_policy_service/rest/service_stub.rb +30 -14
  32. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/client.rb +28 -5
  33. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/client.rb +28 -5
  34. data/lib/google/shopping/merchant/accounts/v1beta/programs_service/rest/service_stub.rb +46 -26
  35. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/client.rb +28 -6
  36. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/client.rb +28 -6
  37. data/lib/google/shopping/merchant/accounts/v1beta/regions_service/rest/service_stub.rb +54 -32
  38. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/client.rb +27 -3
  39. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/client.rb +27 -3
  40. data/lib/google/shopping/merchant/accounts/v1beta/shipping_settings_service/rest/service_stub.rb +30 -14
  41. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/client.rb +27 -3
  42. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/client.rb +27 -3
  43. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_agreement_state_service/rest/service_stub.rb +30 -14
  44. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/client.rb +27 -4
  45. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/client.rb +27 -4
  46. data/lib/google/shopping/merchant/accounts/v1beta/terms_of_service_service/rest/service_stub.rb +38 -20
  47. data/lib/google/shopping/merchant/accounts/v1beta/user_service/client.rb +28 -6
  48. data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/client.rb +28 -6
  49. data/lib/google/shopping/merchant/accounts/v1beta/user_service/rest/service_stub.rb +54 -32
  50. data/lib/google/shopping/merchant/accounts/v1beta/version.rb +1 -1
  51. data/proto_docs/google/api/client.rb +39 -0
  52. data/proto_docs/google/shopping/merchant/accounts/v1beta/accounts.rb +4 -0
  53. metadata +5 -5
@@ -159,8 +159,28 @@ module Google
159
159
  universe_domain: @config.universe_domain,
160
160
  channel_args: @config.channel_args,
161
161
  interceptors: @config.interceptors,
162
- channel_pool_config: @config.channel_pool
162
+ channel_pool_config: @config.channel_pool,
163
+ logger: @config.logger
163
164
  )
165
+
166
+ @shipping_settings_service_stub.stub_logger&.info do |entry|
167
+ entry.set_system_name
168
+ entry.set_service
169
+ entry.message = "Created client for #{entry.service}"
170
+ entry.set_credentials_fields credentials
171
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
172
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
173
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
174
+ end
175
+ end
176
+
177
+ ##
178
+ # The logger used for request/response debug logging.
179
+ #
180
+ # @return [Logger]
181
+ #
182
+ def logger
183
+ @shipping_settings_service_stub.logger
164
184
  end
165
185
 
166
186
  # Service calls
@@ -246,7 +266,6 @@ module Google
246
266
 
247
267
  @shipping_settings_service_stub.call_rpc :get_shipping_settings, request, options: options do |response, operation|
248
268
  yield response, operation if block_given?
249
- return response
250
269
  end
251
270
  rescue ::GRPC::BadStatus => e
252
271
  raise ::Google::Cloud::Error.from_error(e)
@@ -336,7 +355,6 @@ module Google
336
355
 
337
356
  @shipping_settings_service_stub.call_rpc :insert_shipping_settings, request, options: options do |response, operation|
338
357
  yield response, operation if block_given?
339
- return response
340
358
  end
341
359
  rescue ::GRPC::BadStatus => e
342
360
  raise ::Google::Cloud::Error.from_error(e)
@@ -425,6 +443,11 @@ module Google
425
443
  # default endpoint URL. The default value of nil uses the environment
426
444
  # universe (usually the default "googleapis.com" universe).
427
445
  # @return [::String,nil]
446
+ # @!attribute [rw] logger
447
+ # A custom logger to use for request/response debug logging, or the value
448
+ # `:default` (the default) to construct a default logger, or `nil` to
449
+ # explicitly disable logging.
450
+ # @return [::Logger,:default,nil]
428
451
  #
429
452
  class Configuration
430
453
  extend ::Gapic::Config
@@ -449,6 +472,7 @@ module Google
449
472
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
450
473
  config_attr :quota_project, nil, ::String, nil
451
474
  config_attr :universe_domain, nil, ::String, nil
475
+ config_attr :logger, :default, ::Logger, nil, :default
452
476
 
453
477
  # @private
454
478
  def initialize parent_config = nil
@@ -152,8 +152,28 @@ module Google
152
152
  endpoint: @config.endpoint,
153
153
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
154
  universe_domain: @config.universe_domain,
155
- credentials: credentials
155
+ credentials: credentials,
156
+ logger: @config.logger
156
157
  )
158
+
159
+ @shipping_settings_service_stub.logger(stub: true)&.info do |entry|
160
+ entry.set_system_name
161
+ entry.set_service
162
+ entry.message = "Created client for #{entry.service}"
163
+ entry.set_credentials_fields credentials
164
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
165
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
166
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
167
+ end
168
+ end
169
+
170
+ ##
171
+ # The logger used for request/response debug logging.
172
+ #
173
+ # @return [Logger]
174
+ #
175
+ def logger
176
+ @shipping_settings_service_stub.logger
157
177
  end
158
178
 
159
179
  # Service calls
@@ -232,7 +252,6 @@ module Google
232
252
 
233
253
  @shipping_settings_service_stub.get_shipping_settings request, options do |result, operation|
234
254
  yield result, operation if block_given?
235
- return result
236
255
  end
237
256
  rescue ::Gapic::Rest::Error => e
238
257
  raise ::Google::Cloud::Error.from_error(e)
@@ -315,7 +334,6 @@ module Google
315
334
 
316
335
  @shipping_settings_service_stub.insert_shipping_settings request, options do |result, operation|
317
336
  yield result, operation if block_given?
318
- return result
319
337
  end
320
338
  rescue ::Gapic::Rest::Error => e
321
339
  raise ::Google::Cloud::Error.from_error(e)
@@ -395,6 +413,11 @@ module Google
395
413
  # default endpoint URL. The default value of nil uses the environment
396
414
  # universe (usually the default "googleapis.com" universe).
397
415
  # @return [::String,nil]
416
+ # @!attribute [rw] logger
417
+ # A custom logger to use for request/response debug logging, or the value
418
+ # `:default` (the default) to construct a default logger, or `nil` to
419
+ # explicitly disable logging.
420
+ # @return [::Logger,:default,nil]
398
421
  #
399
422
  class Configuration
400
423
  extend ::Gapic::Config
@@ -416,6 +439,7 @@ module Google
416
439
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
417
440
  config_attr :quota_project, nil, ::String, nil
418
441
  config_attr :universe_domain, nil, ::String, nil
442
+ config_attr :logger, :default, ::Logger, nil, :default
419
443
 
420
444
  # @private
421
445
  def initialize parent_config = nil
@@ -31,7 +31,8 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
36
  # These require statements are intentionally placed here to initialize
36
37
  # the REST modules only when it's required.
37
38
  require "gapic/rest"
@@ -41,7 +42,9 @@ module Google
41
42
  universe_domain: universe_domain,
42
43
  credentials: credentials,
43
44
  numeric_enums: true,
44
- raise_faraday_errors: false
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
45
48
  end
46
49
 
47
50
  ##
@@ -62,6 +65,15 @@ module Google
62
65
  @client_stub.endpoint
63
66
  end
64
67
 
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
65
77
  ##
66
78
  # Baseline implementation for the get_shipping_settings REST call
67
79
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "get_shipping_settings",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -126,16 +140,18 @@ module Google
126
140
 
127
141
  response = @client_stub.make_http_request(
128
142
  verb,
129
- uri: uri,
130
- body: body || "",
131
- params: query_string_params,
143
+ uri: uri,
144
+ body: body || "",
145
+ params: query_string_params,
146
+ method_name: "insert_shipping_settings",
132
147
  options: options
133
148
  )
134
149
  operation = ::Gapic::Rest::TransportOperation.new response
135
150
  result = ::Google::Shopping::Merchant::Accounts::V1beta::ShippingSettings.decode_json response.body, ignore_unknown_fields: true
136
-
137
- yield result, operation if block_given?
138
- result
151
+ catch :response do
152
+ yield result, operation if block_given?
153
+ result
154
+ end
139
155
  end
140
156
 
141
157
  ##
@@ -163,8 +163,28 @@ module Google
163
163
  universe_domain: @config.universe_domain,
164
164
  channel_args: @config.channel_args,
165
165
  interceptors: @config.interceptors,
166
- channel_pool_config: @config.channel_pool
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
167
168
  )
169
+
170
+ @terms_of_service_agreement_state_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+ end
180
+
181
+ ##
182
+ # The logger used for request/response debug logging.
183
+ #
184
+ # @return [Logger]
185
+ #
186
+ def logger
187
+ @terms_of_service_agreement_state_service_stub.logger
168
188
  end
169
189
 
170
190
  # Service calls
@@ -251,7 +271,6 @@ module Google
251
271
 
252
272
  @terms_of_service_agreement_state_service_stub.call_rpc :get_terms_of_service_agreement_state, request, options: options do |response, operation|
253
273
  yield response, operation if block_given?
254
- return response
255
274
  end
256
275
  rescue ::GRPC::BadStatus => e
257
276
  raise ::Google::Cloud::Error.from_error(e)
@@ -338,7 +357,6 @@ module Google
338
357
 
339
358
  @terms_of_service_agreement_state_service_stub.call_rpc :retrieve_for_application_terms_of_service_agreement_state, request, options: options do |response, operation|
340
359
  yield response, operation if block_given?
341
- return response
342
360
  end
343
361
  rescue ::GRPC::BadStatus => e
344
362
  raise ::Google::Cloud::Error.from_error(e)
@@ -427,6 +445,11 @@ module Google
427
445
  # default endpoint URL. The default value of nil uses the environment
428
446
  # universe (usually the default "googleapis.com" universe).
429
447
  # @return [::String,nil]
448
+ # @!attribute [rw] logger
449
+ # A custom logger to use for request/response debug logging, or the value
450
+ # `:default` (the default) to construct a default logger, or `nil` to
451
+ # explicitly disable logging.
452
+ # @return [::Logger,:default,nil]
430
453
  #
431
454
  class Configuration
432
455
  extend ::Gapic::Config
@@ -451,6 +474,7 @@ module Google
451
474
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
452
475
  config_attr :quota_project, nil, ::String, nil
453
476
  config_attr :universe_domain, nil, ::String, nil
477
+ config_attr :logger, :default, ::Logger, nil, :default
454
478
 
455
479
  # @private
456
480
  def initialize parent_config = nil
@@ -156,8 +156,28 @@ module Google
156
156
  endpoint: @config.endpoint,
157
157
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
158
  universe_domain: @config.universe_domain,
159
- credentials: credentials
159
+ credentials: credentials,
160
+ logger: @config.logger
160
161
  )
162
+
163
+ @terms_of_service_agreement_state_service_stub.logger(stub: true)&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @terms_of_service_agreement_state_service_stub.logger
161
181
  end
162
182
 
163
183
  # Service calls
@@ -237,7 +257,6 @@ module Google
237
257
 
238
258
  @terms_of_service_agreement_state_service_stub.get_terms_of_service_agreement_state request, options do |result, operation|
239
259
  yield result, operation if block_given?
240
- return result
241
260
  end
242
261
  rescue ::Gapic::Rest::Error => e
243
262
  raise ::Google::Cloud::Error.from_error(e)
@@ -317,7 +336,6 @@ module Google
317
336
 
318
337
  @terms_of_service_agreement_state_service_stub.retrieve_for_application_terms_of_service_agreement_state request, options do |result, operation|
319
338
  yield result, operation if block_given?
320
- return result
321
339
  end
322
340
  rescue ::Gapic::Rest::Error => e
323
341
  raise ::Google::Cloud::Error.from_error(e)
@@ -397,6 +415,11 @@ module Google
397
415
  # default endpoint URL. The default value of nil uses the environment
398
416
  # universe (usually the default "googleapis.com" universe).
399
417
  # @return [::String,nil]
418
+ # @!attribute [rw] logger
419
+ # A custom logger to use for request/response debug logging, or the value
420
+ # `:default` (the default) to construct a default logger, or `nil` to
421
+ # explicitly disable logging.
422
+ # @return [::Logger,:default,nil]
400
423
  #
401
424
  class Configuration
402
425
  extend ::Gapic::Config
@@ -418,6 +441,7 @@ module Google
418
441
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
419
442
  config_attr :quota_project, nil, ::String, nil
420
443
  config_attr :universe_domain, nil, ::String, nil
444
+ config_attr :logger, :default, ::Logger, nil, :default
421
445
 
422
446
  # @private
423
447
  def initialize parent_config = nil
@@ -31,7 +31,8 @@ module Google
31
31
  # including transcoding, making the REST call, and deserialing the response.
32
32
  #
33
33
  class ServiceStub
34
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
+ # @private
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
35
36
  # These require statements are intentionally placed here to initialize
36
37
  # the REST modules only when it's required.
37
38
  require "gapic/rest"
@@ -41,7 +42,9 @@ module Google
41
42
  universe_domain: universe_domain,
42
43
  credentials: credentials,
43
44
  numeric_enums: true,
44
- raise_faraday_errors: false
45
+ service_name: self.class,
46
+ raise_faraday_errors: false,
47
+ logger: logger
45
48
  end
46
49
 
47
50
  ##
@@ -62,6 +65,15 @@ module Google
62
65
  @client_stub.endpoint
63
66
  end
64
67
 
68
+ ##
69
+ # The logger used for request/response debug logging.
70
+ #
71
+ # @return [Logger]
72
+ #
73
+ def logger stub: false
74
+ stub ? @client_stub.stub_logger : @client_stub.logger
75
+ end
76
+
65
77
  ##
66
78
  # Baseline implementation for the get_terms_of_service_agreement_state REST call
67
79
  #
@@ -88,16 +100,18 @@ module Google
88
100
 
89
101
  response = @client_stub.make_http_request(
90
102
  verb,
91
- uri: uri,
92
- body: body || "",
93
- params: query_string_params,
103
+ uri: uri,
104
+ body: body || "",
105
+ params: query_string_params,
106
+ method_name: "get_terms_of_service_agreement_state",
94
107
  options: options
95
108
  )
96
109
  operation = ::Gapic::Rest::TransportOperation.new response
97
110
  result = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceAgreementState.decode_json response.body, ignore_unknown_fields: true
98
-
99
- yield result, operation if block_given?
100
- result
111
+ catch :response do
112
+ yield result, operation if block_given?
113
+ result
114
+ end
101
115
  end
102
116
 
103
117
  ##
@@ -126,16 +140,18 @@ module Google
126
140
 
127
141
  response = @client_stub.make_http_request(
128
142
  verb,
129
- uri: uri,
130
- body: body || "",
131
- params: query_string_params,
143
+ uri: uri,
144
+ body: body || "",
145
+ params: query_string_params,
146
+ method_name: "retrieve_for_application_terms_of_service_agreement_state",
132
147
  options: options
133
148
  )
134
149
  operation = ::Gapic::Rest::TransportOperation.new response
135
150
  result = ::Google::Shopping::Merchant::Accounts::V1beta::TermsOfServiceAgreementState.decode_json response.body, ignore_unknown_fields: true
136
-
137
- yield result, operation if block_given?
138
- result
151
+ catch :response do
152
+ yield result, operation if block_given?
153
+ result
154
+ end
139
155
  end
140
156
 
141
157
  ##
@@ -163,8 +163,28 @@ module Google
163
163
  universe_domain: @config.universe_domain,
164
164
  channel_args: @config.channel_args,
165
165
  interceptors: @config.interceptors,
166
- channel_pool_config: @config.channel_pool
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
167
168
  )
169
+
170
+ @terms_of_service_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+ end
180
+
181
+ ##
182
+ # The logger used for request/response debug logging.
183
+ #
184
+ # @return [Logger]
185
+ #
186
+ def logger
187
+ @terms_of_service_service_stub.logger
168
188
  end
169
189
 
170
190
  # Service calls
@@ -250,7 +270,6 @@ module Google
250
270
 
251
271
  @terms_of_service_service_stub.call_rpc :get_terms_of_service, request, options: options do |response, operation|
252
272
  yield response, operation if block_given?
253
- return response
254
273
  end
255
274
  rescue ::GRPC::BadStatus => e
256
275
  raise ::Google::Cloud::Error.from_error(e)
@@ -333,7 +352,6 @@ module Google
333
352
 
334
353
  @terms_of_service_service_stub.call_rpc :retrieve_latest_terms_of_service, request, options: options do |response, operation|
335
354
  yield response, operation if block_given?
336
- return response
337
355
  end
338
356
  rescue ::GRPC::BadStatus => e
339
357
  raise ::Google::Cloud::Error.from_error(e)
@@ -426,7 +444,6 @@ module Google
426
444
 
427
445
  @terms_of_service_service_stub.call_rpc :accept_terms_of_service, request, options: options do |response, operation|
428
446
  yield response, operation if block_given?
429
- return response
430
447
  end
431
448
  rescue ::GRPC::BadStatus => e
432
449
  raise ::Google::Cloud::Error.from_error(e)
@@ -515,6 +532,11 @@ module Google
515
532
  # default endpoint URL. The default value of nil uses the environment
516
533
  # universe (usually the default "googleapis.com" universe).
517
534
  # @return [::String,nil]
535
+ # @!attribute [rw] logger
536
+ # A custom logger to use for request/response debug logging, or the value
537
+ # `:default` (the default) to construct a default logger, or `nil` to
538
+ # explicitly disable logging.
539
+ # @return [::Logger,:default,nil]
518
540
  #
519
541
  class Configuration
520
542
  extend ::Gapic::Config
@@ -539,6 +561,7 @@ module Google
539
561
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
540
562
  config_attr :quota_project, nil, ::String, nil
541
563
  config_attr :universe_domain, nil, ::String, nil
564
+ config_attr :logger, :default, ::Logger, nil, :default
542
565
 
543
566
  # @private
544
567
  def initialize parent_config = nil
@@ -156,8 +156,28 @@ module Google
156
156
  endpoint: @config.endpoint,
157
157
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
158
  universe_domain: @config.universe_domain,
159
- credentials: credentials
159
+ credentials: credentials,
160
+ logger: @config.logger
160
161
  )
162
+
163
+ @terms_of_service_service_stub.logger(stub: true)&.info do |entry|
164
+ entry.set_system_name
165
+ entry.set_service
166
+ entry.message = "Created client for #{entry.service}"
167
+ entry.set_credentials_fields credentials
168
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
169
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
170
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
171
+ end
172
+ end
173
+
174
+ ##
175
+ # The logger used for request/response debug logging.
176
+ #
177
+ # @return [Logger]
178
+ #
179
+ def logger
180
+ @terms_of_service_service_stub.logger
161
181
  end
162
182
 
163
183
  # Service calls
@@ -236,7 +256,6 @@ module Google
236
256
 
237
257
  @terms_of_service_service_stub.get_terms_of_service request, options do |result, operation|
238
258
  yield result, operation if block_given?
239
- return result
240
259
  end
241
260
  rescue ::Gapic::Rest::Error => e
242
261
  raise ::Google::Cloud::Error.from_error(e)
@@ -320,7 +339,6 @@ module Google
320
339
 
321
340
  @terms_of_service_service_stub.retrieve_latest_terms_of_service request, options do |result, operation|
322
341
  yield result, operation if block_given?
323
- return result
324
342
  end
325
343
  rescue ::Gapic::Rest::Error => e
326
344
  raise ::Google::Cloud::Error.from_error(e)
@@ -406,7 +424,6 @@ module Google
406
424
 
407
425
  @terms_of_service_service_stub.accept_terms_of_service request, options do |result, operation|
408
426
  yield result, operation if block_given?
409
- return result
410
427
  end
411
428
  rescue ::Gapic::Rest::Error => e
412
429
  raise ::Google::Cloud::Error.from_error(e)
@@ -486,6 +503,11 @@ module Google
486
503
  # default endpoint URL. The default value of nil uses the environment
487
504
  # universe (usually the default "googleapis.com" universe).
488
505
  # @return [::String,nil]
506
+ # @!attribute [rw] logger
507
+ # A custom logger to use for request/response debug logging, or the value
508
+ # `:default` (the default) to construct a default logger, or `nil` to
509
+ # explicitly disable logging.
510
+ # @return [::Logger,:default,nil]
489
511
  #
490
512
  class Configuration
491
513
  extend ::Gapic::Config
@@ -507,6 +529,7 @@ module Google
507
529
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
508
530
  config_attr :quota_project, nil, ::String, nil
509
531
  config_attr :universe_domain, nil, ::String, nil
532
+ config_attr :logger, :default, ::Logger, nil, :default
510
533
 
511
534
  # @private
512
535
  def initialize parent_config = nil