google-cloud-recommendation_engine 0.6.2 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ab17040748f91b8f969a25467a64b36d8189acbc12d5271be704cfc3cefc110f
4
- data.tar.gz: 3732ecb12138b3ea051a320448e9ee5315d764c2748b4f089c42bab39ef23dfa
3
+ metadata.gz: 56ebca0ce3beddcabeb136b67565051b234add79c989fc7bf2e3db3c2ce7cb9d
4
+ data.tar.gz: '08aa6f9c99e3db16cda8a50bd8cbf3a6635d01f20dc4559e9441de98fb24f16f'
5
5
  SHA512:
6
- metadata.gz: ef0756e9b3dbdf32edf3c6559c1c751b4da7de1e71b5e77103d91c971f3027416707d64254c8cdfff58b974e33f9eb864f90c7322cf92d7ef1298c692a718467
7
- data.tar.gz: 38fb77221bc73d1097edc6f572278c700d943205fd20599dfe6f4819d92c24074e9f65b1d5183c360cac75288c2944746b59bdeddb224b4bb0acea805913804b
6
+ metadata.gz: 7688f21701a650229879ac697b4ec40bc86cb698e3959f1ad85248a660b7c5f704c1bab6d88d19bab38f4a17ef936fa64607ed2d0e6e539fc1158909f8332895
7
+ data.tar.gz: d2327b43ba3d402652ce6daee1257fa002e5f66cd4864a52b08d2bebffb5a1e23271c61dbd14c7c5a0fca272f7e2ad28753254744b658099b3ad96788ea5b99e
data/README.md CHANGED
@@ -7,7 +7,7 @@ Recommendations AI enables you to build an end-to-end personalized recommendatio
7
7
  Actual client classes for the various versions of this API are defined in
8
8
  _versioned_ client gems, with names of the form `google-cloud-recommendation_engine-v*`.
9
9
  The gem `google-cloud-recommendation_engine` is the main client library that brings the
10
- verisoned gems in as dependencies, and provides high-level methods for
10
+ versioned gems in as dependencies, and provides high-level methods for
11
11
  constructing clients. More information on versioned clients can be found below
12
12
  in the section titled *Which client should I use?*.
13
13
 
@@ -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 2.7+.
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
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module RecommendationEngine
23
- VERSION = "0.6.2"
23
+ VERSION = "0.7.1"
24
24
  end
25
25
  end
26
26
  end
@@ -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.6.2
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 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: '2.7'
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.5.6
82
- signing_key:
79
+ rubygems_version: 3.6.8
83
80
  specification_version: 4
84
81
  summary: API Client library for the Recommendations AI API
85
82
  test_files: []