google-cloud-recommendation_engine 0.6.2 → 0.7.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/recommendation_engine/version.rb +1 -1
- data/lib/google/cloud/recommendation_engine.rb +144 -0
- metadata +4 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab24d3745111d474bca57e8fed52022f4dbe4a05b8e0949ba78d77b3bb2b1e32
|
4
|
+
data.tar.gz: 5f0e9c5b33e7c0b6792f06d458d11b4462d04e92bccb2a240ad3a384c5317784
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfb940ce13429a2b1934e34075ae1bb3ff80f97b40db7f8f0ef84410194c5b974b9be824bc05d304abe02acbc8b626fd25ac59569193dd992953a416280954c6
|
7
|
+
data.tar.gz: '040380a9f330f81934a4cde75e4b431c65eabf3843282c8073e4dcfa2ba2bf2d0767e253b0701d88630fafc2c4b2a5cf71184fe471faaa869f487c812a0d3de1'
|
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/recommendationengine.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-recommendation_engine-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/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
|
@@ -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 CatalogService service.
|
63
|
+
# You can determine whether the method will succeed by calling
|
64
|
+
# {Google::Cloud::RecommendationEngine.catalog_service_available?}.
|
65
|
+
#
|
61
66
|
# ## About CatalogService
|
62
67
|
#
|
63
68
|
# Service for ingesting catalog information of the customer's website.
|
@@ -79,6 +84,37 @@ module Google
|
|
79
84
|
service_module.const_get(:Client).new(&block)
|
80
85
|
end
|
81
86
|
|
87
|
+
##
|
88
|
+
# Determines whether the CatalogService service is supported by the current client.
|
89
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::RecommendationEngine.catalog_service}.
|
90
|
+
# If false, that method will raise an exception. This could happen if the given
|
91
|
+
# API version does not exist or does not support the CatalogService service,
|
92
|
+
# or if the versioned client gem needs an update to support the CatalogService service.
|
93
|
+
#
|
94
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
95
|
+
# Defaults to `:v1beta1`.
|
96
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
97
|
+
# @return [boolean] Whether the service is available.
|
98
|
+
#
|
99
|
+
def self.catalog_service_available? version: :v1beta1, transport: :grpc
|
100
|
+
require "google/cloud/recommendation_engine/#{version.to_s.downcase}"
|
101
|
+
package_name = Google::Cloud::RecommendationEngine
|
102
|
+
.constants
|
103
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
104
|
+
.first
|
105
|
+
return false unless package_name
|
106
|
+
service_module = Google::Cloud::RecommendationEngine.const_get package_name
|
107
|
+
return false unless service_module.const_defined? :CatalogService
|
108
|
+
service_module = service_module.const_get :CatalogService
|
109
|
+
if transport == :rest
|
110
|
+
return false unless service_module.const_defined? :Rest
|
111
|
+
service_module = service_module.const_get :Rest
|
112
|
+
end
|
113
|
+
service_module.const_defined? :Client
|
114
|
+
rescue ::LoadError
|
115
|
+
false
|
116
|
+
end
|
117
|
+
|
82
118
|
##
|
83
119
|
# Create a new client object for PredictionApiKeyRegistry.
|
84
120
|
#
|
@@ -92,6 +128,11 @@ module Google
|
|
92
128
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
93
129
|
# the `transport` parameter.
|
94
130
|
#
|
131
|
+
# Raises an exception if the currently installed versioned client gem for the
|
132
|
+
# given API version does not support the given transport of the PredictionApiKeyRegistry service.
|
133
|
+
# You can determine whether the method will succeed by calling
|
134
|
+
# {Google::Cloud::RecommendationEngine.prediction_api_key_registry_available?}.
|
135
|
+
#
|
95
136
|
# ## About PredictionApiKeyRegistry
|
96
137
|
#
|
97
138
|
# Service for registering API keys for use with the `predict` method. If you
|
@@ -117,6 +158,37 @@ module Google
|
|
117
158
|
service_module.const_get(:Client).new(&block)
|
118
159
|
end
|
119
160
|
|
161
|
+
##
|
162
|
+
# Determines whether the PredictionApiKeyRegistry service is supported by the current client.
|
163
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::RecommendationEngine.prediction_api_key_registry}.
|
164
|
+
# If false, that method will raise an exception. This could happen if the given
|
165
|
+
# API version does not exist or does not support the PredictionApiKeyRegistry service,
|
166
|
+
# or if the versioned client gem needs an update to support the PredictionApiKeyRegistry service.
|
167
|
+
#
|
168
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
169
|
+
# Defaults to `:v1beta1`.
|
170
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
171
|
+
# @return [boolean] Whether the service is available.
|
172
|
+
#
|
173
|
+
def self.prediction_api_key_registry_available? version: :v1beta1, transport: :grpc
|
174
|
+
require "google/cloud/recommendation_engine/#{version.to_s.downcase}"
|
175
|
+
package_name = Google::Cloud::RecommendationEngine
|
176
|
+
.constants
|
177
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
178
|
+
.first
|
179
|
+
return false unless package_name
|
180
|
+
service_module = Google::Cloud::RecommendationEngine.const_get package_name
|
181
|
+
return false unless service_module.const_defined? :PredictionApiKeyRegistry
|
182
|
+
service_module = service_module.const_get :PredictionApiKeyRegistry
|
183
|
+
if transport == :rest
|
184
|
+
return false unless service_module.const_defined? :Rest
|
185
|
+
service_module = service_module.const_get :Rest
|
186
|
+
end
|
187
|
+
service_module.const_defined? :Client
|
188
|
+
rescue ::LoadError
|
189
|
+
false
|
190
|
+
end
|
191
|
+
|
120
192
|
##
|
121
193
|
# Create a new client object for PredictionService.
|
122
194
|
#
|
@@ -130,6 +202,11 @@ module Google
|
|
130
202
|
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
131
203
|
# the `transport` parameter.
|
132
204
|
#
|
205
|
+
# Raises an exception if the currently installed versioned client gem for the
|
206
|
+
# given API version does not support the given transport of the PredictionService service.
|
207
|
+
# You can determine whether the method will succeed by calling
|
208
|
+
# {Google::Cloud::RecommendationEngine.prediction_service_available?}.
|
209
|
+
#
|
133
210
|
# ## About PredictionService
|
134
211
|
#
|
135
212
|
# Service for making recommendation prediction.
|
@@ -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 PredictionService service is supported by the current client.
|
233
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::RecommendationEngine.prediction_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 PredictionService service,
|
236
|
+
# or if the versioned client gem needs an update to support the PredictionService service.
|
237
|
+
#
|
238
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
239
|
+
# Defaults to `:v1beta1`.
|
240
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
241
|
+
# @return [boolean] Whether the service is available.
|
242
|
+
#
|
243
|
+
def self.prediction_service_available? version: :v1beta1, transport: :grpc
|
244
|
+
require "google/cloud/recommendation_engine/#{version.to_s.downcase}"
|
245
|
+
package_name = Google::Cloud::RecommendationEngine
|
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::RecommendationEngine.const_get package_name
|
251
|
+
return false unless service_module.const_defined? :PredictionService
|
252
|
+
service_module = service_module.const_get :PredictionService
|
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 UserEventService.
|
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 UserEventService service.
|
277
|
+
# You can determine whether the method will succeed by calling
|
278
|
+
# {Google::Cloud::RecommendationEngine.user_event_service_available?}.
|
279
|
+
#
|
167
280
|
# ## About UserEventService
|
168
281
|
#
|
169
282
|
# Service for ingesting end user actions on the customer website.
|
@@ -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 UserEventService service is supported by the current client.
|
303
|
+
# If true, you can retrieve a client object by calling {Google::Cloud::RecommendationEngine.user_event_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 UserEventService service,
|
306
|
+
# or if the versioned client gem needs an update to support the UserEventService service.
|
307
|
+
#
|
308
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
309
|
+
# Defaults to `:v1beta1`.
|
310
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
311
|
+
# @return [boolean] Whether the service is available.
|
312
|
+
#
|
313
|
+
def self.user_event_service_available? version: :v1beta1, transport: :grpc
|
314
|
+
require "google/cloud/recommendation_engine/#{version.to_s.downcase}"
|
315
|
+
package_name = Google::Cloud::RecommendationEngine
|
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::RecommendationEngine.const_get package_name
|
321
|
+
return false unless service_module.const_defined? :UserEventService
|
322
|
+
service_module = service_module.const_get :UserEventService
|
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
|
# Configure the google-cloud-recommendation_engine library.
|
190
334
|
#
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-recommendation_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.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-01-29 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: google-cloud-core
|
@@ -63,7 +62,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
|
|
63
62
|
licenses:
|
64
63
|
- Apache-2.0
|
65
64
|
metadata: {}
|
66
|
-
post_install_message:
|
67
65
|
rdoc_options: []
|
68
66
|
require_paths:
|
69
67
|
- lib
|
@@ -71,15 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
71
69
|
requirements:
|
72
70
|
- - ">="
|
73
71
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
72
|
+
version: '3.0'
|
75
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
74
|
requirements:
|
77
75
|
- - ">="
|
78
76
|
- !ruby/object:Gem::Version
|
79
77
|
version: '0'
|
80
78
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
82
|
-
signing_key:
|
79
|
+
rubygems_version: 3.6.2
|
83
80
|
specification_version: 4
|
84
81
|
summary: API Client library for the Recommendations AI API
|
85
82
|
test_files: []
|