google-cloud-dialogflow-v2 0.11.1 → 0.11.5

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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/dialogflow/v2/agent_pb.rb +2 -2
  4. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +39 -5
  5. data/lib/google/cloud/dialogflow/v2/agents/client.rb +252 -31
  6. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +115 -12
  7. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +2 -2
  8. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +1 -1
  9. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +46 -6
  10. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +3 -2
  11. data/lib/google/cloud/dialogflow/v2/context_pb.rb +2 -2
  12. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +1 -1
  13. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +126 -18
  14. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +2 -2
  15. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +2 -2
  16. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +4 -2
  17. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +1 -1
  18. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +106 -15
  19. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +19 -0
  20. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +1 -1
  21. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +112 -15
  22. data/lib/google/cloud/dialogflow/v2/document_pb.rb +2 -2
  23. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +27 -10
  24. data/lib/google/cloud/dialogflow/v2/documents/client.rb +180 -27
  25. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +115 -12
  26. data/lib/google/cloud/dialogflow/v2/entity_type_pb.rb +2 -2
  27. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +45 -1
  28. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +284 -30
  29. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +115 -12
  30. data/lib/google/cloud/dialogflow/v2/environment_pb.rb +2 -2
  31. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +1 -1
  32. data/lib/google/cloud/dialogflow/v2/environments/client.rb +132 -18
  33. data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +2 -2
  34. data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +1 -1
  35. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +40 -6
  36. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +2 -2
  37. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +2 -2
  38. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -2
  39. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +16 -1
  40. data/lib/google/cloud/dialogflow/v2/intents/client.rb +175 -21
  41. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +115 -12
  42. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +2 -2
  43. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +1 -1
  44. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +106 -15
  45. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +2 -2
  46. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +1 -1
  47. data/lib/google/cloud/dialogflow/v2/participants/client.rb +146 -21
  48. data/lib/google/cloud/dialogflow/v2/session_entity_type_pb.rb +2 -2
  49. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +1 -1
  50. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +106 -15
  51. data/lib/google/cloud/dialogflow/v2/session_pb.rb +2 -2
  52. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +15 -1
  53. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +58 -3
  54. data/lib/google/cloud/dialogflow/v2/validation_result_pb.rb +1 -1
  55. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  56. data/lib/google/cloud/dialogflow/v2/version_pb.rb +2 -2
  57. data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +1 -1
  58. data/lib/google/cloud/dialogflow/v2/versions/client.rb +106 -15
  59. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +2 -2
  60. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +4 -3
  61. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +25 -8
  62. data/proto_docs/google/cloud/dialogflow/v2/session.rb +38 -33
  63. metadata +6 -5
@@ -212,6 +212,27 @@ module Google
212
212
  #
213
213
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
214
214
  #
215
+ # @example Basic example
216
+ # require "google/cloud/dialogflow/v2"
217
+ #
218
+ # # Create a client object. The client can be reused for multiple calls.
219
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
220
+ #
221
+ # # Create a request. To set request fields, pass in keyword arguments.
222
+ # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new
223
+ #
224
+ # # Call the list_intents method.
225
+ # result = client.list_intents request
226
+ #
227
+ # # The returned object is of type Gapic::PagedEnumerable. You can
228
+ # # iterate over all elements by calling #each, and the enumerable
229
+ # # will lazily make API calls to fetch subsequent pages. Other
230
+ # # methods are also available for managing paging directly.
231
+ # result.each do |response|
232
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Intent.
233
+ # p response
234
+ # end
235
+ #
215
236
  def list_intents request, options = nil
216
237
  raise ::ArgumentError, "request must be provided" if request.nil?
217
238
 
@@ -229,9 +250,11 @@ module Google
229
250
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
230
251
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
252
 
232
- header_params = {
233
- "parent" => request.parent
234
- }
253
+ header_params = {}
254
+ if request.parent
255
+ header_params["parent"] = request.parent
256
+ end
257
+
235
258
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
236
259
  metadata[:"x-goog-request-params"] ||= request_params_header
237
260
 
@@ -290,6 +313,21 @@ module Google
290
313
  #
291
314
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
292
315
  #
316
+ # @example Basic example
317
+ # require "google/cloud/dialogflow/v2"
318
+ #
319
+ # # Create a client object. The client can be reused for multiple calls.
320
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
321
+ #
322
+ # # Create a request. To set request fields, pass in keyword arguments.
323
+ # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new
324
+ #
325
+ # # Call the get_intent method.
326
+ # result = client.get_intent request
327
+ #
328
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent.
329
+ # p result
330
+ #
293
331
  def get_intent request, options = nil
294
332
  raise ::ArgumentError, "request must be provided" if request.nil?
295
333
 
@@ -307,9 +345,11 @@ module Google
307
345
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
308
346
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
309
347
 
310
- header_params = {
311
- "name" => request.name
312
- }
348
+ header_params = {}
349
+ if request.name
350
+ header_params["name"] = request.name
351
+ end
352
+
313
353
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
314
354
  metadata[:"x-goog-request-params"] ||= request_params_header
315
355
 
@@ -373,6 +413,21 @@ module Google
373
413
  #
374
414
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
375
415
  #
416
+ # @example Basic example
417
+ # require "google/cloud/dialogflow/v2"
418
+ #
419
+ # # Create a client object. The client can be reused for multiple calls.
420
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
421
+ #
422
+ # # Create a request. To set request fields, pass in keyword arguments.
423
+ # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new
424
+ #
425
+ # # Call the create_intent method.
426
+ # result = client.create_intent request
427
+ #
428
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent.
429
+ # p result
430
+ #
376
431
  def create_intent request, options = nil
377
432
  raise ::ArgumentError, "request must be provided" if request.nil?
378
433
 
@@ -390,9 +445,11 @@ module Google
390
445
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
391
446
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
392
447
 
393
- header_params = {
394
- "parent" => request.parent
395
- }
448
+ header_params = {}
449
+ if request.parent
450
+ header_params["parent"] = request.parent
451
+ end
452
+
396
453
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
397
454
  metadata[:"x-goog-request-params"] ||= request_params_header
398
455
 
@@ -455,6 +512,21 @@ module Google
455
512
  #
456
513
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
457
514
  #
515
+ # @example Basic example
516
+ # require "google/cloud/dialogflow/v2"
517
+ #
518
+ # # Create a client object. The client can be reused for multiple calls.
519
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
520
+ #
521
+ # # Create a request. To set request fields, pass in keyword arguments.
522
+ # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new
523
+ #
524
+ # # Call the update_intent method.
525
+ # result = client.update_intent request
526
+ #
527
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent.
528
+ # p result
529
+ #
458
530
  def update_intent request, options = nil
459
531
  raise ::ArgumentError, "request must be provided" if request.nil?
460
532
 
@@ -472,9 +544,11 @@ module Google
472
544
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
473
545
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
474
546
 
475
- header_params = {
476
- "intent.name" => request.intent.name
477
- }
547
+ header_params = {}
548
+ if request.intent&.name
549
+ header_params["intent.name"] = request.intent.name
550
+ end
551
+
478
552
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
479
553
  metadata[:"x-goog-request-params"] ||= request_params_header
480
554
 
@@ -529,6 +603,21 @@ module Google
529
603
  #
530
604
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
531
605
  #
606
+ # @example Basic example
607
+ # require "google/cloud/dialogflow/v2"
608
+ #
609
+ # # Create a client object. The client can be reused for multiple calls.
610
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
611
+ #
612
+ # # Create a request. To set request fields, pass in keyword arguments.
613
+ # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new
614
+ #
615
+ # # Call the delete_intent method.
616
+ # result = client.delete_intent request
617
+ #
618
+ # # The returned object is of type Google::Protobuf::Empty.
619
+ # p result
620
+ #
532
621
  def delete_intent request, options = nil
533
622
  raise ::ArgumentError, "request must be provided" if request.nil?
534
623
 
@@ -546,9 +635,11 @@ module Google
546
635
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
547
636
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
548
637
 
549
- header_params = {
550
- "name" => request.name
551
- }
638
+ header_params = {}
639
+ if request.name
640
+ header_params["name"] = request.name
641
+ end
642
+
552
643
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
553
644
  metadata[:"x-goog-request-params"] ||= request_params_header
554
645
 
@@ -571,6 +662,13 @@ module Google
571
662
  ##
572
663
  # Updates/Creates multiple intents in the specified agent.
573
664
  #
665
+ # This method is a [long-running
666
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
667
+ # The returned `Operation` type has the following method-specific fields:
668
+ #
669
+ # - `metadata`: An empty [Struct
670
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
671
+ # - `response`: {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsResponse BatchUpdateIntentsResponse}
574
672
  #
575
673
  # Note: You should always train an agent prior to sending it queries. See the
576
674
  # [training
@@ -619,6 +717,28 @@ module Google
619
717
  #
620
718
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
621
719
  #
720
+ # @example Basic example
721
+ # require "google/cloud/dialogflow/v2"
722
+ #
723
+ # # Create a client object. The client can be reused for multiple calls.
724
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
725
+ #
726
+ # # Create a request. To set request fields, pass in keyword arguments.
727
+ # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new
728
+ #
729
+ # # Call the batch_update_intents method.
730
+ # result = client.batch_update_intents request
731
+ #
732
+ # # The returned object is of type Gapic::Operation. You can use this
733
+ # # object to check the status of an operation, cancel it, or wait
734
+ # # for results. Here is how to block until completion:
735
+ # result.wait_until_done! timeout: 60
736
+ # if result.response?
737
+ # p result.response
738
+ # else
739
+ # puts "Error!"
740
+ # end
741
+ #
622
742
  def batch_update_intents request, options = nil
623
743
  raise ::ArgumentError, "request must be provided" if request.nil?
624
744
 
@@ -636,9 +756,11 @@ module Google
636
756
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
637
757
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
638
758
 
639
- header_params = {
640
- "parent" => request.parent
641
- }
759
+ header_params = {}
760
+ if request.parent
761
+ header_params["parent"] = request.parent
762
+ end
763
+
642
764
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
643
765
  metadata[:"x-goog-request-params"] ||= request_params_header
644
766
 
@@ -662,6 +784,14 @@ module Google
662
784
  ##
663
785
  # Deletes intents in the specified agent.
664
786
  #
787
+ # This method is a [long-running
788
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
789
+ # The returned `Operation` type has the following method-specific fields:
790
+ #
791
+ # - `metadata`: An empty [Struct
792
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
793
+ # - `response`: An [Empty
794
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
665
795
  #
666
796
  # Note: You should always train an agent prior to sending it queries. See the
667
797
  # [training
@@ -697,6 +827,28 @@ module Google
697
827
  #
698
828
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
699
829
  #
830
+ # @example Basic example
831
+ # require "google/cloud/dialogflow/v2"
832
+ #
833
+ # # Create a client object. The client can be reused for multiple calls.
834
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
835
+ #
836
+ # # Create a request. To set request fields, pass in keyword arguments.
837
+ # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new
838
+ #
839
+ # # Call the batch_delete_intents method.
840
+ # result = client.batch_delete_intents request
841
+ #
842
+ # # The returned object is of type Gapic::Operation. You can use this
843
+ # # object to check the status of an operation, cancel it, or wait
844
+ # # for results. Here is how to block until completion:
845
+ # result.wait_until_done! timeout: 60
846
+ # if result.response?
847
+ # p result.response
848
+ # else
849
+ # puts "Error!"
850
+ # end
851
+ #
700
852
  def batch_delete_intents request, options = nil
701
853
  raise ::ArgumentError, "request must be provided" if request.nil?
702
854
 
@@ -714,9 +866,11 @@ module Google
714
866
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
715
867
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
716
868
 
717
- header_params = {
718
- "parent" => request.parent
719
- }
869
+ header_params = {}
870
+ if request.parent
871
+ header_params["parent"] = request.parent
872
+ end
873
+
720
874
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
721
875
  metadata[:"x-goog-request-params"] ||= request_params_header
722
876
 
@@ -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::Dialogflow::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::Dialogflow::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::Dialogflow::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::Dialogflow::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,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dialogflow/v2/knowledge_base.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'
10
8
  require 'google/protobuf/empty_pb'
11
9
  require 'google/protobuf/field_mask_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/cloud/dialogflow/v2/knowledge_base.proto", :syntax => :proto3) do
14
14
  add_message "google.cloud.dialogflow.v2.KnowledgeBase" do
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase].
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode