google-cloud-dialogflow-cx-v3 0.2.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/AUTHENTICATION.md +7 -25
  4. data/lib/google/cloud/dialogflow/cx/v3/agents/client.rb +201 -27
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/operations.rb +115 -12
  6. data/lib/google/cloud/dialogflow/cx/v3/changelog_pb.rb +52 -0
  7. data/lib/google/cloud/dialogflow/cx/v3/changelog_services_pb.rb +49 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/changelogs/client.rb +522 -0
  9. data/lib/google/cloud/dialogflow/cx/v3/changelogs/credentials.rb +54 -0
  10. data/lib/google/cloud/dialogflow/cx/v3/changelogs/paths.rb +75 -0
  11. data/lib/google/cloud/dialogflow/cx/v3/changelogs.rb +51 -0
  12. data/lib/google/cloud/dialogflow/cx/v3/deployments/client.rb +46 -6
  13. data/lib/google/cloud/dialogflow/cx/v3/entity_types/client.rb +106 -15
  14. data/lib/google/cloud/dialogflow/cx/v3/environment_pb.rb +1 -0
  15. data/lib/google/cloud/dialogflow/cx/v3/environments/client.rb +227 -27
  16. data/lib/google/cloud/dialogflow/cx/v3/environments/operations.rb +115 -12
  17. data/lib/google/cloud/dialogflow/cx/v3/experiments/client.rb +146 -21
  18. data/lib/google/cloud/dialogflow/cx/v3/flows/client.rb +228 -30
  19. data/lib/google/cloud/dialogflow/cx/v3/flows/operations.rb +115 -12
  20. data/lib/google/cloud/dialogflow/cx/v3/intents/client.rb +106 -15
  21. data/lib/google/cloud/dialogflow/cx/v3/pages/client.rb +106 -15
  22. data/lib/google/cloud/dialogflow/cx/v3/response_message_pb.rb +7 -0
  23. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/client.rb +106 -15
  24. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/client.rb +106 -15
  25. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +84 -9
  26. data/lib/google/cloud/dialogflow/cx/v3/test_cases/client.rb +281 -36
  27. data/lib/google/cloud/dialogflow/cx/v3/test_cases/operations.rb +115 -12
  28. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/client.rb +106 -15
  29. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  30. data/lib/google/cloud/dialogflow/cx/v3/version_pb.rb +12 -0
  31. data/lib/google/cloud/dialogflow/cx/v3/version_services_pb.rb +2 -0
  32. data/lib/google/cloud/dialogflow/cx/v3/versions/client.rb +250 -18
  33. data/lib/google/cloud/dialogflow/cx/v3/versions/operations.rb +115 -12
  34. data/lib/google/cloud/dialogflow/cx/v3/webhook_pb.rb +2 -0
  35. data/lib/google/cloud/dialogflow/cx/v3/webhooks/client.rb +106 -15
  36. data/lib/google/cloud/dialogflow/cx/v3.rb +2 -1
  37. data/proto_docs/google/api/resource.rb +10 -71
  38. data/proto_docs/google/cloud/dialogflow/cx/v3/changelog.rb +122 -0
  39. data/proto_docs/google/cloud/dialogflow/cx/v3/response_message.rb +15 -0
  40. data/proto_docs/google/cloud/dialogflow/cx/v3/security_settings.rb +11 -1
  41. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +54 -42
  42. data/proto_docs/google/cloud/dialogflow/cx/v3/version.rb +43 -0
  43. data/proto_docs/google/cloud/dialogflow/cx/v3/webhook.rb +17 -0
  44. metadata +10 -3
@@ -200,6 +200,27 @@ module Google
200
200
  #
201
201
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
202
202
  #
203
+ # @example Basic example
204
+ # require "google/cloud/dialogflow/cx/v3"
205
+ #
206
+ # # Create a client object. The client can be reused for multiple calls.
207
+ # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new
208
+ #
209
+ # # Create a request. To set request fields, pass in keyword arguments.
210
+ # request = Google::Cloud::Dialogflow::CX::V3::ListTransitionRouteGroupsRequest.new
211
+ #
212
+ # # Call the list_transition_route_groups method.
213
+ # result = client.list_transition_route_groups request
214
+ #
215
+ # # The returned object is of type Gapic::PagedEnumerable. You can
216
+ # # iterate over all elements by calling #each, and the enumerable
217
+ # # will lazily make API calls to fetch subsequent pages. Other
218
+ # # methods are also available for managing paging directly.
219
+ # result.each do |response|
220
+ # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.
221
+ # p response
222
+ # end
223
+ #
203
224
  def list_transition_route_groups request, options = nil
204
225
  raise ::ArgumentError, "request must be provided" if request.nil?
205
226
 
@@ -217,9 +238,11 @@ module Google
217
238
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
218
239
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
219
240
 
220
- header_params = {
221
- "parent" => request.parent
222
- }
241
+ header_params = {}
242
+ if request.parent
243
+ header_params["parent"] = request.parent
244
+ end
245
+
223
246
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
224
247
  metadata[:"x-goog-request-params"] ||= request_params_header
225
248
 
@@ -284,6 +307,21 @@ module Google
284
307
  #
285
308
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
286
309
  #
310
+ # @example Basic example
311
+ # require "google/cloud/dialogflow/cx/v3"
312
+ #
313
+ # # Create a client object. The client can be reused for multiple calls.
314
+ # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new
315
+ #
316
+ # # Create a request. To set request fields, pass in keyword arguments.
317
+ # request = Google::Cloud::Dialogflow::CX::V3::GetTransitionRouteGroupRequest.new
318
+ #
319
+ # # Call the get_transition_route_group method.
320
+ # result = client.get_transition_route_group request
321
+ #
322
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.
323
+ # p result
324
+ #
287
325
  def get_transition_route_group request, options = nil
288
326
  raise ::ArgumentError, "request must be provided" if request.nil?
289
327
 
@@ -301,9 +339,11 @@ module Google
301
339
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
302
340
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
303
341
 
304
- header_params = {
305
- "name" => request.name
306
- }
342
+ header_params = {}
343
+ if request.name
344
+ header_params["name"] = request.name
345
+ end
346
+
307
347
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
308
348
  metadata[:"x-goog-request-params"] ||= request_params_header
309
349
 
@@ -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/cx/v3"
417
+ #
418
+ # # Create a client object. The client can be reused for multiple calls.
419
+ # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new
420
+ #
421
+ # # Create a request. To set request fields, pass in keyword arguments.
422
+ # request = Google::Cloud::Dialogflow::CX::V3::CreateTransitionRouteGroupRequest.new
423
+ #
424
+ # # Call the create_transition_route_group method.
425
+ # result = client.create_transition_route_group request
426
+ #
427
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.
428
+ # p result
429
+ #
375
430
  def create_transition_route_group 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::CX::V3::VERSION
390
445
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
391
446
 
392
- header_params = {
393
- "parent" => request.parent
394
- }
447
+ header_params = {}
448
+ if request.parent
449
+ header_params["parent"] = request.parent
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
 
@@ -458,6 +515,21 @@ module Google
458
515
  #
459
516
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
460
517
  #
518
+ # @example Basic example
519
+ # require "google/cloud/dialogflow/cx/v3"
520
+ #
521
+ # # Create a client object. The client can be reused for multiple calls.
522
+ # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new
523
+ #
524
+ # # Create a request. To set request fields, pass in keyword arguments.
525
+ # request = Google::Cloud::Dialogflow::CX::V3::UpdateTransitionRouteGroupRequest.new
526
+ #
527
+ # # Call the update_transition_route_group method.
528
+ # result = client.update_transition_route_group request
529
+ #
530
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroup.
531
+ # p result
532
+ #
461
533
  def update_transition_route_group request, options = nil
462
534
  raise ::ArgumentError, "request must be provided" if request.nil?
463
535
 
@@ -475,9 +547,11 @@ module Google
475
547
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
476
548
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
477
549
 
478
- header_params = {
479
- "transition_route_group.name" => request.transition_route_group.name
480
- }
550
+ header_params = {}
551
+ if request.transition_route_group&.name
552
+ header_params["transition_route_group.name"] = request.transition_route_group.name
553
+ end
554
+
481
555
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
482
556
  metadata[:"x-goog-request-params"] ||= request_params_header
483
557
 
@@ -540,6 +614,21 @@ module Google
540
614
  #
541
615
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
542
616
  #
617
+ # @example Basic example
618
+ # require "google/cloud/dialogflow/cx/v3"
619
+ #
620
+ # # Create a client object. The client can be reused for multiple calls.
621
+ # client = Google::Cloud::Dialogflow::CX::V3::TransitionRouteGroups::Client.new
622
+ #
623
+ # # Create a request. To set request fields, pass in keyword arguments.
624
+ # request = Google::Cloud::Dialogflow::CX::V3::DeleteTransitionRouteGroupRequest.new
625
+ #
626
+ # # Call the delete_transition_route_group method.
627
+ # result = client.delete_transition_route_group request
628
+ #
629
+ # # The returned object is of type Google::Protobuf::Empty.
630
+ # p result
631
+ #
543
632
  def delete_transition_route_group request, options = nil
544
633
  raise ::ArgumentError, "request must be provided" if request.nil?
545
634
 
@@ -557,9 +646,11 @@ module Google
557
646
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
558
647
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
559
648
 
560
- header_params = {
561
- "name" => request.name
562
- }
649
+ header_params = {}
650
+ if request.name
651
+ header_params["name"] = request.name
652
+ end
653
+
563
654
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
564
655
  metadata[:"x-goog-request-params"] ||= request_params_header
565
656
 
@@ -22,7 +22,7 @@ module Google
22
22
  module Dialogflow
23
23
  module CX
24
24
  module V3
25
- VERSION = "0.2.0"
25
+ VERSION = "0.5.0"
26
26
  end
27
27
  end
28
28
  end
@@ -63,6 +63,16 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
63
63
  optional :name, :string, 1
64
64
  optional :allow_override_agent_resources, :bool, 2
65
65
  end
66
+ add_message "google.cloud.dialogflow.cx.v3.CompareVersionsRequest" do
67
+ optional :base_version, :string, 1
68
+ optional :target_version, :string, 2
69
+ optional :language_code, :string, 3
70
+ end
71
+ add_message "google.cloud.dialogflow.cx.v3.CompareVersionsResponse" do
72
+ optional :base_version_content_json, :string, 1
73
+ optional :target_version_content_json, :string, 2
74
+ optional :compare_time, :message, 3, "google.protobuf.Timestamp"
75
+ end
66
76
  end
67
77
  end
68
78
 
@@ -81,6 +91,8 @@ module Google
81
91
  UpdateVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.UpdateVersionRequest").msgclass
82
92
  DeleteVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.DeleteVersionRequest").msgclass
83
93
  LoadVersionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.LoadVersionRequest").msgclass
94
+ CompareVersionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CompareVersionsRequest").msgclass
95
+ CompareVersionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.dialogflow.cx.v3.CompareVersionsResponse").msgclass
84
96
  end
85
97
  end
86
98
  end
@@ -62,6 +62,8 @@ module Google
62
62
  # - `response`: An [Empty
63
63
  # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
64
64
  rpc :LoadVersion, ::Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest, ::Google::Longrunning::Operation
65
+ # Compares the specified base version with target version.
66
+ rpc :CompareVersions, ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse
65
67
  end
66
68
 
67
69
  Stub = Service.rpc_stub_class
@@ -141,6 +141,7 @@ module Google
141
141
 
142
142
  @operations_client = Operations.new do |config|
143
143
  config.credentials = credentials
144
+ config.quota_project = @quota_project_id
144
145
  config.endpoint = @config.endpoint
145
146
  end
146
147
 
@@ -198,6 +199,27 @@ module Google
198
199
  #
199
200
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
200
201
  #
202
+ # @example Basic example
203
+ # require "google/cloud/dialogflow/cx/v3"
204
+ #
205
+ # # Create a client object. The client can be reused for multiple calls.
206
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
207
+ #
208
+ # # Create a request. To set request fields, pass in keyword arguments.
209
+ # request = Google::Cloud::Dialogflow::CX::V3::ListVersionsRequest.new
210
+ #
211
+ # # Call the list_versions method.
212
+ # result = client.list_versions request
213
+ #
214
+ # # The returned object is of type Gapic::PagedEnumerable. You can
215
+ # # iterate over all elements by calling #each, and the enumerable
216
+ # # will lazily make API calls to fetch subsequent pages. Other
217
+ # # methods are also available for managing paging directly.
218
+ # result.each do |response|
219
+ # # Each element is of type ::Google::Cloud::Dialogflow::CX::V3::Version.
220
+ # p response
221
+ # end
222
+ #
201
223
  def list_versions request, options = nil
202
224
  raise ::ArgumentError, "request must be provided" if request.nil?
203
225
 
@@ -215,9 +237,11 @@ module Google
215
237
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
216
238
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
217
239
 
218
- header_params = {
219
- "parent" => request.parent
220
- }
240
+ header_params = {}
241
+ if request.parent
242
+ header_params["parent"] = request.parent
243
+ end
244
+
221
245
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
222
246
  metadata[:"x-goog-request-params"] ||= request_params_header
223
247
 
@@ -269,6 +293,21 @@ module Google
269
293
  #
270
294
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
271
295
  #
296
+ # @example Basic example
297
+ # require "google/cloud/dialogflow/cx/v3"
298
+ #
299
+ # # Create a client object. The client can be reused for multiple calls.
300
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
301
+ #
302
+ # # Create a request. To set request fields, pass in keyword arguments.
303
+ # request = Google::Cloud::Dialogflow::CX::V3::GetVersionRequest.new
304
+ #
305
+ # # Call the get_version method.
306
+ # result = client.get_version request
307
+ #
308
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version.
309
+ # p result
310
+ #
272
311
  def get_version request, options = nil
273
312
  raise ::ArgumentError, "request must be provided" if request.nil?
274
313
 
@@ -286,9 +325,11 @@ module Google
286
325
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
287
326
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
327
 
289
- header_params = {
290
- "name" => request.name
291
- }
328
+ header_params = {}
329
+ if request.name
330
+ header_params["name"] = request.name
331
+ end
332
+
292
333
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
293
334
  metadata[:"x-goog-request-params"] ||= request_params_header
294
335
 
@@ -348,6 +389,28 @@ module Google
348
389
  #
349
390
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
350
391
  #
392
+ # @example Basic example
393
+ # require "google/cloud/dialogflow/cx/v3"
394
+ #
395
+ # # Create a client object. The client can be reused for multiple calls.
396
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
397
+ #
398
+ # # Create a request. To set request fields, pass in keyword arguments.
399
+ # request = Google::Cloud::Dialogflow::CX::V3::CreateVersionRequest.new
400
+ #
401
+ # # Call the create_version method.
402
+ # result = client.create_version request
403
+ #
404
+ # # The returned object is of type Gapic::Operation. You can use this
405
+ # # object to check the status of an operation, cancel it, or wait
406
+ # # for results. Here is how to block until completion:
407
+ # result.wait_until_done! timeout: 60
408
+ # if result.response?
409
+ # p result.response
410
+ # else
411
+ # puts "Error!"
412
+ # end
413
+ #
351
414
  def create_version request, options = nil
352
415
  raise ::ArgumentError, "request must be provided" if request.nil?
353
416
 
@@ -365,9 +428,11 @@ module Google
365
428
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
366
429
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
367
430
 
368
- header_params = {
369
- "parent" => request.parent
370
- }
431
+ header_params = {}
432
+ if request.parent
433
+ header_params["parent"] = request.parent
434
+ end
435
+
371
436
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
372
437
  metadata[:"x-goog-request-params"] ||= request_params_header
373
438
 
@@ -420,6 +485,21 @@ module Google
420
485
  #
421
486
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
422
487
  #
488
+ # @example Basic example
489
+ # require "google/cloud/dialogflow/cx/v3"
490
+ #
491
+ # # Create a client object. The client can be reused for multiple calls.
492
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
493
+ #
494
+ # # Create a request. To set request fields, pass in keyword arguments.
495
+ # request = Google::Cloud::Dialogflow::CX::V3::UpdateVersionRequest.new
496
+ #
497
+ # # Call the update_version method.
498
+ # result = client.update_version request
499
+ #
500
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::Version.
501
+ # p result
502
+ #
423
503
  def update_version request, options = nil
424
504
  raise ::ArgumentError, "request must be provided" if request.nil?
425
505
 
@@ -437,9 +517,11 @@ module Google
437
517
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
438
518
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
439
519
 
440
- header_params = {
441
- "version.name" => request.version.name
442
- }
520
+ header_params = {}
521
+ if request.version&.name
522
+ header_params["version.name"] = request.version.name
523
+ end
524
+
443
525
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
444
526
  metadata[:"x-goog-request-params"] ||= request_params_header
445
527
 
@@ -490,6 +572,21 @@ module Google
490
572
  #
491
573
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
492
574
  #
575
+ # @example Basic example
576
+ # require "google/cloud/dialogflow/cx/v3"
577
+ #
578
+ # # Create a client object. The client can be reused for multiple calls.
579
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
580
+ #
581
+ # # Create a request. To set request fields, pass in keyword arguments.
582
+ # request = Google::Cloud::Dialogflow::CX::V3::DeleteVersionRequest.new
583
+ #
584
+ # # Call the delete_version method.
585
+ # result = client.delete_version request
586
+ #
587
+ # # The returned object is of type Google::Protobuf::Empty.
588
+ # p result
589
+ #
493
590
  def delete_version request, options = nil
494
591
  raise ::ArgumentError, "request must be provided" if request.nil?
495
592
 
@@ -507,9 +604,11 @@ module Google
507
604
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
508
605
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
509
606
 
510
- header_params = {
511
- "name" => request.name
512
- }
607
+ header_params = {}
608
+ if request.name
609
+ header_params["name"] = request.name
610
+ end
611
+
513
612
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
514
613
  metadata[:"x-goog-request-params"] ||= request_params_header
515
614
 
@@ -574,6 +673,28 @@ module Google
574
673
  #
575
674
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
576
675
  #
676
+ # @example Basic example
677
+ # require "google/cloud/dialogflow/cx/v3"
678
+ #
679
+ # # Create a client object. The client can be reused for multiple calls.
680
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
681
+ #
682
+ # # Create a request. To set request fields, pass in keyword arguments.
683
+ # request = Google::Cloud::Dialogflow::CX::V3::LoadVersionRequest.new
684
+ #
685
+ # # Call the load_version method.
686
+ # result = client.load_version request
687
+ #
688
+ # # The returned object is of type Gapic::Operation. You can use this
689
+ # # object to check the status of an operation, cancel it, or wait
690
+ # # for results. Here is how to block until completion:
691
+ # result.wait_until_done! timeout: 60
692
+ # if result.response?
693
+ # p result.response
694
+ # else
695
+ # puts "Error!"
696
+ # end
697
+ #
577
698
  def load_version request, options = nil
578
699
  raise ::ArgumentError, "request must be provided" if request.nil?
579
700
 
@@ -591,9 +712,11 @@ module Google
591
712
  gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
592
713
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
593
714
 
594
- header_params = {
595
- "name" => request.name
596
- }
715
+ header_params = {}
716
+ if request.name
717
+ header_params["name"] = request.name
718
+ end
719
+
597
720
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
598
721
  metadata[:"x-goog-request-params"] ||= request_params_header
599
722
 
@@ -614,6 +737,108 @@ module Google
614
737
  raise ::Google::Cloud::Error.from_error(e)
615
738
  end
616
739
 
740
+ ##
741
+ # Compares the specified base version with target version.
742
+ #
743
+ # @overload compare_versions(request, options = nil)
744
+ # Pass arguments to `compare_versions` via a request object, either of type
745
+ # {::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest} or an equivalent Hash.
746
+ #
747
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest, ::Hash]
748
+ # A request object representing the call parameters. Required. To specify no
749
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
750
+ # @param options [::Gapic::CallOptions, ::Hash]
751
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
752
+ #
753
+ # @overload compare_versions(base_version: nil, target_version: nil, language_code: nil)
754
+ # Pass arguments to `compare_versions` via keyword arguments. Note that at
755
+ # least one keyword argument is required. To specify no parameters, or to keep all
756
+ # the default parameter values, pass an empty Hash as a request object (see above).
757
+ #
758
+ # @param base_version [::String]
759
+ # Required. Name of the base flow version to compare with the target version. Use
760
+ # version ID `0` to indicate the draft version of the specified flow.
761
+ #
762
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/
763
+ # <Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
764
+ # @param target_version [::String]
765
+ # Required. Name of the target flow version to compare with the
766
+ # base version. Use version ID `0` to indicate the draft version of the
767
+ # specified flow. Format: `projects/<Project ID>/locations/<Location
768
+ # ID>/agents/<Agent ID>/flows/<Flow ID>/versions/<Version ID>`.
769
+ # @param language_code [::String]
770
+ # The language to compare the flow versions for.
771
+ #
772
+ # If not specified, the agent's default language is used.
773
+ # [Many
774
+ # languages](https://cloud.google.com/dialogflow/docs/reference/language) are
775
+ # supported. Note: languages must be enabled in the agent before they can be
776
+ # used.
777
+ #
778
+ # @yield [response, operation] Access the result along with the RPC operation
779
+ # @yieldparam response [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse]
780
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
781
+ #
782
+ # @return [::Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse]
783
+ #
784
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
785
+ #
786
+ # @example Basic example
787
+ # require "google/cloud/dialogflow/cx/v3"
788
+ #
789
+ # # Create a client object. The client can be reused for multiple calls.
790
+ # client = Google::Cloud::Dialogflow::CX::V3::Versions::Client.new
791
+ #
792
+ # # Create a request. To set request fields, pass in keyword arguments.
793
+ # request = Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest.new
794
+ #
795
+ # # Call the compare_versions method.
796
+ # result = client.compare_versions request
797
+ #
798
+ # # The returned object is of type Google::Cloud::Dialogflow::CX::V3::CompareVersionsResponse.
799
+ # p result
800
+ #
801
+ def compare_versions request, options = nil
802
+ raise ::ArgumentError, "request must be provided" if request.nil?
803
+
804
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CompareVersionsRequest
805
+
806
+ # Converts hash and nil to an options object
807
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
808
+
809
+ # Customize the options with defaults
810
+ metadata = @config.rpcs.compare_versions.metadata.to_h
811
+
812
+ # Set x-goog-api-client and x-goog-user-project headers
813
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
814
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
815
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION
816
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
817
+
818
+ header_params = {}
819
+ if request.base_version
820
+ header_params["base_version"] = request.base_version
821
+ end
822
+
823
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
824
+ metadata[:"x-goog-request-params"] ||= request_params_header
825
+
826
+ options.apply_defaults timeout: @config.rpcs.compare_versions.timeout,
827
+ metadata: metadata,
828
+ retry_policy: @config.rpcs.compare_versions.retry_policy
829
+
830
+ options.apply_defaults timeout: @config.timeout,
831
+ metadata: @config.metadata,
832
+ retry_policy: @config.retry_policy
833
+
834
+ @versions_stub.call_rpc :compare_versions, request, options: options do |response, operation|
835
+ yield response, operation if block_given?
836
+ return response
837
+ end
838
+ rescue ::GRPC::BadStatus => e
839
+ raise ::Google::Cloud::Error.from_error(e)
840
+ end
841
+
617
842
  ##
618
843
  # Configuration class for the Versions API.
619
844
  #
@@ -779,6 +1004,11 @@ module Google
779
1004
  # @return [::Gapic::Config::Method]
780
1005
  #
781
1006
  attr_reader :load_version
1007
+ ##
1008
+ # RPC-specific configuration for `compare_versions`
1009
+ # @return [::Gapic::Config::Method]
1010
+ #
1011
+ attr_reader :compare_versions
782
1012
 
783
1013
  # @private
784
1014
  def initialize parent_rpcs = nil
@@ -794,6 +1024,8 @@ module Google
794
1024
  @delete_version = ::Gapic::Config::Method.new delete_version_config
795
1025
  load_version_config = parent_rpcs.load_version if parent_rpcs.respond_to? :load_version
796
1026
  @load_version = ::Gapic::Config::Method.new load_version_config
1027
+ compare_versions_config = parent_rpcs.compare_versions if parent_rpcs.respond_to? :compare_versions
1028
+ @compare_versions = ::Gapic::Config::Method.new compare_versions_config
797
1029
 
798
1030
  yield self if block_given?
799
1031
  end