google-cloud-retail 1.10.0 → 2.0.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 +31 -1
- data/lib/google/cloud/retail/version.rb +1 -1
- data/lib/google/cloud/retail.rb +396 -0
- metadata +6 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 24c9ba0a3e71adcd920e6cd79652cd251ecb31d3da31853f862aeee9851dcef1
|
4
|
+
data.tar.gz: 164f56e1d4e94588c2a3b8943bbf4d1c909ebd2f70ec4003bbd68d6322fae42d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8ae689c7272df9caf29f8e97fc63acdd2b4d5eb852c545656dacbc98442685dfe04370df04d4aaa437bc22b63902c48b0598c69c91babdafa4e8786441b7e82
|
7
|
+
data.tar.gz: 7b9bd0048680ae6903631c37adb00a23a0468b30eed9e7ac3c18ba0bd54ab92d670fc73d0e6e4aaac85a41eeedeabb530adf86d398df711b263caa249d430615
|
data/README.md
CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/retail.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
+
## Debug Logging
|
38
|
+
|
39
|
+
This library comes with opt-in Debug Logging that can help you troubleshoot
|
40
|
+
your application's integration with the API. When logging is activated, key
|
41
|
+
events such as requests and responses, along with data payloads and metadata
|
42
|
+
such as headers and client configuration, are logged to the standard error
|
43
|
+
stream.
|
44
|
+
|
45
|
+
**WARNING:** Client Library Debug Logging includes your data payloads in
|
46
|
+
plaintext, which could include sensitive data such as PII for yourself or your
|
47
|
+
customers, private keys, or other security data that could be compromising if
|
48
|
+
leaked. Always practice good data hygiene with your application logs, and follow
|
49
|
+
the principle of least access. Google also recommends that Client Library Debug
|
50
|
+
Logging be enabled only temporarily during active debugging, and not used
|
51
|
+
permanently in production.
|
52
|
+
|
53
|
+
To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
|
54
|
+
to the value `all`. Alternatively, you can set the value to a comma-delimited
|
55
|
+
list of client library gem names. This will select the default logging behavior,
|
56
|
+
which writes logs to the standard error stream. On a local workstation, this may
|
57
|
+
result in logs appearing on the console. When running on a Google Cloud hosting
|
58
|
+
service such as [Google Cloud Run](https://cloud.google.com/run), this generally
|
59
|
+
results in logs appearing alongside your application logs in the
|
60
|
+
[Google Cloud Logging](https://cloud.google.com/logging/) service.
|
61
|
+
|
62
|
+
Debug logging also requires that the versioned clients for this service be
|
63
|
+
sufficiently recent, released after about Dec 10, 2024. If logging is not
|
64
|
+
working, try updating the versioned clients in your bundle or installed gems:
|
65
|
+
[google-cloud-retail-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-retail-v2/latest).
|
66
|
+
|
37
67
|
## Supported Ruby Versions
|
38
68
|
|
39
|
-
This library is supported on Ruby
|
69
|
+
This library is supported on Ruby 3.0+.
|
40
70
|
|
41
71
|
Google provides official support for Ruby versions that are actively supported
|
42
72
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
data/lib/google/cloud/retail.rb
CHANGED
@@ -58,6 +58,11 @@ module Google
|
|
58
58
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
59
59
|
# the `transport` parameter.
|
60
60
|
#
|
61
|
+
# Raises an exception if the currently installed versioned client gem for the
|
62
|
+
# given API version does not support the given transport of the AnalyticsService service.
|
63
|
+
# You can determine whether the method will succeed by calling
|
64
|
+
# {Google::Cloud::Retail.analytics_service_available?}.
|
65
|
+
#
|
61
66
|
# ## About AnalyticsService
|
62
67
|
#
|
63
68
|
# Service for managing & accessing retail search business metric.
|
@@ -80,6 +85,37 @@ module Google
|
|
80
85
|
service_module.const_get(:Client).new(&block)
|
81
86
|
end
|
82
87
|
|
88
|
+
##
|
89
|
+
# Determines whether the AnalyticsService service is supported by the current client.
|
90
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.analytics_service}.
|
91
|
+
# If false, that method will raise an exception. This could happen if the given
|
92
|
+
# API version does not exist or does not support the AnalyticsService service,
|
93
|
+
# or if the versioned client gem needs an update to support the AnalyticsService service.
|
94
|
+
#
|
95
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
96
|
+
# Defaults to `:v2`.
|
97
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
98
|
+
# @return [boolean] Whether the service is available.
|
99
|
+
#
|
100
|
+
def self.analytics_service_available? version: :v2, transport: :grpc
|
101
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
102
|
+
package_name = Google::Cloud::Retail
|
103
|
+
.constants
|
104
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
105
|
+
.first
|
106
|
+
return false unless package_name
|
107
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
108
|
+
return false unless service_module.const_defined? :AnalyticsService
|
109
|
+
service_module = service_module.const_get :AnalyticsService
|
110
|
+
if transport == :rest
|
111
|
+
return false unless service_module.const_defined? :Rest
|
112
|
+
service_module = service_module.const_get :Rest
|
113
|
+
end
|
114
|
+
service_module.const_defined? :Client
|
115
|
+
rescue ::LoadError
|
116
|
+
false
|
117
|
+
end
|
118
|
+
|
83
119
|
##
|
84
120
|
# Create a new client object for CatalogService.
|
85
121
|
#
|
@@ -93,6 +129,11 @@ module Google
|
|
93
129
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
94
130
|
# the `transport` parameter.
|
95
131
|
#
|
132
|
+
# Raises an exception if the currently installed versioned client gem for the
|
133
|
+
# given API version does not support the given transport of the CatalogService service.
|
134
|
+
# You can determine whether the method will succeed by calling
|
135
|
+
# {Google::Cloud::Retail.catalog_service_available?}.
|
136
|
+
#
|
96
137
|
# ## About CatalogService
|
97
138
|
#
|
98
139
|
# Service for managing catalog configuration.
|
@@ -114,6 +155,37 @@ module Google
|
|
114
155
|
service_module.const_get(:Client).new(&block)
|
115
156
|
end
|
116
157
|
|
158
|
+
##
|
159
|
+
# Determines whether the CatalogService service is supported by the current client.
|
160
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.catalog_service}.
|
161
|
+
# If false, that method will raise an exception. This could happen if the given
|
162
|
+
# API version does not exist or does not support the CatalogService service,
|
163
|
+
# or if the versioned client gem needs an update to support the CatalogService service.
|
164
|
+
#
|
165
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
166
|
+
# Defaults to `:v2`.
|
167
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
168
|
+
# @return [boolean] Whether the service is available.
|
169
|
+
#
|
170
|
+
def self.catalog_service_available? version: :v2, transport: :grpc
|
171
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
172
|
+
package_name = Google::Cloud::Retail
|
173
|
+
.constants
|
174
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
175
|
+
.first
|
176
|
+
return false unless package_name
|
177
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
178
|
+
return false unless service_module.const_defined? :CatalogService
|
179
|
+
service_module = service_module.const_get :CatalogService
|
180
|
+
if transport == :rest
|
181
|
+
return false unless service_module.const_defined? :Rest
|
182
|
+
service_module = service_module.const_get :Rest
|
183
|
+
end
|
184
|
+
service_module.const_defined? :Client
|
185
|
+
rescue ::LoadError
|
186
|
+
false
|
187
|
+
end
|
188
|
+
|
117
189
|
##
|
118
190
|
# Create a new client object for CompletionService.
|
119
191
|
#
|
@@ -127,6 +199,11 @@ module Google
|
|
127
199
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
128
200
|
# the `transport` parameter.
|
129
201
|
#
|
202
|
+
# Raises an exception if the currently installed versioned client gem for the
|
203
|
+
# given API version does not support the given transport of the CompletionService service.
|
204
|
+
# You can determine whether the method will succeed by calling
|
205
|
+
# {Google::Cloud::Retail.completion_service_available?}.
|
206
|
+
#
|
130
207
|
# ## About CompletionService
|
131
208
|
#
|
132
209
|
# Autocomplete service for retail.
|
@@ -151,6 +228,37 @@ module Google
|
|
151
228
|
service_module.const_get(:Client).new(&block)
|
152
229
|
end
|
153
230
|
|
231
|
+
##
|
232
|
+
# Determines whether the CompletionService service is supported by the current client.
|
233
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.completion_service}.
|
234
|
+
# If false, that method will raise an exception. This could happen if the given
|
235
|
+
# API version does not exist or does not support the CompletionService service,
|
236
|
+
# or if the versioned client gem needs an update to support the CompletionService service.
|
237
|
+
#
|
238
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
239
|
+
# Defaults to `:v2`.
|
240
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
241
|
+
# @return [boolean] Whether the service is available.
|
242
|
+
#
|
243
|
+
def self.completion_service_available? version: :v2, transport: :grpc
|
244
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
245
|
+
package_name = Google::Cloud::Retail
|
246
|
+
.constants
|
247
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
248
|
+
.first
|
249
|
+
return false unless package_name
|
250
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
251
|
+
return false unless service_module.const_defined? :CompletionService
|
252
|
+
service_module = service_module.const_get :CompletionService
|
253
|
+
if transport == :rest
|
254
|
+
return false unless service_module.const_defined? :Rest
|
255
|
+
service_module = service_module.const_get :Rest
|
256
|
+
end
|
257
|
+
service_module.const_defined? :Client
|
258
|
+
rescue ::LoadError
|
259
|
+
false
|
260
|
+
end
|
261
|
+
|
154
262
|
##
|
155
263
|
# Create a new client object for ControlService.
|
156
264
|
#
|
@@ -164,6 +272,11 @@ module Google
|
|
164
272
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
165
273
|
# the `transport` parameter.
|
166
274
|
#
|
275
|
+
# Raises an exception if the currently installed versioned client gem for the
|
276
|
+
# given API version does not support the given transport of the ControlService service.
|
277
|
+
# You can determine whether the method will succeed by calling
|
278
|
+
# {Google::Cloud::Retail.control_service_available?}.
|
279
|
+
#
|
167
280
|
# ## About ControlService
|
168
281
|
#
|
169
282
|
# Service for modifying Control.
|
@@ -185,6 +298,37 @@ module Google
|
|
185
298
|
service_module.const_get(:Client).new(&block)
|
186
299
|
end
|
187
300
|
|
301
|
+
##
|
302
|
+
# Determines whether the ControlService service is supported by the current client.
|
303
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.control_service}.
|
304
|
+
# If false, that method will raise an exception. This could happen if the given
|
305
|
+
# API version does not exist or does not support the ControlService service,
|
306
|
+
# or if the versioned client gem needs an update to support the ControlService service.
|
307
|
+
#
|
308
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
309
|
+
# Defaults to `:v2`.
|
310
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
311
|
+
# @return [boolean] Whether the service is available.
|
312
|
+
#
|
313
|
+
def self.control_service_available? version: :v2, transport: :grpc
|
314
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
315
|
+
package_name = Google::Cloud::Retail
|
316
|
+
.constants
|
317
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
318
|
+
.first
|
319
|
+
return false unless package_name
|
320
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
321
|
+
return false unless service_module.const_defined? :ControlService
|
322
|
+
service_module = service_module.const_get :ControlService
|
323
|
+
if transport == :rest
|
324
|
+
return false unless service_module.const_defined? :Rest
|
325
|
+
service_module = service_module.const_get :Rest
|
326
|
+
end
|
327
|
+
service_module.const_defined? :Client
|
328
|
+
rescue ::LoadError
|
329
|
+
false
|
330
|
+
end
|
331
|
+
|
188
332
|
##
|
189
333
|
# Create a new client object for GenerativeQuestionService.
|
190
334
|
#
|
@@ -198,6 +342,11 @@ module Google
|
|
198
342
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
199
343
|
# the `transport` parameter.
|
200
344
|
#
|
345
|
+
# Raises an exception if the currently installed versioned client gem for the
|
346
|
+
# given API version does not support the given transport of the GenerativeQuestionService service.
|
347
|
+
# You can determine whether the method will succeed by calling
|
348
|
+
# {Google::Cloud::Retail.generative_question_service_available?}.
|
349
|
+
#
|
201
350
|
# ## About GenerativeQuestionService
|
202
351
|
#
|
203
352
|
# Service for managing LLM generated questions in search serving.
|
@@ -219,6 +368,37 @@ module Google
|
|
219
368
|
service_module.const_get(:Client).new(&block)
|
220
369
|
end
|
221
370
|
|
371
|
+
##
|
372
|
+
# Determines whether the GenerativeQuestionService service is supported by the current client.
|
373
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.generative_question_service}.
|
374
|
+
# If false, that method will raise an exception. This could happen if the given
|
375
|
+
# API version does not exist or does not support the GenerativeQuestionService service,
|
376
|
+
# or if the versioned client gem needs an update to support the GenerativeQuestionService service.
|
377
|
+
#
|
378
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
379
|
+
# Defaults to `:v2`.
|
380
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
381
|
+
# @return [boolean] Whether the service is available.
|
382
|
+
#
|
383
|
+
def self.generative_question_service_available? version: :v2, transport: :grpc
|
384
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
385
|
+
package_name = Google::Cloud::Retail
|
386
|
+
.constants
|
387
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
388
|
+
.first
|
389
|
+
return false unless package_name
|
390
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
391
|
+
return false unless service_module.const_defined? :GenerativeQuestionService
|
392
|
+
service_module = service_module.const_get :GenerativeQuestionService
|
393
|
+
if transport == :rest
|
394
|
+
return false unless service_module.const_defined? :Rest
|
395
|
+
service_module = service_module.const_get :Rest
|
396
|
+
end
|
397
|
+
service_module.const_defined? :Client
|
398
|
+
rescue ::LoadError
|
399
|
+
false
|
400
|
+
end
|
401
|
+
|
222
402
|
##
|
223
403
|
# Create a new client object for ModelService.
|
224
404
|
#
|
@@ -232,6 +412,11 @@ module Google
|
|
232
412
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
233
413
|
# the `transport` parameter.
|
234
414
|
#
|
415
|
+
# Raises an exception if the currently installed versioned client gem for the
|
416
|
+
# given API version does not support the given transport of the ModelService service.
|
417
|
+
# You can determine whether the method will succeed by calling
|
418
|
+
# {Google::Cloud::Retail.model_service_available?}.
|
419
|
+
#
|
235
420
|
# ## About ModelService
|
236
421
|
#
|
237
422
|
# Service for performing CRUD operations on models.
|
@@ -264,6 +449,37 @@ module Google
|
|
264
449
|
service_module.const_get(:Client).new(&block)
|
265
450
|
end
|
266
451
|
|
452
|
+
##
|
453
|
+
# Determines whether the ModelService service is supported by the current client.
|
454
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.model_service}.
|
455
|
+
# If false, that method will raise an exception. This could happen if the given
|
456
|
+
# API version does not exist or does not support the ModelService service,
|
457
|
+
# or if the versioned client gem needs an update to support the ModelService service.
|
458
|
+
#
|
459
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
460
|
+
# Defaults to `:v2`.
|
461
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
462
|
+
# @return [boolean] Whether the service is available.
|
463
|
+
#
|
464
|
+
def self.model_service_available? version: :v2, transport: :grpc
|
465
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
466
|
+
package_name = Google::Cloud::Retail
|
467
|
+
.constants
|
468
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
469
|
+
.first
|
470
|
+
return false unless package_name
|
471
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
472
|
+
return false unless service_module.const_defined? :ModelService
|
473
|
+
service_module = service_module.const_get :ModelService
|
474
|
+
if transport == :rest
|
475
|
+
return false unless service_module.const_defined? :Rest
|
476
|
+
service_module = service_module.const_get :Rest
|
477
|
+
end
|
478
|
+
service_module.const_defined? :Client
|
479
|
+
rescue ::LoadError
|
480
|
+
false
|
481
|
+
end
|
482
|
+
|
267
483
|
##
|
268
484
|
# Create a new client object for PredictionService.
|
269
485
|
#
|
@@ -277,6 +493,11 @@ module Google
|
|
277
493
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
278
494
|
# the `transport` parameter.
|
279
495
|
#
|
496
|
+
# Raises an exception if the currently installed versioned client gem for the
|
497
|
+
# given API version does not support the given transport of the PredictionService service.
|
498
|
+
# You can determine whether the method will succeed by calling
|
499
|
+
# {Google::Cloud::Retail.prediction_service_available?}.
|
500
|
+
#
|
280
501
|
# ## About PredictionService
|
281
502
|
#
|
282
503
|
# Service for making recommendation prediction.
|
@@ -298,6 +519,37 @@ module Google
|
|
298
519
|
service_module.const_get(:Client).new(&block)
|
299
520
|
end
|
300
521
|
|
522
|
+
##
|
523
|
+
# Determines whether the PredictionService service is supported by the current client.
|
524
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.prediction_service}.
|
525
|
+
# If false, that method will raise an exception. This could happen if the given
|
526
|
+
# API version does not exist or does not support the PredictionService service,
|
527
|
+
# or if the versioned client gem needs an update to support the PredictionService service.
|
528
|
+
#
|
529
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
530
|
+
# Defaults to `:v2`.
|
531
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
532
|
+
# @return [boolean] Whether the service is available.
|
533
|
+
#
|
534
|
+
def self.prediction_service_available? version: :v2, transport: :grpc
|
535
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
536
|
+
package_name = Google::Cloud::Retail
|
537
|
+
.constants
|
538
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
539
|
+
.first
|
540
|
+
return false unless package_name
|
541
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
542
|
+
return false unless service_module.const_defined? :PredictionService
|
543
|
+
service_module = service_module.const_get :PredictionService
|
544
|
+
if transport == :rest
|
545
|
+
return false unless service_module.const_defined? :Rest
|
546
|
+
service_module = service_module.const_get :Rest
|
547
|
+
end
|
548
|
+
service_module.const_defined? :Client
|
549
|
+
rescue ::LoadError
|
550
|
+
false
|
551
|
+
end
|
552
|
+
|
301
553
|
##
|
302
554
|
# Create a new client object for ProductService.
|
303
555
|
#
|
@@ -311,6 +563,11 @@ module Google
|
|
311
563
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
312
564
|
# the `transport` parameter.
|
313
565
|
#
|
566
|
+
# Raises an exception if the currently installed versioned client gem for the
|
567
|
+
# given API version does not support the given transport of the ProductService service.
|
568
|
+
# You can determine whether the method will succeed by calling
|
569
|
+
# {Google::Cloud::Retail.product_service_available?}.
|
570
|
+
#
|
314
571
|
# ## About ProductService
|
315
572
|
#
|
316
573
|
# Service for ingesting Product information
|
@@ -333,6 +590,37 @@ module Google
|
|
333
590
|
service_module.const_get(:Client).new(&block)
|
334
591
|
end
|
335
592
|
|
593
|
+
##
|
594
|
+
# Determines whether the ProductService service is supported by the current client.
|
595
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.product_service}.
|
596
|
+
# If false, that method will raise an exception. This could happen if the given
|
597
|
+
# API version does not exist or does not support the ProductService service,
|
598
|
+
# or if the versioned client gem needs an update to support the ProductService service.
|
599
|
+
#
|
600
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
601
|
+
# Defaults to `:v2`.
|
602
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
603
|
+
# @return [boolean] Whether the service is available.
|
604
|
+
#
|
605
|
+
def self.product_service_available? version: :v2, transport: :grpc
|
606
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
607
|
+
package_name = Google::Cloud::Retail
|
608
|
+
.constants
|
609
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
610
|
+
.first
|
611
|
+
return false unless package_name
|
612
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
613
|
+
return false unless service_module.const_defined? :ProductService
|
614
|
+
service_module = service_module.const_get :ProductService
|
615
|
+
if transport == :rest
|
616
|
+
return false unless service_module.const_defined? :Rest
|
617
|
+
service_module = service_module.const_get :Rest
|
618
|
+
end
|
619
|
+
service_module.const_defined? :Client
|
620
|
+
rescue ::LoadError
|
621
|
+
false
|
622
|
+
end
|
623
|
+
|
336
624
|
##
|
337
625
|
# Create a new client object for SearchService.
|
338
626
|
#
|
@@ -346,6 +634,11 @@ module Google
|
|
346
634
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
347
635
|
# the `transport` parameter.
|
348
636
|
#
|
637
|
+
# Raises an exception if the currently installed versioned client gem for the
|
638
|
+
# given API version does not support the given transport of the SearchService service.
|
639
|
+
# You can determine whether the method will succeed by calling
|
640
|
+
# {Google::Cloud::Retail.search_service_available?}.
|
641
|
+
#
|
349
642
|
# ## About SearchService
|
350
643
|
#
|
351
644
|
# Service for search.
|
@@ -370,6 +663,37 @@ module Google
|
|
370
663
|
service_module.const_get(:Client).new(&block)
|
371
664
|
end
|
372
665
|
|
666
|
+
##
|
667
|
+
# Determines whether the SearchService service is supported by the current client.
|
668
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.search_service}.
|
669
|
+
# If false, that method will raise an exception. This could happen if the given
|
670
|
+
# API version does not exist or does not support the SearchService service,
|
671
|
+
# or if the versioned client gem needs an update to support the SearchService service.
|
672
|
+
#
|
673
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
674
|
+
# Defaults to `:v2`.
|
675
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
676
|
+
# @return [boolean] Whether the service is available.
|
677
|
+
#
|
678
|
+
def self.search_service_available? version: :v2, transport: :grpc
|
679
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
680
|
+
package_name = Google::Cloud::Retail
|
681
|
+
.constants
|
682
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
683
|
+
.first
|
684
|
+
return false unless package_name
|
685
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
686
|
+
return false unless service_module.const_defined? :SearchService
|
687
|
+
service_module = service_module.const_get :SearchService
|
688
|
+
if transport == :rest
|
689
|
+
return false unless service_module.const_defined? :Rest
|
690
|
+
service_module = service_module.const_get :Rest
|
691
|
+
end
|
692
|
+
service_module.const_defined? :Client
|
693
|
+
rescue ::LoadError
|
694
|
+
false
|
695
|
+
end
|
696
|
+
|
373
697
|
##
|
374
698
|
# Create a new client object for ServingConfigService.
|
375
699
|
#
|
@@ -383,6 +707,11 @@ module Google
|
|
383
707
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
384
708
|
# the `transport` parameter.
|
385
709
|
#
|
710
|
+
# Raises an exception if the currently installed versioned client gem for the
|
711
|
+
# given API version does not support the given transport of the ServingConfigService service.
|
712
|
+
# You can determine whether the method will succeed by calling
|
713
|
+
# {Google::Cloud::Retail.serving_config_service_available?}.
|
714
|
+
#
|
386
715
|
# ## About ServingConfigService
|
387
716
|
#
|
388
717
|
# Service for modifying ServingConfig.
|
@@ -404,6 +733,37 @@ module Google
|
|
404
733
|
service_module.const_get(:Client).new(&block)
|
405
734
|
end
|
406
735
|
|
736
|
+
##
|
737
|
+
# Determines whether the ServingConfigService service is supported by the current client.
|
738
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.serving_config_service}.
|
739
|
+
# If false, that method will raise an exception. This could happen if the given
|
740
|
+
# API version does not exist or does not support the ServingConfigService service,
|
741
|
+
# or if the versioned client gem needs an update to support the ServingConfigService service.
|
742
|
+
#
|
743
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
744
|
+
# Defaults to `:v2`.
|
745
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
746
|
+
# @return [boolean] Whether the service is available.
|
747
|
+
#
|
748
|
+
def self.serving_config_service_available? version: :v2, transport: :grpc
|
749
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
750
|
+
package_name = Google::Cloud::Retail
|
751
|
+
.constants
|
752
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
753
|
+
.first
|
754
|
+
return false unless package_name
|
755
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
756
|
+
return false unless service_module.const_defined? :ServingConfigService
|
757
|
+
service_module = service_module.const_get :ServingConfigService
|
758
|
+
if transport == :rest
|
759
|
+
return false unless service_module.const_defined? :Rest
|
760
|
+
service_module = service_module.const_get :Rest
|
761
|
+
end
|
762
|
+
service_module.const_defined? :Client
|
763
|
+
rescue ::LoadError
|
764
|
+
false
|
765
|
+
end
|
766
|
+
|
407
767
|
##
|
408
768
|
# Create a new client object for UserEventService.
|
409
769
|
#
|
@@ -417,6 +777,11 @@ module Google
|
|
417
777
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
418
778
|
# the `transport` parameter.
|
419
779
|
#
|
780
|
+
# Raises an exception if the currently installed versioned client gem for the
|
781
|
+
# given API version does not support the given transport of the UserEventService service.
|
782
|
+
# You can determine whether the method will succeed by calling
|
783
|
+
# {Google::Cloud::Retail.user_event_service_available?}.
|
784
|
+
#
|
420
785
|
# ## About UserEventService
|
421
786
|
#
|
422
787
|
# Service for ingesting end user actions on the customer website.
|
@@ -438,6 +803,37 @@ module Google
|
|
438
803
|
service_module.const_get(:Client).new(&block)
|
439
804
|
end
|
440
805
|
|
806
|
+
##
|
807
|
+
# Determines whether the UserEventService service is supported by the current client.
|
808
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::Retail.user_event_service}.
|
809
|
+
# If false, that method will raise an exception. This could happen if the given
|
810
|
+
# API version does not exist or does not support the UserEventService service,
|
811
|
+
# or if the versioned client gem needs an update to support the UserEventService service.
|
812
|
+
#
|
813
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
814
|
+
# Defaults to `:v2`.
|
815
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
816
|
+
# @return [boolean] Whether the service is available.
|
817
|
+
#
|
818
|
+
def self.user_event_service_available? version: :v2, transport: :grpc
|
819
|
+
require "google/cloud/retail/#{version.to_s.downcase}"
|
820
|
+
package_name = Google::Cloud::Retail
|
821
|
+
.constants
|
822
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
823
|
+
.first
|
824
|
+
return false unless package_name
|
825
|
+
service_module = Google::Cloud::Retail.const_get package_name
|
826
|
+
return false unless service_module.const_defined? :UserEventService
|
827
|
+
service_module = service_module.const_get :UserEventService
|
828
|
+
if transport == :rest
|
829
|
+
return false unless service_module.const_defined? :Rest
|
830
|
+
service_module = service_module.const_get :Rest
|
831
|
+
end
|
832
|
+
service_module.const_defined? :Client
|
833
|
+
rescue ::LoadError
|
834
|
+
false
|
835
|
+
end
|
836
|
+
|
441
837
|
##
|
442
838
|
# Configure the google-cloud-retail library.
|
443
839
|
#
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-retail
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-02-13 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -30,14 +29,14 @@ dependencies:
|
|
30
29
|
requirements:
|
31
30
|
- - "~>"
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
32
|
+
version: '2.0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - "~>"
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
39
|
+
version: '2.0'
|
41
40
|
description: Retail enables you to build an end-to-end personalized recommendation
|
42
41
|
system based on state-of-the-art deep learning ML models, without a need for expertise
|
43
42
|
in ML or recommendation systems.
|
@@ -57,7 +56,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
57
56
|
licenses:
|
58
57
|
- Apache-2.0
|
59
58
|
metadata: {}
|
60
|
-
post_install_message:
|
61
59
|
rdoc_options: []
|
62
60
|
require_paths:
|
63
61
|
- lib
|
@@ -65,15 +63,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
65
63
|
requirements:
|
66
64
|
- - ">="
|
67
65
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
66
|
+
version: '3.0'
|
69
67
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
68
|
requirements:
|
71
69
|
- - ">="
|
72
70
|
- !ruby/object:Gem::Version
|
73
71
|
version: '0'
|
74
72
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
73
|
+
rubygems_version: 3.6.3
|
77
74
|
specification_version: 4
|
78
75
|
summary: API Client library for the Retail API
|
79
76
|
test_files: []
|