google-cloud-retail-v2 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/retail/v2/analytics_service/client.rb +29 -2
  4. data/lib/google/cloud/retail/v2/analytics_service/operations.rb +12 -15
  5. data/lib/google/cloud/retail/v2/analytics_service/rest/client.rb +29 -2
  6. data/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb +43 -38
  7. data/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb +22 -8
  8. data/lib/google/cloud/retail/v2/catalog_service/client.rb +29 -12
  9. data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +29 -12
  10. data/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +102 -68
  11. data/lib/google/cloud/retail/v2/completion_service/client.rb +29 -3
  12. data/lib/google/cloud/retail/v2/completion_service/operations.rb +12 -15
  13. data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +29 -3
  14. data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +43 -38
  15. data/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +30 -14
  16. data/lib/google/cloud/retail/v2/control_service/client.rb +29 -6
  17. data/lib/google/cloud/retail/v2/control_service/rest/client.rb +29 -6
  18. data/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +54 -32
  19. data/lib/google/cloud/retail/v2/generative_question_service/client.rb +28 -6
  20. data/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb +28 -6
  21. data/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb +54 -32
  22. data/lib/google/cloud/retail/v2/model_service/client.rb +31 -9
  23. data/lib/google/cloud/retail/v2/model_service/operations.rb +12 -15
  24. data/lib/google/cloud/retail/v2/model_service/rest/client.rb +31 -9
  25. data/lib/google/cloud/retail/v2/model_service/rest/operations.rb +43 -38
  26. data/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +78 -50
  27. data/lib/google/cloud/retail/v2/prediction_service/client.rb +28 -2
  28. data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +28 -2
  29. data/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +22 -8
  30. data/lib/google/cloud/retail/v2/product_service/client.rb +36 -13
  31. data/lib/google/cloud/retail/v2/product_service/operations.rb +12 -15
  32. data/lib/google/cloud/retail/v2/product_service/rest/client.rb +36 -13
  33. data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +43 -38
  34. data/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +110 -74
  35. data/lib/google/cloud/retail/v2/search_service/client.rb +29 -2
  36. data/lib/google/cloud/retail/v2/search_service/rest/client.rb +28 -2
  37. data/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +22 -8
  38. data/lib/google/cloud/retail/v2/serving_config_service/client.rb +29 -8
  39. data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +29 -8
  40. data/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +70 -44
  41. data/lib/google/cloud/retail/v2/user_event_service/client.rb +31 -6
  42. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +12 -15
  43. data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +31 -6
  44. data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +43 -38
  45. data/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +54 -32
  46. data/lib/google/cloud/retail/v2/version.rb +1 -1
  47. data/proto_docs/google/api/client.rb +39 -0
  48. data/proto_docs/google/longrunning/operations.rb +19 -14
  49. metadata +5 -5
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_control REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_control",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Retail::V2::Control.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "delete_control",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "update_control",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::Retail::V2::Control.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "get_control",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::Retail::V2::Control.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "list_controls",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::Retail::V2::ListControlsResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -158,14 +158,26 @@ module Google
158
158
  universe_domain: @config.universe_domain,
159
159
  channel_args: @config.channel_args,
160
160
  interceptors: @config.interceptors,
161
- channel_pool_config: @config.channel_pool
161
+ channel_pool_config: @config.channel_pool,
162
+ logger: @config.logger
162
163
  )
163
164
 
165
+ @generative_question_service_stub.stub_logger&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
164
175
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
165
176
  config.credentials = credentials
166
177
  config.quota_project = @quota_project_id
167
178
  config.endpoint = @generative_question_service_stub.endpoint
168
179
  config.universe_domain = @generative_question_service_stub.universe_domain
180
+ config.logger = @generative_question_service_stub.logger if config.respond_to? :logger=
169
181
  end
170
182
  end
171
183
 
@@ -176,6 +188,15 @@ module Google
176
188
  #
177
189
  attr_reader :location_client
178
190
 
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @generative_question_service_stub.logger
198
+ end
199
+
179
200
  # Service calls
180
201
 
181
202
  ##
@@ -263,7 +284,6 @@ module Google
263
284
 
264
285
  @generative_question_service_stub.call_rpc :update_generative_questions_feature_config, request, options: options do |response, operation|
265
286
  yield response, operation if block_given?
266
- return response
267
287
  end
268
288
  rescue ::GRPC::BadStatus => e
269
289
  raise ::Google::Cloud::Error.from_error(e)
@@ -351,7 +371,6 @@ module Google
351
371
 
352
372
  @generative_question_service_stub.call_rpc :get_generative_questions_feature_config, request, options: options do |response, operation|
353
373
  yield response, operation if block_given?
354
- return response
355
374
  end
356
375
  rescue ::GRPC::BadStatus => e
357
376
  raise ::Google::Cloud::Error.from_error(e)
@@ -438,7 +457,6 @@ module Google
438
457
 
439
458
  @generative_question_service_stub.call_rpc :list_generative_question_configs, request, options: options do |response, operation|
440
459
  yield response, operation if block_given?
441
- return response
442
460
  end
443
461
  rescue ::GRPC::BadStatus => e
444
462
  raise ::Google::Cloud::Error.from_error(e)
@@ -532,7 +550,6 @@ module Google
532
550
 
533
551
  @generative_question_service_stub.call_rpc :update_generative_question_config, request, options: options do |response, operation|
534
552
  yield response, operation if block_given?
535
- return response
536
553
  end
537
554
  rescue ::GRPC::BadStatus => e
538
555
  raise ::Google::Cloud::Error.from_error(e)
@@ -621,7 +638,6 @@ module Google
621
638
 
622
639
  @generative_question_service_stub.call_rpc :batch_update_generative_question_configs, request, options: options do |response, operation|
623
640
  yield response, operation if block_given?
624
- return response
625
641
  end
626
642
  rescue ::GRPC::BadStatus => e
627
643
  raise ::Google::Cloud::Error.from_error(e)
@@ -710,6 +726,11 @@ module Google
710
726
  # default endpoint URL. The default value of nil uses the environment
711
727
  # universe (usually the default "googleapis.com" universe).
712
728
  # @return [::String,nil]
729
+ # @!attribute [rw] logger
730
+ # A custom logger to use for request/response debug logging, or the value
731
+ # `:default` (the default) to construct a default logger, or `nil` to
732
+ # explicitly disable logging.
733
+ # @return [::Logger,:default,nil]
713
734
  #
714
735
  class Configuration
715
736
  extend ::Gapic::Config
@@ -734,6 +755,7 @@ module Google
734
755
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
735
756
  config_attr :quota_project, nil, ::String, nil
736
757
  config_attr :universe_domain, nil, ::String, nil
758
+ config_attr :logger, :default, ::Logger, nil, :default
737
759
 
738
760
  # @private
739
761
  def initialize parent_config = nil
@@ -151,14 +151,26 @@ module Google
151
151
  endpoint: @config.endpoint,
152
152
  endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
153
153
  universe_domain: @config.universe_domain,
154
- credentials: credentials
154
+ credentials: credentials,
155
+ logger: @config.logger
155
156
  )
156
157
 
158
+ @generative_question_service_stub.logger(stub: true)&.info do |entry|
159
+ entry.set_system_name
160
+ entry.set_service
161
+ entry.message = "Created client for #{entry.service}"
162
+ entry.set_credentials_fields credentials
163
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
164
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
165
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
166
+ end
167
+
157
168
  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
158
169
  config.credentials = credentials
159
170
  config.quota_project = @quota_project_id
160
171
  config.endpoint = @generative_question_service_stub.endpoint
161
172
  config.universe_domain = @generative_question_service_stub.universe_domain
173
+ config.logger = @generative_question_service_stub.logger if config.respond_to? :logger=
162
174
  end
163
175
  end
164
176
 
@@ -169,6 +181,15 @@ module Google
169
181
  #
170
182
  attr_reader :location_client
171
183
 
184
+ ##
185
+ # The logger used for request/response debug logging.
186
+ #
187
+ # @return [Logger]
188
+ #
189
+ def logger
190
+ @generative_question_service_stub.logger
191
+ end
192
+
172
193
  # Service calls
173
194
 
174
195
  ##
@@ -249,7 +270,6 @@ module Google
249
270
 
250
271
  @generative_question_service_stub.update_generative_questions_feature_config request, options do |result, operation|
251
272
  yield result, operation if block_given?
252
- return result
253
273
  end
254
274
  rescue ::Gapic::Rest::Error => e
255
275
  raise ::Google::Cloud::Error.from_error(e)
@@ -330,7 +350,6 @@ module Google
330
350
 
331
351
  @generative_question_service_stub.get_generative_questions_feature_config request, options do |result, operation|
332
352
  yield result, operation if block_given?
333
- return result
334
353
  end
335
354
  rescue ::Gapic::Rest::Error => e
336
355
  raise ::Google::Cloud::Error.from_error(e)
@@ -410,7 +429,6 @@ module Google
410
429
 
411
430
  @generative_question_service_stub.list_generative_question_configs request, options do |result, operation|
412
431
  yield result, operation if block_given?
413
- return result
414
432
  end
415
433
  rescue ::Gapic::Rest::Error => e
416
434
  raise ::Google::Cloud::Error.from_error(e)
@@ -497,7 +515,6 @@ module Google
497
515
 
498
516
  @generative_question_service_stub.update_generative_question_config request, options do |result, operation|
499
517
  yield result, operation if block_given?
500
- return result
501
518
  end
502
519
  rescue ::Gapic::Rest::Error => e
503
520
  raise ::Google::Cloud::Error.from_error(e)
@@ -579,7 +596,6 @@ module Google
579
596
 
580
597
  @generative_question_service_stub.batch_update_generative_question_configs request, options do |result, operation|
581
598
  yield result, operation if block_given?
582
- return result
583
599
  end
584
600
  rescue ::Gapic::Rest::Error => e
585
601
  raise ::Google::Cloud::Error.from_error(e)
@@ -659,6 +675,11 @@ module Google
659
675
  # default endpoint URL. The default value of nil uses the environment
660
676
  # universe (usually the default "googleapis.com" universe).
661
677
  # @return [::String,nil]
678
+ # @!attribute [rw] logger
679
+ # A custom logger to use for request/response debug logging, or the value
680
+ # `:default` (the default) to construct a default logger, or `nil` to
681
+ # explicitly disable logging.
682
+ # @return [::Logger,:default,nil]
662
683
  #
663
684
  class Configuration
664
685
  extend ::Gapic::Config
@@ -680,6 +701,7 @@ module Google
680
701
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
681
702
  config_attr :quota_project, nil, ::String, nil
682
703
  config_attr :universe_domain, nil, ::String, nil
704
+ config_attr :logger, :default, ::Logger, nil, :default
683
705
 
684
706
  # @private
685
707
  def initialize parent_config = nil
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the update_generative_questions_feature_config REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "update_generative_questions_feature_config",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "get_generative_questions_feature_config",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Cloud::Retail::V2::GenerativeQuestionsFeatureConfig.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "list_generative_question_configs",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::Retail::V2::ListGenerativeQuestionConfigsResponse.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "update_generative_question_config",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::Retail::V2::GenerativeQuestionConfig.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "batch_update_generative_question_configs",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::Retail::V2::BatchUpdateGenerativeQuestionConfigsResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -181,14 +181,26 @@ module Google
181
181
  universe_domain: @config.universe_domain,
182
182
  channel_args: @config.channel_args,
183
183
  interceptors: @config.interceptors,
184
- channel_pool_config: @config.channel_pool
184
+ channel_pool_config: @config.channel_pool,
185
+ logger: @config.logger
185
186
  )
186
187
 
188
+ @model_service_stub.stub_logger&.info do |entry|
189
+ entry.set_system_name
190
+ entry.set_service
191
+ entry.message = "Created client for #{entry.service}"
192
+ entry.set_credentials_fields credentials
193
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
194
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
195
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
196
+ end
197
+
187
198
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
188
199
  config.credentials = credentials
189
200
  config.quota_project = @quota_project_id
190
201
  config.endpoint = @model_service_stub.endpoint
191
202
  config.universe_domain = @model_service_stub.universe_domain
203
+ config.logger = @model_service_stub.logger if config.respond_to? :logger=
192
204
  end
193
205
  end
194
206
 
@@ -206,6 +218,15 @@ module Google
206
218
  #
207
219
  attr_reader :location_client
208
220
 
221
+ ##
222
+ # The logger used for request/response debug logging.
223
+ #
224
+ # @return [Logger]
225
+ #
226
+ def logger
227
+ @model_service_stub.logger
228
+ end
229
+
209
230
  # Service calls
210
231
 
211
232
  ##
@@ -303,7 +324,7 @@ module Google
303
324
  @model_service_stub.call_rpc :create_model, request, options: options do |response, operation|
304
325
  response = ::Gapic::Operation.new response, @operations_client, options: options
305
326
  yield response, operation if block_given?
306
- return response
327
+ throw :response, response
307
328
  end
308
329
  rescue ::GRPC::BadStatus => e
309
330
  raise ::Google::Cloud::Error.from_error(e)
@@ -391,7 +412,6 @@ module Google
391
412
 
392
413
  @model_service_stub.call_rpc :get_model, request, options: options do |response, operation|
393
414
  yield response, operation if block_given?
394
- return response
395
415
  end
396
416
  rescue ::GRPC::BadStatus => e
397
417
  raise ::Google::Cloud::Error.from_error(e)
@@ -479,7 +499,6 @@ module Google
479
499
 
480
500
  @model_service_stub.call_rpc :pause_model, request, options: options do |response, operation|
481
501
  yield response, operation if block_given?
482
- return response
483
502
  end
484
503
  rescue ::GRPC::BadStatus => e
485
504
  raise ::Google::Cloud::Error.from_error(e)
@@ -567,7 +586,6 @@ module Google
567
586
 
568
587
  @model_service_stub.call_rpc :resume_model, request, options: options do |response, operation|
569
588
  yield response, operation if block_given?
570
- return response
571
589
  end
572
590
  rescue ::GRPC::BadStatus => e
573
591
  raise ::Google::Cloud::Error.from_error(e)
@@ -655,7 +673,6 @@ module Google
655
673
 
656
674
  @model_service_stub.call_rpc :delete_model, request, options: options do |response, operation|
657
675
  yield response, operation if block_given?
658
- return response
659
676
  end
660
677
  rescue ::GRPC::BadStatus => e
661
678
  raise ::Google::Cloud::Error.from_error(e)
@@ -754,7 +771,7 @@ module Google
754
771
  @model_service_stub.call_rpc :list_models, request, options: options do |response, operation|
755
772
  response = ::Gapic::PagedEnumerable.new @model_service_stub, :list_models, request, response, operation, options
756
773
  yield response, operation if block_given?
757
- return response
774
+ throw :response, response
758
775
  end
759
776
  rescue ::GRPC::BadStatus => e
760
777
  raise ::Google::Cloud::Error.from_error(e)
@@ -846,7 +863,6 @@ module Google
846
863
 
847
864
  @model_service_stub.call_rpc :update_model, request, options: options do |response, operation|
848
865
  yield response, operation if block_given?
849
- return response
850
866
  end
851
867
  rescue ::GRPC::BadStatus => e
852
868
  raise ::Google::Cloud::Error.from_error(e)
@@ -942,7 +958,7 @@ module Google
942
958
  @model_service_stub.call_rpc :tune_model, request, options: options do |response, operation|
943
959
  response = ::Gapic::Operation.new response, @operations_client, options: options
944
960
  yield response, operation if block_given?
945
- return response
961
+ throw :response, response
946
962
  end
947
963
  rescue ::GRPC::BadStatus => e
948
964
  raise ::Google::Cloud::Error.from_error(e)
@@ -1031,6 +1047,11 @@ module Google
1031
1047
  # default endpoint URL. The default value of nil uses the environment
1032
1048
  # universe (usually the default "googleapis.com" universe).
1033
1049
  # @return [::String,nil]
1050
+ # @!attribute [rw] logger
1051
+ # A custom logger to use for request/response debug logging, or the value
1052
+ # `:default` (the default) to construct a default logger, or `nil` to
1053
+ # explicitly disable logging.
1054
+ # @return [::Logger,:default,nil]
1034
1055
  #
1035
1056
  class Configuration
1036
1057
  extend ::Gapic::Config
@@ -1055,6 +1076,7 @@ module Google
1055
1076
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1056
1077
  config_attr :quota_project, nil, ::String, nil
1057
1078
  config_attr :universe_domain, nil, ::String, nil
1079
+ config_attr :logger, :default, ::Logger, nil, :default
1058
1080
 
1059
1081
  # @private
1060
1082
  def initialize parent_config = nil