google-cloud-dialogflow-v2 0.11.1 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -202,6 +202,27 @@ module Google
202
202
  #
203
203
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
204
204
  #
205
+ # @example Basic example
206
+ # require "google/cloud/dialogflow/v2"
207
+ #
208
+ # # Create a client object. The client can be reused for multiple calls.
209
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
210
+ #
211
+ # # Create a request. To set request fields, pass in keyword arguments.
212
+ # request = Google::Cloud::Dialogflow::V2::ListEntityTypesRequest.new
213
+ #
214
+ # # Call the list_entity_types method.
215
+ # result = client.list_entity_types request
216
+ #
217
+ # # The returned object is of type Gapic::PagedEnumerable. You can
218
+ # # iterate over all elements by calling #each, and the enumerable
219
+ # # will lazily make API calls to fetch subsequent pages. Other
220
+ # # methods are also available for managing paging directly.
221
+ # result.each do |response|
222
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::EntityType.
223
+ # p response
224
+ # end
225
+ #
205
226
  def list_entity_types request, options = nil
206
227
  raise ::ArgumentError, "request must be provided" if request.nil?
207
228
 
@@ -219,9 +240,11 @@ module Google
219
240
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
220
241
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
221
242
 
222
- header_params = {
223
- "parent" => request.parent
224
- }
243
+ header_params = {}
244
+ if request.parent
245
+ header_params["parent"] = request.parent
246
+ end
247
+
225
248
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
226
249
  metadata[:"x-goog-request-params"] ||= request_params_header
227
250
 
@@ -278,6 +301,21 @@ module Google
278
301
  #
279
302
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
280
303
  #
304
+ # @example Basic example
305
+ # require "google/cloud/dialogflow/v2"
306
+ #
307
+ # # Create a client object. The client can be reused for multiple calls.
308
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
309
+ #
310
+ # # Create a request. To set request fields, pass in keyword arguments.
311
+ # request = Google::Cloud::Dialogflow::V2::GetEntityTypeRequest.new
312
+ #
313
+ # # Call the get_entity_type method.
314
+ # result = client.get_entity_type request
315
+ #
316
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType.
317
+ # p result
318
+ #
281
319
  def get_entity_type request, options = nil
282
320
  raise ::ArgumentError, "request must be provided" if request.nil?
283
321
 
@@ -295,9 +333,11 @@ module Google
295
333
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
296
334
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
297
335
 
298
- header_params = {
299
- "name" => request.name
300
- }
336
+ header_params = {}
337
+ if request.name
338
+ header_params["name"] = request.name
339
+ end
340
+
301
341
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
302
342
  metadata[:"x-goog-request-params"] ||= request_params_header
303
343
 
@@ -359,6 +399,21 @@ module Google
359
399
  #
360
400
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
361
401
  #
402
+ # @example Basic example
403
+ # require "google/cloud/dialogflow/v2"
404
+ #
405
+ # # Create a client object. The client can be reused for multiple calls.
406
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
407
+ #
408
+ # # Create a request. To set request fields, pass in keyword arguments.
409
+ # request = Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest.new
410
+ #
411
+ # # Call the create_entity_type method.
412
+ # result = client.create_entity_type request
413
+ #
414
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType.
415
+ # p result
416
+ #
362
417
  def create_entity_type request, options = nil
363
418
  raise ::ArgumentError, "request must be provided" if request.nil?
364
419
 
@@ -376,9 +431,11 @@ module Google
376
431
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
377
432
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
433
 
379
- header_params = {
380
- "parent" => request.parent
381
- }
434
+ header_params = {}
435
+ if request.parent
436
+ header_params["parent"] = request.parent
437
+ end
438
+
382
439
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
383
440
  metadata[:"x-goog-request-params"] ||= request_params_header
384
441
 
@@ -439,6 +496,21 @@ module Google
439
496
  #
440
497
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
441
498
  #
499
+ # @example Basic example
500
+ # require "google/cloud/dialogflow/v2"
501
+ #
502
+ # # Create a client object. The client can be reused for multiple calls.
503
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
504
+ #
505
+ # # Create a request. To set request fields, pass in keyword arguments.
506
+ # request = Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest.new
507
+ #
508
+ # # Call the update_entity_type method.
509
+ # result = client.update_entity_type request
510
+ #
511
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::EntityType.
512
+ # p result
513
+ #
442
514
  def update_entity_type request, options = nil
443
515
  raise ::ArgumentError, "request must be provided" if request.nil?
444
516
 
@@ -456,9 +528,11 @@ module Google
456
528
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
457
529
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
458
530
 
459
- header_params = {
460
- "entity_type.name" => request.entity_type.name
461
- }
531
+ header_params = {}
532
+ if request.entity_type&.name
533
+ header_params["entity_type.name"] = request.entity_type.name
534
+ end
535
+
462
536
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
463
537
  metadata[:"x-goog-request-params"] ||= request_params_header
464
538
 
@@ -512,6 +586,21 @@ module Google
512
586
  #
513
587
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
514
588
  #
589
+ # @example Basic example
590
+ # require "google/cloud/dialogflow/v2"
591
+ #
592
+ # # Create a client object. The client can be reused for multiple calls.
593
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
594
+ #
595
+ # # Create a request. To set request fields, pass in keyword arguments.
596
+ # request = Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest.new
597
+ #
598
+ # # Call the delete_entity_type method.
599
+ # result = client.delete_entity_type request
600
+ #
601
+ # # The returned object is of type Google::Protobuf::Empty.
602
+ # p result
603
+ #
515
604
  def delete_entity_type request, options = nil
516
605
  raise ::ArgumentError, "request must be provided" if request.nil?
517
606
 
@@ -529,9 +618,11 @@ module Google
529
618
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
530
619
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
531
620
 
532
- header_params = {
533
- "name" => request.name
534
- }
621
+ header_params = {}
622
+ if request.name
623
+ header_params["name"] = request.name
624
+ end
625
+
535
626
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
536
627
  metadata[:"x-goog-request-params"] ||= request_params_header
537
628
 
@@ -554,6 +645,13 @@ module Google
554
645
  ##
555
646
  # Updates/Creates multiple entity types in the specified agent.
556
647
  #
648
+ # This method is a [long-running
649
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
650
+ # The returned `Operation` type has the following method-specific fields:
651
+ #
652
+ # - `metadata`: An empty [Struct
653
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
654
+ # - `response`: {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}
557
655
  #
558
656
  # Note: You should always train an agent prior to sending it queries. See the
559
657
  # [training
@@ -601,6 +699,28 @@ module Google
601
699
  #
602
700
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
603
701
  #
702
+ # @example Basic example
703
+ # require "google/cloud/dialogflow/v2"
704
+ #
705
+ # # Create a client object. The client can be reused for multiple calls.
706
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
707
+ #
708
+ # # Create a request. To set request fields, pass in keyword arguments.
709
+ # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest.new
710
+ #
711
+ # # Call the batch_update_entity_types method.
712
+ # result = client.batch_update_entity_types request
713
+ #
714
+ # # The returned object is of type Gapic::Operation. You can use this
715
+ # # object to check the status of an operation, cancel it, or wait
716
+ # # for results. Here is how to block until completion:
717
+ # result.wait_until_done! timeout: 60
718
+ # if result.response?
719
+ # p result.response
720
+ # else
721
+ # puts "Error!"
722
+ # end
723
+ #
604
724
  def batch_update_entity_types request, options = nil
605
725
  raise ::ArgumentError, "request must be provided" if request.nil?
606
726
 
@@ -618,9 +738,11 @@ module Google
618
738
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
619
739
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
620
740
 
621
- header_params = {
622
- "parent" => request.parent
623
- }
741
+ header_params = {}
742
+ if request.parent
743
+ header_params["parent"] = request.parent
744
+ end
745
+
624
746
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
625
747
  metadata[:"x-goog-request-params"] ||= request_params_header
626
748
 
@@ -644,6 +766,15 @@ module Google
644
766
  ##
645
767
  # Deletes entity types in the specified agent.
646
768
  #
769
+ # This method is a [long-running
770
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
771
+ # The returned `Operation` type has the following method-specific fields:
772
+ #
773
+ # - `metadata`: An empty [Struct
774
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
775
+ # - `response`: An [Empty
776
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
777
+ #
647
778
  # Note: You should always train an agent prior to sending it queries. See the
648
779
  # [training
649
780
  # documentation](https://cloud.google.com/dialogflow/es/docs/training).
@@ -678,6 +809,28 @@ module Google
678
809
  #
679
810
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
680
811
  #
812
+ # @example Basic example
813
+ # require "google/cloud/dialogflow/v2"
814
+ #
815
+ # # Create a client object. The client can be reused for multiple calls.
816
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
817
+ #
818
+ # # Create a request. To set request fields, pass in keyword arguments.
819
+ # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest.new
820
+ #
821
+ # # Call the batch_delete_entity_types method.
822
+ # result = client.batch_delete_entity_types 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
+ #
681
834
  def batch_delete_entity_types request, options = nil
682
835
  raise ::ArgumentError, "request must be provided" if request.nil?
683
836
 
@@ -695,9 +848,11 @@ module Google
695
848
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
696
849
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
697
850
 
698
- header_params = {
699
- "parent" => request.parent
700
- }
851
+ header_params = {}
852
+ if request.parent
853
+ header_params["parent"] = request.parent
854
+ end
855
+
701
856
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
702
857
  metadata[:"x-goog-request-params"] ||= request_params_header
703
858
 
@@ -721,6 +876,15 @@ module Google
721
876
  ##
722
877
  # Creates multiple new entities in the specified entity type.
723
878
  #
879
+ # This method is a [long-running
880
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
881
+ # The returned `Operation` type has the following method-specific fields:
882
+ #
883
+ # - `metadata`: An empty [Struct
884
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
885
+ # - `response`: An [Empty
886
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
887
+ #
724
888
  # Note: You should always train an agent prior to sending it queries. See the
725
889
  # [training
726
890
  # documentation](https://cloud.google.com/dialogflow/es/docs/training).
@@ -760,6 +924,28 @@ module Google
760
924
  #
761
925
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
762
926
  #
927
+ # @example Basic example
928
+ # require "google/cloud/dialogflow/v2"
929
+ #
930
+ # # Create a client object. The client can be reused for multiple calls.
931
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
932
+ #
933
+ # # Create a request. To set request fields, pass in keyword arguments.
934
+ # request = Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest.new
935
+ #
936
+ # # Call the batch_create_entities method.
937
+ # result = client.batch_create_entities request
938
+ #
939
+ # # The returned object is of type Gapic::Operation. You can use this
940
+ # # object to check the status of an operation, cancel it, or wait
941
+ # # for results. Here is how to block until completion:
942
+ # result.wait_until_done! timeout: 60
943
+ # if result.response?
944
+ # p result.response
945
+ # else
946
+ # puts "Error!"
947
+ # end
948
+ #
763
949
  def batch_create_entities request, options = nil
764
950
  raise ::ArgumentError, "request must be provided" if request.nil?
765
951
 
@@ -777,9 +963,11 @@ module Google
777
963
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
778
964
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
779
965
 
780
- header_params = {
781
- "parent" => request.parent
782
- }
966
+ header_params = {}
967
+ if request.parent
968
+ header_params["parent"] = request.parent
969
+ end
970
+
783
971
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
784
972
  metadata[:"x-goog-request-params"] ||= request_params_header
785
973
 
@@ -805,6 +993,15 @@ module Google
805
993
  # method does not affect entities in the entity type that aren't explicitly
806
994
  # specified in the request.
807
995
  #
996
+ # This method is a [long-running
997
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
998
+ # The returned `Operation` type has the following method-specific fields:
999
+ #
1000
+ # - `metadata`: An empty [Struct
1001
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
1002
+ # - `response`: An [Empty
1003
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
1004
+ #
808
1005
  # Note: You should always train an agent prior to sending it queries. See the
809
1006
  # [training
810
1007
  # documentation](https://cloud.google.com/dialogflow/es/docs/training).
@@ -846,6 +1043,28 @@ module Google
846
1043
  #
847
1044
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
848
1045
  #
1046
+ # @example Basic example
1047
+ # require "google/cloud/dialogflow/v2"
1048
+ #
1049
+ # # Create a client object. The client can be reused for multiple calls.
1050
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
1051
+ #
1052
+ # # Create a request. To set request fields, pass in keyword arguments.
1053
+ # request = Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest.new
1054
+ #
1055
+ # # Call the batch_update_entities method.
1056
+ # result = client.batch_update_entities request
1057
+ #
1058
+ # # The returned object is of type Gapic::Operation. You can use this
1059
+ # # object to check the status of an operation, cancel it, or wait
1060
+ # # for results. Here is how to block until completion:
1061
+ # result.wait_until_done! timeout: 60
1062
+ # if result.response?
1063
+ # p result.response
1064
+ # else
1065
+ # puts "Error!"
1066
+ # end
1067
+ #
849
1068
  def batch_update_entities request, options = nil
850
1069
  raise ::ArgumentError, "request must be provided" if request.nil?
851
1070
 
@@ -863,9 +1082,11 @@ module Google
863
1082
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
864
1083
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
865
1084
 
866
- header_params = {
867
- "parent" => request.parent
868
- }
1085
+ header_params = {}
1086
+ if request.parent
1087
+ header_params["parent"] = request.parent
1088
+ end
1089
+
869
1090
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
870
1091
  metadata[:"x-goog-request-params"] ||= request_params_header
871
1092
 
@@ -889,6 +1110,15 @@ module Google
889
1110
  ##
890
1111
  # Deletes entities in the specified entity type.
891
1112
  #
1113
+ # This method is a [long-running
1114
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
1115
+ # The returned `Operation` type has the following method-specific fields:
1116
+ #
1117
+ # - `metadata`: An empty [Struct
1118
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
1119
+ # - `response`: An [Empty
1120
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
1121
+ #
892
1122
  # Note: You should always train an agent prior to sending it queries. See the
893
1123
  # [training
894
1124
  # documentation](https://cloud.google.com/dialogflow/es/docs/training).
@@ -930,6 +1160,28 @@ module Google
930
1160
  #
931
1161
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
932
1162
  #
1163
+ # @example Basic example
1164
+ # require "google/cloud/dialogflow/v2"
1165
+ #
1166
+ # # Create a client object. The client can be reused for multiple calls.
1167
+ # client = Google::Cloud::Dialogflow::V2::EntityTypes::Client.new
1168
+ #
1169
+ # # Create a request. To set request fields, pass in keyword arguments.
1170
+ # request = Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest.new
1171
+ #
1172
+ # # Call the batch_delete_entities method.
1173
+ # result = client.batch_delete_entities request
1174
+ #
1175
+ # # The returned object is of type Gapic::Operation. You can use this
1176
+ # # object to check the status of an operation, cancel it, or wait
1177
+ # # for results. Here is how to block until completion:
1178
+ # result.wait_until_done! timeout: 60
1179
+ # if result.response?
1180
+ # p result.response
1181
+ # else
1182
+ # puts "Error!"
1183
+ # end
1184
+ #
933
1185
  def batch_delete_entities request, options = nil
934
1186
  raise ::ArgumentError, "request must be provided" if request.nil?
935
1187
 
@@ -947,9 +1199,11 @@ module Google
947
1199
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
948
1200
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
949
1201
 
950
- header_params = {
951
- "parent" => request.parent
952
- }
1202
+ header_params = {}
1203
+ if request.parent
1204
+ header_params["parent"] = request.parent
1205
+ end
1206
+
953
1207
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
954
1208
  metadata[:"x-goog-request-params"] ||= request_params_header
955
1209
 
@@ -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