google-cloud-recommendation_engine-v1beta1 0.3.5 → 0.4.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.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/README.md +11 -6
  5. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/client.rb +134 -18
  6. data/lib/google/cloud/recommendation_engine/v1beta1/catalog_service/operations.rb +118 -12
  7. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_api_key_registry/client.rb +66 -9
  8. data/lib/google/cloud/recommendation_engine/v1beta1/prediction_service/client.rb +26 -3
  9. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/client.rb +121 -15
  10. data/lib/google/cloud/recommendation_engine/v1beta1/user_event_service/operations.rb +118 -12
  11. data/lib/google/cloud/recommendation_engine/v1beta1/version.rb +1 -1
  12. data/lib/google/cloud/recommendation_engine/v1beta1.rb +2 -0
  13. data/lib/google/cloud/recommendationengine/v1beta1/catalog_pb.rb +2 -1
  14. data/lib/google/cloud/recommendationengine/v1beta1/catalog_service_pb.rb +2 -1
  15. data/lib/google/cloud/recommendationengine/v1beta1/common_pb.rb +2 -1
  16. data/lib/google/cloud/recommendationengine/v1beta1/import_pb.rb +2 -1
  17. data/lib/google/cloud/recommendationengine/v1beta1/prediction_apikey_registry_service_pb.rb +2 -1
  18. data/lib/google/cloud/recommendationengine/v1beta1/prediction_service_pb.rb +2 -1
  19. data/lib/google/cloud/recommendationengine/v1beta1/recommendationengine_resources_pb.rb +2 -1
  20. data/lib/google/cloud/recommendationengine/v1beta1/user_event_pb.rb +2 -1
  21. data/lib/google/cloud/recommendationengine/v1beta1/user_event_service_pb.rb +2 -1
  22. data/proto_docs/google/api/resource.rb +10 -71
  23. data/proto_docs/google/protobuf/any.rb +3 -3
  24. data/proto_docs/google/protobuf/struct.rb +2 -2
  25. metadata +12 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bb30bc07b0cc3de0d504ecc16d49fdd0146f9d244afc230fe583a8d813160135
4
- data.tar.gz: b683c46f645c6a376de3585f8e5760bbcb2865c28976923bf393257918e77307
3
+ metadata.gz: c3774d3e69a6597966ced584e5643d16edad759b65fd3c625e3da5b6daece6b0
4
+ data.tar.gz: 37af55a303b114cc96cd408d003747a0b9c9ad263edf3a9ad084809e66056045
5
5
  SHA512:
6
- metadata.gz: 4e35da936a621d0acbaf78124bee2d7bca960212f9da3c3d49cf20ae40dc582a8047a70d3fe0281d6ff38e9c3e514a185177ce2bec0b19619a9259012086bff7
7
- data.tar.gz: afa103a455c46fcc7778bda3d08c8db4108284e423339e4c04b3fb212aa75a1922144037adde8f53458da68ccad59988a57c94c5f7be0f308e891da8c504511e
6
+ metadata.gz: 9bd66dae9cd5122d5754701c9c3f9e52554b5bb6db867e3885626734b2ec07b644f855f77875257cf0a0cb27770b47a74b050d67eff9b6cec240482f8986dbeb
7
+ data.tar.gz: ec280a3bfe45ee95e20442379eaff25da5c5fd62f165d5e515573120c2af619e7091d8c6b6b4dad8829a81182e79ea79492369798bd0c7b6d4574a8af08d6b68
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Recommendations AI V1beta1 API
2
+ --title="Recommendations AI V1beta1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
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 Developers Console][dev-console].
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 slide-out navigation tray and select **API Manager**. From
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
- You should see a screen like one of the following.
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, and click "Generate
164
- new JSON key":
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.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemReque
37
37
  response = client.create_catalog_item request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-recommendation_engine-v1beta1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-recommendation_engine-v1beta1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/recommendations-ai/)
@@ -69,16 +69,21 @@ module GRPC
69
69
  end
70
70
  ```
71
71
 
72
+
73
+ ## Google Cloud Samples
74
+
75
+ To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
+
72
77
  ## Supported Ruby Versions
73
78
 
74
- This library is supported on Ruby 2.5+.
79
+ This library is supported on Ruby 2.6+.
75
80
 
76
81
  Google provides official support for Ruby versions that are actively supported
77
82
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
78
- in security maintenance, and not end of life. Currently, this means Ruby 2.5
79
- and later. Older versions of Ruby _may_ still work, but are unsupported and not
80
- recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
81
- about the Ruby support schedule.
83
+ in security maintenance, and not end of life. Older versions of Ruby _may_
84
+ still work, but are unsupported and not recommended. See
85
+ https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
+ support schedule.
82
87
 
83
88
  ## Which client should I use?
84
89
 
@@ -165,6 +165,7 @@ module Google
165
165
 
166
166
  @operations_client = Operations.new do |config|
167
167
  config.credentials = credentials
168
+ config.quota_project = @quota_project_id
168
169
  config.endpoint = @config.endpoint
169
170
  end
170
171
 
@@ -218,6 +219,21 @@ module Google
218
219
  #
219
220
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
220
221
  #
222
+ # @example Basic example
223
+ # require "google/cloud/recommendation_engine/v1beta1"
224
+ #
225
+ # # Create a client object. The client can be reused for multiple calls.
226
+ # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
227
+ #
228
+ # # Create a request. To set request fields, pass in keyword arguments.
229
+ # request = Google::Cloud::RecommendationEngine::V1beta1::CreateCatalogItemRequest.new
230
+ #
231
+ # # Call the create_catalog_item method.
232
+ # result = client.create_catalog_item request
233
+ #
234
+ # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
235
+ # p result
236
+ #
221
237
  def create_catalog_item request, options = nil
222
238
  raise ::ArgumentError, "request must be provided" if request.nil?
223
239
 
@@ -235,9 +251,11 @@ module Google
235
251
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
236
252
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
237
253
 
238
- header_params = {
239
- "parent" => request.parent
240
- }
254
+ header_params = {}
255
+ if request.parent
256
+ header_params["parent"] = request.parent
257
+ end
258
+
241
259
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
242
260
  metadata[:"x-goog-request-params"] ||= request_params_header
243
261
 
@@ -287,6 +305,21 @@ module Google
287
305
  #
288
306
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
307
  #
308
+ # @example Basic example
309
+ # require "google/cloud/recommendation_engine/v1beta1"
310
+ #
311
+ # # Create a client object. The client can be reused for multiple calls.
312
+ # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
313
+ #
314
+ # # Create a request. To set request fields, pass in keyword arguments.
315
+ # request = Google::Cloud::RecommendationEngine::V1beta1::GetCatalogItemRequest.new
316
+ #
317
+ # # Call the get_catalog_item method.
318
+ # result = client.get_catalog_item request
319
+ #
320
+ # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
321
+ # p result
322
+ #
290
323
  def get_catalog_item request, options = nil
291
324
  raise ::ArgumentError, "request must be provided" if request.nil?
292
325
 
@@ -304,9 +337,11 @@ module Google
304
337
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
305
338
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
339
 
307
- header_params = {
308
- "name" => request.name
309
- }
340
+ header_params = {}
341
+ if request.name
342
+ header_params["name"] = request.name
343
+ end
344
+
310
345
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
346
  metadata[:"x-goog-request-params"] ||= request_params_header
312
347
 
@@ -363,6 +398,27 @@ module Google
363
398
  #
364
399
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
365
400
  #
401
+ # @example Basic example
402
+ # require "google/cloud/recommendation_engine/v1beta1"
403
+ #
404
+ # # Create a client object. The client can be reused for multiple calls.
405
+ # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
406
+ #
407
+ # # Create a request. To set request fields, pass in keyword arguments.
408
+ # request = Google::Cloud::RecommendationEngine::V1beta1::ListCatalogItemsRequest.new
409
+ #
410
+ # # Call the list_catalog_items method.
411
+ # result = client.list_catalog_items request
412
+ #
413
+ # # The returned object is of type Gapic::PagedEnumerable. You can
414
+ # # iterate over all elements by calling #each, and the enumerable
415
+ # # will lazily make API calls to fetch subsequent pages. Other
416
+ # # methods are also available for managing paging directly.
417
+ # result.each do |response|
418
+ # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
419
+ # p response
420
+ # end
421
+ #
366
422
  def list_catalog_items request, options = nil
367
423
  raise ::ArgumentError, "request must be provided" if request.nil?
368
424
 
@@ -380,9 +436,11 @@ module Google
380
436
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
381
437
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
438
 
383
- header_params = {
384
- "parent" => request.parent
385
- }
439
+ header_params = {}
440
+ if request.parent
441
+ header_params["parent"] = request.parent
442
+ end
443
+
386
444
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
387
445
  metadata[:"x-goog-request-params"] ||= request_params_header
388
446
 
@@ -440,6 +498,21 @@ module Google
440
498
  #
441
499
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
442
500
  #
501
+ # @example Basic example
502
+ # require "google/cloud/recommendation_engine/v1beta1"
503
+ #
504
+ # # Create a client object. The client can be reused for multiple calls.
505
+ # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
506
+ #
507
+ # # Create a request. To set request fields, pass in keyword arguments.
508
+ # request = Google::Cloud::RecommendationEngine::V1beta1::UpdateCatalogItemRequest.new
509
+ #
510
+ # # Call the update_catalog_item method.
511
+ # result = client.update_catalog_item request
512
+ #
513
+ # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::CatalogItem.
514
+ # p result
515
+ #
443
516
  def update_catalog_item request, options = nil
444
517
  raise ::ArgumentError, "request must be provided" if request.nil?
445
518
 
@@ -457,9 +530,11 @@ module Google
457
530
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
458
531
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
459
532
 
460
- header_params = {
461
- "name" => request.name
462
- }
533
+ header_params = {}
534
+ if request.name
535
+ header_params["name"] = request.name
536
+ end
537
+
463
538
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
464
539
  metadata[:"x-goog-request-params"] ||= request_params_header
465
540
 
@@ -509,6 +584,21 @@ module Google
509
584
  #
510
585
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
511
586
  #
587
+ # @example Basic example
588
+ # require "google/cloud/recommendation_engine/v1beta1"
589
+ #
590
+ # # Create a client object. The client can be reused for multiple calls.
591
+ # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
592
+ #
593
+ # # Create a request. To set request fields, pass in keyword arguments.
594
+ # request = Google::Cloud::RecommendationEngine::V1beta1::DeleteCatalogItemRequest.new
595
+ #
596
+ # # Call the delete_catalog_item method.
597
+ # result = client.delete_catalog_item request
598
+ #
599
+ # # The returned object is of type Google::Protobuf::Empty.
600
+ # p result
601
+ #
512
602
  def delete_catalog_item request, options = nil
513
603
  raise ::ArgumentError, "request must be provided" if request.nil?
514
604
 
@@ -526,9 +616,11 @@ module Google
526
616
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
527
617
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
528
618
 
529
- header_params = {
530
- "name" => request.name
531
- }
619
+ header_params = {}
620
+ if request.name
621
+ header_params["name"] = request.name
622
+ end
623
+
532
624
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
533
625
  metadata[:"x-goog-request-params"] ||= request_params_header
534
626
 
@@ -591,6 +683,28 @@ module Google
591
683
  #
592
684
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
593
685
  #
686
+ # @example Basic example
687
+ # require "google/cloud/recommendation_engine/v1beta1"
688
+ #
689
+ # # Create a client object. The client can be reused for multiple calls.
690
+ # client = Google::Cloud::RecommendationEngine::V1beta1::CatalogService::Client.new
691
+ #
692
+ # # Create a request. To set request fields, pass in keyword arguments.
693
+ # request = Google::Cloud::RecommendationEngine::V1beta1::ImportCatalogItemsRequest.new
694
+ #
695
+ # # Call the import_catalog_items method.
696
+ # result = client.import_catalog_items request
697
+ #
698
+ # # The returned object is of type Gapic::Operation. You can use this
699
+ # # object to check the status of an operation, cancel it, or wait
700
+ # # for results. Here is how to block until completion:
701
+ # result.wait_until_done! timeout: 60
702
+ # if result.response?
703
+ # p result.response
704
+ # else
705
+ # puts "Error!"
706
+ # end
707
+ #
594
708
  def import_catalog_items request, options = nil
595
709
  raise ::ArgumentError, "request must be provided" if request.nil?
596
710
 
@@ -608,9 +722,11 @@ module Google
608
722
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
609
723
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
610
724
 
611
- header_params = {
612
- "parent" => request.parent
613
- }
725
+ header_params = {}
726
+ if request.parent
727
+ header_params["parent"] = request.parent
728
+ end
729
+
614
730
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
615
731
  metadata[:"x-goog-request-params"] ||= request_params_header
616
732
 
@@ -95,6 +95,9 @@ module Google
95
95
  channel_args: @config.channel_args,
96
96
  interceptors: @config.interceptors
97
97
  )
98
+
99
+ # Used by an LRO wrapper for some methods of this service
100
+ @operations_client = self
98
101
  end
99
102
 
100
103
  # Service calls
@@ -143,6 +146,27 @@ module Google
143
146
  #
144
147
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
148
  #
149
+ # @example Basic example
150
+ # require "google/longrunning"
151
+ #
152
+ # # Create a client object. The client can be reused for multiple calls.
153
+ # client = Google::Longrunning::Operations::Client.new
154
+ #
155
+ # # Create a request. To set request fields, pass in keyword arguments.
156
+ # request = Google::Longrunning::ListOperationsRequest.new
157
+ #
158
+ # # Call the list_operations method.
159
+ # result = client.list_operations request
160
+ #
161
+ # # The returned object is of type Gapic::PagedEnumerable. You can
162
+ # # iterate over all elements by calling #each, and the enumerable
163
+ # # will lazily make API calls to fetch subsequent pages. Other
164
+ # # methods are also available for managing paging directly.
165
+ # result.each do |response|
166
+ # # Each element is of type ::Google::Longrunning::Operation.
167
+ # p response
168
+ # end
169
+ #
146
170
  def list_operations request, options = nil
147
171
  raise ::ArgumentError, "request must be provided" if request.nil?
148
172
 
@@ -160,9 +184,11 @@ module Google
160
184
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
161
185
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
186
 
163
- header_params = {
164
- "name" => request.name
165
- }
187
+ header_params = {}
188
+ if request.name
189
+ header_params["name"] = request.name
190
+ end
191
+
166
192
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
193
  metadata[:"x-goog-request-params"] ||= request_params_header
168
194
 
@@ -215,6 +241,28 @@ module Google
215
241
  #
216
242
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
243
  #
244
+ # @example Basic example
245
+ # require "google/longrunning"
246
+ #
247
+ # # Create a client object. The client can be reused for multiple calls.
248
+ # client = Google::Longrunning::Operations::Client.new
249
+ #
250
+ # # Create a request. To set request fields, pass in keyword arguments.
251
+ # request = Google::Longrunning::GetOperationRequest.new
252
+ #
253
+ # # Call the get_operation method.
254
+ # result = client.get_operation request
255
+ #
256
+ # # The returned object is of type Gapic::Operation. You can use this
257
+ # # object to check the status of an operation, cancel it, or wait
258
+ # # for results. Here is how to block until completion:
259
+ # result.wait_until_done! timeout: 60
260
+ # if result.response?
261
+ # p result.response
262
+ # else
263
+ # puts "Error!"
264
+ # end
265
+ #
218
266
  def get_operation request, options = nil
219
267
  raise ::ArgumentError, "request must be provided" if request.nil?
220
268
 
@@ -232,9 +280,11 @@ module Google
232
280
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
233
281
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
282
 
235
- header_params = {
236
- "name" => request.name
237
- }
283
+ header_params = {}
284
+ if request.name
285
+ header_params["name"] = request.name
286
+ end
287
+
238
288
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
289
  metadata[:"x-goog-request-params"] ||= request_params_header
240
290
 
@@ -287,6 +337,21 @@ module Google
287
337
  #
288
338
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
339
  #
340
+ # @example Basic example
341
+ # require "google/longrunning"
342
+ #
343
+ # # Create a client object. The client can be reused for multiple calls.
344
+ # client = Google::Longrunning::Operations::Client.new
345
+ #
346
+ # # Create a request. To set request fields, pass in keyword arguments.
347
+ # request = Google::Longrunning::DeleteOperationRequest.new
348
+ #
349
+ # # Call the delete_operation method.
350
+ # result = client.delete_operation request
351
+ #
352
+ # # The returned object is of type Google::Protobuf::Empty.
353
+ # p result
354
+ #
290
355
  def delete_operation request, options = nil
291
356
  raise ::ArgumentError, "request must be provided" if request.nil?
292
357
 
@@ -304,9 +369,11 @@ module Google
304
369
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
305
370
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
371
 
307
- header_params = {
308
- "name" => request.name
309
- }
372
+ header_params = {}
373
+ if request.name
374
+ header_params["name"] = request.name
375
+ end
376
+
310
377
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
378
  metadata[:"x-goog-request-params"] ||= request_params_header
312
379
 
@@ -364,6 +431,21 @@ module Google
364
431
  #
365
432
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
433
  #
434
+ # @example Basic example
435
+ # require "google/longrunning"
436
+ #
437
+ # # Create a client object. The client can be reused for multiple calls.
438
+ # client = Google::Longrunning::Operations::Client.new
439
+ #
440
+ # # Create a request. To set request fields, pass in keyword arguments.
441
+ # request = Google::Longrunning::CancelOperationRequest.new
442
+ #
443
+ # # Call the cancel_operation method.
444
+ # result = client.cancel_operation request
445
+ #
446
+ # # The returned object is of type Google::Protobuf::Empty.
447
+ # p result
448
+ #
367
449
  def cancel_operation request, options = nil
368
450
  raise ::ArgumentError, "request must be provided" if request.nil?
369
451
 
@@ -381,9 +463,11 @@ module Google
381
463
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
382
464
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
465
 
384
- header_params = {
385
- "name" => request.name
386
- }
466
+ header_params = {}
467
+ if request.name
468
+ header_params["name"] = request.name
469
+ end
470
+
387
471
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
472
  metadata[:"x-goog-request-params"] ||= request_params_header
389
473
 
@@ -444,6 +528,28 @@ module Google
444
528
  #
445
529
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
530
  #
531
+ # @example Basic example
532
+ # require "google/longrunning"
533
+ #
534
+ # # Create a client object. The client can be reused for multiple calls.
535
+ # client = Google::Longrunning::Operations::Client.new
536
+ #
537
+ # # Create a request. To set request fields, pass in keyword arguments.
538
+ # request = Google::Longrunning::WaitOperationRequest.new
539
+ #
540
+ # # Call the wait_operation method.
541
+ # result = client.wait_operation request
542
+ #
543
+ # # The returned object is of type Gapic::Operation. You can use this
544
+ # # object to check the status of an operation, cancel it, or wait
545
+ # # for results. Here is how to block until completion:
546
+ # result.wait_until_done! timeout: 60
547
+ # if result.response?
548
+ # p result.response
549
+ # else
550
+ # puts "Error!"
551
+ # end
552
+ #
447
553
  def wait_operation request, options = nil
448
554
  raise ::ArgumentError, "request must be provided" if request.nil?
449
555
 
@@ -195,6 +195,21 @@ module Google
195
195
  #
196
196
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
197
197
  #
198
+ # @example Basic example
199
+ # require "google/cloud/recommendation_engine/v1beta1"
200
+ #
201
+ # # Create a client object. The client can be reused for multiple calls.
202
+ # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new
203
+ #
204
+ # # Create a request. To set request fields, pass in keyword arguments.
205
+ # request = Google::Cloud::RecommendationEngine::V1beta1::CreatePredictionApiKeyRegistrationRequest.new
206
+ #
207
+ # # Call the create_prediction_api_key_registration method.
208
+ # result = client.create_prediction_api_key_registration request
209
+ #
210
+ # # The returned object is of type Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.
211
+ # p result
212
+ #
198
213
  def create_prediction_api_key_registration request, options = nil
199
214
  raise ::ArgumentError, "request must be provided" if request.nil?
200
215
 
@@ -212,9 +227,11 @@ module Google
212
227
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
213
228
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
214
229
 
215
- header_params = {
216
- "parent" => request.parent
217
- }
230
+ header_params = {}
231
+ if request.parent
232
+ header_params["parent"] = request.parent
233
+ end
234
+
218
235
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
219
236
  metadata[:"x-goog-request-params"] ||= request_params_header
220
237
 
@@ -269,6 +286,27 @@ module Google
269
286
  #
270
287
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
271
288
  #
289
+ # @example Basic example
290
+ # require "google/cloud/recommendation_engine/v1beta1"
291
+ #
292
+ # # Create a client object. The client can be reused for multiple calls.
293
+ # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new
294
+ #
295
+ # # Create a request. To set request fields, pass in keyword arguments.
296
+ # request = Google::Cloud::RecommendationEngine::V1beta1::ListPredictionApiKeyRegistrationsRequest.new
297
+ #
298
+ # # Call the list_prediction_api_key_registrations method.
299
+ # result = client.list_prediction_api_key_registrations request
300
+ #
301
+ # # The returned object is of type Gapic::PagedEnumerable. You can
302
+ # # iterate over all elements by calling #each, and the enumerable
303
+ # # will lazily make API calls to fetch subsequent pages. Other
304
+ # # methods are also available for managing paging directly.
305
+ # result.each do |response|
306
+ # # Each element is of type ::Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistration.
307
+ # p response
308
+ # end
309
+ #
272
310
  def list_prediction_api_key_registrations request, options = nil
273
311
  raise ::ArgumentError, "request must be provided" if request.nil?
274
312
 
@@ -286,9 +324,11 @@ module Google
286
324
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
287
325
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
326
 
289
- header_params = {
290
- "parent" => request.parent
291
- }
327
+ header_params = {}
328
+ if request.parent
329
+ header_params["parent"] = request.parent
330
+ end
331
+
292
332
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
293
333
  metadata[:"x-goog-request-params"] ||= request_params_header
294
334
 
@@ -339,6 +379,21 @@ module Google
339
379
  #
340
380
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
381
  #
382
+ # @example Basic example
383
+ # require "google/cloud/recommendation_engine/v1beta1"
384
+ #
385
+ # # Create a client object. The client can be reused for multiple calls.
386
+ # client = Google::Cloud::RecommendationEngine::V1beta1::PredictionApiKeyRegistry::Client.new
387
+ #
388
+ # # Create a request. To set request fields, pass in keyword arguments.
389
+ # request = Google::Cloud::RecommendationEngine::V1beta1::DeletePredictionApiKeyRegistrationRequest.new
390
+ #
391
+ # # Call the delete_prediction_api_key_registration method.
392
+ # result = client.delete_prediction_api_key_registration request
393
+ #
394
+ # # The returned object is of type Google::Protobuf::Empty.
395
+ # p result
396
+ #
342
397
  def delete_prediction_api_key_registration request, options = nil
343
398
  raise ::ArgumentError, "request must be provided" if request.nil?
344
399
 
@@ -356,9 +411,11 @@ module Google
356
411
  gapic_version: ::Google::Cloud::RecommendationEngine::V1beta1::VERSION
357
412
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
358
413
 
359
- header_params = {
360
- "name" => request.name
361
- }
414
+ header_params = {}
415
+ if request.name
416
+ header_params["name"] = request.name
417
+ end
418
+
362
419
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
363
420
  metadata[:"x-goog-request-params"] ||= request_params_header
364
421