google-cloud-dialogflow-v2 0.11.4 → 0.11.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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
@@ -188,6 +188,27 @@ module Google
188
188
  #
189
189
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
190
190
  #
191
+ # @example Basic example
192
+ # require "google/cloud/dialogflow/v2"
193
+ #
194
+ # # Create a client object. The client can be reused for multiple calls.
195
+ # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new
196
+ #
197
+ # # Create a request. To set request fields, pass in keyword arguments.
198
+ # request = Google::Cloud::Dialogflow::V2::ListContextsRequest.new
199
+ #
200
+ # # Call the list_contexts method.
201
+ # result = client.list_contexts request
202
+ #
203
+ # # The returned object is of type Gapic::PagedEnumerable. You can
204
+ # # iterate over all elements by calling #each, and the enumerable
205
+ # # will lazily make API calls to fetch subsequent pages. Other
206
+ # # methods are also available for managing paging directly.
207
+ # result.each do |response|
208
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Context.
209
+ # p response
210
+ # end
211
+ #
191
212
  def list_contexts request, options = nil
192
213
  raise ::ArgumentError, "request must be provided" if request.nil?
193
214
 
@@ -205,9 +226,11 @@ module Google
205
226
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
206
227
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
207
228
 
208
- header_params = {
209
- "parent" => request.parent
210
- }
229
+ header_params = {}
230
+ if request.parent
231
+ header_params["parent"] = request.parent
232
+ end
233
+
211
234
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
212
235
  metadata[:"x-goog-request-params"] ||= request_params_header
213
236
 
@@ -262,6 +285,21 @@ module Google
262
285
  #
263
286
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
264
287
  #
288
+ # @example Basic example
289
+ # require "google/cloud/dialogflow/v2"
290
+ #
291
+ # # Create a client object. The client can be reused for multiple calls.
292
+ # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new
293
+ #
294
+ # # Create a request. To set request fields, pass in keyword arguments.
295
+ # request = Google::Cloud::Dialogflow::V2::GetContextRequest.new
296
+ #
297
+ # # Call the get_context method.
298
+ # result = client.get_context request
299
+ #
300
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Context.
301
+ # p result
302
+ #
265
303
  def get_context request, options = nil
266
304
  raise ::ArgumentError, "request must be provided" if request.nil?
267
305
 
@@ -279,9 +317,11 @@ module Google
279
317
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
280
318
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
281
319
 
282
- header_params = {
283
- "name" => request.name
284
- }
320
+ header_params = {}
321
+ if request.name
322
+ header_params["name"] = request.name
323
+ end
324
+
285
325
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
286
326
  metadata[:"x-goog-request-params"] ||= request_params_header
287
327
 
@@ -339,6 +379,21 @@ module Google
339
379
  #
340
380
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
341
381
  #
382
+ # @example Basic example
383
+ # require "google/cloud/dialogflow/v2"
384
+ #
385
+ # # Create a client object. The client can be reused for multiple calls.
386
+ # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new
387
+ #
388
+ # # Create a request. To set request fields, pass in keyword arguments.
389
+ # request = Google::Cloud::Dialogflow::V2::CreateContextRequest.new
390
+ #
391
+ # # Call the create_context method.
392
+ # result = client.create_context request
393
+ #
394
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Context.
395
+ # p result
396
+ #
342
397
  def create_context request, options = nil
343
398
  raise ::ArgumentError, "request must be provided" if request.nil?
344
399
 
@@ -356,9 +411,11 @@ module Google
356
411
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
357
412
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
358
413
 
359
- header_params = {
360
- "parent" => request.parent
361
- }
414
+ header_params = {}
415
+ if request.parent
416
+ header_params["parent"] = request.parent
417
+ end
418
+
362
419
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
363
420
  metadata[:"x-goog-request-params"] ||= request_params_header
364
421
 
@@ -409,6 +466,21 @@ module Google
409
466
  #
410
467
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
411
468
  #
469
+ # @example Basic example
470
+ # require "google/cloud/dialogflow/v2"
471
+ #
472
+ # # Create a client object. The client can be reused for multiple calls.
473
+ # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new
474
+ #
475
+ # # Create a request. To set request fields, pass in keyword arguments.
476
+ # request = Google::Cloud::Dialogflow::V2::UpdateContextRequest.new
477
+ #
478
+ # # Call the update_context method.
479
+ # result = client.update_context request
480
+ #
481
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Context.
482
+ # p result
483
+ #
412
484
  def update_context request, options = nil
413
485
  raise ::ArgumentError, "request must be provided" if request.nil?
414
486
 
@@ -426,9 +498,11 @@ module Google
426
498
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
427
499
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
500
 
429
- header_params = {
430
- "context.name" => request.context.name
431
- }
501
+ header_params = {}
502
+ if request.context&.name
503
+ header_params["context.name"] = request.context.name
504
+ end
505
+
432
506
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
433
507
  metadata[:"x-goog-request-params"] ||= request_params_header
434
508
 
@@ -482,6 +556,21 @@ module Google
482
556
  #
483
557
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
484
558
  #
559
+ # @example Basic example
560
+ # require "google/cloud/dialogflow/v2"
561
+ #
562
+ # # Create a client object. The client can be reused for multiple calls.
563
+ # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new
564
+ #
565
+ # # Create a request. To set request fields, pass in keyword arguments.
566
+ # request = Google::Cloud::Dialogflow::V2::DeleteContextRequest.new
567
+ #
568
+ # # Call the delete_context method.
569
+ # result = client.delete_context request
570
+ #
571
+ # # The returned object is of type Google::Protobuf::Empty.
572
+ # p result
573
+ #
485
574
  def delete_context request, options = nil
486
575
  raise ::ArgumentError, "request must be provided" if request.nil?
487
576
 
@@ -499,9 +588,11 @@ module Google
499
588
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
500
589
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
501
590
 
502
- header_params = {
503
- "name" => request.name
504
- }
591
+ header_params = {}
592
+ if request.name
593
+ header_params["name"] = request.name
594
+ end
595
+
505
596
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
506
597
  metadata[:"x-goog-request-params"] ||= request_params_header
507
598
 
@@ -555,6 +646,21 @@ module Google
555
646
  #
556
647
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
557
648
  #
649
+ # @example Basic example
650
+ # require "google/cloud/dialogflow/v2"
651
+ #
652
+ # # Create a client object. The client can be reused for multiple calls.
653
+ # client = Google::Cloud::Dialogflow::V2::Contexts::Client.new
654
+ #
655
+ # # Create a request. To set request fields, pass in keyword arguments.
656
+ # request = Google::Cloud::Dialogflow::V2::DeleteAllContextsRequest.new
657
+ #
658
+ # # Call the delete_all_contexts method.
659
+ # result = client.delete_all_contexts request
660
+ #
661
+ # # The returned object is of type Google::Protobuf::Empty.
662
+ # p result
663
+ #
558
664
  def delete_all_contexts request, options = nil
559
665
  raise ::ArgumentError, "request must be provided" if request.nil?
560
666
 
@@ -572,9 +678,11 @@ module Google
572
678
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
573
679
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
574
680
 
575
- header_params = {
576
- "parent" => request.parent
577
- }
681
+ header_params = {}
682
+ if request.parent
683
+ header_params["parent"] = request.parent
684
+ end
685
+
578
686
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
579
687
  metadata[:"x-goog-request-params"] ||= request_params_header
580
688
 
@@ -28,6 +28,8 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
28
28
  optional :new_message_event_notification_config, :message, 8, "google.cloud.dialogflow.v2.NotificationConfig"
29
29
  optional :stt_config, :message, 9, "google.cloud.dialogflow.v2.SpeechToTextConfig"
30
30
  optional :language_code, :string, 10
31
+ optional :time_zone, :string, 14
32
+ optional :security_settings, :string, 13
31
33
  end
32
34
  add_message "google.cloud.dialogflow.v2.ListConversationProfilesRequest" do
33
35
  optional :parent, :string, 1
@@ -184,6 +184,27 @@ module Google
184
184
  #
185
185
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
186
186
  #
187
+ # @example Basic example
188
+ # require "google/cloud/dialogflow/v2"
189
+ #
190
+ # # Create a client object. The client can be reused for multiple calls.
191
+ # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new
192
+ #
193
+ # # Create a request. To set request fields, pass in keyword arguments.
194
+ # request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new
195
+ #
196
+ # # Call the list_conversation_profiles method.
197
+ # result = client.list_conversation_profiles request
198
+ #
199
+ # # The returned object is of type Gapic::PagedEnumerable. You can
200
+ # # iterate over all elements by calling #each, and the enumerable
201
+ # # will lazily make API calls to fetch subsequent pages. Other
202
+ # # methods are also available for managing paging directly.
203
+ # result.each do |response|
204
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationProfile.
205
+ # p response
206
+ # end
207
+ #
187
208
  def list_conversation_profiles request, options = nil
188
209
  raise ::ArgumentError, "request must be provided" if request.nil?
189
210
 
@@ -201,9 +222,11 @@ module Google
201
222
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
202
223
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
203
224
 
204
- header_params = {
205
- "parent" => request.parent
206
- }
225
+ header_params = {}
226
+ if request.parent
227
+ header_params["parent"] = request.parent
228
+ end
229
+
207
230
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
208
231
  metadata[:"x-goog-request-params"] ||= request_params_header
209
232
 
@@ -255,6 +278,21 @@ module Google
255
278
  #
256
279
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
257
280
  #
281
+ # @example Basic example
282
+ # require "google/cloud/dialogflow/v2"
283
+ #
284
+ # # Create a client object. The client can be reused for multiple calls.
285
+ # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new
286
+ #
287
+ # # Create a request. To set request fields, pass in keyword arguments.
288
+ # request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new
289
+ #
290
+ # # Call the get_conversation_profile method.
291
+ # result = client.get_conversation_profile request
292
+ #
293
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile.
294
+ # p result
295
+ #
258
296
  def get_conversation_profile request, options = nil
259
297
  raise ::ArgumentError, "request must be provided" if request.nil?
260
298
 
@@ -272,9 +310,11 @@ module Google
272
310
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
273
311
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
274
312
 
275
- header_params = {
276
- "name" => request.name
277
- }
313
+ header_params = {}
314
+ if request.name
315
+ header_params["name"] = request.name
316
+ end
317
+
278
318
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
279
319
  metadata[:"x-goog-request-params"] ||= request_params_header
280
320
 
@@ -330,6 +370,21 @@ module Google
330
370
  #
331
371
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
332
372
  #
373
+ # @example Basic example
374
+ # require "google/cloud/dialogflow/v2"
375
+ #
376
+ # # Create a client object. The client can be reused for multiple calls.
377
+ # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new
378
+ #
379
+ # # Create a request. To set request fields, pass in keyword arguments.
380
+ # request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new
381
+ #
382
+ # # Call the create_conversation_profile method.
383
+ # result = client.create_conversation_profile request
384
+ #
385
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile.
386
+ # p result
387
+ #
333
388
  def create_conversation_profile request, options = nil
334
389
  raise ::ArgumentError, "request must be provided" if request.nil?
335
390
 
@@ -347,9 +402,11 @@ module Google
347
402
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
348
403
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
349
404
 
350
- header_params = {
351
- "parent" => request.parent
352
- }
405
+ header_params = {}
406
+ if request.parent
407
+ header_params["parent"] = request.parent
408
+ end
409
+
353
410
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
354
411
  metadata[:"x-goog-request-params"] ||= request_params_header
355
412
 
@@ -404,6 +461,21 @@ module Google
404
461
  #
405
462
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
406
463
  #
464
+ # @example Basic example
465
+ # require "google/cloud/dialogflow/v2"
466
+ #
467
+ # # Create a client object. The client can be reused for multiple calls.
468
+ # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new
469
+ #
470
+ # # Create a request. To set request fields, pass in keyword arguments.
471
+ # request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new
472
+ #
473
+ # # Call the update_conversation_profile method.
474
+ # result = client.update_conversation_profile request
475
+ #
476
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile.
477
+ # p result
478
+ #
407
479
  def update_conversation_profile request, options = nil
408
480
  raise ::ArgumentError, "request must be provided" if request.nil?
409
481
 
@@ -421,9 +493,11 @@ module Google
421
493
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
422
494
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
423
495
 
424
- header_params = {
425
- "conversation_profile.name" => request.conversation_profile.name
426
- }
496
+ header_params = {}
497
+ if request.conversation_profile&.name
498
+ header_params["conversation_profile.name"] = request.conversation_profile.name
499
+ end
500
+
427
501
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
428
502
  metadata[:"x-goog-request-params"] ||= request_params_header
429
503
 
@@ -474,6 +548,21 @@ module Google
474
548
  #
475
549
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
476
550
  #
551
+ # @example Basic example
552
+ # require "google/cloud/dialogflow/v2"
553
+ #
554
+ # # Create a client object. The client can be reused for multiple calls.
555
+ # client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Client.new
556
+ #
557
+ # # Create a request. To set request fields, pass in keyword arguments.
558
+ # request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new
559
+ #
560
+ # # Call the delete_conversation_profile method.
561
+ # result = client.delete_conversation_profile request
562
+ #
563
+ # # The returned object is of type Google::Protobuf::Empty.
564
+ # p result
565
+ #
477
566
  def delete_conversation_profile request, options = nil
478
567
  raise ::ArgumentError, "request must be provided" if request.nil?
479
568
 
@@ -491,9 +580,11 @@ module Google
491
580
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
492
581
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
493
582
 
494
- header_params = {
495
- "name" => request.name
496
- }
583
+ header_params = {}
584
+ if request.name
585
+ header_params["name"] = request.name
586
+ end
587
+
497
588
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
498
589
  metadata[:"x-goog-request-params"] ||= request_params_header
499
590
 
@@ -60,6 +60,25 @@ module Google
60
60
  resource.call(**args)
61
61
  end
62
62
 
63
+ ##
64
+ # Create a fully-qualified CXSecuritySettings resource string.
65
+ #
66
+ # The resource will be in the following format:
67
+ #
68
+ # `projects/{project}/locations/{location}/securitySettings/{security_settings}`
69
+ #
70
+ # @param project [String]
71
+ # @param location [String]
72
+ # @param security_settings [String]
73
+ #
74
+ # @return [::String]
75
+ def cx_security_settings_path project:, location:, security_settings:
76
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
77
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
78
+
79
+ "projects/#{project}/locations/#{location}/securitySettings/#{security_settings}"
80
+ end
81
+
63
82
  ##
64
83
  # Create a fully-qualified ConversationModel resource string.
65
84
  #
@@ -209,6 +209,21 @@ module Google
209
209
  #
210
210
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
211
211
  #
212
+ # @example Basic example
213
+ # require "google/cloud/dialogflow/v2"
214
+ #
215
+ # # Create a client object. The client can be reused for multiple calls.
216
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new
217
+ #
218
+ # # Create a request. To set request fields, pass in keyword arguments.
219
+ # request = Google::Cloud::Dialogflow::V2::CreateConversationRequest.new
220
+ #
221
+ # # Call the create_conversation method.
222
+ # result = client.create_conversation request
223
+ #
224
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation.
225
+ # p result
226
+ #
212
227
  def create_conversation request, options = nil
213
228
  raise ::ArgumentError, "request must be provided" if request.nil?
214
229
 
@@ -226,9 +241,11 @@ module Google
226
241
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
227
242
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
228
243
 
229
- header_params = {
230
- "parent" => request.parent
231
- }
244
+ header_params = {}
245
+ if request.parent
246
+ header_params["parent"] = request.parent
247
+ end
248
+
232
249
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
233
250
  metadata[:"x-goog-request-params"] ||= request_params_header
234
251
 
@@ -301,6 +318,27 @@ module Google
301
318
  #
302
319
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
303
320
  #
321
+ # @example Basic example
322
+ # require "google/cloud/dialogflow/v2"
323
+ #
324
+ # # Create a client object. The client can be reused for multiple calls.
325
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new
326
+ #
327
+ # # Create a request. To set request fields, pass in keyword arguments.
328
+ # request = Google::Cloud::Dialogflow::V2::ListConversationsRequest.new
329
+ #
330
+ # # Call the list_conversations method.
331
+ # result = client.list_conversations request
332
+ #
333
+ # # The returned object is of type Gapic::PagedEnumerable. You can
334
+ # # iterate over all elements by calling #each, and the enumerable
335
+ # # will lazily make API calls to fetch subsequent pages. Other
336
+ # # methods are also available for managing paging directly.
337
+ # result.each do |response|
338
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Conversation.
339
+ # p response
340
+ # end
341
+ #
304
342
  def list_conversations request, options = nil
305
343
  raise ::ArgumentError, "request must be provided" if request.nil?
306
344
 
@@ -318,9 +356,11 @@ module Google
318
356
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
319
357
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
320
358
 
321
- header_params = {
322
- "parent" => request.parent
323
- }
359
+ header_params = {}
360
+ if request.parent
361
+ header_params["parent"] = request.parent
362
+ end
363
+
324
364
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
325
365
  metadata[:"x-goog-request-params"] ||= request_params_header
326
366
 
@@ -372,6 +412,21 @@ module Google
372
412
  #
373
413
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
374
414
  #
415
+ # @example Basic example
416
+ # require "google/cloud/dialogflow/v2"
417
+ #
418
+ # # Create a client object. The client can be reused for multiple calls.
419
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new
420
+ #
421
+ # # Create a request. To set request fields, pass in keyword arguments.
422
+ # request = Google::Cloud::Dialogflow::V2::GetConversationRequest.new
423
+ #
424
+ # # Call the get_conversation method.
425
+ # result = client.get_conversation request
426
+ #
427
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation.
428
+ # p result
429
+ #
375
430
  def get_conversation request, options = nil
376
431
  raise ::ArgumentError, "request must be provided" if request.nil?
377
432
 
@@ -389,9 +444,11 @@ module Google
389
444
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
390
445
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
391
446
 
392
- header_params = {
393
- "name" => request.name
394
- }
447
+ header_params = {}
448
+ if request.name
449
+ header_params["name"] = request.name
450
+ end
451
+
395
452
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
396
453
  metadata[:"x-goog-request-params"] ||= request_params_header
397
454
 
@@ -443,6 +500,21 @@ module Google
443
500
  #
444
501
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
445
502
  #
503
+ # @example Basic example
504
+ # require "google/cloud/dialogflow/v2"
505
+ #
506
+ # # Create a client object. The client can be reused for multiple calls.
507
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new
508
+ #
509
+ # # Create a request. To set request fields, pass in keyword arguments.
510
+ # request = Google::Cloud::Dialogflow::V2::CompleteConversationRequest.new
511
+ #
512
+ # # Call the complete_conversation method.
513
+ # result = client.complete_conversation request
514
+ #
515
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::Conversation.
516
+ # p result
517
+ #
446
518
  def complete_conversation request, options = nil
447
519
  raise ::ArgumentError, "request must be provided" if request.nil?
448
520
 
@@ -460,9 +532,11 @@ module Google
460
532
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
461
533
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
462
534
 
463
- header_params = {
464
- "name" => request.name
465
- }
535
+ header_params = {}
536
+ if request.name
537
+ header_params["name"] = request.name
538
+ end
539
+
466
540
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
467
541
  metadata[:"x-goog-request-params"] ||= request_params_header
468
542
 
@@ -531,6 +605,27 @@ module Google
531
605
  #
532
606
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
533
607
  #
608
+ # @example Basic example
609
+ # require "google/cloud/dialogflow/v2"
610
+ #
611
+ # # Create a client object. The client can be reused for multiple calls.
612
+ # client = Google::Cloud::Dialogflow::V2::Conversations::Client.new
613
+ #
614
+ # # Create a request. To set request fields, pass in keyword arguments.
615
+ # request = Google::Cloud::Dialogflow::V2::ListMessagesRequest.new
616
+ #
617
+ # # Call the list_messages method.
618
+ # result = client.list_messages request
619
+ #
620
+ # # The returned object is of type Gapic::PagedEnumerable. You can
621
+ # # iterate over all elements by calling #each, and the enumerable
622
+ # # will lazily make API calls to fetch subsequent pages. Other
623
+ # # methods are also available for managing paging directly.
624
+ # result.each do |response|
625
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::Message.
626
+ # p response
627
+ # end
628
+ #
534
629
  def list_messages request, options = nil
535
630
  raise ::ArgumentError, "request must be provided" if request.nil?
536
631
 
@@ -548,9 +643,11 @@ module Google
548
643
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
549
644
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
550
645
 
551
- header_params = {
552
- "parent" => request.parent
553
- }
646
+ header_params = {}
647
+ if request.parent
648
+ header_params["parent"] = request.parent
649
+ end
650
+
554
651
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
555
652
  metadata[:"x-goog-request-params"] ||= request_params_header
556
653