google-cloud-retail 1.3.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: 11d3c9e4deee056e6b0b7d2acbc8bd85a73670f8f925d9eed55a8f6e8c116a83
4
- data.tar.gz: d9bd5e9d2fda81e6fcc5b6a131da59ddc9e2b763015d07b432e29ccedf379620
3
+ metadata.gz: a326f2f1ee0d5dc971bfad4ab9da4471a42c96b9b21198358f70dbced31cd03e
4
+ data.tar.gz: c2c2a27b28126b2a994a7bb9a32b68d723724e3d4086dd0bcb8f3de35e21c0f8
5
5
  SHA512:
6
- metadata.gz: 51585988c05742df3b5f85a1d00f98ffaaf64c17a018a294a0b881f4076d12bd7577a84aa53b502f87d63ba7ceb187f6207e51396ced96b46ad1e432c8c8096e
7
- data.tar.gz: e01d2751bec46261120f19f97f48ccc1cdef42ddc9fbfb2b5080edaddb54980dff88a0b0e67bb73ef5b234a6cbf1d74575192e6a41d63c552b20f9589e28cf17
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.3.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,70 @@ 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)
116
+ end
117
+
118
+ ##
119
+ # Create a new client object for ControlService.
120
+ #
121
+ # By default, this returns an instance of
122
+ # [Google::Cloud::Retail::V2::ControlService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/ControlService/Client.html)
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
125
+ # `version` parameter. If the ControlService service is
126
+ # supported by that API version, and the corresponding gem is available, the
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.
130
+ #
131
+ # ## About ControlService
132
+ #
133
+ # Service for modifying Control.
134
+ #
135
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
136
+ # Defaults to `:v2`.
137
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
138
+ # @return [::Object] A client object for the specified version.
139
+ #
140
+ def self.control_service version: :v2, transport: :grpc, &block
141
+ require "google/cloud/retail/#{version.to_s.downcase}"
142
+
143
+ package_name = Google::Cloud::Retail
144
+ .constants
145
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
146
+ .first
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)
108
150
  end
109
151
 
110
152
  ##
@@ -112,11 +154,13 @@ module Google
112
154
  #
113
155
  # By default, this returns an instance of
114
156
  # [Google::Cloud::Retail::V2::PredictionService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/PredictionService/Client.html)
115
- # for version V2 of the API.
116
- # 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
117
159
  # `version` parameter. If the PredictionService service is
118
160
  # supported by that API version, and the corresponding gem is available, the
119
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.
120
164
  #
121
165
  # ## About PredictionService
122
166
  #
@@ -124,17 +168,19 @@ module Google
124
168
  #
125
169
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
126
170
  # Defaults to `:v2`.
127
- # @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.
128
173
  #
129
- def self.prediction_service version: :v2, &block
174
+ def self.prediction_service version: :v2, transport: :grpc, &block
130
175
  require "google/cloud/retail/#{version.to_s.downcase}"
131
176
 
132
177
  package_name = Google::Cloud::Retail
133
178
  .constants
134
179
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
135
180
  .first
136
- package_module = Google::Cloud::Retail.const_get package_name
137
- 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)
138
184
  end
139
185
 
140
186
  ##
@@ -142,11 +188,13 @@ module Google
142
188
  #
143
189
  # By default, this returns an instance of
144
190
  # [Google::Cloud::Retail::V2::ProductService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/ProductService/Client.html)
145
- # for version V2 of the API.
146
- # 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
147
193
  # `version` parameter. If the ProductService service is
148
194
  # supported by that API version, and the corresponding gem is available, the
149
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.
150
198
  #
151
199
  # ## About ProductService
152
200
  #
@@ -155,17 +203,19 @@ module Google
155
203
  #
156
204
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
157
205
  # Defaults to `:v2`.
158
- # @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.
159
208
  #
160
- def self.product_service version: :v2, &block
209
+ def self.product_service version: :v2, transport: :grpc, &block
161
210
  require "google/cloud/retail/#{version.to_s.downcase}"
162
211
 
163
212
  package_name = Google::Cloud::Retail
164
213
  .constants
165
214
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
166
215
  .first
167
- package_module = Google::Cloud::Retail.const_get package_name
168
- 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)
169
219
  end
170
220
 
171
221
  ##
@@ -173,32 +223,70 @@ module Google
173
223
  #
174
224
  # By default, this returns an instance of
175
225
  # [Google::Cloud::Retail::V2::SearchService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/SearchService/Client.html)
176
- # for version V2 of the API.
177
- # 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
178
228
  # `version` parameter. If the SearchService service is
179
229
  # supported by that API version, and the corresponding gem is available, the
180
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.
181
233
  #
182
234
  # ## About SearchService
183
235
  #
184
236
  # Service for search.
185
237
  #
186
238
  # This feature is only available for users who have Retail Search enabled.
187
- # Please enable Retail Search on Cloud Console before using this feature.
239
+ # Enable Retail Search on Cloud Console before using this feature.
240
+ #
241
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
242
+ # Defaults to `:v2`.
243
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
244
+ # @return [::Object] A client object for the specified version.
245
+ #
246
+ def self.search_service version: :v2, transport: :grpc, &block
247
+ require "google/cloud/retail/#{version.to_s.downcase}"
248
+
249
+ package_name = Google::Cloud::Retail
250
+ .constants
251
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
252
+ .first
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)
256
+ end
257
+
258
+ ##
259
+ # Create a new client object for ServingConfigService.
260
+ #
261
+ # By default, this returns an instance of
262
+ # [Google::Cloud::Retail::V2::ServingConfigService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/ServingConfigService/Client.html)
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
265
+ # `version` parameter. If the ServingConfigService service is
266
+ # supported by that API version, and the corresponding gem is available, the
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.
270
+ #
271
+ # ## About ServingConfigService
272
+ #
273
+ # Service for modifying ServingConfig.
188
274
  #
189
275
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
190
276
  # Defaults to `:v2`.
191
- # @return [SearchService::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.
192
279
  #
193
- def self.search_service version: :v2, &block
280
+ def self.serving_config_service version: :v2, transport: :grpc, &block
194
281
  require "google/cloud/retail/#{version.to_s.downcase}"
195
282
 
196
283
  package_name = Google::Cloud::Retail
197
284
  .constants
198
285
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
199
286
  .first
200
- package_module = Google::Cloud::Retail.const_get package_name
201
- package_module.const_get(:SearchService).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)
202
290
  end
203
291
 
204
292
  ##
@@ -206,11 +294,13 @@ module Google
206
294
  #
207
295
  # By default, this returns an instance of
208
296
  # [Google::Cloud::Retail::V2::UserEventService::Client](https://googleapis.dev/ruby/google-cloud-retail-v2/latest/Google/Cloud/Retail/V2/UserEventService/Client.html)
209
- # for version V2 of the API.
210
- # 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
211
299
  # `version` parameter. If the UserEventService service is
212
300
  # supported by that API version, and the corresponding gem is available, the
213
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.
214
304
  #
215
305
  # ## About UserEventService
216
306
  #
@@ -218,17 +308,19 @@ module Google
218
308
  #
219
309
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
220
310
  # Defaults to `:v2`.
221
- # @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.
222
313
  #
223
- def self.user_event_service version: :v2, &block
314
+ def self.user_event_service version: :v2, transport: :grpc, &block
224
315
  require "google/cloud/retail/#{version.to_s.downcase}"
225
316
 
226
317
  package_name = Google::Cloud::Retail
227
318
  .constants
228
319
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
229
320
  .first
230
- package_module = Google::Cloud::Retail.const_get package_name
231
- 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)
232
324
  end
233
325
 
234
326
  ##
@@ -248,7 +340,7 @@ module Google
248
340
  # * `timeout` (*type:* `Numeric`) -
249
341
  # Default timeout in seconds.
250
342
  # * `metadata` (*type:* `Hash{Symbol=>String}`) -
251
- # Additional gRPC headers to be sent with the call.
343
+ # Additional headers to be sent with the call.
252
344
  # * `retry_policy` (*type:* `Hash`) -
253
345
  # The retry policy. The value is a hash with the following keys:
254
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.3.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-07-07 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.4'
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.4'
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