google-cloud-dialogflow-v2 0.11.4 → 0.11.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dialogflow/v2/agents/client.rb +214 -27
  3. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +115 -12
  4. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +46 -6
  5. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +126 -18
  6. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +2 -0
  7. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +106 -15
  8. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +19 -0
  9. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +112 -15
  10. data/lib/google/cloud/dialogflow/v2/documents/client.rb +154 -18
  11. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +115 -12
  12. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +241 -30
  13. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +115 -12
  14. data/lib/google/cloud/dialogflow/v2/environments/client.rb +132 -18
  15. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +40 -6
  16. data/lib/google/cloud/dialogflow/v2/intents/client.rb +160 -21
  17. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +115 -12
  18. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +106 -15
  19. data/lib/google/cloud/dialogflow/v2/participants/client.rb +146 -21
  20. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +106 -15
  21. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +44 -3
  22. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  23. data/lib/google/cloud/dialogflow/v2/versions/client.rb +106 -15
  24. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +25 -8
  25. metadata +2 -2
@@ -197,6 +197,27 @@ module Google
197
197
  #
198
198
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
199
199
  #
200
+ # @example Basic example
201
+ # require "google/cloud/dialogflow/v2"
202
+ #
203
+ # # Create a client object. The client can be reused for multiple calls.
204
+ # client = Google::Cloud::Dialogflow::V2::Documents::Client.new
205
+ #
206
+ # # Create a request. To set request fields, pass in keyword arguments.
207
+ # request = Google::Cloud::Dialogflow::V2::ListDocumentsRequest.new
208
+ #
209
+ # # Call the list_documents method.
210
+ # result = client.list_documents request
211
+ #
212
+ # # The returned object is of type Gapic::PagedEnumerable. You can
213
+ # # iterate over all elements by calling #each, and the enumerable
214
+ # # will lazily make API calls to fetch subsequent pages. Other
215
+ # # methods are also available for managing paging directly.
216
+ # result.each do |response|
217
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Document.
218
+ # p response
219
+ # end
220
+ #
200
221
  def list_documents request, options = nil
201
222
  raise ::ArgumentError, "request must be provided" if request.nil?
202
223
 
@@ -214,9 +235,11 @@ module Google
214
235
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
215
236
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
216
237
 
217
- header_params = {
218
- "parent" => request.parent
219
- }
238
+ header_params = {}
239
+ if request.parent
240
+ header_params["parent"] = request.parent
241
+ end
242
+
220
243
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
221
244
  metadata[:"x-goog-request-params"] ||= request_params_header
222
245
 
@@ -268,6 +291,21 @@ module Google
268
291
  #
269
292
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
270
293
  #
294
+ # @example Basic example
295
+ # require "google/cloud/dialogflow/v2"
296
+ #
297
+ # # Create a client object. The client can be reused for multiple calls.
298
+ # client = Google::Cloud::Dialogflow::V2::Documents::Client.new
299
+ #
300
+ # # Create a request. To set request fields, pass in keyword arguments.
301
+ # request = Google::Cloud::Dialogflow::V2::GetDocumentRequest.new
302
+ #
303
+ # # Call the get_document method.
304
+ # result = client.get_document request
305
+ #
306
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Document.
307
+ # p result
308
+ #
271
309
  def get_document request, options = nil
272
310
  raise ::ArgumentError, "request must be provided" if request.nil?
273
311
 
@@ -285,9 +323,11 @@ module Google
285
323
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
286
324
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
287
325
 
288
- header_params = {
289
- "name" => request.name
290
- }
326
+ header_params = {}
327
+ if request.name
328
+ header_params["name"] = request.name
329
+ end
330
+
291
331
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
292
332
  metadata[:"x-goog-request-params"] ||= request_params_header
293
333
 
@@ -347,6 +387,28 @@ module Google
347
387
  #
348
388
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
349
389
  #
390
+ # @example Basic example
391
+ # require "google/cloud/dialogflow/v2"
392
+ #
393
+ # # Create a client object. The client can be reused for multiple calls.
394
+ # client = Google::Cloud::Dialogflow::V2::Documents::Client.new
395
+ #
396
+ # # Create a request. To set request fields, pass in keyword arguments.
397
+ # request = Google::Cloud::Dialogflow::V2::CreateDocumentRequest.new
398
+ #
399
+ # # Call the create_document method.
400
+ # result = client.create_document request
401
+ #
402
+ # # The returned object is of type Gapic::Operation. You can use this
403
+ # # object to check the status of an operation, cancel it, or wait
404
+ # # for results. Here is how to block until completion:
405
+ # result.wait_until_done! timeout: 60
406
+ # if result.response?
407
+ # p result.response
408
+ # else
409
+ # puts "Error!"
410
+ # end
411
+ #
350
412
  def create_document request, options = nil
351
413
  raise ::ArgumentError, "request must be provided" if request.nil?
352
414
 
@@ -364,9 +426,11 @@ module Google
364
426
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
365
427
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
366
428
 
367
- header_params = {
368
- "parent" => request.parent
369
- }
429
+ header_params = {}
430
+ if request.parent
431
+ header_params["parent"] = request.parent
432
+ end
433
+
370
434
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
371
435
  metadata[:"x-goog-request-params"] ||= request_params_header
372
436
 
@@ -426,6 +490,28 @@ module Google
426
490
  #
427
491
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
428
492
  #
493
+ # @example Basic example
494
+ # require "google/cloud/dialogflow/v2"
495
+ #
496
+ # # Create a client object. The client can be reused for multiple calls.
497
+ # client = Google::Cloud::Dialogflow::V2::Documents::Client.new
498
+ #
499
+ # # Create a request. To set request fields, pass in keyword arguments.
500
+ # request = Google::Cloud::Dialogflow::V2::DeleteDocumentRequest.new
501
+ #
502
+ # # Call the delete_document method.
503
+ # result = client.delete_document request
504
+ #
505
+ # # The returned object is of type Gapic::Operation. You can use this
506
+ # # object to check the status of an operation, cancel it, or wait
507
+ # # for results. Here is how to block until completion:
508
+ # result.wait_until_done! timeout: 60
509
+ # if result.response?
510
+ # p result.response
511
+ # else
512
+ # puts "Error!"
513
+ # end
514
+ #
429
515
  def delete_document request, options = nil
430
516
  raise ::ArgumentError, "request must be provided" if request.nil?
431
517
 
@@ -443,9 +529,11 @@ module Google
443
529
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
444
530
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
445
531
 
446
- header_params = {
447
- "name" => request.name
448
- }
532
+ header_params = {}
533
+ if request.name
534
+ header_params["name"] = request.name
535
+ end
536
+
449
537
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
450
538
  metadata[:"x-goog-request-params"] ||= request_params_header
451
539
 
@@ -506,6 +594,28 @@ module Google
506
594
  #
507
595
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
508
596
  #
597
+ # @example Basic example
598
+ # require "google/cloud/dialogflow/v2"
599
+ #
600
+ # # Create a client object. The client can be reused for multiple calls.
601
+ # client = Google::Cloud::Dialogflow::V2::Documents::Client.new
602
+ #
603
+ # # Create a request. To set request fields, pass in keyword arguments.
604
+ # request = Google::Cloud::Dialogflow::V2::UpdateDocumentRequest.new
605
+ #
606
+ # # Call the update_document method.
607
+ # result = client.update_document request
608
+ #
609
+ # # The returned object is of type Gapic::Operation. You can use this
610
+ # # object to check the status of an operation, cancel it, or wait
611
+ # # for results. Here is how to block until completion:
612
+ # result.wait_until_done! timeout: 60
613
+ # if result.response?
614
+ # p result.response
615
+ # else
616
+ # puts "Error!"
617
+ # end
618
+ #
509
619
  def update_document request, options = nil
510
620
  raise ::ArgumentError, "request must be provided" if request.nil?
511
621
 
@@ -523,9 +633,11 @@ module Google
523
633
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
524
634
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
525
635
 
526
- header_params = {
527
- "document.name" => request.document.name
528
- }
636
+ header_params = {}
637
+ if request.document&.name
638
+ header_params["document.name"] = request.document.name
639
+ end
640
+
529
641
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
530
642
  metadata[:"x-goog-request-params"] ||= request_params_header
531
643
 
@@ -596,6 +708,28 @@ module Google
596
708
  #
597
709
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
598
710
  #
711
+ # @example Basic example
712
+ # require "google/cloud/dialogflow/v2"
713
+ #
714
+ # # Create a client object. The client can be reused for multiple calls.
715
+ # client = Google::Cloud::Dialogflow::V2::Documents::Client.new
716
+ #
717
+ # # Create a request. To set request fields, pass in keyword arguments.
718
+ # request = Google::Cloud::Dialogflow::V2::ReloadDocumentRequest.new
719
+ #
720
+ # # Call the reload_document method.
721
+ # result = client.reload_document request
722
+ #
723
+ # # The returned object is of type Gapic::Operation. You can use this
724
+ # # object to check the status of an operation, cancel it, or wait
725
+ # # for results. Here is how to block until completion:
726
+ # result.wait_until_done! timeout: 60
727
+ # if result.response?
728
+ # p result.response
729
+ # else
730
+ # puts "Error!"
731
+ # end
732
+ #
599
733
  def reload_document request, options = nil
600
734
  raise ::ArgumentError, "request must be provided" if request.nil?
601
735
 
@@ -613,9 +747,11 @@ module Google
613
747
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
614
748
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
615
749
 
616
- header_params = {
617
- "name" => request.name
618
- }
750
+ header_params = {}
751
+ if request.name
752
+ header_params["name"] = request.name
753
+ end
754
+
619
755
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
620
756
  metadata[:"x-goog-request-params"] ||= request_params_header
621
757
 
@@ -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