google-cloud-dialogflow-v2 0.27.0 → 0.29.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dialogflow/v2/agents/client.rb +10 -1
  3. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +10 -1
  4. data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +176 -0
  5. data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +75 -0
  6. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +2 -1
  7. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +10 -1
  8. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +126 -0
  9. data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +36 -0
  10. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +1 -1
  11. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +10 -1
  12. data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +100 -0
  13. data/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +10 -1
  14. data/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb +10 -1
  15. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +105 -0
  16. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +75 -0
  17. data/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +10 -1
  18. data/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb +10 -1
  19. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +187 -0
  20. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +75 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +8 -1
  22. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +2 -1
  23. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +10 -1
  24. data/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb +10 -1
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +130 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +75 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +2 -0
  28. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +127 -1
  29. data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +230 -0
  30. data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +84 -0
  31. data/lib/google/cloud/dialogflow/v2/documents/client.rb +10 -1
  32. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +10 -1
  33. data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +174 -0
  34. data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +75 -0
  35. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +10 -1
  36. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +10 -1
  37. data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +199 -0
  38. data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +75 -0
  39. data/lib/google/cloud/dialogflow/v2/environments/client.rb +10 -1
  40. data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +104 -0
  41. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +10 -1
  42. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +32 -0
  43. data/lib/google/cloud/dialogflow/v2/intents/client.rb +10 -1
  44. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +10 -1
  45. data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +130 -0
  46. data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +75 -0
  47. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +10 -1
  48. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +84 -0
  49. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +4 -1
  50. data/lib/google/cloud/dialogflow/v2/participants/client.rb +13 -2
  51. data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +135 -1
  52. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +10 -1
  53. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +84 -0
  54. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -1
  55. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +10 -1
  56. data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +16 -0
  57. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  58. data/lib/google/cloud/dialogflow/v2/versions/client.rb +10 -1
  59. data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +84 -0
  60. data/proto_docs/google/api/field_behavior.rb +14 -0
  61. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +25 -0
  62. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +4 -0
  63. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +99 -0
  64. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +26 -1
  65. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +53 -1
  66. data/proto_docs/google/cloud/dialogflow/v2/session.rb +4 -1
  67. metadata +5 -5
@@ -217,6 +217,22 @@ module Google
217
217
  # @return [::Google::Cloud::Dialogflow::V2::Conversation]
218
218
  #
219
219
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
220
+ #
221
+ # @example Basic example
222
+ # require "google/cloud/dialogflow/v2"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new
229
+ #
230
+ # # Call the create_conversation method.
231
+ # result = client.create_conversation request
232
+ #
233
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation.
234
+ # p result
235
+ #
220
236
  def create_conversation request, options = nil
221
237
  raise ::ArgumentError, "request must be provided" if request.nil?
222
238
 
@@ -303,6 +319,26 @@ module Google
303
319
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Conversation>]
304
320
  #
305
321
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
322
+ #
323
+ # @example Basic example
324
+ # require "google/cloud/dialogflow/v2"
325
+ #
326
+ # # Create a client object. The client can be reused for multiple calls.
327
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
328
+ #
329
+ # # Create a request. To set request fields, pass in keyword arguments.
330
+ # request = Google::Cloud::Dialogflow::V2::ListConversationsRequest.new
331
+ #
332
+ # # Call the list_conversations method.
333
+ # result = client.list_conversations request
334
+ #
335
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
336
+ # # over elements, and API calls will be issued to fetch pages as needed.
337
+ # result.each do |item|
338
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Conversation.
339
+ # p item
340
+ # end
341
+ #
306
342
  def list_conversations request, options = nil
307
343
  raise ::ArgumentError, "request must be provided" if request.nil?
308
344
 
@@ -368,6 +404,22 @@ module Google
368
404
  # @return [::Google::Cloud::Dialogflow::V2::Conversation]
369
405
  #
370
406
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
407
+ #
408
+ # @example Basic example
409
+ # require "google/cloud/dialogflow/v2"
410
+ #
411
+ # # Create a client object. The client can be reused for multiple calls.
412
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
413
+ #
414
+ # # Create a request. To set request fields, pass in keyword arguments.
415
+ # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new
416
+ #
417
+ # # Call the get_conversation method.
418
+ # result = client.get_conversation request
419
+ #
420
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation.
421
+ # p result
422
+ #
371
423
  def get_conversation request, options = nil
372
424
  raise ::ArgumentError, "request must be provided" if request.nil?
373
425
 
@@ -433,6 +485,22 @@ module Google
433
485
  # @return [::Google::Cloud::Dialogflow::V2::Conversation]
434
486
  #
435
487
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
488
+ #
489
+ # @example Basic example
490
+ # require "google/cloud/dialogflow/v2"
491
+ #
492
+ # # Create a client object. The client can be reused for multiple calls.
493
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
494
+ #
495
+ # # Create a request. To set request fields, pass in keyword arguments.
496
+ # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new
497
+ #
498
+ # # Call the complete_conversation method.
499
+ # result = client.complete_conversation request
500
+ #
501
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation.
502
+ # p result
503
+ #
436
504
  def complete_conversation request, options = nil
437
505
  raise ::ArgumentError, "request must be provided" if request.nil?
438
506
 
@@ -515,6 +583,26 @@ module Google
515
583
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Message>]
516
584
  #
517
585
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
586
+ #
587
+ # @example Basic example
588
+ # require "google/cloud/dialogflow/v2"
589
+ #
590
+ # # Create a client object. The client can be reused for multiple calls.
591
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
592
+ #
593
+ # # Create a request. To set request fields, pass in keyword arguments.
594
+ # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new
595
+ #
596
+ # # Call the list_messages method.
597
+ # result = client.list_messages request
598
+ #
599
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
600
+ # # over elements, and API calls will be issued to fetch pages as needed.
601
+ # result.each do |item|
602
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Message.
603
+ # p item
604
+ # end
605
+ #
518
606
  def list_messages request, options = nil
519
607
  raise ::ArgumentError, "request must be provided" if request.nil?
520
608
 
@@ -595,6 +683,22 @@ module Google
595
683
  # @return [::Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse]
596
684
  #
597
685
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
686
+ #
687
+ # @example Basic example
688
+ # require "google/cloud/dialogflow/v2"
689
+ #
690
+ # # Create a client object. The client can be reused for multiple calls.
691
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
692
+ #
693
+ # # Create a request. To set request fields, pass in keyword arguments.
694
+ # request = Google::Cloud::Dialogflow::V2::SuggestConversationSummaryRequest.new
695
+ #
696
+ # # Call the suggest_conversation_summary method.
697
+ # result = client.suggest_conversation_summary request
698
+ #
699
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SuggestConversationSummaryResponse.
700
+ # p result
701
+ #
598
702
  def suggest_conversation_summary request, options = nil
599
703
  raise ::ArgumentError, "request must be provided" if request.nil?
600
704
 
@@ -672,6 +776,22 @@ module Google
672
776
  # @return [::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse]
673
777
  #
674
778
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
779
+ #
780
+ # @example Basic example
781
+ # require "google/cloud/dialogflow/v2"
782
+ #
783
+ # # Create a client object. The client can be reused for multiple calls.
784
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
785
+ #
786
+ # # Create a request. To set request fields, pass in keyword arguments.
787
+ # request = Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest.new
788
+ #
789
+ # # Call the generate_stateless_summary method.
790
+ # result = client.generate_stateless_summary request
791
+ #
792
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse.
793
+ # p result
794
+ #
675
795
  def generate_stateless_summary request, options = nil
676
796
  raise ::ArgumentError, "request must be provided" if request.nil?
677
797
 
@@ -707,6 +827,109 @@ module Google
707
827
  raise ::Google::Cloud::Error.from_error(e)
708
828
  end
709
829
 
830
+ ##
831
+ # Get answers for the given query based on knowledge documents.
832
+ #
833
+ # @overload search_knowledge(request, options = nil)
834
+ # Pass arguments to `search_knowledge` via a request object, either of type
835
+ # {::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest} or an equivalent Hash.
836
+ #
837
+ # @param request [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::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 search_knowledge(parent: nil, query: nil, conversation_profile: nil, session_id: nil, conversation: nil, latest_message: nil)
844
+ # Pass arguments to `search_knowledge` 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
+ # The parent resource contains the conversation profile
850
+ # Format: 'projects/<Project ID>' or `projects/<Project
851
+ # ID>/locations/<Location ID>`.
852
+ # @param query [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash]
853
+ # Required. The natural language text query for knowledge search.
854
+ # @param conversation_profile [::String]
855
+ # Required. The conversation profile used to configure the search.
856
+ # Format: `projects/<Project ID>/locations/<Location
857
+ # ID>/conversationProfiles/<Conversation Profile ID>`.
858
+ # @param session_id [::String]
859
+ # The ID of the search session.
860
+ # The session_id can be combined with Dialogflow V3 Agent ID retrieved from
861
+ # conversation profile or on its own to identify a search session. The search
862
+ # history of the same session will impact the search result. It's up to the
863
+ # API caller to choose an appropriate `Session ID`. It can be a random number
864
+ # or some type of session identifiers (preferably hashed). The length must
865
+ # not exceed 36 characters.
866
+ # @param conversation [::String]
867
+ # The conversation (between human agent and end user) where the search
868
+ # request is triggered. Format: `projects/<Project ID>/locations/<Location
869
+ # ID>/conversations/<Conversation ID>`.
870
+ # @param latest_message [::String]
871
+ # The name of the latest conversation message when the request is
872
+ # triggered.
873
+ # Format: `projects/<Project ID>/locations/<Location
874
+ # ID>/conversations/<Conversation ID>/messages/<Message ID>`.
875
+ # @yield [result, operation] Access the result along with the TransportOperation object
876
+ # @yieldparam result [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse]
877
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
878
+ #
879
+ # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse]
880
+ #
881
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
882
+ #
883
+ # @example Basic example
884
+ # require "google/cloud/dialogflow/v2"
885
+ #
886
+ # # Create a client object. The client can be reused for multiple calls.
887
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Rest::Client.new
888
+ #
889
+ # # Create a request. To set request fields, pass in keyword arguments.
890
+ # request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new
891
+ #
892
+ # # Call the search_knowledge method.
893
+ # result = client.search_knowledge request
894
+ #
895
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.
896
+ # p result
897
+ #
898
+ def search_knowledge request, options = nil
899
+ raise ::ArgumentError, "request must be provided" if request.nil?
900
+
901
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest
902
+
903
+ # Converts hash and nil to an options object
904
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
905
+
906
+ # Customize the options with defaults
907
+ call_metadata = @config.rpcs.search_knowledge.metadata.to_h
908
+
909
+ # Set x-goog-api-client and x-goog-user-project headers
910
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
911
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
912
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
913
+ transports_version_send: [:rest]
914
+
915
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
916
+
917
+ options.apply_defaults timeout: @config.rpcs.search_knowledge.timeout,
918
+ metadata: call_metadata,
919
+ retry_policy: @config.rpcs.search_knowledge.retry_policy
920
+
921
+ options.apply_defaults timeout: @config.timeout,
922
+ metadata: @config.metadata,
923
+ retry_policy: @config.retry_policy
924
+
925
+ @conversations_stub.search_knowledge request, options do |result, operation|
926
+ yield result, operation if block_given?
927
+ return result
928
+ end
929
+ rescue ::Gapic::Rest::Error => e
930
+ raise ::Google::Cloud::Error.from_error(e)
931
+ end
932
+
710
933
  ##
711
934
  # Configuration class for the Conversations REST API.
712
935
  #
@@ -874,6 +1097,11 @@ module Google
874
1097
  # @return [::Gapic::Config::Method]
875
1098
  #
876
1099
  attr_reader :generate_stateless_summary
1100
+ ##
1101
+ # RPC-specific configuration for `search_knowledge`
1102
+ # @return [::Gapic::Config::Method]
1103
+ #
1104
+ attr_reader :search_knowledge
877
1105
 
878
1106
  # @private
879
1107
  def initialize parent_rpcs = nil
@@ -891,6 +1119,8 @@ module Google
891
1119
  @suggest_conversation_summary = ::Gapic::Config::Method.new suggest_conversation_summary_config
892
1120
  generate_stateless_summary_config = parent_rpcs.generate_stateless_summary if parent_rpcs.respond_to? :generate_stateless_summary
893
1121
  @generate_stateless_summary = ::Gapic::Config::Method.new generate_stateless_summary_config
1122
+ search_knowledge_config = parent_rpcs.search_knowledge if parent_rpcs.respond_to? :search_knowledge
1123
+ @search_knowledge = ::Gapic::Config::Method.new search_knowledge_config
894
1124
 
895
1125
  yield self if block_given?
896
1126
  end
@@ -306,6 +306,44 @@ module Google
306
306
  result
307
307
  end
308
308
 
309
+ ##
310
+ # Baseline implementation for the search_knowledge REST call
311
+ #
312
+ # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest]
313
+ # A request object representing the call parameters. Required.
314
+ # @param options [::Gapic::CallOptions]
315
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
316
+ #
317
+ # @yield [result, operation] Access the result along with the TransportOperation object
318
+ # @yieldparam result [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse]
319
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
320
+ #
321
+ # @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse]
322
+ # A result object deserialized from the server's reply
323
+ def search_knowledge request_pb, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
325
+
326
+ verb, uri, query_string_params, body = ServiceStub.transcode_search_knowledge_request request_pb
327
+ query_string_params = if query_string_params.any?
328
+ query_string_params.to_h { |p| p.split "=", 2 }
329
+ else
330
+ {}
331
+ end
332
+
333
+ response = @client_stub.make_http_request(
334
+ verb,
335
+ uri: uri,
336
+ body: body || "",
337
+ params: query_string_params,
338
+ options: options
339
+ )
340
+ operation = ::Gapic::Rest::TransportOperation.new response
341
+ result = ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.decode_json response.body, ignore_unknown_fields: true
342
+
343
+ yield result, operation if block_given?
344
+ result
345
+ end
346
+
309
347
  ##
310
348
  # @private
311
349
  #
@@ -509,6 +547,52 @@ module Google
509
547
  )
510
548
  transcoder.transcode request_pb
511
549
  end
550
+
551
+ ##
552
+ # @private
553
+ #
554
+ # GRPC transcoding helper method for the search_knowledge REST call
555
+ #
556
+ # @param request_pb [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest]
557
+ # A request object representing the call parameters. Required.
558
+ # @return [Array(String, [String, nil], Hash{String => String})]
559
+ # Uri, Body, Query string parameters
560
+ def self.transcode_search_knowledge_request request_pb
561
+ transcoder = Gapic::Rest::GrpcTranscoder.new
562
+ .with_bindings(
563
+ uri_method: :post,
564
+ uri_template: "/v2/{parent}/suggestions:searchKnowledge",
565
+ body: "*",
566
+ matches: [
567
+ ["parent", %r{^projects/[^/]+/?$}, false]
568
+ ]
569
+ )
570
+ .with_bindings(
571
+ uri_method: :post,
572
+ uri_template: "/v2/{parent}/suggestions:searchKnowledge",
573
+ body: "*",
574
+ matches: [
575
+ ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
576
+ ]
577
+ )
578
+ .with_bindings(
579
+ uri_method: :post,
580
+ uri_template: "/v2/{conversation}/suggestions:searchKnowledge",
581
+ body: "*",
582
+ matches: [
583
+ ["conversation", %r{^projects/[^/]+/conversations/[^/]+/?$}, false]
584
+ ]
585
+ )
586
+ .with_bindings(
587
+ uri_method: :post,
588
+ uri_template: "/v2/{conversation}/suggestions:searchKnowledge",
589
+ body: "*",
590
+ matches: [
591
+ ["conversation", %r{^projects/[^/]+/locations/[^/]+/conversations/[^/]+/?$}, false]
592
+ ]
593
+ )
594
+ transcoder.transcode request_pb
595
+ end
512
596
  end
513
597
  end
514
598
  end
@@ -157,7 +157,8 @@ module Google
157
157
  credentials: credentials,
158
158
  endpoint: @config.endpoint,
159
159
  channel_args: @config.channel_args,
160
- interceptors: @config.interceptors
160
+ interceptors: @config.interceptors,
161
+ channel_pool_config: @config.channel_pool
161
162
  )
162
163
  end
163
164
 
@@ -1167,6 +1168,14 @@ module Google
1167
1168
  end
1168
1169
  end
1169
1170
 
1171
+ ##
1172
+ # Configuration for the channel pool
1173
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1174
+ #
1175
+ def channel_pool
1176
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1177
+ end
1178
+
1170
1179
  ##
1171
1180
  # Configuration RPC class for the Documents API.
1172
1181
  #
@@ -93,7 +93,8 @@ module Google
93
93
  credentials: credentials,
94
94
  endpoint: @config.endpoint,
95
95
  channel_args: @config.channel_args,
96
- interceptors: @config.interceptors
96
+ interceptors: @config.interceptors,
97
+ channel_pool_config: @config.channel_pool
97
98
  )
98
99
 
99
100
  # Used by an LRO wrapper for some methods of this service
@@ -701,6 +702,14 @@ module Google
701
702
  end
702
703
  end
703
704
 
705
+ ##
706
+ # Configuration for the channel pool
707
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
708
+ #
709
+ def channel_pool
710
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
711
+ end
712
+
704
713
  ##
705
714
  # Configuration RPC class for the Operations API.
706
715
  #
@@ -225,6 +225,26 @@ module Google
225
225
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Document>]
226
226
  #
227
227
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
228
+ #
229
+ # @example Basic example
230
+ # require "google/cloud/dialogflow/v2"
231
+ #
232
+ # # Create a client object. The client can be reused for multiple calls.
233
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
234
+ #
235
+ # # Create a request. To set request fields, pass in keyword arguments.
236
+ # request = Google::Cloud::Dialogflow::V2::ListDocumentsRequest.new
237
+ #
238
+ # # Call the list_documents method.
239
+ # result = client.list_documents request
240
+ #
241
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
242
+ # # over elements, and API calls will be issued to fetch pages as needed.
243
+ # result.each do |item|
244
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Document.
245
+ # p item
246
+ # end
247
+ #
228
248
  def list_documents request, options = nil
229
249
  raise ::ArgumentError, "request must be provided" if request.nil?
230
250
 
@@ -290,6 +310,22 @@ module Google
290
310
  # @return [::Google::Cloud::Dialogflow::V2::Document]
291
311
  #
292
312
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
313
+ #
314
+ # @example Basic example
315
+ # require "google/cloud/dialogflow/v2"
316
+ #
317
+ # # Create a client object. The client can be reused for multiple calls.
318
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
319
+ #
320
+ # # Create a request. To set request fields, pass in keyword arguments.
321
+ # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new
322
+ #
323
+ # # Call the get_document method.
324
+ # result = client.get_document request
325
+ #
326
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Document.
327
+ # p result
328
+ #
293
329
  def get_document request, options = nil
294
330
  raise ::ArgumentError, "request must be provided" if request.nil?
295
331
 
@@ -364,6 +400,29 @@ module Google
364
400
  # @return [::Gapic::Operation]
365
401
  #
366
402
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
403
+ #
404
+ # @example Basic example
405
+ # require "google/cloud/dialogflow/v2"
406
+ #
407
+ # # Create a client object. The client can be reused for multiple calls.
408
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
409
+ #
410
+ # # Create a request. To set request fields, pass in keyword arguments.
411
+ # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new
412
+ #
413
+ # # Call the create_document method.
414
+ # result = client.create_document request
415
+ #
416
+ # # The returned object is of type Gapic::Operation. You can use it to
417
+ # # check the status of an operation, cancel it, or wait for results.
418
+ # # Here is how to wait for a response.
419
+ # result.wait_until_done! timeout: 60
420
+ # if result.response?
421
+ # p result.response
422
+ # else
423
+ # puts "No response received."
424
+ # end
425
+ #
367
426
  def create_document request, options = nil
368
427
  raise ::ArgumentError, "request must be provided" if request.nil?
369
428
 
@@ -452,6 +511,29 @@ module Google
452
511
  # @return [::Gapic::Operation]
453
512
  #
454
513
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
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::Documents::Rest::Client.new
520
+ #
521
+ # # Create a request. To set request fields, pass in keyword arguments.
522
+ # request = Google::Cloud::Dialogflow::V2::ImportDocumentsRequest.new
523
+ #
524
+ # # Call the import_documents method.
525
+ # result = client.import_documents request
526
+ #
527
+ # # The returned object is of type Gapic::Operation. You can use it to
528
+ # # check the status of an operation, cancel it, or wait for results.
529
+ # # Here is how to wait for a response.
530
+ # result.wait_until_done! timeout: 60
531
+ # if result.response?
532
+ # p result.response
533
+ # else
534
+ # puts "No response received."
535
+ # end
536
+ #
455
537
  def import_documents request, options = nil
456
538
  raise ::ArgumentError, "request must be provided" if request.nil?
457
539
 
@@ -526,6 +608,29 @@ module Google
526
608
  # @return [::Gapic::Operation]
527
609
  #
528
610
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
611
+ #
612
+ # @example Basic example
613
+ # require "google/cloud/dialogflow/v2"
614
+ #
615
+ # # Create a client object. The client can be reused for multiple calls.
616
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
617
+ #
618
+ # # Create a request. To set request fields, pass in keyword arguments.
619
+ # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new
620
+ #
621
+ # # Call the delete_document method.
622
+ # result = client.delete_document request
623
+ #
624
+ # # The returned object is of type Gapic::Operation. You can use it to
625
+ # # check the status of an operation, cancel it, or wait for results.
626
+ # # Here is how to wait for a response.
627
+ # result.wait_until_done! timeout: 60
628
+ # if result.response?
629
+ # p result.response
630
+ # else
631
+ # puts "No response received."
632
+ # end
633
+ #
529
634
  def delete_document request, options = nil
530
635
  raise ::ArgumentError, "request must be provided" if request.nil?
531
636
 
@@ -601,6 +706,29 @@ module Google
601
706
  # @return [::Gapic::Operation]
602
707
  #
603
708
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
709
+ #
710
+ # @example Basic example
711
+ # require "google/cloud/dialogflow/v2"
712
+ #
713
+ # # Create a client object. The client can be reused for multiple calls.
714
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
715
+ #
716
+ # # Create a request. To set request fields, pass in keyword arguments.
717
+ # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new
718
+ #
719
+ # # Call the update_document method.
720
+ # result = client.update_document request
721
+ #
722
+ # # The returned object is of type Gapic::Operation. You can use it to
723
+ # # check the status of an operation, cancel it, or wait for results.
724
+ # # Here is how to wait for a response.
725
+ # result.wait_until_done! timeout: 60
726
+ # if result.response?
727
+ # p result.response
728
+ # else
729
+ # puts "No response received."
730
+ # end
731
+ #
604
732
  def update_document request, options = nil
605
733
  raise ::ArgumentError, "request must be provided" if request.nil?
606
734
 
@@ -692,6 +820,29 @@ module Google
692
820
  # @return [::Gapic::Operation]
693
821
  #
694
822
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
823
+ #
824
+ # @example Basic example
825
+ # require "google/cloud/dialogflow/v2"
826
+ #
827
+ # # Create a client object. The client can be reused for multiple calls.
828
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
829
+ #
830
+ # # Create a request. To set request fields, pass in keyword arguments.
831
+ # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new
832
+ #
833
+ # # Call the reload_document method.
834
+ # result = client.reload_document request
835
+ #
836
+ # # The returned object is of type Gapic::Operation. You can use it to
837
+ # # check the status of an operation, cancel it, or wait for results.
838
+ # # Here is how to wait for a response.
839
+ # result.wait_until_done! timeout: 60
840
+ # if result.response?
841
+ # p result.response
842
+ # else
843
+ # puts "No response received."
844
+ # end
845
+ #
695
846
  def reload_document request, options = nil
696
847
  raise ::ArgumentError, "request must be provided" if request.nil?
697
848
 
@@ -774,6 +925,29 @@ module Google
774
925
  # @return [::Gapic::Operation]
775
926
  #
776
927
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
928
+ #
929
+ # @example Basic example
930
+ # require "google/cloud/dialogflow/v2"
931
+ #
932
+ # # Create a client object. The client can be reused for multiple calls.
933
+ # client = Google::Cloud::Dialogflow::V2::Documents::Rest::Client.new
934
+ #
935
+ # # Create a request. To set request fields, pass in keyword arguments.
936
+ # request = Google::Cloud::Dialogflow::V2::ExportDocumentRequest.new
937
+ #
938
+ # # Call the export_document method.
939
+ # result = client.export_document request
940
+ #
941
+ # # The returned object is of type Gapic::Operation. You can use it to
942
+ # # check the status of an operation, cancel it, or wait for results.
943
+ # # Here is how to wait for a response.
944
+ # result.wait_until_done! timeout: 60
945
+ # if result.response?
946
+ # p result.response
947
+ # else
948
+ # puts "No response received."
949
+ # end
950
+ #
777
951
  def export_document request, options = nil
778
952
  raise ::ArgumentError, "request must be provided" if request.nil?
779
953