google-cloud-retail-v2 0.5.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/retail/v2/catalog_pb.rb +2 -2
  3. data/lib/google/cloud/retail/v2/catalog_service/client.rb +88 -14
  4. data/lib/google/cloud/retail/v2/catalog_service_pb.rb +2 -2
  5. data/lib/google/cloud/retail/v2/catalog_service_services_pb.rb +1 -1
  6. data/lib/google/cloud/retail/v2/common_pb.rb +2 -2
  7. data/lib/google/cloud/retail/v2/completion_service/client.rb +54 -13
  8. data/lib/google/cloud/retail/v2/completion_service/operations.rb +115 -12
  9. data/lib/google/cloud/retail/v2/completion_service_pb.rb +2 -2
  10. data/lib/google/cloud/retail/v2/completion_service_services_pb.rb +1 -1
  11. data/lib/google/cloud/retail/v2/import_config_pb.rb +2 -2
  12. data/lib/google/cloud/retail/v2/prediction_service/client.rb +22 -5
  13. data/lib/google/cloud/retail/v2/prediction_service_pb.rb +2 -2
  14. data/lib/google/cloud/retail/v2/prediction_service_services_pb.rb +1 -1
  15. data/lib/google/cloud/retail/v2/product_pb.rb +2 -2
  16. data/lib/google/cloud/retail/v2/product_service/client.rb +229 -37
  17. data/lib/google/cloud/retail/v2/product_service/operations.rb +115 -12
  18. data/lib/google/cloud/retail/v2/product_service_pb.rb +3 -2
  19. data/lib/google/cloud/retail/v2/product_service_services_pb.rb +1 -1
  20. data/lib/google/cloud/retail/v2/purge_config_pb.rb +2 -2
  21. data/lib/google/cloud/retail/v2/search_service/client.rb +45 -16
  22. data/lib/google/cloud/retail/v2/search_service_pb.rb +9 -2
  23. data/lib/google/cloud/retail/v2/search_service_services_pb.rb +1 -1
  24. data/lib/google/cloud/retail/v2/user_event_pb.rb +2 -2
  25. data/lib/google/cloud/retail/v2/user_event_service/client.rb +133 -17
  26. data/lib/google/cloud/retail/v2/user_event_service/operations.rb +115 -12
  27. data/lib/google/cloud/retail/v2/user_event_service_pb.rb +2 -2
  28. data/lib/google/cloud/retail/v2/user_event_service_services_pb.rb +1 -1
  29. data/lib/google/cloud/retail/v2/version.rb +1 -1
  30. data/proto_docs/google/api/httpbody.rb +7 -3
  31. data/proto_docs/google/cloud/retail/v2/common.rb +6 -5
  32. data/proto_docs/google/cloud/retail/v2/completion_service.rb +5 -5
  33. data/proto_docs/google/cloud/retail/v2/import_config.rb +1 -1
  34. data/proto_docs/google/cloud/retail/v2/product.rb +16 -10
  35. data/proto_docs/google/cloud/retail/v2/product_service.rb +8 -8
  36. data/proto_docs/google/cloud/retail/v2/search_service.rb +52 -15
  37. data/proto_docs/google/cloud/retail/v2/user_event.rb +4 -4
  38. metadata +2 -2
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/product.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/field_behavior_pb'
8
6
  require 'google/api/resource_pb'
@@ -11,6 +9,8 @@ require 'google/protobuf/duration_pb'
11
9
  require 'google/protobuf/field_mask_pb'
12
10
  require 'google/protobuf/timestamp_pb'
13
11
  require 'google/protobuf/wrappers_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/retail/v2/product.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.retail.v2.Product" do
@@ -65,9 +65,14 @@ module Google
65
65
  end
66
66
  default_config = Client::Configuration.new parent_config
67
67
 
68
- default_config.timeout = 60.0
68
+ default_config.timeout = 30.0
69
69
  default_config.retry_policy = {
70
- initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
70
+ initial_delay: 0.1, max_delay: 30.0, multiplier: 1.3, retry_codes: [14, 4]
71
+ }
72
+
73
+ default_config.rpcs.import_products.timeout = 300.0
74
+ default_config.rpcs.import_products.retry_policy = {
75
+ initial_delay: 0.1, max_delay: 300.0, multiplier: 1.3, retry_codes: [14, 4]
71
76
  }
72
77
 
73
78
  default_config
@@ -210,6 +215,21 @@ module Google
210
215
  #
211
216
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
212
217
  #
218
+ # @example Basic example
219
+ # require "google/cloud/retail/v2"
220
+ #
221
+ # # Create a client object. The client can be reused for multiple calls.
222
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
223
+ #
224
+ # # Create a request. To set request fields, pass in keyword arguments.
225
+ # request = Google::Cloud::Retail::V2::CreateProductRequest.new
226
+ #
227
+ # # Call the create_product method.
228
+ # result = client.create_product request
229
+ #
230
+ # # The returned object is of type Google::Cloud::Retail::V2::Product.
231
+ # p result
232
+ #
213
233
  def create_product request, options = nil
214
234
  raise ::ArgumentError, "request must be provided" if request.nil?
215
235
 
@@ -227,9 +247,11 @@ module Google
227
247
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
228
248
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
229
249
 
230
- header_params = {
231
- "parent" => request.parent
232
- }
250
+ header_params = {}
251
+ if request.parent
252
+ header_params["parent"] = request.parent
253
+ end
254
+
233
255
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
234
256
  metadata[:"x-goog-request-params"] ||= request_params_header
235
257
 
@@ -287,6 +309,21 @@ module Google
287
309
  #
288
310
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
311
  #
312
+ # @example Basic example
313
+ # require "google/cloud/retail/v2"
314
+ #
315
+ # # Create a client object. The client can be reused for multiple calls.
316
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
317
+ #
318
+ # # Create a request. To set request fields, pass in keyword arguments.
319
+ # request = Google::Cloud::Retail::V2::GetProductRequest.new
320
+ #
321
+ # # Call the get_product method.
322
+ # result = client.get_product request
323
+ #
324
+ # # The returned object is of type Google::Cloud::Retail::V2::Product.
325
+ # p result
326
+ #
290
327
  def get_product request, options = nil
291
328
  raise ::ArgumentError, "request must be provided" if request.nil?
292
329
 
@@ -304,9 +341,11 @@ module Google
304
341
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
305
342
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
343
 
307
- header_params = {
308
- "name" => request.name
309
- }
344
+ header_params = {}
345
+ if request.name
346
+ header_params["name"] = request.name
347
+ end
348
+
310
349
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
350
  metadata[:"x-goog-request-params"] ||= request_params_header
312
351
 
@@ -426,6 +465,27 @@ module Google
426
465
  #
427
466
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
467
  #
468
+ # @example Basic example
469
+ # require "google/cloud/retail/v2"
470
+ #
471
+ # # Create a client object. The client can be reused for multiple calls.
472
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
473
+ #
474
+ # # Create a request. To set request fields, pass in keyword arguments.
475
+ # request = Google::Cloud::Retail::V2::ListProductsRequest.new
476
+ #
477
+ # # Call the list_products method.
478
+ # result = client.list_products request
479
+ #
480
+ # # The returned object is of type Gapic::PagedEnumerable. You can
481
+ # # iterate over all elements by calling #each, and the enumerable
482
+ # # will lazily make API calls to fetch subsequent pages. Other
483
+ # # methods are also available for managing paging directly.
484
+ # result.each do |response|
485
+ # # Each element is of type ::Google::Cloud::Retail::V2::Product.
486
+ # p response
487
+ # end
488
+ #
429
489
  def list_products request, options = nil
430
490
  raise ::ArgumentError, "request must be provided" if request.nil?
431
491
 
@@ -443,9 +503,11 @@ module Google
443
503
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
444
504
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
505
 
446
- header_params = {
447
- "parent" => request.parent
448
- }
506
+ header_params = {}
507
+ if request.parent
508
+ header_params["parent"] = request.parent
509
+ end
510
+
449
511
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
450
512
  metadata[:"x-goog-request-params"] ||= request_params_header
451
513
 
@@ -516,6 +578,21 @@ module Google
516
578
  #
517
579
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
518
580
  #
581
+ # @example Basic example
582
+ # require "google/cloud/retail/v2"
583
+ #
584
+ # # Create a client object. The client can be reused for multiple calls.
585
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
586
+ #
587
+ # # Create a request. To set request fields, pass in keyword arguments.
588
+ # request = Google::Cloud::Retail::V2::UpdateProductRequest.new
589
+ #
590
+ # # Call the update_product method.
591
+ # result = client.update_product request
592
+ #
593
+ # # The returned object is of type Google::Cloud::Retail::V2::Product.
594
+ # p result
595
+ #
519
596
  def update_product request, options = nil
520
597
  raise ::ArgumentError, "request must be provided" if request.nil?
521
598
 
@@ -533,9 +610,11 @@ module Google
533
610
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
534
611
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
535
612
 
536
- header_params = {
537
- "product.name" => request.product.name
538
- }
613
+ header_params = {}
614
+ if request.product&.name
615
+ header_params["product.name"] = request.product.name
616
+ end
617
+
539
618
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
540
619
  metadata[:"x-goog-request-params"] ||= request_params_header
541
620
 
@@ -604,6 +683,21 @@ module Google
604
683
  #
605
684
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
606
685
  #
686
+ # @example Basic example
687
+ # require "google/cloud/retail/v2"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::Retail::V2::DeleteProductRequest.new
694
+ #
695
+ # # Call the delete_product method.
696
+ # result = client.delete_product request
697
+ #
698
+ # # The returned object is of type Google::Protobuf::Empty.
699
+ # p result
700
+ #
607
701
  def delete_product request, options = nil
608
702
  raise ::ArgumentError, "request must be provided" if request.nil?
609
703
 
@@ -621,9 +715,11 @@ module Google
621
715
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
622
716
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
623
717
 
624
- header_params = {
625
- "name" => request.name
626
- }
718
+ header_params = {}
719
+ if request.name
720
+ header_params["name"] = request.name
721
+ end
722
+
627
723
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
628
724
  metadata[:"x-goog-request-params"] ||= request_params_header
629
725
 
@@ -677,7 +773,7 @@ module Google
677
773
  # Unique identifier provided by client, within the ancestor
678
774
  # dataset scope. Ensures idempotency and used for request deduplication.
679
775
  # Server-generated if unspecified. Up to 128 characters long and must match
680
- # the pattern: "[a-zA-Z0-9_]+". This is returned as [Operation.name][] in
776
+ # the pattern: `[a-zA-Z0-9_]+`. This is returned as [Operation.name][] in
681
777
  # {::Google::Cloud::Retail::V2::ImportMetadata ImportMetadata}.
682
778
  #
683
779
  # Only supported when
@@ -713,6 +809,28 @@ module Google
713
809
  #
714
810
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
715
811
  #
812
+ # @example Basic example
813
+ # require "google/cloud/retail/v2"
814
+ #
815
+ # # Create a client object. The client can be reused for multiple calls.
816
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
817
+ #
818
+ # # Create a request. To set request fields, pass in keyword arguments.
819
+ # request = Google::Cloud::Retail::V2::ImportProductsRequest.new
820
+ #
821
+ # # Call the import_products method.
822
+ # result = client.import_products request
823
+ #
824
+ # # The returned object is of type Gapic::Operation. You can use this
825
+ # # object to check the status of an operation, cancel it, or wait
826
+ # # for results. Here is how to block until completion:
827
+ # result.wait_until_done! timeout: 60
828
+ # if result.response?
829
+ # p result.response
830
+ # else
831
+ # puts "Error!"
832
+ # end
833
+ #
716
834
  def import_products request, options = nil
717
835
  raise ::ArgumentError, "request must be provided" if request.nil?
718
836
 
@@ -730,9 +848,11 @@ module Google
730
848
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
731
849
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
732
850
 
733
- header_params = {
734
- "parent" => request.parent
735
- }
851
+ header_params = {}
852
+ if request.parent
853
+ header_params["parent"] = request.parent
854
+ end
855
+
736
856
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
737
857
  metadata[:"x-goog-request-params"] ||= request_params_header
738
858
 
@@ -862,7 +982,7 @@ module Google
862
982
  # {::Google::Cloud::Retail::V2::Product#name Product.name} is not found, the
863
983
  # inventory update will still be processed and retained for at most 1 day
864
984
  # until the {::Google::Cloud::Retail::V2::Product Product} is created. If set to
865
- # false, an INVALID_ARGUMENT error is returned if the
985
+ # false, a NOT_FOUND error is returned if the
866
986
  # {::Google::Cloud::Retail::V2::Product Product} is not found.
867
987
  #
868
988
  # @yield [response, operation] Access the result along with the RPC operation
@@ -873,6 +993,28 @@ module Google
873
993
  #
874
994
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
875
995
  #
996
+ # @example Basic example
997
+ # require "google/cloud/retail/v2"
998
+ #
999
+ # # Create a client object. The client can be reused for multiple calls.
1000
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
1001
+ #
1002
+ # # Create a request. To set request fields, pass in keyword arguments.
1003
+ # request = Google::Cloud::Retail::V2::SetInventoryRequest.new
1004
+ #
1005
+ # # Call the set_inventory method.
1006
+ # result = client.set_inventory request
1007
+ #
1008
+ # # The returned object is of type Gapic::Operation. You can use this
1009
+ # # object to check the status of an operation, cancel it, or wait
1010
+ # # for results. Here is how to block until completion:
1011
+ # result.wait_until_done! timeout: 60
1012
+ # if result.response?
1013
+ # p result.response
1014
+ # else
1015
+ # puts "Error!"
1016
+ # end
1017
+ #
876
1018
  def set_inventory request, options = nil
877
1019
  raise ::ArgumentError, "request must be provided" if request.nil?
878
1020
 
@@ -890,9 +1032,11 @@ module Google
890
1032
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
891
1033
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
892
1034
 
893
- header_params = {
894
- "inventory.name" => request.inventory.name
895
- }
1035
+ header_params = {}
1036
+ if request.inventory&.name
1037
+ header_params["inventory.name"] = request.inventory.name
1038
+ end
1039
+
896
1040
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
897
1041
  metadata[:"x-goog-request-params"] ||= request_params_header
898
1042
 
@@ -983,7 +1127,7 @@ module Google
983
1127
  #
984
1128
  # At least 1 value is required, and a maximum of 2000 values are allowed.
985
1129
  # Each value must be a string with a length limit of 10 characters, matching
986
- # the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
1130
+ # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
987
1131
  # INVALID_ARGUMENT error is returned.
988
1132
  #
989
1133
  # If the total number of place IDs exceeds 2000 for this
@@ -997,8 +1141,8 @@ module Google
997
1141
  # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
998
1142
  # found, the fulfillment information will still be processed and retained for
999
1143
  # at most 1 day and processed once the
1000
- # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
1001
- # INVALID_ARGUMENT error is returned if the
1144
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a
1145
+ # NOT_FOUND error is returned if the
1002
1146
  # {::Google::Cloud::Retail::V2::Product Product} is not found.
1003
1147
  #
1004
1148
  # @yield [response, operation] Access the result along with the RPC operation
@@ -1009,6 +1153,28 @@ module Google
1009
1153
  #
1010
1154
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1011
1155
  #
1156
+ # @example Basic example
1157
+ # require "google/cloud/retail/v2"
1158
+ #
1159
+ # # Create a client object. The client can be reused for multiple calls.
1160
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
1161
+ #
1162
+ # # Create a request. To set request fields, pass in keyword arguments.
1163
+ # request = Google::Cloud::Retail::V2::AddFulfillmentPlacesRequest.new
1164
+ #
1165
+ # # Call the add_fulfillment_places method.
1166
+ # result = client.add_fulfillment_places request
1167
+ #
1168
+ # # The returned object is of type Gapic::Operation. You can use this
1169
+ # # object to check the status of an operation, cancel it, or wait
1170
+ # # for results. Here is how to block until completion:
1171
+ # result.wait_until_done! timeout: 60
1172
+ # if result.response?
1173
+ # p result.response
1174
+ # else
1175
+ # puts "Error!"
1176
+ # end
1177
+ #
1012
1178
  def add_fulfillment_places request, options = nil
1013
1179
  raise ::ArgumentError, "request must be provided" if request.nil?
1014
1180
 
@@ -1026,9 +1192,11 @@ module Google
1026
1192
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
1027
1193
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1028
1194
 
1029
- header_params = {
1030
- "product" => request.product
1031
- }
1195
+ header_params = {}
1196
+ if request.product
1197
+ header_params["product"] = request.product
1198
+ end
1199
+
1032
1200
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1033
1201
  metadata[:"x-goog-request-params"] ||= request_params_header
1034
1202
 
@@ -1118,7 +1286,7 @@ module Google
1118
1286
  #
1119
1287
  # At least 1 value is required, and a maximum of 2000 values are allowed.
1120
1288
  # Each value must be a string with a length limit of 10 characters, matching
1121
- # the pattern [a-zA-Z0-9_-]+, such as "store1" or "REGION-2". Otherwise, an
1289
+ # the pattern `[a-zA-Z0-9_-]+`, such as "store1" or "REGION-2". Otherwise, an
1122
1290
  # INVALID_ARGUMENT error is returned.
1123
1291
  # @param remove_time [::Google::Protobuf::Timestamp, ::Hash]
1124
1292
  # The time when the fulfillment updates are issued, used to prevent
@@ -1128,8 +1296,8 @@ module Google
1128
1296
  # If set to true, and the {::Google::Cloud::Retail::V2::Product Product} is not
1129
1297
  # found, the fulfillment information will still be processed and retained for
1130
1298
  # at most 1 day and processed once the
1131
- # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, an
1132
- # INVALID_ARGUMENT error is returned if the
1299
+ # {::Google::Cloud::Retail::V2::Product Product} is created. If set to false, a
1300
+ # NOT_FOUND error is returned if the
1133
1301
  # {::Google::Cloud::Retail::V2::Product Product} is not found.
1134
1302
  #
1135
1303
  # @yield [response, operation] Access the result along with the RPC operation
@@ -1140,6 +1308,28 @@ module Google
1140
1308
  #
1141
1309
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1142
1310
  #
1311
+ # @example Basic example
1312
+ # require "google/cloud/retail/v2"
1313
+ #
1314
+ # # Create a client object. The client can be reused for multiple calls.
1315
+ # client = Google::Cloud::Retail::V2::ProductService::Client.new
1316
+ #
1317
+ # # Create a request. To set request fields, pass in keyword arguments.
1318
+ # request = Google::Cloud::Retail::V2::RemoveFulfillmentPlacesRequest.new
1319
+ #
1320
+ # # Call the remove_fulfillment_places method.
1321
+ # result = client.remove_fulfillment_places request
1322
+ #
1323
+ # # The returned object is of type Gapic::Operation. You can use this
1324
+ # # object to check the status of an operation, cancel it, or wait
1325
+ # # for results. Here is how to block until completion:
1326
+ # result.wait_until_done! timeout: 60
1327
+ # if result.response?
1328
+ # p result.response
1329
+ # else
1330
+ # puts "Error!"
1331
+ # end
1332
+ #
1143
1333
  def remove_fulfillment_places request, options = nil
1144
1334
  raise ::ArgumentError, "request must be provided" if request.nil?
1145
1335
 
@@ -1157,9 +1347,11 @@ module Google
1157
1347
  gapic_version: ::Google::Cloud::Retail::V2::VERSION
1158
1348
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1159
1349
 
1160
- header_params = {
1161
- "product" => request.product
1162
- }
1350
+ header_params = {}
1351
+ if request.product
1352
+ header_params["product"] = request.product
1353
+ end
1354
+
1163
1355
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1164
1356
  metadata[:"x-goog-request-params"] ||= request_params_header
1165
1357
 
@@ -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
- "name" => request.name
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
- "name" => request.name
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
- "name" => request.name
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
- "name" => request.name
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
 
@@ -1,12 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/retail/v2/product_service.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
9
7
  require 'google/api/resource_pb'
8
+ require 'google/cloud/retail/v2/common_pb'
10
9
  require 'google/cloud/retail/v2/import_config_pb'
11
10
  require 'google/cloud/retail/v2/product_pb'
12
11
  require 'google/cloud/retail/v2/purge_config_pb'
@@ -14,6 +13,8 @@ require 'google/longrunning/operations_pb'
14
13
  require 'google/protobuf/empty_pb'
15
14
  require 'google/protobuf/field_mask_pb'
16
15
  require 'google/protobuf/timestamp_pb'
16
+ require 'google/protobuf'
17
+
17
18
  Google::Protobuf::DescriptorPool.generated_pool.build do
18
19
  add_file("google/cloud/retail/v2/product_service.proto", :syntax => :proto3) do
19
20
  add_message "google.cloud.retail.v2.CreateProductRequest" do
@@ -28,7 +28,7 @@ module Google
28
28
  # of the customer's website.
29
29
  class Service
30
30
 
31
- include GRPC::GenericService
31
+ include ::GRPC::GenericService
32
32
 
33
33
  self.marshal_class_method = :encode
34
34
  self.unmarshal_class_method = :decode