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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b4d2b29e726ce9b67ccde9f362e7ea72c2853e473e66c9044c46fcdc95ab3cd6
4
- data.tar.gz: 10bea396d32d2e0c8d1fbbe12fe7e2bcc2102717f7e62303665247dce3981f0e
3
+ metadata.gz: babf4c27527e0d2aaf7b5ce4722126ff9945da8ab6b3a468d68679b136965c1e
4
+ data.tar.gz: 32f84284e33348b1046009de909aecbd375b62334ba5a0b223da3146fb094823
5
5
  SHA512:
6
- metadata.gz: 59cc1ea02ae7620404dae8eed7eb51ee8c1922a905af1f893651cd63d4be95107f0750ffd112cda7df5a006c07849ac18b8192a2d1827e178c56a0151921f4ce
7
- data.tar.gz: 4c48335d9393de2f5743c74a44877196af1c941201bf664b7fc8bb9b6b8ee382a6b9b54059485a07fc4a411f6d3b9451f8e98e564e36298e2aa7a6dbb6b71c63
6
+ metadata.gz: 616c51ceb04996f0efb7902e3b91c7d04593b66dfab7d3e64dcf8fd9eb4caa5300783e3c02e3a60b91a3c9be0513583cb18e8fe0ef26d171c49c8a6e5ac2d585
7
+ data.tar.gz: dc9f9a747dc77869b20d4fe2206c5edcfb36b8c5bb5952b5621cea57c3b6db22cb2a663c56dde04c2d9dba787aeec96e0fba98ce03dcda8b0b8fcfc15b5e1f9c
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  API Client library for the Dialogflow V2 API
4
4
 
5
- Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business.
5
+ Dialogflow is an end-to-end, build-once deploy-everywhere development suite for creating conversational interfaces for websites, mobile applications, popular messaging platforms, and IoT devices. You can use it to build interfaces (such as chatbots and conversational IVR) that enable natural and rich interactions between your users and your business. This client is for Dialogflow ES, providing the standard agent type suitable for small and simple agents.
6
6
 
7
7
  https://github.com/googleapis/google-cloud-ruby
8
8
 
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/cloud/dialogflow/v2/agent.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -11,6 +9,8 @@ require 'google/cloud/dialogflow/v2/validation_result_pb'
11
9
  require 'google/longrunning/operations_pb'
12
10
  require 'google/protobuf/empty_pb'
13
11
  require 'google/protobuf/field_mask_pb'
12
+ require 'google/protobuf'
13
+
14
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
15
15
  add_file("google/cloud/dialogflow/v2/agent.proto", :syntax => :proto3) do
16
16
  add_message "google.cloud.dialogflow.v2.Agent" do
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [Agents][google.cloud.dialogflow.v2.Agent].
28
28
  class Service
29
29
 
30
- include GRPC::GenericService
30
+ include ::GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -53,12 +53,28 @@ module Google
53
53
  rpc :SearchAgents, ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Google::Cloud::Dialogflow::V2::SearchAgentsResponse
54
54
  # Trains the specified agent.
55
55
  #
56
+ # This method is a [long-running
57
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
58
+ # The returned `Operation` type has the following method-specific fields:
59
+ #
60
+ # - `metadata`: An empty [Struct
61
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
62
+ # - `response`: An [Empty
63
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
56
64
  #
57
65
  # Note: You should always train an agent prior to sending it queries. See the
58
66
  # [training
59
67
  # documentation](https://cloud.google.com/dialogflow/es/docs/training).
60
68
  rpc :TrainAgent, ::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Google::Longrunning::Operation
61
69
  # Exports the specified agent to a ZIP file.
70
+ #
71
+ # This method is a [long-running
72
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
73
+ # The returned `Operation` type has the following method-specific fields:
74
+ #
75
+ # - `metadata`: An empty [Struct
76
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
77
+ # - `response`: [ExportAgentResponse][google.cloud.dialogflow.v2.ExportAgentResponse]
62
78
  rpc :ExportAgent, ::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Google::Longrunning::Operation
63
79
  # Imports the specified agent from a ZIP file.
64
80
  #
@@ -70,8 +86,17 @@ module Google
70
86
  # call [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the operation it returns in order to train
71
87
  # explicitly.
72
88
  #
73
- # An operation which tracks when importing is complete. It only tracks
74
- # when the draft agent is updated not when it is done training.
89
+ # This method is a [long-running
90
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
91
+ # The returned `Operation` type has the following method-specific fields:
92
+ #
93
+ # - `metadata`: An empty [Struct
94
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
95
+ # - `response`: An [Empty
96
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
97
+ #
98
+ # The operation only tracks when importing is complete, not when it is done
99
+ # training.
75
100
  #
76
101
  # Note: You should always train an agent prior to sending it queries. See the
77
102
  # [training
@@ -86,8 +111,17 @@ module Google
86
111
  # completed yet. Please call [TrainAgent][google.cloud.dialogflow.v2.Agents.TrainAgent] and wait for the operation it
87
112
  # returns in order to train explicitly.
88
113
  #
89
- # An operation which tracks when restoring is complete. It only tracks
90
- # when the draft agent is updated not when it is done training.
114
+ # This method is a [long-running
115
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
116
+ # The returned `Operation` type has the following method-specific fields:
117
+ #
118
+ # - `metadata`: An empty [Struct
119
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
120
+ # - `response`: An [Empty
121
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
122
+ #
123
+ # The operation only tracks when restoring is complete, not when it is done
124
+ # training.
91
125
  #
92
126
  # Note: You should always train an agent prior to sending it queries. See the
93
127
  # [training
@@ -191,6 +191,21 @@ module Google
191
191
  #
192
192
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
193
193
  #
194
+ # @example Basic example
195
+ # require "google/cloud/dialogflow/v2"
196
+ #
197
+ # # Create a client object. The client can be reused for multiple calls.
198
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
199
+ #
200
+ # # Create a request. To set request fields, pass in keyword arguments.
201
+ # request = Google::Cloud::Dialogflow::V2::GetAgentRequest.new
202
+ #
203
+ # # Call the get_agent method.
204
+ # result = client.get_agent request
205
+ #
206
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent.
207
+ # p result
208
+ #
194
209
  def get_agent request, options = nil
195
210
  raise ::ArgumentError, "request must be provided" if request.nil?
196
211
 
@@ -208,9 +223,11 @@ module Google
208
223
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
209
224
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
210
225
 
211
- header_params = {
212
- "parent" => request.parent
213
- }
226
+ header_params = {}
227
+ if request.parent
228
+ header_params["parent"] = request.parent
229
+ end
230
+
214
231
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
215
232
  metadata[:"x-goog-request-params"] ||= request_params_header
216
233
 
@@ -265,6 +282,21 @@ module Google
265
282
  #
266
283
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
267
284
  #
285
+ # @example Basic example
286
+ # require "google/cloud/dialogflow/v2"
287
+ #
288
+ # # Create a client object. The client can be reused for multiple calls.
289
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
290
+ #
291
+ # # Create a request. To set request fields, pass in keyword arguments.
292
+ # request = Google::Cloud::Dialogflow::V2::SetAgentRequest.new
293
+ #
294
+ # # Call the set_agent method.
295
+ # result = client.set_agent request
296
+ #
297
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Agent.
298
+ # p result
299
+ #
268
300
  def set_agent request, options = nil
269
301
  raise ::ArgumentError, "request must be provided" if request.nil?
270
302
 
@@ -282,9 +314,11 @@ module Google
282
314
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
283
315
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
284
316
 
285
- header_params = {
286
- "agent.parent" => request.agent.parent
287
- }
317
+ header_params = {}
318
+ if request.agent&.parent
319
+ header_params["agent.parent"] = request.agent.parent
320
+ end
321
+
288
322
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
289
323
  metadata[:"x-goog-request-params"] ||= request_params_header
290
324
 
@@ -334,6 +368,21 @@ module Google
334
368
  #
335
369
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
336
370
  #
371
+ # @example Basic example
372
+ # require "google/cloud/dialogflow/v2"
373
+ #
374
+ # # Create a client object. The client can be reused for multiple calls.
375
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
376
+ #
377
+ # # Create a request. To set request fields, pass in keyword arguments.
378
+ # request = Google::Cloud::Dialogflow::V2::DeleteAgentRequest.new
379
+ #
380
+ # # Call the delete_agent method.
381
+ # result = client.delete_agent request
382
+ #
383
+ # # The returned object is of type Google::Protobuf::Empty.
384
+ # p result
385
+ #
337
386
  def delete_agent request, options = nil
338
387
  raise ::ArgumentError, "request must be provided" if request.nil?
339
388
 
@@ -351,9 +400,11 @@ module Google
351
400
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
352
401
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
402
 
354
- header_params = {
355
- "parent" => request.parent
356
- }
403
+ header_params = {}
404
+ if request.parent
405
+ header_params["parent"] = request.parent
406
+ end
407
+
357
408
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
358
409
  metadata[:"x-goog-request-params"] ||= request_params_header
359
410
 
@@ -414,6 +465,27 @@ module Google
414
465
  #
415
466
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
416
467
  #
468
+ # @example Basic example
469
+ # require "google/cloud/dialogflow/v2"
470
+ #
471
+ # # Create a client object. The client can be reused for multiple calls.
472
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
473
+ #
474
+ # # Create a request. To set request fields, pass in keyword arguments.
475
+ # request = Google::Cloud::Dialogflow::V2::SearchAgentsRequest.new
476
+ #
477
+ # # Call the search_agents method.
478
+ # result = client.search_agents request
479
+ #
480
+ # # The returned object is of type Gapic::PagedEnumerable. You can
481
+ # # iterate over all elements by calling #each, and the enumerable
482
+ # # will lazily make API calls to fetch subsequent pages. Other
483
+ # # methods are also available for managing paging directly.
484
+ # result.each do |response|
485
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Agent.
486
+ # p response
487
+ # end
488
+ #
417
489
  def search_agents request, options = nil
418
490
  raise ::ArgumentError, "request must be provided" if request.nil?
419
491
 
@@ -431,9 +503,11 @@ module Google
431
503
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
432
504
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
505
 
434
- header_params = {
435
- "parent" => request.parent
436
- }
506
+ header_params = {}
507
+ if request.parent
508
+ header_params["parent"] = request.parent
509
+ end
510
+
437
511
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
438
512
  metadata[:"x-goog-request-params"] ||= request_params_header
439
513
 
@@ -457,6 +531,14 @@ module Google
457
531
  ##
458
532
  # Trains the specified agent.
459
533
  #
534
+ # This method is a [long-running
535
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
536
+ # The returned `Operation` type has the following method-specific fields:
537
+ #
538
+ # - `metadata`: An empty [Struct
539
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
540
+ # - `response`: An [Empty
541
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
460
542
  #
461
543
  # Note: You should always train an agent prior to sending it queries. See the
462
544
  # [training
@@ -489,6 +571,28 @@ module Google
489
571
  #
490
572
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
491
573
  #
574
+ # @example Basic example
575
+ # require "google/cloud/dialogflow/v2"
576
+ #
577
+ # # Create a client object. The client can be reused for multiple calls.
578
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
579
+ #
580
+ # # Create a request. To set request fields, pass in keyword arguments.
581
+ # request = Google::Cloud::Dialogflow::V2::TrainAgentRequest.new
582
+ #
583
+ # # Call the train_agent method.
584
+ # result = client.train_agent request
585
+ #
586
+ # # The returned object is of type Gapic::Operation. You can use this
587
+ # # object to check the status of an operation, cancel it, or wait
588
+ # # for results. Here is how to block until completion:
589
+ # result.wait_until_done! timeout: 60
590
+ # if result.response?
591
+ # p result.response
592
+ # else
593
+ # puts "Error!"
594
+ # end
595
+ #
492
596
  def train_agent request, options = nil
493
597
  raise ::ArgumentError, "request must be provided" if request.nil?
494
598
 
@@ -506,9 +610,11 @@ module Google
506
610
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
507
611
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
508
612
 
509
- header_params = {
510
- "parent" => request.parent
511
- }
613
+ header_params = {}
614
+ if request.parent
615
+ header_params["parent"] = request.parent
616
+ end
617
+
512
618
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
513
619
  metadata[:"x-goog-request-params"] ||= request_params_header
514
620
 
@@ -532,6 +638,14 @@ module Google
532
638
  ##
533
639
  # Exports the specified agent to a ZIP file.
534
640
  #
641
+ # This method is a [long-running
642
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
643
+ # The returned `Operation` type has the following method-specific fields:
644
+ #
645
+ # - `metadata`: An empty [Struct
646
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
647
+ # - `response`: {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse}
648
+ #
535
649
  # @overload export_agent(request, options = nil)
536
650
  # Pass arguments to `export_agent` via a request object, either of type
537
651
  # {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash.
@@ -564,6 +678,28 @@ module Google
564
678
  #
565
679
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
566
680
  #
681
+ # @example Basic example
682
+ # require "google/cloud/dialogflow/v2"
683
+ #
684
+ # # Create a client object. The client can be reused for multiple calls.
685
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
686
+ #
687
+ # # Create a request. To set request fields, pass in keyword arguments.
688
+ # request = Google::Cloud::Dialogflow::V2::ExportAgentRequest.new
689
+ #
690
+ # # Call the export_agent method.
691
+ # result = client.export_agent request
692
+ #
693
+ # # The returned object is of type Gapic::Operation. You can use this
694
+ # # object to check the status of an operation, cancel it, or wait
695
+ # # for results. Here is how to block until completion:
696
+ # result.wait_until_done! timeout: 60
697
+ # if result.response?
698
+ # p result.response
699
+ # else
700
+ # puts "Error!"
701
+ # end
702
+ #
567
703
  def export_agent request, options = nil
568
704
  raise ::ArgumentError, "request must be provided" if request.nil?
569
705
 
@@ -581,9 +717,11 @@ module Google
581
717
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
582
718
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
583
719
 
584
- header_params = {
585
- "parent" => request.parent
586
- }
720
+ header_params = {}
721
+ if request.parent
722
+ header_params["parent"] = request.parent
723
+ end
724
+
587
725
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
588
726
  metadata[:"x-goog-request-params"] ||= request_params_header
589
727
 
@@ -615,8 +753,17 @@ module Google
615
753
  # call {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the operation it returns in order to train
616
754
  # explicitly.
617
755
  #
618
- # An operation which tracks when importing is complete. It only tracks
619
- # when the draft agent is updated not when it is done training.
756
+ # This method is a [long-running
757
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
758
+ # The returned `Operation` type has the following method-specific fields:
759
+ #
760
+ # - `metadata`: An empty [Struct
761
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
762
+ # - `response`: An [Empty
763
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
764
+ #
765
+ # The operation only tracks when importing is complete, not when it is done
766
+ # training.
620
767
  #
621
768
  # Note: You should always train an agent prior to sending it queries. See the
622
769
  # [training
@@ -654,6 +801,28 @@ module Google
654
801
  #
655
802
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
656
803
  #
804
+ # @example Basic example
805
+ # require "google/cloud/dialogflow/v2"
806
+ #
807
+ # # Create a client object. The client can be reused for multiple calls.
808
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
809
+ #
810
+ # # Create a request. To set request fields, pass in keyword arguments.
811
+ # request = Google::Cloud::Dialogflow::V2::ImportAgentRequest.new
812
+ #
813
+ # # Call the import_agent method.
814
+ # result = client.import_agent request
815
+ #
816
+ # # The returned object is of type Gapic::Operation. You can use this
817
+ # # object to check the status of an operation, cancel it, or wait
818
+ # # for results. Here is how to block until completion:
819
+ # result.wait_until_done! timeout: 60
820
+ # if result.response?
821
+ # p result.response
822
+ # else
823
+ # puts "Error!"
824
+ # end
825
+ #
657
826
  def import_agent request, options = nil
658
827
  raise ::ArgumentError, "request must be provided" if request.nil?
659
828
 
@@ -671,9 +840,11 @@ module Google
671
840
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
672
841
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
673
842
 
674
- header_params = {
675
- "parent" => request.parent
676
- }
843
+ header_params = {}
844
+ if request.parent
845
+ header_params["parent"] = request.parent
846
+ end
847
+
677
848
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
678
849
  metadata[:"x-goog-request-params"] ||= request_params_header
679
850
 
@@ -704,8 +875,17 @@ module Google
704
875
  # completed yet. Please call {::Google::Cloud::Dialogflow::V2::Agents::Client#train_agent TrainAgent} and wait for the operation it
705
876
  # returns in order to train explicitly.
706
877
  #
707
- # An operation which tracks when restoring is complete. It only tracks
708
- # when the draft agent is updated not when it is done training.
878
+ # This method is a [long-running
879
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
880
+ # The returned `Operation` type has the following method-specific fields:
881
+ #
882
+ # - `metadata`: An empty [Struct
883
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
884
+ # - `response`: An [Empty
885
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
886
+ #
887
+ # The operation only tracks when restoring is complete, not when it is done
888
+ # training.
709
889
  #
710
890
  # Note: You should always train an agent prior to sending it queries. See the
711
891
  # [training
@@ -743,6 +923,28 @@ module Google
743
923
  #
744
924
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
745
925
  #
926
+ # @example Basic example
927
+ # require "google/cloud/dialogflow/v2"
928
+ #
929
+ # # Create a client object. The client can be reused for multiple calls.
930
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
931
+ #
932
+ # # Create a request. To set request fields, pass in keyword arguments.
933
+ # request = Google::Cloud::Dialogflow::V2::RestoreAgentRequest.new
934
+ #
935
+ # # Call the restore_agent method.
936
+ # result = client.restore_agent request
937
+ #
938
+ # # The returned object is of type Gapic::Operation. You can use this
939
+ # # object to check the status of an operation, cancel it, or wait
940
+ # # for results. Here is how to block until completion:
941
+ # result.wait_until_done! timeout: 60
942
+ # if result.response?
943
+ # p result.response
944
+ # else
945
+ # puts "Error!"
946
+ # end
947
+ #
746
948
  def restore_agent request, options = nil
747
949
  raise ::ArgumentError, "request must be provided" if request.nil?
748
950
 
@@ -760,9 +962,11 @@ module Google
760
962
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
761
963
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
762
964
 
763
- header_params = {
764
- "parent" => request.parent
765
- }
965
+ header_params = {}
966
+ if request.parent
967
+ header_params["parent"] = request.parent
968
+ end
969
+
766
970
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
767
971
  metadata[:"x-goog-request-params"] ||= request_params_header
768
972
 
@@ -820,6 +1024,21 @@ module Google
820
1024
  #
821
1025
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
822
1026
  #
1027
+ # @example Basic example
1028
+ # require "google/cloud/dialogflow/v2"
1029
+ #
1030
+ # # Create a client object. The client can be reused for multiple calls.
1031
+ # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
1032
+ #
1033
+ # # Create a request. To set request fields, pass in keyword arguments.
1034
+ # request = Google::Cloud::Dialogflow::V2::GetValidationResultRequest.new
1035
+ #
1036
+ # # Call the get_validation_result method.
1037
+ # result = client.get_validation_result request
1038
+ #
1039
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::ValidationResult.
1040
+ # p result
1041
+ #
823
1042
  def get_validation_result request, options = nil
824
1043
  raise ::ArgumentError, "request must be provided" if request.nil?
825
1044
 
@@ -837,9 +1056,11 @@ module Google
837
1056
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
838
1057
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
839
1058
 
840
- header_params = {
841
- "parent" => request.parent
842
- }
1059
+ header_params = {}
1060
+ if request.parent
1061
+ header_params["parent"] = request.parent
1062
+ end
1063
+
843
1064
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
844
1065
  metadata[:"x-goog-request-params"] ||= request_params_header
845
1066