google-cloud-retail-v2 1.0.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +30 -20
- data/lib/google/cloud/retail/v2/analytics_service/client.rb +29 -2
- data/lib/google/cloud/retail/v2/analytics_service/operations.rb +12 -15
- data/lib/google/cloud/retail/v2/analytics_service/rest/client.rb +29 -2
- data/lib/google/cloud/retail/v2/analytics_service/rest/operations.rb +43 -38
- data/lib/google/cloud/retail/v2/analytics_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +29 -12
- data/lib/google/cloud/retail/v2/catalog_service/rest/client.rb +29 -12
- data/lib/google/cloud/retail/v2/catalog_service/rest/service_stub.rb +102 -68
- data/lib/google/cloud/retail/v2/completion_service/client.rb +31 -5
- data/lib/google/cloud/retail/v2/completion_service/operations.rb +12 -15
- data/lib/google/cloud/retail/v2/completion_service/rest/client.rb +31 -5
- data/lib/google/cloud/retail/v2/completion_service/rest/operations.rb +43 -38
- data/lib/google/cloud/retail/v2/completion_service/rest/service_stub.rb +30 -14
- data/lib/google/cloud/retail/v2/completion_service_pb.rb +2 -1
- data/lib/google/cloud/retail/v2/control_service/client.rb +29 -6
- data/lib/google/cloud/retail/v2/control_service/rest/client.rb +29 -6
- data/lib/google/cloud/retail/v2/control_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/retail/v2/generative_question_pb.rb +45 -0
- data/lib/google/cloud/retail/v2/generative_question_service/client.rb +853 -0
- data/lib/google/cloud/retail/v2/generative_question_service/credentials.rb +51 -0
- data/lib/google/cloud/retail/v2/generative_question_service/paths.rb +52 -0
- data/lib/google/cloud/retail/v2/generative_question_service/rest/client.rb +792 -0
- data/lib/google/cloud/retail/v2/generative_question_service/rest/service_stub.rb +389 -0
- data/lib/google/cloud/retail/v2/generative_question_service/rest.rb +52 -0
- data/lib/google/cloud/retail/v2/generative_question_service.rb +55 -0
- data/lib/google/cloud/retail/v2/generative_question_service_pb.rb +57 -0
- data/lib/google/cloud/retail/v2/generative_question_service_services_pb.rb +55 -0
- data/lib/google/cloud/retail/v2/model_service/client.rb +31 -9
- data/lib/google/cloud/retail/v2/model_service/operations.rb +12 -15
- data/lib/google/cloud/retail/v2/model_service/rest/client.rb +31 -9
- data/lib/google/cloud/retail/v2/model_service/rest/operations.rb +43 -38
- data/lib/google/cloud/retail/v2/model_service/rest/service_stub.rb +78 -50
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +28 -2
- data/lib/google/cloud/retail/v2/prediction_service/rest/client.rb +28 -2
- data/lib/google/cloud/retail/v2/prediction_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/retail/v2/product_service/client.rb +36 -13
- data/lib/google/cloud/retail/v2/product_service/operations.rb +12 -15
- data/lib/google/cloud/retail/v2/product_service/rest/client.rb +36 -13
- data/lib/google/cloud/retail/v2/product_service/rest/operations.rb +43 -38
- data/lib/google/cloud/retail/v2/product_service/rest/service_stub.rb +110 -74
- data/lib/google/cloud/retail/v2/rest.rb +1 -0
- data/lib/google/cloud/retail/v2/search_service/client.rb +35 -3
- data/lib/google/cloud/retail/v2/search_service/rest/client.rb +34 -3
- data/lib/google/cloud/retail/v2/search_service/rest/service_stub.rb +22 -8
- data/lib/google/cloud/retail/v2/search_service_pb.rb +13 -2
- data/lib/google/cloud/retail/v2/serving_config_service/client.rb +29 -8
- data/lib/google/cloud/retail/v2/serving_config_service/rest/client.rb +29 -8
- data/lib/google/cloud/retail/v2/serving_config_service/rest/service_stub.rb +70 -44
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +31 -6
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +12 -15
- data/lib/google/cloud/retail/v2/user_event_service/rest/client.rb +31 -6
- data/lib/google/cloud/retail/v2/user_event_service/rest/operations.rb +43 -38
- data/lib/google/cloud/retail/v2/user_event_service/rest/service_stub.rb +54 -32
- data/lib/google/cloud/retail/v2/version.rb +1 -1
- data/lib/google/cloud/retail/v2.rb +1 -0
- data/proto_docs/google/api/client.rb +39 -0
- data/proto_docs/google/cloud/retail/v2/common.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/completion_service.rb +30 -2
- data/proto_docs/google/cloud/retail/v2/generative_question.rb +75 -0
- data/proto_docs/google/cloud/retail/v2/generative_question_service.rb +109 -0
- data/proto_docs/google/cloud/retail/v2/product.rb +9 -2
- data/proto_docs/google/cloud/retail/v2/search_service.rb +204 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +17 -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
|
-
|
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
|
-
|
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_model 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:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "create_model",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
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:
|
129
|
-
body:
|
130
|
-
params:
|
142
|
+
uri: uri,
|
143
|
+
body: body || "",
|
144
|
+
params: query_string_params,
|
145
|
+
method_name: "get_model",
|
131
146
|
options: options
|
132
147
|
)
|
133
148
|
operation = ::Gapic::Rest::TransportOperation.new response
|
134
149
|
result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true
|
135
|
-
|
136
|
-
|
137
|
-
|
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:
|
167
|
-
body:
|
168
|
-
params:
|
182
|
+
uri: uri,
|
183
|
+
body: body || "",
|
184
|
+
params: query_string_params,
|
185
|
+
method_name: "pause_model",
|
169
186
|
options: options
|
170
187
|
)
|
171
188
|
operation = ::Gapic::Rest::TransportOperation.new response
|
172
189
|
result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true
|
173
|
-
|
174
|
-
|
175
|
-
|
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:
|
205
|
-
body:
|
206
|
-
params:
|
222
|
+
uri: uri,
|
223
|
+
body: body || "",
|
224
|
+
params: query_string_params,
|
225
|
+
method_name: "resume_model",
|
207
226
|
options: options
|
208
227
|
)
|
209
228
|
operation = ::Gapic::Rest::TransportOperation.new response
|
210
229
|
result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true
|
211
|
-
|
212
|
-
|
213
|
-
|
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:
|
243
|
-
body:
|
244
|
-
params:
|
262
|
+
uri: uri,
|
263
|
+
body: body || "",
|
264
|
+
params: query_string_params,
|
265
|
+
method_name: "delete_model",
|
245
266
|
options: options
|
246
267
|
)
|
247
268
|
operation = ::Gapic::Rest::TransportOperation.new response
|
248
269
|
result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
|
249
|
-
|
250
|
-
|
251
|
-
|
270
|
+
catch :response do
|
271
|
+
yield result, operation if block_given?
|
272
|
+
result
|
273
|
+
end
|
252
274
|
end
|
253
275
|
|
254
276
|
##
|
@@ -277,16 +299,18 @@ module Google
|
|
277
299
|
|
278
300
|
response = @client_stub.make_http_request(
|
279
301
|
verb,
|
280
|
-
uri:
|
281
|
-
body:
|
282
|
-
params:
|
302
|
+
uri: uri,
|
303
|
+
body: body || "",
|
304
|
+
params: query_string_params,
|
305
|
+
method_name: "list_models",
|
283
306
|
options: options
|
284
307
|
)
|
285
308
|
operation = ::Gapic::Rest::TransportOperation.new response
|
286
309
|
result = ::Google::Cloud::Retail::V2::ListModelsResponse.decode_json response.body, ignore_unknown_fields: true
|
287
|
-
|
288
|
-
|
289
|
-
|
310
|
+
catch :response do
|
311
|
+
yield result, operation if block_given?
|
312
|
+
result
|
313
|
+
end
|
290
314
|
end
|
291
315
|
|
292
316
|
##
|
@@ -315,16 +339,18 @@ module Google
|
|
315
339
|
|
316
340
|
response = @client_stub.make_http_request(
|
317
341
|
verb,
|
318
|
-
uri:
|
319
|
-
body:
|
320
|
-
params:
|
342
|
+
uri: uri,
|
343
|
+
body: body || "",
|
344
|
+
params: query_string_params,
|
345
|
+
method_name: "update_model",
|
321
346
|
options: options
|
322
347
|
)
|
323
348
|
operation = ::Gapic::Rest::TransportOperation.new response
|
324
349
|
result = ::Google::Cloud::Retail::V2::Model.decode_json response.body, ignore_unknown_fields: true
|
325
|
-
|
326
|
-
|
327
|
-
|
350
|
+
catch :response do
|
351
|
+
yield result, operation if block_given?
|
352
|
+
result
|
353
|
+
end
|
328
354
|
end
|
329
355
|
|
330
356
|
##
|
@@ -353,16 +379,18 @@ module Google
|
|
353
379
|
|
354
380
|
response = @client_stub.make_http_request(
|
355
381
|
verb,
|
356
|
-
uri:
|
357
|
-
body:
|
358
|
-
params:
|
382
|
+
uri: uri,
|
383
|
+
body: body || "",
|
384
|
+
params: query_string_params,
|
385
|
+
method_name: "tune_model",
|
359
386
|
options: options
|
360
387
|
)
|
361
388
|
operation = ::Gapic::Rest::TransportOperation.new response
|
362
389
|
result = ::Google::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true
|
363
|
-
|
364
|
-
|
365
|
-
|
390
|
+
catch :response do
|
391
|
+
yield result, operation if block_given?
|
392
|
+
result
|
393
|
+
end
|
366
394
|
end
|
367
395
|
|
368
396
|
##
|
@@ -163,14 +163,26 @@ 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
|
)
|
168
169
|
|
170
|
+
@prediction_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
|
+
|
169
180
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
170
181
|
config.credentials = credentials
|
171
182
|
config.quota_project = @quota_project_id
|
172
183
|
config.endpoint = @prediction_service_stub.endpoint
|
173
184
|
config.universe_domain = @prediction_service_stub.universe_domain
|
185
|
+
config.logger = @prediction_service_stub.logger if config.respond_to? :logger=
|
174
186
|
end
|
175
187
|
end
|
176
188
|
|
@@ -181,6 +193,15 @@ module Google
|
|
181
193
|
#
|
182
194
|
attr_reader :location_client
|
183
195
|
|
196
|
+
##
|
197
|
+
# The logger used for request/response debug logging.
|
198
|
+
#
|
199
|
+
# @return [Logger]
|
200
|
+
#
|
201
|
+
def logger
|
202
|
+
@prediction_service_stub.logger
|
203
|
+
end
|
204
|
+
|
184
205
|
# Service calls
|
185
206
|
|
186
207
|
##
|
@@ -389,7 +410,6 @@ module Google
|
|
389
410
|
|
390
411
|
@prediction_service_stub.call_rpc :predict, request, options: options do |response, operation|
|
391
412
|
yield response, operation if block_given?
|
392
|
-
return response
|
393
413
|
end
|
394
414
|
rescue ::GRPC::BadStatus => e
|
395
415
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -478,6 +498,11 @@ module Google
|
|
478
498
|
# default endpoint URL. The default value of nil uses the environment
|
479
499
|
# universe (usually the default "googleapis.com" universe).
|
480
500
|
# @return [::String,nil]
|
501
|
+
# @!attribute [rw] logger
|
502
|
+
# A custom logger to use for request/response debug logging, or the value
|
503
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
504
|
+
# explicitly disable logging.
|
505
|
+
# @return [::Logger,:default,nil]
|
481
506
|
#
|
482
507
|
class Configuration
|
483
508
|
extend ::Gapic::Config
|
@@ -502,6 +527,7 @@ module Google
|
|
502
527
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
503
528
|
config_attr :quota_project, nil, ::String, nil
|
504
529
|
config_attr :universe_domain, nil, ::String, nil
|
530
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
505
531
|
|
506
532
|
# @private
|
507
533
|
def initialize parent_config = nil
|
@@ -156,14 +156,26 @@ 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
|
)
|
161
162
|
|
163
|
+
@prediction_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
|
+
|
162
173
|
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
163
174
|
config.credentials = credentials
|
164
175
|
config.quota_project = @quota_project_id
|
165
176
|
config.endpoint = @prediction_service_stub.endpoint
|
166
177
|
config.universe_domain = @prediction_service_stub.universe_domain
|
178
|
+
config.logger = @prediction_service_stub.logger if config.respond_to? :logger=
|
167
179
|
end
|
168
180
|
end
|
169
181
|
|
@@ -174,6 +186,15 @@ module Google
|
|
174
186
|
#
|
175
187
|
attr_reader :location_client
|
176
188
|
|
189
|
+
##
|
190
|
+
# The logger used for request/response debug logging.
|
191
|
+
#
|
192
|
+
# @return [Logger]
|
193
|
+
#
|
194
|
+
def logger
|
195
|
+
@prediction_service_stub.logger
|
196
|
+
end
|
197
|
+
|
177
198
|
# Service calls
|
178
199
|
|
179
200
|
##
|
@@ -375,7 +396,6 @@ module Google
|
|
375
396
|
|
376
397
|
@prediction_service_stub.predict request, options do |result, operation|
|
377
398
|
yield result, operation if block_given?
|
378
|
-
return result
|
379
399
|
end
|
380
400
|
rescue ::Gapic::Rest::Error => e
|
381
401
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -455,6 +475,11 @@ module Google
|
|
455
475
|
# default endpoint URL. The default value of nil uses the environment
|
456
476
|
# universe (usually the default "googleapis.com" universe).
|
457
477
|
# @return [::String,nil]
|
478
|
+
# @!attribute [rw] logger
|
479
|
+
# A custom logger to use for request/response debug logging, or the value
|
480
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
481
|
+
# explicitly disable logging.
|
482
|
+
# @return [::Logger,:default,nil]
|
458
483
|
#
|
459
484
|
class Configuration
|
460
485
|
extend ::Gapic::Config
|
@@ -476,6 +501,7 @@ module Google
|
|
476
501
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
477
502
|
config_attr :quota_project, nil, ::String, nil
|
478
503
|
config_attr :universe_domain, nil, ::String, nil
|
504
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
479
505
|
|
480
506
|
# @private
|
481
507
|
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
|
-
|
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
|
-
|
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 predict 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:
|
91
|
-
body:
|
92
|
-
params:
|
102
|
+
uri: uri,
|
103
|
+
body: body || "",
|
104
|
+
params: query_string_params,
|
105
|
+
method_name: "predict",
|
93
106
|
options: options
|
94
107
|
)
|
95
108
|
operation = ::Gapic::Rest::TransportOperation.new response
|
96
109
|
result = ::Google::Cloud::Retail::V2::PredictResponse.decode_json response.body, ignore_unknown_fields: true
|
97
|
-
|
98
|
-
|
99
|
-
|
110
|
+
catch :response do
|
111
|
+
yield result, operation if block_given?
|
112
|
+
result
|
113
|
+
end
|
100
114
|
end
|
101
115
|
|
102
116
|
##
|
@@ -176,14 +176,26 @@ module Google
|
|
176
176
|
universe_domain: @config.universe_domain,
|
177
177
|
channel_args: @config.channel_args,
|
178
178
|
interceptors: @config.interceptors,
|
179
|
-
channel_pool_config: @config.channel_pool
|
179
|
+
channel_pool_config: @config.channel_pool,
|
180
|
+
logger: @config.logger
|
180
181
|
)
|
181
182
|
|
183
|
+
@product_service_stub.stub_logger&.info do |entry|
|
184
|
+
entry.set_system_name
|
185
|
+
entry.set_service
|
186
|
+
entry.message = "Created client for #{entry.service}"
|
187
|
+
entry.set_credentials_fields credentials
|
188
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
189
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
190
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
191
|
+
end
|
192
|
+
|
182
193
|
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
183
194
|
config.credentials = credentials
|
184
195
|
config.quota_project = @quota_project_id
|
185
196
|
config.endpoint = @product_service_stub.endpoint
|
186
197
|
config.universe_domain = @product_service_stub.universe_domain
|
198
|
+
config.logger = @product_service_stub.logger if config.respond_to? :logger=
|
187
199
|
end
|
188
200
|
end
|
189
201
|
|
@@ -201,6 +213,15 @@ module Google
|
|
201
213
|
#
|
202
214
|
attr_reader :location_client
|
203
215
|
|
216
|
+
##
|
217
|
+
# The logger used for request/response debug logging.
|
218
|
+
#
|
219
|
+
# @return [Logger]
|
220
|
+
#
|
221
|
+
def logger
|
222
|
+
@product_service_stub.logger
|
223
|
+
end
|
224
|
+
|
204
225
|
# Service calls
|
205
226
|
|
206
227
|
##
|
@@ -302,7 +323,6 @@ module Google
|
|
302
323
|
|
303
324
|
@product_service_stub.call_rpc :create_product, request, options: options do |response, operation|
|
304
325
|
yield response, operation if block_given?
|
305
|
-
return response
|
306
326
|
end
|
307
327
|
rescue ::GRPC::BadStatus => e
|
308
328
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -397,7 +417,6 @@ module Google
|
|
397
417
|
|
398
418
|
@product_service_stub.call_rpc :get_product, request, options: options do |response, operation|
|
399
419
|
yield response, operation if block_given?
|
400
|
-
return response
|
401
420
|
end
|
402
421
|
rescue ::GRPC::BadStatus => e
|
403
422
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -559,7 +578,7 @@ module Google
|
|
559
578
|
@product_service_stub.call_rpc :list_products, request, options: options do |response, operation|
|
560
579
|
response = ::Gapic::PagedEnumerable.new @product_service_stub, :list_products, request, response, operation, options
|
561
580
|
yield response, operation if block_given?
|
562
|
-
|
581
|
+
throw :response, response
|
563
582
|
end
|
564
583
|
rescue ::GRPC::BadStatus => e
|
565
584
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -671,7 +690,6 @@ module Google
|
|
671
690
|
|
672
691
|
@product_service_stub.call_rpc :update_product, request, options: options do |response, operation|
|
673
692
|
yield response, operation if block_given?
|
674
|
-
return response
|
675
693
|
end
|
676
694
|
rescue ::GRPC::BadStatus => e
|
677
695
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -777,7 +795,6 @@ module Google
|
|
777
795
|
|
778
796
|
@product_service_stub.call_rpc :delete_product, request, options: options do |response, operation|
|
779
797
|
yield response, operation if block_given?
|
780
|
-
return response
|
781
798
|
end
|
782
799
|
rescue ::GRPC::BadStatus => e
|
783
800
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -933,7 +950,7 @@ module Google
|
|
933
950
|
@product_service_stub.call_rpc :purge_products, request, options: options do |response, operation|
|
934
951
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
935
952
|
yield response, operation if block_given?
|
936
|
-
|
953
|
+
throw :response, response
|
937
954
|
end
|
938
955
|
rescue ::GRPC::BadStatus => e
|
939
956
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1068,7 +1085,7 @@ module Google
|
|
1068
1085
|
@product_service_stub.call_rpc :import_products, request, options: options do |response, operation|
|
1069
1086
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1070
1087
|
yield response, operation if block_given?
|
1071
|
-
|
1088
|
+
throw :response, response
|
1072
1089
|
end
|
1073
1090
|
rescue ::GRPC::BadStatus => e
|
1074
1091
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1286,7 +1303,7 @@ module Google
|
|
1286
1303
|
@product_service_stub.call_rpc :set_inventory, request, options: options do |response, operation|
|
1287
1304
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1288
1305
|
yield response, operation if block_given?
|
1289
|
-
|
1306
|
+
throw :response, response
|
1290
1307
|
end
|
1291
1308
|
rescue ::GRPC::BadStatus => e
|
1292
1309
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1463,7 +1480,7 @@ module Google
|
|
1463
1480
|
@product_service_stub.call_rpc :add_fulfillment_places, request, options: options do |response, operation|
|
1464
1481
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1465
1482
|
yield response, operation if block_given?
|
1466
|
-
|
1483
|
+
throw :response, response
|
1467
1484
|
end
|
1468
1485
|
rescue ::GRPC::BadStatus => e
|
1469
1486
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1635,7 +1652,7 @@ module Google
|
|
1635
1652
|
@product_service_stub.call_rpc :remove_fulfillment_places, request, options: options do |response, operation|
|
1636
1653
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1637
1654
|
yield response, operation if block_given?
|
1638
|
-
|
1655
|
+
throw :response, response
|
1639
1656
|
end
|
1640
1657
|
rescue ::GRPC::BadStatus => e
|
1641
1658
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1792,7 +1809,7 @@ module Google
|
|
1792
1809
|
@product_service_stub.call_rpc :add_local_inventories, request, options: options do |response, operation|
|
1793
1810
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1794
1811
|
yield response, operation if block_given?
|
1795
|
-
|
1812
|
+
throw :response, response
|
1796
1813
|
end
|
1797
1814
|
rescue ::GRPC::BadStatus => e
|
1798
1815
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -1931,7 +1948,7 @@ module Google
|
|
1931
1948
|
@product_service_stub.call_rpc :remove_local_inventories, request, options: options do |response, operation|
|
1932
1949
|
response = ::Gapic::Operation.new response, @operations_client, options: options
|
1933
1950
|
yield response, operation if block_given?
|
1934
|
-
|
1951
|
+
throw :response, response
|
1935
1952
|
end
|
1936
1953
|
rescue ::GRPC::BadStatus => e
|
1937
1954
|
raise ::Google::Cloud::Error.from_error(e)
|
@@ -2020,6 +2037,11 @@ module Google
|
|
2020
2037
|
# default endpoint URL. The default value of nil uses the environment
|
2021
2038
|
# universe (usually the default "googleapis.com" universe).
|
2022
2039
|
# @return [::String,nil]
|
2040
|
+
# @!attribute [rw] logger
|
2041
|
+
# A custom logger to use for request/response debug logging, or the value
|
2042
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
2043
|
+
# explicitly disable logging.
|
2044
|
+
# @return [::Logger,:default,nil]
|
2023
2045
|
#
|
2024
2046
|
class Configuration
|
2025
2047
|
extend ::Gapic::Config
|
@@ -2044,6 +2066,7 @@ module Google
|
|
2044
2066
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
2045
2067
|
config_attr :quota_project, nil, ::String, nil
|
2046
2068
|
config_attr :universe_domain, nil, ::String, nil
|
2069
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
2047
2070
|
|
2048
2071
|
# @private
|
2049
2072
|
def initialize parent_config = nil
|