google-cloud-dialogflow-v2 0.11.4 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -140,6 +140,7 @@ module Google
140
140
 
141
141
  @operations_client = Operations.new do |config|
142
142
  config.credentials = credentials
143
+ config.quota_project = @quota_project_id
143
144
  config.endpoint = @config.endpoint
144
145
  end
145
146
 
@@ -212,6 +213,27 @@ module Google
212
213
  #
213
214
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
214
215
  #
216
+ # @example Basic example
217
+ # require "google/cloud/dialogflow/v2"
218
+ #
219
+ # # Create a client object. The client can be reused for multiple calls.
220
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
221
+ #
222
+ # # Create a request. To set request fields, pass in keyword arguments.
223
+ # request = Google::Cloud::Dialogflow::V2::ListIntentsRequest.new
224
+ #
225
+ # # Call the list_intents method.
226
+ # result = client.list_intents request
227
+ #
228
+ # # The returned object is of type Gapic::PagedEnumerable. You can
229
+ # # iterate over all elements by calling #each, and the enumerable
230
+ # # will lazily make API calls to fetch subsequent pages. Other
231
+ # # methods are also available for managing paging directly.
232
+ # result.each do |response|
233
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Intent.
234
+ # p response
235
+ # end
236
+ #
215
237
  def list_intents request, options = nil
216
238
  raise ::ArgumentError, "request must be provided" if request.nil?
217
239
 
@@ -229,9 +251,11 @@ module Google
229
251
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
230
252
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
231
253
 
232
- header_params = {
233
- "parent" => request.parent
234
- }
254
+ header_params = {}
255
+ if request.parent
256
+ header_params["parent"] = request.parent
257
+ end
258
+
235
259
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
236
260
  metadata[:"x-goog-request-params"] ||= request_params_header
237
261
 
@@ -290,6 +314,21 @@ module Google
290
314
  #
291
315
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
292
316
  #
317
+ # @example Basic example
318
+ # require "google/cloud/dialogflow/v2"
319
+ #
320
+ # # Create a client object. The client can be reused for multiple calls.
321
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
322
+ #
323
+ # # Create a request. To set request fields, pass in keyword arguments.
324
+ # request = Google::Cloud::Dialogflow::V2::GetIntentRequest.new
325
+ #
326
+ # # Call the get_intent method.
327
+ # result = client.get_intent request
328
+ #
329
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent.
330
+ # p result
331
+ #
293
332
  def get_intent request, options = nil
294
333
  raise ::ArgumentError, "request must be provided" if request.nil?
295
334
 
@@ -307,9 +346,11 @@ module Google
307
346
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
308
347
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
309
348
 
310
- header_params = {
311
- "name" => request.name
312
- }
349
+ header_params = {}
350
+ if request.name
351
+ header_params["name"] = request.name
352
+ end
353
+
313
354
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
314
355
  metadata[:"x-goog-request-params"] ||= request_params_header
315
356
 
@@ -373,6 +414,21 @@ module Google
373
414
  #
374
415
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
375
416
  #
417
+ # @example Basic example
418
+ # require "google/cloud/dialogflow/v2"
419
+ #
420
+ # # Create a client object. The client can be reused for multiple calls.
421
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
422
+ #
423
+ # # Create a request. To set request fields, pass in keyword arguments.
424
+ # request = Google::Cloud::Dialogflow::V2::CreateIntentRequest.new
425
+ #
426
+ # # Call the create_intent method.
427
+ # result = client.create_intent request
428
+ #
429
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent.
430
+ # p result
431
+ #
376
432
  def create_intent request, options = nil
377
433
  raise ::ArgumentError, "request must be provided" if request.nil?
378
434
 
@@ -390,9 +446,11 @@ module Google
390
446
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
391
447
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
392
448
 
393
- header_params = {
394
- "parent" => request.parent
395
- }
449
+ header_params = {}
450
+ if request.parent
451
+ header_params["parent"] = request.parent
452
+ end
453
+
396
454
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
397
455
  metadata[:"x-goog-request-params"] ||= request_params_header
398
456
 
@@ -455,6 +513,21 @@ module Google
455
513
  #
456
514
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
457
515
  #
516
+ # @example Basic example
517
+ # require "google/cloud/dialogflow/v2"
518
+ #
519
+ # # Create a client object. The client can be reused for multiple calls.
520
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
521
+ #
522
+ # # Create a request. To set request fields, pass in keyword arguments.
523
+ # request = Google::Cloud::Dialogflow::V2::UpdateIntentRequest.new
524
+ #
525
+ # # Call the update_intent method.
526
+ # result = client.update_intent request
527
+ #
528
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Intent.
529
+ # p result
530
+ #
458
531
  def update_intent request, options = nil
459
532
  raise ::ArgumentError, "request must be provided" if request.nil?
460
533
 
@@ -472,9 +545,11 @@ module Google
472
545
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
473
546
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
474
547
 
475
- header_params = {
476
- "intent.name" => request.intent.name
477
- }
548
+ header_params = {}
549
+ if request.intent&.name
550
+ header_params["intent.name"] = request.intent.name
551
+ end
552
+
478
553
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
479
554
  metadata[:"x-goog-request-params"] ||= request_params_header
480
555
 
@@ -529,6 +604,21 @@ module Google
529
604
  #
530
605
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
531
606
  #
607
+ # @example Basic example
608
+ # require "google/cloud/dialogflow/v2"
609
+ #
610
+ # # Create a client object. The client can be reused for multiple calls.
611
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
612
+ #
613
+ # # Create a request. To set request fields, pass in keyword arguments.
614
+ # request = Google::Cloud::Dialogflow::V2::DeleteIntentRequest.new
615
+ #
616
+ # # Call the delete_intent method.
617
+ # result = client.delete_intent request
618
+ #
619
+ # # The returned object is of type Google::Protobuf::Empty.
620
+ # p result
621
+ #
532
622
  def delete_intent request, options = nil
533
623
  raise ::ArgumentError, "request must be provided" if request.nil?
534
624
 
@@ -546,9 +636,11 @@ module Google
546
636
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
547
637
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
548
638
 
549
- header_params = {
550
- "name" => request.name
551
- }
639
+ header_params = {}
640
+ if request.name
641
+ header_params["name"] = request.name
642
+ end
643
+
552
644
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
553
645
  metadata[:"x-goog-request-params"] ||= request_params_header
554
646
 
@@ -626,6 +718,28 @@ module Google
626
718
  #
627
719
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
628
720
  #
721
+ # @example Basic example
722
+ # require "google/cloud/dialogflow/v2"
723
+ #
724
+ # # Create a client object. The client can be reused for multiple calls.
725
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
726
+ #
727
+ # # Create a request. To set request fields, pass in keyword arguments.
728
+ # request = Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest.new
729
+ #
730
+ # # Call the batch_update_intents method.
731
+ # result = client.batch_update_intents request
732
+ #
733
+ # # The returned object is of type Gapic::Operation. You can use this
734
+ # # object to check the status of an operation, cancel it, or wait
735
+ # # for results. Here is how to block until completion:
736
+ # result.wait_until_done! timeout: 60
737
+ # if result.response?
738
+ # p result.response
739
+ # else
740
+ # puts "Error!"
741
+ # end
742
+ #
629
743
  def batch_update_intents request, options = nil
630
744
  raise ::ArgumentError, "request must be provided" if request.nil?
631
745
 
@@ -643,9 +757,11 @@ module Google
643
757
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
644
758
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
645
759
 
646
- header_params = {
647
- "parent" => request.parent
648
- }
760
+ header_params = {}
761
+ if request.parent
762
+ header_params["parent"] = request.parent
763
+ end
764
+
649
765
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
650
766
  metadata[:"x-goog-request-params"] ||= request_params_header
651
767
 
@@ -712,6 +828,28 @@ module Google
712
828
  #
713
829
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
714
830
  #
831
+ # @example Basic example
832
+ # require "google/cloud/dialogflow/v2"
833
+ #
834
+ # # Create a client object. The client can be reused for multiple calls.
835
+ # client = Google::Cloud::Dialogflow::V2::Intents::Client.new
836
+ #
837
+ # # Create a request. To set request fields, pass in keyword arguments.
838
+ # request = Google::Cloud::Dialogflow::V2::BatchDeleteIntentsRequest.new
839
+ #
840
+ # # Call the batch_delete_intents method.
841
+ # result = client.batch_delete_intents request
842
+ #
843
+ # # The returned object is of type Gapic::Operation. You can use this
844
+ # # object to check the status of an operation, cancel it, or wait
845
+ # # for results. Here is how to block until completion:
846
+ # result.wait_until_done! timeout: 60
847
+ # if result.response?
848
+ # p result.response
849
+ # else
850
+ # puts "Error!"
851
+ # end
852
+ #
715
853
  def batch_delete_intents request, options = nil
716
854
  raise ::ArgumentError, "request must be provided" if request.nil?
717
855
 
@@ -729,9 +867,11 @@ module Google
729
867
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
730
868
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
731
869
 
732
- header_params = {
733
- "parent" => request.parent
734
- }
870
+ header_params = {}
871
+ if request.parent
872
+ header_params["parent"] = request.parent
873
+ end
874
+
735
875
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
736
876
  metadata[:"x-goog-request-params"] ||= request_params_header
737
877
 
@@ -143,6 +143,27 @@ module Google
143
143
  #
144
144
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
145
145
  #
146
+ # @example Basic example
147
+ # require "google/longrunning"
148
+ #
149
+ # # Create a client object. The client can be reused for multiple calls.
150
+ # client = Google::Longrunning::Operations::Client.new
151
+ #
152
+ # # Create a request. To set request fields, pass in keyword arguments.
153
+ # request = Google::Longrunning::ListOperationsRequest.new
154
+ #
155
+ # # Call the list_operations method.
156
+ # result = client.list_operations request
157
+ #
158
+ # # The returned object is of type Gapic::PagedEnumerable. You can
159
+ # # iterate over all elements by calling #each, and the enumerable
160
+ # # will lazily make API calls to fetch subsequent pages. Other
161
+ # # methods are also available for managing paging directly.
162
+ # result.each do |response|
163
+ # # Each element is of type ::Google::Longrunning::Operation.
164
+ # p response
165
+ # end
166
+ #
146
167
  def list_operations request, options = nil
147
168
  raise ::ArgumentError, "request must be provided" if request.nil?
148
169
 
@@ -160,9 +181,11 @@ module Google
160
181
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
161
182
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
162
183
 
163
- header_params = {
164
- "name" => request.name
165
- }
184
+ header_params = {}
185
+ if request.name
186
+ header_params["name"] = request.name
187
+ end
188
+
166
189
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
167
190
  metadata[:"x-goog-request-params"] ||= request_params_header
168
191
 
@@ -215,6 +238,28 @@ module Google
215
238
  #
216
239
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
217
240
  #
241
+ # @example Basic example
242
+ # require "google/longrunning"
243
+ #
244
+ # # Create a client object. The client can be reused for multiple calls.
245
+ # client = Google::Longrunning::Operations::Client.new
246
+ #
247
+ # # Create a request. To set request fields, pass in keyword arguments.
248
+ # request = Google::Longrunning::GetOperationRequest.new
249
+ #
250
+ # # Call the get_operation method.
251
+ # result = client.get_operation request
252
+ #
253
+ # # The returned object is of type Gapic::Operation. You can use this
254
+ # # object to check the status of an operation, cancel it, or wait
255
+ # # for results. Here is how to block until completion:
256
+ # result.wait_until_done! timeout: 60
257
+ # if result.response?
258
+ # p result.response
259
+ # else
260
+ # puts "Error!"
261
+ # end
262
+ #
218
263
  def get_operation request, options = nil
219
264
  raise ::ArgumentError, "request must be provided" if request.nil?
220
265
 
@@ -232,9 +277,11 @@ module Google
232
277
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
233
278
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
234
279
 
235
- header_params = {
236
- "name" => request.name
237
- }
280
+ header_params = {}
281
+ if request.name
282
+ header_params["name"] = request.name
283
+ end
284
+
238
285
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
239
286
  metadata[:"x-goog-request-params"] ||= request_params_header
240
287
 
@@ -287,6 +334,21 @@ module Google
287
334
  #
288
335
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
289
336
  #
337
+ # @example Basic example
338
+ # require "google/longrunning"
339
+ #
340
+ # # Create a client object. The client can be reused for multiple calls.
341
+ # client = Google::Longrunning::Operations::Client.new
342
+ #
343
+ # # Create a request. To set request fields, pass in keyword arguments.
344
+ # request = Google::Longrunning::DeleteOperationRequest.new
345
+ #
346
+ # # Call the delete_operation method.
347
+ # result = client.delete_operation request
348
+ #
349
+ # # The returned object is of type Google::Protobuf::Empty.
350
+ # p result
351
+ #
290
352
  def delete_operation request, options = nil
291
353
  raise ::ArgumentError, "request must be provided" if request.nil?
292
354
 
@@ -304,9 +366,11 @@ module Google
304
366
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
305
367
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
306
368
 
307
- header_params = {
308
- "name" => request.name
309
- }
369
+ header_params = {}
370
+ if request.name
371
+ header_params["name"] = request.name
372
+ end
373
+
310
374
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
375
  metadata[:"x-goog-request-params"] ||= request_params_header
312
376
 
@@ -364,6 +428,21 @@ module Google
364
428
  #
365
429
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
366
430
  #
431
+ # @example Basic example
432
+ # require "google/longrunning"
433
+ #
434
+ # # Create a client object. The client can be reused for multiple calls.
435
+ # client = Google::Longrunning::Operations::Client.new
436
+ #
437
+ # # Create a request. To set request fields, pass in keyword arguments.
438
+ # request = Google::Longrunning::CancelOperationRequest.new
439
+ #
440
+ # # Call the cancel_operation method.
441
+ # result = client.cancel_operation request
442
+ #
443
+ # # The returned object is of type Google::Protobuf::Empty.
444
+ # p result
445
+ #
367
446
  def cancel_operation request, options = nil
368
447
  raise ::ArgumentError, "request must be provided" if request.nil?
369
448
 
@@ -381,9 +460,11 @@ module Google
381
460
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
382
461
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
383
462
 
384
- header_params = {
385
- "name" => request.name
386
- }
463
+ header_params = {}
464
+ if request.name
465
+ header_params["name"] = request.name
466
+ end
467
+
387
468
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
469
  metadata[:"x-goog-request-params"] ||= request_params_header
389
470
 
@@ -444,6 +525,28 @@ module Google
444
525
  #
445
526
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
446
527
  #
528
+ # @example Basic example
529
+ # require "google/longrunning"
530
+ #
531
+ # # Create a client object. The client can be reused for multiple calls.
532
+ # client = Google::Longrunning::Operations::Client.new
533
+ #
534
+ # # Create a request. To set request fields, pass in keyword arguments.
535
+ # request = Google::Longrunning::WaitOperationRequest.new
536
+ #
537
+ # # Call the wait_operation method.
538
+ # result = client.wait_operation request
539
+ #
540
+ # # The returned object is of type Gapic::Operation. You can use this
541
+ # # object to check the status of an operation, cancel it, or wait
542
+ # # for results. Here is how to block until completion:
543
+ # result.wait_until_done! timeout: 60
544
+ # if result.response?
545
+ # p result.response
546
+ # else
547
+ # puts "Error!"
548
+ # end
549
+ #
447
550
  def wait_operation request, options = nil
448
551
  raise ::ArgumentError, "request must be provided" if request.nil?
449
552
 
@@ -20,6 +20,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
20
20
  optional :parent, :string, 1
21
21
  optional :page_size, :int32, 2
22
22
  optional :page_token, :string, 3
23
+ optional :filter, :string, 4
23
24
  end
24
25
  add_message "google.cloud.dialogflow.v2.ListKnowledgeBasesResponse" do
25
26
  repeated :knowledge_bases, :message, 1, "google.cloud.dialogflow.v2.KnowledgeBase"