google-cloud-retail 1.4.0 → 1.5.0

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: ecbf42a8ddb8eca22c559621073600bc341e91f27b7b942877a78df58475d280
4
- data.tar.gz: 0531a056012fb57a7f5f5215b9a6580caa5970c467b1401995f1dedf8270c40a
3
+ metadata.gz: a326f2f1ee0d5dc971bfad4ab9da4471a42c96b9b21198358f70dbced31cd03e
4
+ data.tar.gz: c2c2a27b28126b2a994a7bb9a32b68d723724e3d4086dd0bcb8f3de35e21c0f8
5
5
  SHA512:
6
- metadata.gz: 5f9b4a89d048a3de2482e8f0d1e838c8161798ad9b890dcc5a7af98c260f082939372855ac6eefe5d17dcb6331165a707b0bc5acd3f55daba152a9cad95dded4
7
- data.tar.gz: 2fed92768a291225b2329ede64883770ea77554e818f45939a19a5db2147b0af2f7e710a19c419d6030b79af8ef9f451eee492f07ff6fe21a4e395a3d7729481
6
+ metadata.gz: ad0b6f0b358e1f020498c46cb925e20889a036825179f86263720e4c46d9f18dd9b9d30fd580103004e4c0b29800f7d66e5bcb748b1df80991160fa4705c0edc
7
+ data.tar.gz: 4299c9e05edb3450d847c420df94ba2b064e1d382b3d921307788159db7b7f1e16eb19ff6420466358cad23d83a4c39afbd97205513cd722492b8fb6403bd2cf
data/AUTHENTICATION.md CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
114
114
  To configure your system for this, simply:
115
115
 
116
116
  1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
117
- 2. Authenticate using OAuth 2.0 `$ gcloud auth login`
117
+ 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
118
118
  3. Write code as if already authenticated.
119
119
 
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
data/README.md CHANGED
@@ -34,32 +34,6 @@ 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
- ## Enabling Logging
38
-
39
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
40
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
41
- or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
42
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
43
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
44
-
45
- Configuring a Ruby stdlib logger:
46
-
47
- ```ruby
48
- require "logger"
49
-
50
- module MyLogger
51
- LOGGER = Logger.new $stderr, level: Logger::WARN
52
- def logger
53
- LOGGER
54
- end
55
- end
56
-
57
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
58
- module GRPC
59
- extend MyLogger
60
- end
61
- ```
62
-
63
37
  ## Supported Ruby Versions
64
38
 
65
39
  This library is supported on Ruby 2.6+.
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Retail
23
- VERSION = "1.4.0"
23
+ VERSION = "1.5.0"
24
24
  end
25
25
  end
26
26
  end
@@ -49,11 +49,13 @@ module Google
49
49
  #
50
50
  # By default, this returns an instance of
51
51
  # [Google::Cloud::Retail::V2::CatalogService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/CatalogService/Client.html)
52
- # for version V2 of the API.
53
- # However, you can specify specify a different API version by passing it in the
52
+ # for a gRPC client for version V2 of the API.
53
+ # However, you can specify a different API version by passing it in the
54
54
  # `version` parameter. If the CatalogService service is
55
55
  # supported by that API version, and the corresponding gem is available, the
56
56
  # appropriate versioned client will be returned.
57
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
58
+ # the `transport` parameter.
57
59
  #
58
60
  # ## About CatalogService
59
61
  #
@@ -61,17 +63,19 @@ module Google
61
63
  #
62
64
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
63
65
  # Defaults to `:v2`.
64
- # @return [CatalogService::Client] A client object for the specified version.
66
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
67
+ # @return [::Object] A client object for the specified version.
65
68
  #
66
- def self.catalog_service version: :v2, &block
69
+ def self.catalog_service version: :v2, transport: :grpc, &block
67
70
  require "google/cloud/retail/#{version.to_s.downcase}"
68
71
 
69
72
  package_name = Google::Cloud::Retail
70
73
  .constants
71
74
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
72
75
  .first
73
- package_module = Google::Cloud::Retail.const_get package_name
74
- package_module.const_get(:CatalogService).const_get(:Client).new(&block)
76
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CatalogService)
77
+ service_module = service_module.const_get(:Rest) if transport == :rest
78
+ service_module.const_get(:Client).new(&block)
75
79
  end
76
80
 
77
81
  ##
@@ -79,32 +83,36 @@ module Google
79
83
  #
80
84
  # By default, this returns an instance of
81
85
  # [Google::Cloud::Retail::V2::CompletionService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/CompletionService/Client.html)
82
- # for version V2 of the API.
83
- # However, you can specify specify a different API version by passing it in the
86
+ # for a gRPC client for version V2 of the API.
87
+ # However, you can specify a different API version by passing it in the
84
88
  # `version` parameter. If the CompletionService service is
85
89
  # supported by that API version, and the corresponding gem is available, the
86
90
  # appropriate versioned client will be returned.
91
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
92
+ # the `transport` parameter.
87
93
  #
88
94
  # ## About CompletionService
89
95
  #
90
96
  # Auto-completion service for retail.
91
97
  #
92
98
  # This feature is only available for users who have Retail Search enabled.
93
- # Please enable Retail Search on Cloud Console before using this feature.
99
+ # Enable Retail Search on Cloud Console before using this feature.
94
100
  #
95
101
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
96
102
  # Defaults to `:v2`.
97
- # @return [CompletionService::Client] A client object for the specified version.
103
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
104
+ # @return [::Object] A client object for the specified version.
98
105
  #
99
- def self.completion_service version: :v2, &block
106
+ def self.completion_service version: :v2, transport: :grpc, &block
100
107
  require "google/cloud/retail/#{version.to_s.downcase}"
101
108
 
102
109
  package_name = Google::Cloud::Retail
103
110
  .constants
104
111
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
105
112
  .first
106
- package_module = Google::Cloud::Retail.const_get package_name
107
- package_module.const_get(:CompletionService).const_get(:Client).new(&block)
113
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:CompletionService)
114
+ service_module = service_module.const_get(:Rest) if transport == :rest
115
+ service_module.const_get(:Client).new(&block)
108
116
  end
109
117
 
110
118
  ##
@@ -112,11 +120,13 @@ module Google
112
120
  #
113
121
  # By default, this returns an instance of
114
122
  # [Google::Cloud::Retail::V2::ControlService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/ControlService/Client.html)
115
- # for version V2 of the API.
116
- # However, you can specify specify a different API version by passing it in the
123
+ # for a gRPC client for version V2 of the API.
124
+ # However, you can specify a different API version by passing it in the
117
125
  # `version` parameter. If the ControlService service is
118
126
  # supported by that API version, and the corresponding gem is available, the
119
127
  # appropriate versioned client will be returned.
128
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
129
+ # the `transport` parameter.
120
130
  #
121
131
  # ## About ControlService
122
132
  #
@@ -124,17 +134,19 @@ module Google
124
134
  #
125
135
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
126
136
  # Defaults to `:v2`.
127
- # @return [ControlService::Client] A client object for the specified version.
137
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
138
+ # @return [::Object] A client object for the specified version.
128
139
  #
129
- def self.control_service version: :v2, &block
140
+ def self.control_service version: :v2, transport: :grpc, &block
130
141
  require "google/cloud/retail/#{version.to_s.downcase}"
131
142
 
132
143
  package_name = Google::Cloud::Retail
133
144
  .constants
134
145
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
135
146
  .first
136
- package_module = Google::Cloud::Retail.const_get package_name
137
- package_module.const_get(:ControlService).const_get(:Client).new(&block)
147
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ControlService)
148
+ service_module = service_module.const_get(:Rest) if transport == :rest
149
+ service_module.const_get(:Client).new(&block)
138
150
  end
139
151
 
140
152
  ##
@@ -142,11 +154,13 @@ module Google
142
154
  #
143
155
  # By default, this returns an instance of
144
156
  # [Google::Cloud::Retail::V2::PredictionService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/PredictionService/Client.html)
145
- # for version V2 of the API.
146
- # However, you can specify specify a different API version by passing it in the
157
+ # for a gRPC client for version V2 of the API.
158
+ # However, you can specify a different API version by passing it in the
147
159
  # `version` parameter. If the PredictionService service is
148
160
  # supported by that API version, and the corresponding gem is available, the
149
161
  # appropriate versioned client will be returned.
162
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
163
+ # the `transport` parameter.
150
164
  #
151
165
  # ## About PredictionService
152
166
  #
@@ -154,17 +168,19 @@ module Google
154
168
  #
155
169
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
156
170
  # Defaults to `:v2`.
157
- # @return [PredictionService::Client] A client object for the specified version.
171
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
172
+ # @return [::Object] A client object for the specified version.
158
173
  #
159
- def self.prediction_service version: :v2, &block
174
+ def self.prediction_service version: :v2, transport: :grpc, &block
160
175
  require "google/cloud/retail/#{version.to_s.downcase}"
161
176
 
162
177
  package_name = Google::Cloud::Retail
163
178
  .constants
164
179
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
165
180
  .first
166
- package_module = Google::Cloud::Retail.const_get package_name
167
- package_module.const_get(:PredictionService).const_get(:Client).new(&block)
181
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:PredictionService)
182
+ service_module = service_module.const_get(:Rest) if transport == :rest
183
+ service_module.const_get(:Client).new(&block)
168
184
  end
169
185
 
170
186
  ##
@@ -172,11 +188,13 @@ module Google
172
188
  #
173
189
  # By default, this returns an instance of
174
190
  # [Google::Cloud::Retail::V2::ProductService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/ProductService/Client.html)
175
- # for version V2 of the API.
176
- # However, you can specify specify a different API version by passing it in the
191
+ # for a gRPC client for version V2 of the API.
192
+ # However, you can specify a different API version by passing it in the
177
193
  # `version` parameter. If the ProductService service is
178
194
  # supported by that API version, and the corresponding gem is available, the
179
195
  # appropriate versioned client will be returned.
196
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
197
+ # the `transport` parameter.
180
198
  #
181
199
  # ## About ProductService
182
200
  #
@@ -185,17 +203,19 @@ module Google
185
203
  #
186
204
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
187
205
  # Defaults to `:v2`.
188
- # @return [ProductService::Client] A client object for the specified version.
206
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
207
+ # @return [::Object] A client object for the specified version.
189
208
  #
190
- def self.product_service version: :v2, &block
209
+ def self.product_service version: :v2, transport: :grpc, &block
191
210
  require "google/cloud/retail/#{version.to_s.downcase}"
192
211
 
193
212
  package_name = Google::Cloud::Retail
194
213
  .constants
195
214
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
196
215
  .first
197
- package_module = Google::Cloud::Retail.const_get package_name
198
- package_module.const_get(:ProductService).const_get(:Client).new(&block)
216
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ProductService)
217
+ service_module = service_module.const_get(:Rest) if transport == :rest
218
+ service_module.const_get(:Client).new(&block)
199
219
  end
200
220
 
201
221
  ##
@@ -203,32 +223,36 @@ module Google
203
223
  #
204
224
  # By default, this returns an instance of
205
225
  # [Google::Cloud::Retail::V2::SearchService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/SearchService/Client.html)
206
- # for version V2 of the API.
207
- # However, you can specify specify a different API version by passing it in the
226
+ # for a gRPC client for version V2 of the API.
227
+ # However, you can specify a different API version by passing it in the
208
228
  # `version` parameter. If the SearchService service is
209
229
  # supported by that API version, and the corresponding gem is available, the
210
230
  # appropriate versioned client will be returned.
231
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
232
+ # the `transport` parameter.
211
233
  #
212
234
  # ## About SearchService
213
235
  #
214
236
  # Service for search.
215
237
  #
216
238
  # This feature is only available for users who have Retail Search enabled.
217
- # Please enable Retail Search on Cloud Console before using this feature.
239
+ # Enable Retail Search on Cloud Console before using this feature.
218
240
  #
219
241
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
220
242
  # Defaults to `:v2`.
221
- # @return [SearchService::Client] A client object for the specified version.
243
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
244
+ # @return [::Object] A client object for the specified version.
222
245
  #
223
- def self.search_service version: :v2, &block
246
+ def self.search_service version: :v2, transport: :grpc, &block
224
247
  require "google/cloud/retail/#{version.to_s.downcase}"
225
248
 
226
249
  package_name = Google::Cloud::Retail
227
250
  .constants
228
251
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
229
252
  .first
230
- package_module = Google::Cloud::Retail.const_get package_name
231
- package_module.const_get(:SearchService).const_get(:Client).new(&block)
253
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:SearchService)
254
+ service_module = service_module.const_get(:Rest) if transport == :rest
255
+ service_module.const_get(:Client).new(&block)
232
256
  end
233
257
 
234
258
  ##
@@ -236,11 +260,13 @@ module Google
236
260
  #
237
261
  # By default, this returns an instance of
238
262
  # [Google::Cloud::Retail::V2::ServingConfigService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/ServingConfigService/Client.html)
239
- # for version V2 of the API.
240
- # However, you can specify specify a different API version by passing it in the
263
+ # for a gRPC client for version V2 of the API.
264
+ # However, you can specify a different API version by passing it in the
241
265
  # `version` parameter. If the ServingConfigService service is
242
266
  # supported by that API version, and the corresponding gem is available, the
243
267
  # appropriate versioned client will be returned.
268
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
269
+ # the `transport` parameter.
244
270
  #
245
271
  # ## About ServingConfigService
246
272
  #
@@ -248,17 +274,19 @@ module Google
248
274
  #
249
275
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
250
276
  # Defaults to `:v2`.
251
- # @return [ServingConfigService::Client] A client object for the specified version.
277
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
278
+ # @return [::Object] A client object for the specified version.
252
279
  #
253
- def self.serving_config_service version: :v2, &block
280
+ def self.serving_config_service version: :v2, transport: :grpc, &block
254
281
  require "google/cloud/retail/#{version.to_s.downcase}"
255
282
 
256
283
  package_name = Google::Cloud::Retail
257
284
  .constants
258
285
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
259
286
  .first
260
- package_module = Google::Cloud::Retail.const_get package_name
261
- package_module.const_get(:ServingConfigService).const_get(:Client).new(&block)
287
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:ServingConfigService)
288
+ service_module = service_module.const_get(:Rest) if transport == :rest
289
+ service_module.const_get(:Client).new(&block)
262
290
  end
263
291
 
264
292
  ##
@@ -266,11 +294,13 @@ module Google
266
294
  #
267
295
  # By default, this returns an instance of
268
296
  # [Google::Cloud::Retail::V2::UserEventService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/UserEventService/Client.html)
269
- # for version V2 of the API.
270
- # However, you can specify specify a different API version by passing it in the
297
+ # for a gRPC client for version V2 of the API.
298
+ # However, you can specify a different API version by passing it in the
271
299
  # `version` parameter. If the UserEventService service is
272
300
  # supported by that API version, and the corresponding gem is available, the
273
301
  # appropriate versioned client will be returned.
302
+ # You can also specify a different transport by passing `:rest` or `:grpc` in
303
+ # the `transport` parameter.
274
304
  #
275
305
  # ## About UserEventService
276
306
  #
@@ -278,17 +308,19 @@ module Google
278
308
  #
279
309
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
280
310
  # Defaults to `:v2`.
281
- # @return [UserEventService::Client] A client object for the specified version.
311
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
312
+ # @return [::Object] A client object for the specified version.
282
313
  #
283
- def self.user_event_service version: :v2, &block
314
+ def self.user_event_service version: :v2, transport: :grpc, &block
284
315
  require "google/cloud/retail/#{version.to_s.downcase}"
285
316
 
286
317
  package_name = Google::Cloud::Retail
287
318
  .constants
288
319
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
289
320
  .first
290
- package_module = Google::Cloud::Retail.const_get package_name
291
- package_module.const_get(:UserEventService).const_get(:Client).new(&block)
321
+ service_module = Google::Cloud::Retail.const_get(package_name).const_get(:UserEventService)
322
+ service_module = service_module.const_get(:Rest) if transport == :rest
323
+ service_module.const_get(:Client).new(&block)
292
324
  end
293
325
 
294
326
  ##
@@ -308,7 +340,7 @@ module Google
308
340
  # * `timeout` (*type:* `Numeric`) -
309
341
  # Default timeout in seconds.
310
342
  # * `metadata` (*type:* `Hash{Symbol=>String}`) -
311
- # Additional gRPC headers to be sent with the call.
343
+ # Additional headers to be sent with the call.
312
344
  # * `retry_policy` (*type:* `Hash`) -
313
345
  # The retry policy. The value is a hash with the following keys:
314
346
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-retail
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-03 00:00:00.000000000 Z
11
+ date: 2023-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-core
@@ -30,7 +30,7 @@ dependencies:
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '0.11'
33
+ version: '0.14'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 2.a
@@ -40,7 +40,7 @@ dependencies:
40
40
  requirements:
41
41
  - - ">="
42
42
  - !ruby/object:Gem::Version
43
- version: '0.11'
43
+ version: '0.14'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 2.a
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  - !ruby/object:Gem::Version
191
191
  version: '0'
192
192
  requirements: []
193
- rubygems_version: 3.3.14
193
+ rubygems_version: 3.4.2
194
194
  signing_key:
195
195
  specification_version: 4
196
196
  summary: API Client library for the Retail API