google-cloud-dialogflow-v2 0.11.4 → 0.14.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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/lib/google/cloud/dialogflow/v2/agents/client.rb +215 -27
  5. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +115 -12
  6. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +46 -6
  7. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +1 -1
  8. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +126 -18
  9. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +1 -1
  10. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +2 -0
  11. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +9 -0
  12. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +106 -15
  13. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +19 -0
  14. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +112 -15
  15. data/lib/google/cloud/dialogflow/v2/document_pb.rb +33 -0
  16. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +21 -0
  17. data/lib/google/cloud/dialogflow/v2/documents/client.rb +426 -20
  18. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +115 -12
  19. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +242 -30
  20. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +115 -12
  21. data/lib/google/cloud/dialogflow/v2/environments/client.rb +132 -18
  22. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +40 -6
  23. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +9 -1
  24. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +1 -1
  25. data/lib/google/cloud/dialogflow/v2/intents/client.rb +161 -21
  26. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +115 -12
  27. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +1 -0
  28. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +134 -16
  29. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +31 -0
  30. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +3 -0
  31. data/lib/google/cloud/dialogflow/v2/participants/client.rb +268 -28
  32. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +106 -15
  33. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
  34. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +44 -3
  35. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  36. data/lib/google/cloud/dialogflow/v2/versions/client.rb +106 -15
  37. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +1 -1
  38. data/lib/google/cloud/dialogflow/v2.rb +1 -1
  39. data/proto_docs/google/api/resource.rb +10 -71
  40. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +4 -1
  41. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +41 -8
  42. data/proto_docs/google/cloud/dialogflow/v2/document.rb +118 -0
  43. data/proto_docs/google/cloud/dialogflow/v2/gcs.rb +50 -0
  44. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +28 -0
  45. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +157 -6
  46. metadata +4 -3
@@ -187,6 +187,21 @@ module Google
187
187
  #
188
188
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
189
189
  #
190
+ # @example Basic example
191
+ # require "google/cloud/dialogflow/v2"
192
+ #
193
+ # # Create a client object. The client can be reused for multiple calls.
194
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
195
+ #
196
+ # # Create a request. To set request fields, pass in keyword arguments.
197
+ # request = Google::Cloud::Dialogflow::V2::CreateParticipantRequest.new
198
+ #
199
+ # # Call the create_participant method.
200
+ # result = client.create_participant request
201
+ #
202
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant.
203
+ # p result
204
+ #
190
205
  def create_participant request, options = nil
191
206
  raise ::ArgumentError, "request must be provided" if request.nil?
192
207
 
@@ -204,9 +219,11 @@ module Google
204
219
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
205
220
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
206
221
 
207
- header_params = {
208
- "parent" => request.parent
209
- }
222
+ header_params = {}
223
+ if request.parent
224
+ header_params["parent"] = request.parent
225
+ end
226
+
210
227
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
211
228
  metadata[:"x-goog-request-params"] ||= request_params_header
212
229
 
@@ -257,6 +274,21 @@ module Google
257
274
  #
258
275
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
259
276
  #
277
+ # @example Basic example
278
+ # require "google/cloud/dialogflow/v2"
279
+ #
280
+ # # Create a client object. The client can be reused for multiple calls.
281
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
282
+ #
283
+ # # Create a request. To set request fields, pass in keyword arguments.
284
+ # request = Google::Cloud::Dialogflow::V2::GetParticipantRequest.new
285
+ #
286
+ # # Call the get_participant method.
287
+ # result = client.get_participant request
288
+ #
289
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant.
290
+ # p result
291
+ #
260
292
  def get_participant request, options = nil
261
293
  raise ::ArgumentError, "request must be provided" if request.nil?
262
294
 
@@ -274,9 +306,11 @@ module Google
274
306
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
275
307
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
276
308
 
277
- header_params = {
278
- "name" => request.name
279
- }
309
+ header_params = {}
310
+ if request.name
311
+ header_params["name"] = request.name
312
+ end
313
+
280
314
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
281
315
  metadata[:"x-goog-request-params"] ||= request_params_header
282
316
 
@@ -332,6 +366,27 @@ module Google
332
366
  #
333
367
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
334
368
  #
369
+ # @example Basic example
370
+ # require "google/cloud/dialogflow/v2"
371
+ #
372
+ # # Create a client object. The client can be reused for multiple calls.
373
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
374
+ #
375
+ # # Create a request. To set request fields, pass in keyword arguments.
376
+ # request = Google::Cloud::Dialogflow::V2::ListParticipantsRequest.new
377
+ #
378
+ # # Call the list_participants method.
379
+ # result = client.list_participants request
380
+ #
381
+ # # The returned object is of type Gapic::PagedEnumerable. You can
382
+ # # iterate over all elements by calling #each, and the enumerable
383
+ # # will lazily make API calls to fetch subsequent pages. Other
384
+ # # methods are also available for managing paging directly.
385
+ # result.each do |response|
386
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Participant.
387
+ # p response
388
+ # end
389
+ #
335
390
  def list_participants request, options = nil
336
391
  raise ::ArgumentError, "request must be provided" if request.nil?
337
392
 
@@ -349,9 +404,11 @@ module Google
349
404
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
350
405
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
351
406
 
352
- header_params = {
353
- "parent" => request.parent
354
- }
407
+ header_params = {}
408
+ if request.parent
409
+ header_params["parent"] = request.parent
410
+ end
411
+
355
412
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
356
413
  metadata[:"x-goog-request-params"] ||= request_params_header
357
414
 
@@ -403,6 +460,21 @@ module Google
403
460
  #
404
461
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
405
462
  #
463
+ # @example Basic example
464
+ # require "google/cloud/dialogflow/v2"
465
+ #
466
+ # # Create a client object. The client can be reused for multiple calls.
467
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
468
+ #
469
+ # # Create a request. To set request fields, pass in keyword arguments.
470
+ # request = Google::Cloud::Dialogflow::V2::UpdateParticipantRequest.new
471
+ #
472
+ # # Call the update_participant method.
473
+ # result = client.update_participant request
474
+ #
475
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Participant.
476
+ # p result
477
+ #
406
478
  def update_participant request, options = nil
407
479
  raise ::ArgumentError, "request must be provided" if request.nil?
408
480
 
@@ -420,9 +492,11 @@ module Google
420
492
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
421
493
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
422
494
 
423
- header_params = {
424
- "participant.name" => request.participant.name
425
- }
495
+ header_params = {}
496
+ if request.participant&.name
497
+ header_params["participant.name"] = request.participant.name
498
+ end
499
+
426
500
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
427
501
  metadata[:"x-goog-request-params"] ||= request_params_header
428
502
 
@@ -460,7 +534,7 @@ module Google
460
534
  # @param options [::Gapic::CallOptions, ::Hash]
461
535
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
462
536
  #
463
- # @overload analyze_content(participant: nil, text_input: nil, event_input: nil, reply_audio_config: nil, query_params: nil, request_id: nil)
537
+ # @overload analyze_content(participant: nil, text_input: nil, event_input: nil, reply_audio_config: nil, query_params: nil, assist_query_params: nil, request_id: nil)
464
538
  # Pass arguments to `analyze_content` via keyword arguments. Note that at
465
539
  # least one keyword argument is required. To specify no parameters, or to keep all
466
540
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -481,6 +555,8 @@ module Google
481
555
  # is disabled.
482
556
  # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash]
483
557
  # Parameters for a Dialogflow virtual-agent query.
558
+ # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash]
559
+ # Parameters for a human assist query.
484
560
  # @param request_id [::String]
485
561
  # A unique identifier for this request. Restricted to 36 ASCII characters.
486
562
  # A random UUID is recommended.
@@ -494,6 +570,21 @@ module Google
494
570
  #
495
571
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
496
572
  #
573
+ # @example Basic example
574
+ # require "google/cloud/dialogflow/v2"
575
+ #
576
+ # # Create a client object. The client can be reused for multiple calls.
577
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
578
+ #
579
+ # # Create a request. To set request fields, pass in keyword arguments.
580
+ # request = Google::Cloud::Dialogflow::V2::AnalyzeContentRequest.new
581
+ #
582
+ # # Call the analyze_content method.
583
+ # result = client.analyze_content request
584
+ #
585
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::AnalyzeContentResponse.
586
+ # p result
587
+ #
497
588
  def analyze_content request, options = nil
498
589
  raise ::ArgumentError, "request must be provided" if request.nil?
499
590
 
@@ -511,9 +602,11 @@ module Google
511
602
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
512
603
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
513
604
 
514
- header_params = {
515
- "participant" => request.participant
516
- }
605
+ header_params = {}
606
+ if request.participant
607
+ header_params["participant"] = request.participant
608
+ end
609
+
517
610
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
518
611
  metadata[:"x-goog-request-params"] ||= request_params_header
519
612
 
@@ -547,7 +640,7 @@ module Google
547
640
  # @param options [::Gapic::CallOptions, ::Hash]
548
641
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
549
642
  #
550
- # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil)
643
+ # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil)
551
644
  # Pass arguments to `suggest_articles` via keyword arguments. Note that at
552
645
  # least one keyword argument is required. To specify no parameters, or to keep all
553
646
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -557,15 +650,17 @@ module Google
557
650
  # Format: `projects/<Project ID>/locations/<Location
558
651
  # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
559
652
  # @param latest_message [::String]
560
- # The name of the latest conversation message to compile suggestion
653
+ # Optional. The name of the latest conversation message to compile suggestion
561
654
  # for. If empty, it will be the latest message of the conversation.
562
655
  #
563
656
  # Format: `projects/<Project ID>/locations/<Location
564
657
  # ID>/conversations/<Conversation ID>/messages/<Message ID>`.
565
658
  # @param context_size [::Integer]
566
- # Max number of messages prior to and including
659
+ # Optional. Max number of messages prior to and including
567
660
  # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} to use as context
568
661
  # when compiling the suggestion. By default 20 and at most 50.
662
+ # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash]
663
+ # Parameters for a human assist query.
569
664
  #
570
665
  # @yield [response, operation] Access the result along with the RPC operation
571
666
  # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse]
@@ -575,6 +670,21 @@ module Google
575
670
  #
576
671
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
577
672
  #
673
+ # @example Basic example
674
+ # require "google/cloud/dialogflow/v2"
675
+ #
676
+ # # Create a client object. The client can be reused for multiple calls.
677
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
678
+ #
679
+ # # Create a request. To set request fields, pass in keyword arguments.
680
+ # request = Google::Cloud::Dialogflow::V2::SuggestArticlesRequest.new
681
+ #
682
+ # # Call the suggest_articles method.
683
+ # result = client.suggest_articles request
684
+ #
685
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestArticlesResponse.
686
+ # p result
687
+ #
578
688
  def suggest_articles request, options = nil
579
689
  raise ::ArgumentError, "request must be provided" if request.nil?
580
690
 
@@ -592,9 +702,11 @@ module Google
592
702
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
593
703
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
594
704
 
595
- header_params = {
596
- "parent" => request.parent
597
- }
705
+ header_params = {}
706
+ if request.parent
707
+ header_params["parent"] = request.parent
708
+ end
709
+
598
710
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
599
711
  metadata[:"x-goog-request-params"] ||= request_params_header
600
712
 
@@ -628,7 +740,7 @@ module Google
628
740
  # @param options [::Gapic::CallOptions, ::Hash]
629
741
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
630
742
  #
631
- # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil)
743
+ # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil, assist_query_params: nil)
632
744
  # Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at
633
745
  # least one keyword argument is required. To specify no parameters, or to keep all
634
746
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -638,15 +750,17 @@ module Google
638
750
  # Format: `projects/<Project ID>/locations/<Location
639
751
  # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
640
752
  # @param latest_message [::String]
641
- # The name of the latest conversation message to compile suggestion
753
+ # Optional. The name of the latest conversation message to compile suggestion
642
754
  # for. If empty, it will be the latest message of the conversation.
643
755
  #
644
756
  # Format: `projects/<Project ID>/locations/<Location
645
757
  # ID>/conversations/<Conversation ID>/messages/<Message ID>`.
646
758
  # @param context_size [::Integer]
647
- # Max number of messages prior to and including
759
+ # Optional. Max number of messages prior to and including
648
760
  # [latest_message] to use as context when compiling the
649
761
  # suggestion. By default 20 and at most 50.
762
+ # @param assist_query_params [::Google::Cloud::Dialogflow::V2::AssistQueryParameters, ::Hash]
763
+ # Parameters for a human assist query.
650
764
  #
651
765
  # @yield [response, operation] Access the result along with the RPC operation
652
766
  # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse]
@@ -656,6 +770,21 @@ module Google
656
770
  #
657
771
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
658
772
  #
773
+ # @example Basic example
774
+ # require "google/cloud/dialogflow/v2"
775
+ #
776
+ # # Create a client object. The client can be reused for multiple calls.
777
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
778
+ #
779
+ # # Create a request. To set request fields, pass in keyword arguments.
780
+ # request = Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest.new
781
+ #
782
+ # # Call the suggest_faq_answers method.
783
+ # result = client.suggest_faq_answers request
784
+ #
785
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse.
786
+ # p result
787
+ #
659
788
  def suggest_faq_answers request, options = nil
660
789
  raise ::ArgumentError, "request must be provided" if request.nil?
661
790
 
@@ -673,9 +802,11 @@ module Google
673
802
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
674
803
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
675
804
 
676
- header_params = {
677
- "parent" => request.parent
678
- }
805
+ header_params = {}
806
+ if request.parent
807
+ header_params["parent"] = request.parent
808
+ end
809
+
679
810
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
680
811
  metadata[:"x-goog-request-params"] ||= request_params_header
681
812
 
@@ -695,6 +826,108 @@ module Google
695
826
  raise ::Google::Cloud::Error.from_error(e)
696
827
  end
697
828
 
829
+ ##
830
+ # Gets smart replies for a participant based on specific historical
831
+ # messages.
832
+ #
833
+ # @overload suggest_smart_replies(request, options = nil)
834
+ # Pass arguments to `suggest_smart_replies` via a request object, either of type
835
+ # {::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest} or an equivalent Hash.
836
+ #
837
+ # @param request [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest, ::Hash]
838
+ # A request object representing the call parameters. Required. To specify no
839
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
840
+ # @param options [::Gapic::CallOptions, ::Hash]
841
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
842
+ #
843
+ # @overload suggest_smart_replies(parent: nil, current_text_input: nil, latest_message: nil, context_size: nil)
844
+ # Pass arguments to `suggest_smart_replies` via keyword arguments. Note that at
845
+ # least one keyword argument is required. To specify no parameters, or to keep all
846
+ # the default parameter values, pass an empty Hash as a request object (see above).
847
+ #
848
+ # @param parent [::String]
849
+ # Required. The name of the participant to fetch suggestion for.
850
+ # Format: `projects/<Project ID>/locations/<Location
851
+ # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
852
+ # @param current_text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash]
853
+ # The current natural language text segment to compile suggestion
854
+ # for. This provides a way for user to get follow up smart reply suggestion
855
+ # after a smart reply selection, without sending a text message.
856
+ # @param latest_message [::String]
857
+ # The name of the latest conversation message to compile suggestion
858
+ # for. If empty, it will be the latest message of the conversation.
859
+ #
860
+ # Format: `projects/<Project ID>/locations/<Location
861
+ # ID>/conversations/<Conversation ID>/messages/<Message ID>`.
862
+ # @param context_size [::Integer]
863
+ # Max number of messages prior to and including
864
+ # [latest_message] to use as context when compiling the
865
+ # suggestion. By default 20 and at most 50.
866
+ #
867
+ # @yield [response, operation] Access the result along with the RPC operation
868
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse]
869
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
870
+ #
871
+ # @return [::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse]
872
+ #
873
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
874
+ #
875
+ # @example Basic example
876
+ # require "google/cloud/dialogflow/v2"
877
+ #
878
+ # # Create a client object. The client can be reused for multiple calls.
879
+ # client = Google::Cloud::Dialogflow::V2::Participants::Client.new
880
+ #
881
+ # # Create a request. To set request fields, pass in keyword arguments.
882
+ # request = Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest.new
883
+ #
884
+ # # Call the suggest_smart_replies method.
885
+ # result = client.suggest_smart_replies request
886
+ #
887
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestSmartRepliesResponse.
888
+ # p result
889
+ #
890
+ def suggest_smart_replies request, options = nil
891
+ raise ::ArgumentError, "request must be provided" if request.nil?
892
+
893
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestSmartRepliesRequest
894
+
895
+ # Converts hash and nil to an options object
896
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
897
+
898
+ # Customize the options with defaults
899
+ metadata = @config.rpcs.suggest_smart_replies.metadata.to_h
900
+
901
+ # Set x-goog-api-client and x-goog-user-project headers
902
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
903
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
904
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
905
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
906
+
907
+ header_params = {}
908
+ if request.parent
909
+ header_params["parent"] = request.parent
910
+ end
911
+
912
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
913
+ metadata[:"x-goog-request-params"] ||= request_params_header
914
+
915
+ options.apply_defaults timeout: @config.rpcs.suggest_smart_replies.timeout,
916
+ metadata: metadata,
917
+ retry_policy: @config.rpcs.suggest_smart_replies.retry_policy
918
+
919
+ options.apply_defaults timeout: @config.timeout,
920
+ metadata: @config.metadata,
921
+ retry_policy: @config.retry_policy
922
+
923
+ @participants_stub.call_rpc :suggest_smart_replies, request, options: options do |response, operation|
924
+ yield response, operation if block_given?
925
+ return response
926
+ end
927
+ rescue ::GRPC::BadStatus => e
928
+ raise ::Google::Cloud::Error.from_error(e)
929
+ end
930
+
698
931
  ##
699
932
  # Configuration class for the Participants API.
700
933
  #
@@ -865,6 +1098,11 @@ module Google
865
1098
  # @return [::Gapic::Config::Method]
866
1099
  #
867
1100
  attr_reader :suggest_faq_answers
1101
+ ##
1102
+ # RPC-specific configuration for `suggest_smart_replies`
1103
+ # @return [::Gapic::Config::Method]
1104
+ #
1105
+ attr_reader :suggest_smart_replies
868
1106
 
869
1107
  # @private
870
1108
  def initialize parent_rpcs = nil
@@ -882,6 +1120,8 @@ module Google
882
1120
  @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config
883
1121
  suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers
884
1122
  @suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config
1123
+ suggest_smart_replies_config = parent_rpcs.suggest_smart_replies if parent_rpcs.respond_to? :suggest_smart_replies
1124
+ @suggest_smart_replies = ::Gapic::Config::Method.new suggest_smart_replies_config
885
1125
 
886
1126
  yield self if block_given?
887
1127
  end
@@ -192,6 +192,27 @@ module Google
192
192
  #
193
193
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
194
194
  #
195
+ # @example Basic example
196
+ # require "google/cloud/dialogflow/v2"
197
+ #
198
+ # # Create a client object. The client can be reused for multiple calls.
199
+ # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
200
+ #
201
+ # # Create a request. To set request fields, pass in keyword arguments.
202
+ # request = Google::Cloud::Dialogflow::V2::ListSessionEntityTypesRequest.new
203
+ #
204
+ # # Call the list_session_entity_types method.
205
+ # result = client.list_session_entity_types request
206
+ #
207
+ # # The returned object is of type Gapic::PagedEnumerable. You can
208
+ # # iterate over all elements by calling #each, and the enumerable
209
+ # # will lazily make API calls to fetch subsequent pages. Other
210
+ # # methods are also available for managing paging directly.
211
+ # result.each do |response|
212
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::SessionEntityType.
213
+ # p response
214
+ # end
215
+ #
195
216
  def list_session_entity_types request, options = nil
196
217
  raise ::ArgumentError, "request must be provided" if request.nil?
197
218
 
@@ -209,9 +230,11 @@ module Google
209
230
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
210
231
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
211
232
 
212
- header_params = {
213
- "parent" => request.parent
214
- }
233
+ header_params = {}
234
+ if request.parent
235
+ header_params["parent"] = request.parent
236
+ end
237
+
215
238
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
216
239
  metadata[:"x-goog-request-params"] ||= request_params_header
217
240
 
@@ -271,6 +294,21 @@ module Google
271
294
  #
272
295
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
273
296
  #
297
+ # @example Basic example
298
+ # require "google/cloud/dialogflow/v2"
299
+ #
300
+ # # Create a client object. The client can be reused for multiple calls.
301
+ # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
302
+ #
303
+ # # Create a request. To set request fields, pass in keyword arguments.
304
+ # request = Google::Cloud::Dialogflow::V2::GetSessionEntityTypeRequest.new
305
+ #
306
+ # # Call the get_session_entity_type method.
307
+ # result = client.get_session_entity_type request
308
+ #
309
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType.
310
+ # p result
311
+ #
274
312
  def get_session_entity_type request, options = nil
275
313
  raise ::ArgumentError, "request must be provided" if request.nil?
276
314
 
@@ -288,9 +326,11 @@ module Google
288
326
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
289
327
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
290
328
 
291
- header_params = {
292
- "name" => request.name
293
- }
329
+ header_params = {}
330
+ if request.name
331
+ header_params["name"] = request.name
332
+ end
333
+
294
334
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
295
335
  metadata[:"x-goog-request-params"] ||= request_params_header
296
336
 
@@ -353,6 +393,21 @@ module Google
353
393
  #
354
394
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
355
395
  #
396
+ # @example Basic example
397
+ # require "google/cloud/dialogflow/v2"
398
+ #
399
+ # # Create a client object. The client can be reused for multiple calls.
400
+ # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
401
+ #
402
+ # # Create a request. To set request fields, pass in keyword arguments.
403
+ # request = Google::Cloud::Dialogflow::V2::CreateSessionEntityTypeRequest.new
404
+ #
405
+ # # Call the create_session_entity_type method.
406
+ # result = client.create_session_entity_type request
407
+ #
408
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType.
409
+ # p result
410
+ #
356
411
  def create_session_entity_type request, options = nil
357
412
  raise ::ArgumentError, "request must be provided" if request.nil?
358
413
 
@@ -370,9 +425,11 @@ module Google
370
425
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
371
426
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
372
427
 
373
- header_params = {
374
- "parent" => request.parent
375
- }
428
+ header_params = {}
429
+ if request.parent
430
+ header_params["parent"] = request.parent
431
+ end
432
+
376
433
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
377
434
  metadata[:"x-goog-request-params"] ||= request_params_header
378
435
 
@@ -427,6 +484,21 @@ module Google
427
484
  #
428
485
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
429
486
  #
487
+ # @example Basic example
488
+ # require "google/cloud/dialogflow/v2"
489
+ #
490
+ # # Create a client object. The client can be reused for multiple calls.
491
+ # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
492
+ #
493
+ # # Create a request. To set request fields, pass in keyword arguments.
494
+ # request = Google::Cloud::Dialogflow::V2::UpdateSessionEntityTypeRequest.new
495
+ #
496
+ # # Call the update_session_entity_type method.
497
+ # result = client.update_session_entity_type request
498
+ #
499
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SessionEntityType.
500
+ # p result
501
+ #
430
502
  def update_session_entity_type request, options = nil
431
503
  raise ::ArgumentError, "request must be provided" if request.nil?
432
504
 
@@ -444,9 +516,11 @@ module Google
444
516
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
445
517
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
446
518
 
447
- header_params = {
448
- "session_entity_type.name" => request.session_entity_type.name
449
- }
519
+ header_params = {}
520
+ if request.session_entity_type&.name
521
+ header_params["session_entity_type.name"] = request.session_entity_type.name
522
+ end
523
+
450
524
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
451
525
  metadata[:"x-goog-request-params"] ||= request_params_header
452
526
 
@@ -505,6 +579,21 @@ module Google
505
579
  #
506
580
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
507
581
  #
582
+ # @example Basic example
583
+ # require "google/cloud/dialogflow/v2"
584
+ #
585
+ # # Create a client object. The client can be reused for multiple calls.
586
+ # client = Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
587
+ #
588
+ # # Create a request. To set request fields, pass in keyword arguments.
589
+ # request = Google::Cloud::Dialogflow::V2::DeleteSessionEntityTypeRequest.new
590
+ #
591
+ # # Call the delete_session_entity_type method.
592
+ # result = client.delete_session_entity_type request
593
+ #
594
+ # # The returned object is of type Google::Protobuf::Empty.
595
+ # p result
596
+ #
508
597
  def delete_session_entity_type request, options = nil
509
598
  raise ::ArgumentError, "request must be provided" if request.nil?
510
599
 
@@ -522,9 +611,11 @@ module Google
522
611
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
523
612
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
524
613
 
525
- header_params = {
526
- "name" => request.name
527
- }
614
+ header_params = {}
615
+ if request.name
616
+ header_params["name"] = request.name
617
+ end
618
+
528
619
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
529
620
  metadata[:"x-goog-request-params"] ||= request_params_header
530
621
 
@@ -7,6 +7,7 @@ require 'google/api/field_behavior_pb'
7
7
  require 'google/api/resource_pb'
8
8
  require 'google/cloud/dialogflow/v2/audio_config_pb'
9
9
  require 'google/cloud/dialogflow/v2/context_pb'
10
+ require 'google/cloud/dialogflow/v2/gcs_pb'
10
11
  require 'google/cloud/dialogflow/v2/intent_pb'
11
12
  require 'google/cloud/dialogflow/v2/session_entity_type_pb'
12
13
  require 'google/protobuf/duration_pb'