google-cloud-retail-v2 0.6.0 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/lib/google/cloud/retail/v2/catalog_service/client.rb +86 -12
- data/lib/google/cloud/retail/v2/completion_service/client.rb +53 -11
- data/lib/google/cloud/retail/v2/completion_service/operations.rb +115 -12
- data/lib/google/cloud/retail/v2/prediction_service/client.rb +20 -3
- data/lib/google/cloud/retail/v2/product_service/client.rb +218 -30
- data/lib/google/cloud/retail/v2/product_service/operations.rb +115 -12
- data/lib/google/cloud/retail/v2/search_service/client.rb +29 -3
- data/lib/google/cloud/retail/v2/user_event_service/client.rb +123 -16
- data/lib/google/cloud/retail/v2/user_event_service/operations.rb +115 -12
- data/lib/google/cloud/retail/v2/version.rb +1 -1
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/cloud/retail/v2/catalog.rb +6 -6
- data/proto_docs/google/cloud/retail/v2/common.rb +4 -3
- data/proto_docs/google/cloud/retail/v2/completion_service.rb +5 -5
- data/proto_docs/google/cloud/retail/v2/import_config.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/product.rb +1 -1
- data/proto_docs/google/cloud/retail/v2/product_service.rb +2 -2
- data/proto_docs/google/cloud/retail/v2/search_service.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5a649dac660528f0cc6df350433fadbebeb4667b242626fcc0132c9f0991764
|
4
|
+
data.tar.gz: 7eeb345615247cc8d5615e82fc552e33da8e97dfce7de9a86a178ce4eb6bdca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7c62e299e7df843e466cbec3e49396114c482470af10c9c7b2af946711f7e3d48cf260e7f99583299609da6af3d84cc5750a8c56105f35c733f02ebe8f53219
|
7
|
+
data.tar.gz: 8d9424d295d578b88ab237281ae148794a12460ce96d8a5ed996c69c442414ab3849ba312967f15ebed17ea5d923ca159952b8eb9be7169dad7f52e5ea160e59
|
data/.yardopts
CHANGED
data/AUTHENTICATION.md
CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
121
121
|
*should* only be used during development.
|
122
122
|
|
123
|
-
[gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
|
124
|
-
[dev-console]: https://console.cloud.google.com/project
|
125
|
-
|
126
|
-
[enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
|
127
|
-
|
128
|
-
[create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
|
129
|
-
[create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
|
130
|
-
[reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
|
131
|
-
|
132
123
|
## Creating a Service Account
|
133
124
|
|
134
125
|
Google Cloud requires **Service Account Credentials** to
|
@@ -139,31 +130,22 @@ If you are not running this client within
|
|
139
130
|
[Google Cloud Platform environments](#google-cloud-platform-environments), you
|
140
131
|
need a Google Developers service account.
|
141
132
|
|
142
|
-
1. Visit the [Google
|
133
|
+
1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
|
143
134
|
2. Create a new project or click on an existing project.
|
144
|
-
3. Activate the
|
135
|
+
3. Activate the menu in the upper left and select **APIs & Services**. From
|
145
136
|
here, you will enable the APIs that your application requires.
|
146
137
|
|
147
|
-
![Enable the APIs that your application requires][enable-apis]
|
148
|
-
|
149
138
|
*Note: You may need to enable billing in order to use these services.*
|
150
139
|
|
151
140
|
4. Select **Credentials** from the side navigation.
|
152
141
|
|
153
|
-
|
154
|
-
|
155
|
-
![Create a new service account][create-new-service-account]
|
156
|
-
|
157
|
-
![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
|
158
|
-
|
159
|
-
Find the "Add credentials" drop down and select "Service account" to be
|
160
|
-
guided through downloading a new JSON key file.
|
142
|
+
Find the "Create credentials" drop down near the top of the page, and select
|
143
|
+
"Service account" to be guided through downloading a new JSON key file.
|
161
144
|
|
162
145
|
If you want to re-use an existing service account, you can easily generate a
|
163
|
-
new key file. Just select the account you wish to re-use,
|
164
|
-
|
165
|
-
|
166
|
-
![Re-use an existing service account][reuse-service-account]
|
146
|
+
new key file. Just select the account you wish to re-use, click the pencil
|
147
|
+
tool on the right side to edit the service account, select the **Keys** tab,
|
148
|
+
and then select **Add Key**.
|
167
149
|
|
168
150
|
The key file you download will be used by this library to authenticate API
|
169
151
|
requests and should be stored in a secure location.
|
@@ -201,6 +201,27 @@ module Google
|
|
201
201
|
#
|
202
202
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
203
203
|
#
|
204
|
+
# @example Basic example
|
205
|
+
# require "google/cloud/retail/v2"
|
206
|
+
#
|
207
|
+
# # Create a client object. The client can be reused for multiple calls.
|
208
|
+
# client = Google::Cloud::Retail::V2::CatalogService::Client.new
|
209
|
+
#
|
210
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
211
|
+
# request = Google::Cloud::Retail::V2::ListCatalogsRequest.new
|
212
|
+
#
|
213
|
+
# # Call the list_catalogs method.
|
214
|
+
# result = client.list_catalogs request
|
215
|
+
#
|
216
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
217
|
+
# # iterate over all elements by calling #each, and the enumerable
|
218
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
219
|
+
# # methods are also available for managing paging directly.
|
220
|
+
# result.each do |response|
|
221
|
+
# # Each element is of type ::Google::Cloud::Retail::V2::Catalog.
|
222
|
+
# p response
|
223
|
+
# end
|
224
|
+
#
|
204
225
|
def list_catalogs request, options = nil
|
205
226
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
206
227
|
|
@@ -218,9 +239,11 @@ module Google
|
|
218
239
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
219
240
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
220
241
|
|
221
|
-
header_params = {
|
222
|
-
|
223
|
-
|
242
|
+
header_params = {}
|
243
|
+
if request.parent
|
244
|
+
header_params["parent"] = request.parent
|
245
|
+
end
|
246
|
+
|
224
247
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
225
248
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
226
249
|
|
@@ -283,6 +306,21 @@ module Google
|
|
283
306
|
#
|
284
307
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
285
308
|
#
|
309
|
+
# @example Basic example
|
310
|
+
# require "google/cloud/retail/v2"
|
311
|
+
#
|
312
|
+
# # Create a client object. The client can be reused for multiple calls.
|
313
|
+
# client = Google::Cloud::Retail::V2::CatalogService::Client.new
|
314
|
+
#
|
315
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
316
|
+
# request = Google::Cloud::Retail::V2::UpdateCatalogRequest.new
|
317
|
+
#
|
318
|
+
# # Call the update_catalog method.
|
319
|
+
# result = client.update_catalog request
|
320
|
+
#
|
321
|
+
# # The returned object is of type Google::Cloud::Retail::V2::Catalog.
|
322
|
+
# p result
|
323
|
+
#
|
286
324
|
def update_catalog request, options = nil
|
287
325
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
288
326
|
|
@@ -300,9 +338,11 @@ module Google
|
|
300
338
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
301
339
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
302
340
|
|
303
|
-
header_params = {
|
304
|
-
|
305
|
-
|
341
|
+
header_params = {}
|
342
|
+
if request.catalog&.name
|
343
|
+
header_params["catalog.name"] = request.catalog.name
|
344
|
+
end
|
345
|
+
|
306
346
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
307
347
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
308
348
|
|
@@ -400,6 +440,21 @@ module Google
|
|
400
440
|
#
|
401
441
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
402
442
|
#
|
443
|
+
# @example Basic example
|
444
|
+
# require "google/cloud/retail/v2"
|
445
|
+
#
|
446
|
+
# # Create a client object. The client can be reused for multiple calls.
|
447
|
+
# client = Google::Cloud::Retail::V2::CatalogService::Client.new
|
448
|
+
#
|
449
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
450
|
+
# request = Google::Cloud::Retail::V2::SetDefaultBranchRequest.new
|
451
|
+
#
|
452
|
+
# # Call the set_default_branch method.
|
453
|
+
# result = client.set_default_branch request
|
454
|
+
#
|
455
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
456
|
+
# p result
|
457
|
+
#
|
403
458
|
def set_default_branch request, options = nil
|
404
459
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
405
460
|
|
@@ -417,9 +472,11 @@ module Google
|
|
417
472
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
418
473
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
419
474
|
|
420
|
-
header_params = {
|
421
|
-
|
422
|
-
|
475
|
+
header_params = {}
|
476
|
+
if request.catalog
|
477
|
+
header_params["catalog"] = request.catalog
|
478
|
+
end
|
479
|
+
|
423
480
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
424
481
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
425
482
|
|
@@ -475,6 +532,21 @@ module Google
|
|
475
532
|
#
|
476
533
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
477
534
|
#
|
535
|
+
# @example Basic example
|
536
|
+
# require "google/cloud/retail/v2"
|
537
|
+
#
|
538
|
+
# # Create a client object. The client can be reused for multiple calls.
|
539
|
+
# client = Google::Cloud::Retail::V2::CatalogService::Client.new
|
540
|
+
#
|
541
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
542
|
+
# request = Google::Cloud::Retail::V2::GetDefaultBranchRequest.new
|
543
|
+
#
|
544
|
+
# # Call the get_default_branch method.
|
545
|
+
# result = client.get_default_branch request
|
546
|
+
#
|
547
|
+
# # The returned object is of type Google::Cloud::Retail::V2::GetDefaultBranchResponse.
|
548
|
+
# p result
|
549
|
+
#
|
478
550
|
def get_default_branch request, options = nil
|
479
551
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
480
552
|
|
@@ -492,9 +564,11 @@ module Google
|
|
492
564
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
493
565
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
494
566
|
|
495
|
-
header_params = {
|
496
|
-
|
497
|
-
|
567
|
+
header_params = {}
|
568
|
+
if request.catalog
|
569
|
+
header_params["catalog"] = request.catalog
|
570
|
+
end
|
571
|
+
|
498
572
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
499
573
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
500
574
|
|
@@ -144,6 +144,7 @@ module Google
|
|
144
144
|
|
145
145
|
@operations_client = Operations.new do |config|
|
146
146
|
config.credentials = credentials
|
147
|
+
config.quota_project = @quota_project_id
|
147
148
|
config.endpoint = @config.endpoint
|
148
149
|
end
|
149
150
|
|
@@ -215,18 +216,18 @@ module Google
|
|
215
216
|
# @param device_type [::String]
|
216
217
|
# The device type context for completion suggestions.
|
217
218
|
# It is useful to apply different suggestions on different device types, e.g.
|
218
|
-
# DESKTOP
|
219
|
+
# `DESKTOP`, `MOBILE`. If it is empty, the suggestions are across all device
|
219
220
|
# types.
|
220
221
|
#
|
221
222
|
# Supported formats:
|
222
223
|
#
|
223
|
-
# * UNKNOWN_DEVICE_TYPE
|
224
|
+
# * `UNKNOWN_DEVICE_TYPE`
|
224
225
|
#
|
225
|
-
# * DESKTOP
|
226
|
+
# * `DESKTOP`
|
226
227
|
#
|
227
|
-
# * MOBILE
|
228
|
+
# * `MOBILE`
|
228
229
|
#
|
229
|
-
# * A customized string starts with OTHER_
|
230
|
+
# * A customized string starts with `OTHER_`, e.g. `OTHER_IPHONE`.
|
230
231
|
# @param dataset [::String]
|
231
232
|
# Determines which dataset to use for fetching completion. "user-data" will
|
232
233
|
# use the imported dataset through
|
@@ -256,6 +257,21 @@ module Google
|
|
256
257
|
#
|
257
258
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
258
259
|
#
|
260
|
+
# @example Basic example
|
261
|
+
# require "google/cloud/retail/v2"
|
262
|
+
#
|
263
|
+
# # Create a client object. The client can be reused for multiple calls.
|
264
|
+
# client = Google::Cloud::Retail::V2::CompletionService::Client.new
|
265
|
+
#
|
266
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
267
|
+
# request = Google::Cloud::Retail::V2::CompleteQueryRequest.new
|
268
|
+
#
|
269
|
+
# # Call the complete_query method.
|
270
|
+
# result = client.complete_query request
|
271
|
+
#
|
272
|
+
# # The returned object is of type Google::Cloud::Retail::V2::CompleteQueryResponse.
|
273
|
+
# p result
|
274
|
+
#
|
259
275
|
def complete_query request, options = nil
|
260
276
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
261
277
|
|
@@ -273,9 +289,11 @@ module Google
|
|
273
289
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
274
290
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
275
291
|
|
276
|
-
header_params = {
|
277
|
-
|
278
|
-
|
292
|
+
header_params = {}
|
293
|
+
if request.catalog
|
294
|
+
header_params["catalog"] = request.catalog
|
295
|
+
end
|
296
|
+
|
279
297
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
280
298
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
281
299
|
|
@@ -340,6 +358,28 @@ module Google
|
|
340
358
|
#
|
341
359
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
342
360
|
#
|
361
|
+
# @example Basic example
|
362
|
+
# require "google/cloud/retail/v2"
|
363
|
+
#
|
364
|
+
# # Create a client object. The client can be reused for multiple calls.
|
365
|
+
# client = Google::Cloud::Retail::V2::CompletionService::Client.new
|
366
|
+
#
|
367
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
368
|
+
# request = Google::Cloud::Retail::V2::ImportCompletionDataRequest.new
|
369
|
+
#
|
370
|
+
# # Call the import_completion_data method.
|
371
|
+
# result = client.import_completion_data request
|
372
|
+
#
|
373
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
374
|
+
# # object to check the status of an operation, cancel it, or wait
|
375
|
+
# # for results. Here is how to block until completion:
|
376
|
+
# result.wait_until_done! timeout: 60
|
377
|
+
# if result.response?
|
378
|
+
# p result.response
|
379
|
+
# else
|
380
|
+
# puts "Error!"
|
381
|
+
# end
|
382
|
+
#
|
343
383
|
def import_completion_data request, options = nil
|
344
384
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
345
385
|
|
@@ -357,9 +397,11 @@ module Google
|
|
357
397
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
358
398
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
359
399
|
|
360
|
-
header_params = {
|
361
|
-
|
362
|
-
|
400
|
+
header_params = {}
|
401
|
+
if request.parent
|
402
|
+
header_params["parent"] = request.parent
|
403
|
+
end
|
404
|
+
|
363
405
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
364
406
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
365
407
|
|
@@ -143,6 +143,27 @@ module Google
|
|
143
143
|
#
|
144
144
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
145
145
|
#
|
146
|
+
# @example Basic example
|
147
|
+
# require "google/longrunning"
|
148
|
+
#
|
149
|
+
# # Create a client object. The client can be reused for multiple calls.
|
150
|
+
# client = Google::Longrunning::Operations::Client.new
|
151
|
+
#
|
152
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
153
|
+
# request = Google::Longrunning::ListOperationsRequest.new
|
154
|
+
#
|
155
|
+
# # Call the list_operations method.
|
156
|
+
# result = client.list_operations request
|
157
|
+
#
|
158
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
159
|
+
# # iterate over all elements by calling #each, and the enumerable
|
160
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
161
|
+
# # methods are also available for managing paging directly.
|
162
|
+
# result.each do |response|
|
163
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
164
|
+
# p response
|
165
|
+
# end
|
166
|
+
#
|
146
167
|
def list_operations request, options = nil
|
147
168
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
148
169
|
|
@@ -160,9 +181,11 @@ module Google
|
|
160
181
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
161
182
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
162
183
|
|
163
|
-
header_params = {
|
164
|
-
|
165
|
-
|
184
|
+
header_params = {}
|
185
|
+
if request.name
|
186
|
+
header_params["name"] = request.name
|
187
|
+
end
|
188
|
+
|
166
189
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
167
190
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
168
191
|
|
@@ -215,6 +238,28 @@ module Google
|
|
215
238
|
#
|
216
239
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
217
240
|
#
|
241
|
+
# @example Basic example
|
242
|
+
# require "google/longrunning"
|
243
|
+
#
|
244
|
+
# # Create a client object. The client can be reused for multiple calls.
|
245
|
+
# client = Google::Longrunning::Operations::Client.new
|
246
|
+
#
|
247
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
248
|
+
# request = Google::Longrunning::GetOperationRequest.new
|
249
|
+
#
|
250
|
+
# # Call the get_operation method.
|
251
|
+
# result = client.get_operation request
|
252
|
+
#
|
253
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
254
|
+
# # object to check the status of an operation, cancel it, or wait
|
255
|
+
# # for results. Here is how to block until completion:
|
256
|
+
# result.wait_until_done! timeout: 60
|
257
|
+
# if result.response?
|
258
|
+
# p result.response
|
259
|
+
# else
|
260
|
+
# puts "Error!"
|
261
|
+
# end
|
262
|
+
#
|
218
263
|
def get_operation request, options = nil
|
219
264
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
220
265
|
|
@@ -232,9 +277,11 @@ module Google
|
|
232
277
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
233
278
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
234
279
|
|
235
|
-
header_params = {
|
236
|
-
|
237
|
-
|
280
|
+
header_params = {}
|
281
|
+
if request.name
|
282
|
+
header_params["name"] = request.name
|
283
|
+
end
|
284
|
+
|
238
285
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
239
286
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
240
287
|
|
@@ -287,6 +334,21 @@ module Google
|
|
287
334
|
#
|
288
335
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
289
336
|
#
|
337
|
+
# @example Basic example
|
338
|
+
# require "google/longrunning"
|
339
|
+
#
|
340
|
+
# # Create a client object. The client can be reused for multiple calls.
|
341
|
+
# client = Google::Longrunning::Operations::Client.new
|
342
|
+
#
|
343
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
344
|
+
# request = Google::Longrunning::DeleteOperationRequest.new
|
345
|
+
#
|
346
|
+
# # Call the delete_operation method.
|
347
|
+
# result = client.delete_operation request
|
348
|
+
#
|
349
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
350
|
+
# p result
|
351
|
+
#
|
290
352
|
def delete_operation request, options = nil
|
291
353
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
292
354
|
|
@@ -304,9 +366,11 @@ module Google
|
|
304
366
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
305
367
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
306
368
|
|
307
|
-
header_params = {
|
308
|
-
|
309
|
-
|
369
|
+
header_params = {}
|
370
|
+
if request.name
|
371
|
+
header_params["name"] = request.name
|
372
|
+
end
|
373
|
+
|
310
374
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
311
375
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
312
376
|
|
@@ -364,6 +428,21 @@ module Google
|
|
364
428
|
#
|
365
429
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
366
430
|
#
|
431
|
+
# @example Basic example
|
432
|
+
# require "google/longrunning"
|
433
|
+
#
|
434
|
+
# # Create a client object. The client can be reused for multiple calls.
|
435
|
+
# client = Google::Longrunning::Operations::Client.new
|
436
|
+
#
|
437
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
438
|
+
# request = Google::Longrunning::CancelOperationRequest.new
|
439
|
+
#
|
440
|
+
# # Call the cancel_operation method.
|
441
|
+
# result = client.cancel_operation request
|
442
|
+
#
|
443
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
444
|
+
# p result
|
445
|
+
#
|
367
446
|
def cancel_operation request, options = nil
|
368
447
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
369
448
|
|
@@ -381,9 +460,11 @@ module Google
|
|
381
460
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
382
461
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
383
462
|
|
384
|
-
header_params = {
|
385
|
-
|
386
|
-
|
463
|
+
header_params = {}
|
464
|
+
if request.name
|
465
|
+
header_params["name"] = request.name
|
466
|
+
end
|
467
|
+
|
387
468
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
388
469
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
389
470
|
|
@@ -444,6 +525,28 @@ module Google
|
|
444
525
|
#
|
445
526
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
446
527
|
#
|
528
|
+
# @example Basic example
|
529
|
+
# require "google/longrunning"
|
530
|
+
#
|
531
|
+
# # Create a client object. The client can be reused for multiple calls.
|
532
|
+
# client = Google::Longrunning::Operations::Client.new
|
533
|
+
#
|
534
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
535
|
+
# request = Google::Longrunning::WaitOperationRequest.new
|
536
|
+
#
|
537
|
+
# # Call the wait_operation method.
|
538
|
+
# result = client.wait_operation request
|
539
|
+
#
|
540
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
541
|
+
# # object to check the status of an operation, cancel it, or wait
|
542
|
+
# # for results. Here is how to block until completion:
|
543
|
+
# result.wait_until_done! timeout: 60
|
544
|
+
# if result.response?
|
545
|
+
# p result.response
|
546
|
+
# else
|
547
|
+
# puts "Error!"
|
548
|
+
# end
|
549
|
+
#
|
447
550
|
def wait_operation request, options = nil
|
448
551
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
449
552
|
|
@@ -274,6 +274,21 @@ module Google
|
|
274
274
|
#
|
275
275
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
276
276
|
#
|
277
|
+
# @example Basic example
|
278
|
+
# require "google/cloud/retail/v2"
|
279
|
+
#
|
280
|
+
# # Create a client object. The client can be reused for multiple calls.
|
281
|
+
# client = Google::Cloud::Retail::V2::PredictionService::Client.new
|
282
|
+
#
|
283
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
284
|
+
# request = Google::Cloud::Retail::V2::PredictRequest.new
|
285
|
+
#
|
286
|
+
# # Call the predict method.
|
287
|
+
# result = client.predict request
|
288
|
+
#
|
289
|
+
# # The returned object is of type Google::Cloud::Retail::V2::PredictResponse.
|
290
|
+
# p result
|
291
|
+
#
|
277
292
|
def predict request, options = nil
|
278
293
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
279
294
|
|
@@ -291,9 +306,11 @@ module Google
|
|
291
306
|
gapic_version: ::Google::Cloud::Retail::V2::VERSION
|
292
307
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
293
308
|
|
294
|
-
header_params = {
|
295
|
-
|
296
|
-
|
309
|
+
header_params = {}
|
310
|
+
if request.placement
|
311
|
+
header_params["placement"] = request.placement
|
312
|
+
end
|
313
|
+
|
297
314
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
298
315
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
299
316
|
|