google-cloud-dialogflow-v2 0.10.0 → 0.11.2

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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +2 -2
  4. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +39 -5
  5. data/lib/google/cloud/dialogflow/v2/agents/client.rb +96 -54
  6. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +34 -25
  7. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +1 -1
  8. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +37 -43
  9. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +1 -0
  10. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +1 -1
  11. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +49 -47
  12. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +1 -1
  13. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +46 -46
  14. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +1 -1
  15. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +46 -46
  16. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +27 -10
  17. data/lib/google/cloud/dialogflow/v2/documents/client.rb +75 -56
  18. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +34 -25
  19. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +45 -1
  20. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +104 -51
  21. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +34 -25
  22. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +7 -7
  23. data/lib/google/cloud/dialogflow/v2/environments/client.rb +69 -56
  24. data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +1 -1
  25. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +37 -43
  26. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +16 -1
  27. data/lib/google/cloud/dialogflow/v2/intents/client.rb +67 -48
  28. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +34 -25
  29. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +1 -1
  30. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +46 -46
  31. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +1 -1
  32. data/lib/google/cloud/dialogflow/v2/participants/client.rb +53 -52
  33. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +1 -1
  34. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +46 -46
  35. data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -0
  36. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +1 -1
  37. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +38 -47
  38. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  39. data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +1 -1
  40. data/lib/google/cloud/dialogflow/v2/versions/client.rb +51 -46
  41. data/proto_docs/google/api/field_behavior.rb +7 -1
  42. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +22 -4
  43. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +4 -3
  44. data/proto_docs/google/cloud/dialogflow/v2/session.rb +3 -0
  45. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
  46. data/proto_docs/google/cloud/dialogflow/v2/version.rb +6 -0
  47. metadata +8 -7
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [Intents][google.cloud.dialogflow.v2.Intent].
28
28
  class Service
29
29
 
30
- include ::GRPC::GenericService
30
+ include GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -57,6 +57,13 @@ module Google
57
57
  rpc :DeleteIntent, ::Google::Cloud::Dialogflow::V2::DeleteIntentRequest, ::Google::Protobuf::Empty
58
58
  # Updates/Creates multiple intents in the specified agent.
59
59
  #
60
+ # This method is a [long-running
61
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
62
+ # The returned `Operation` type has the following method-specific fields:
63
+ #
64
+ # - `metadata`: An empty [Struct
65
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
66
+ # - `response`: [BatchUpdateIntentsResponse][google.cloud.dialogflow.v2.BatchUpdateIntentsResponse]
60
67
  #
61
68
  # Note: You should always train an agent prior to sending it queries. See the
62
69
  # [training
@@ -64,6 +71,14 @@ module Google
64
71
  rpc :BatchUpdateIntents, ::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsRequest, ::Google::Longrunning::Operation
65
72
  # Deletes intents in the specified agent.
66
73
  #
74
+ # This method is a [long-running
75
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
76
+ # The returned `Operation` type has the following method-specific fields:
77
+ #
78
+ # - `metadata`: An empty [Struct
79
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
80
+ # - `response`: An [Empty
81
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
67
82
  #
68
83
  # Note: You should always train an agent prior to sending it queries. See the
69
84
  # [training
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Dialogflow::V2::Intents::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all Intents clients:
47
- #
48
- # ::Google::Cloud::Dialogflow::V2::Intents::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all Intents clients
47
+ # ::Google::Cloud::Dialogflow::V2::Intents::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -67,10 +66,7 @@ module Google
67
66
 
68
67
  default_config.timeout = 60.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14]
69
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
74
70
  }
75
71
 
76
72
  default_config
@@ -102,19 +98,15 @@ module Google
102
98
  ##
103
99
  # Create a new Intents client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new Intents client with the default
108
- # configuration:
101
+ # @example
109
102
  #
110
- # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new
111
105
  #
112
- # To create a new Intents client with a custom
113
- # configuration:
114
- #
115
- # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config|
116
- # config.timeout = 10.0
117
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the Intents client.
120
112
  # @yieldparam config [Client::Configuration]
@@ -134,14 +126,13 @@ module Google
134
126
 
135
127
  # Create credentials
136
128
  credentials = @config.credentials
137
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
130
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
132
  !@config.endpoint.split(".").first.include?("-")
142
133
  credentials ||= Credentials.default scope: @config.scope,
143
134
  enable_self_signed_jwt: enable_self_signed_jwt
144
- if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
136
  credentials = Credentials.new credentials, scope: @config.scope
146
137
  end
147
138
  @quota_project_id = @config.quota_project
@@ -247,7 +238,9 @@ module Google
247
238
  options.apply_defaults timeout: @config.rpcs.list_intents.timeout,
248
239
  metadata: metadata,
249
240
  retry_policy: @config.rpcs.list_intents.retry_policy
250
- options.apply_defaults metadata: @config.metadata,
241
+
242
+ options.apply_defaults timeout: @config.timeout,
243
+ metadata: @config.metadata,
251
244
  retry_policy: @config.retry_policy
252
245
 
253
246
  @intents_stub.call_rpc :list_intents, request, options: options do |response, operation|
@@ -323,7 +316,9 @@ module Google
323
316
  options.apply_defaults timeout: @config.rpcs.get_intent.timeout,
324
317
  metadata: metadata,
325
318
  retry_policy: @config.rpcs.get_intent.retry_policy
326
- options.apply_defaults metadata: @config.metadata,
319
+
320
+ options.apply_defaults timeout: @config.timeout,
321
+ metadata: @config.metadata,
327
322
  retry_policy: @config.retry_policy
328
323
 
329
324
  @intents_stub.call_rpc :get_intent, request, options: options do |response, operation|
@@ -404,7 +399,9 @@ module Google
404
399
  options.apply_defaults timeout: @config.rpcs.create_intent.timeout,
405
400
  metadata: metadata,
406
401
  retry_policy: @config.rpcs.create_intent.retry_policy
407
- options.apply_defaults metadata: @config.metadata,
402
+
403
+ options.apply_defaults timeout: @config.timeout,
404
+ metadata: @config.metadata,
408
405
  retry_policy: @config.retry_policy
409
406
 
410
407
  @intents_stub.call_rpc :create_intent, request, options: options do |response, operation|
@@ -484,7 +481,9 @@ module Google
484
481
  options.apply_defaults timeout: @config.rpcs.update_intent.timeout,
485
482
  metadata: metadata,
486
483
  retry_policy: @config.rpcs.update_intent.retry_policy
487
- options.apply_defaults metadata: @config.metadata,
484
+
485
+ options.apply_defaults timeout: @config.timeout,
486
+ metadata: @config.metadata,
488
487
  retry_policy: @config.retry_policy
489
488
 
490
489
  @intents_stub.call_rpc :update_intent, request, options: options do |response, operation|
@@ -556,7 +555,9 @@ module Google
556
555
  options.apply_defaults timeout: @config.rpcs.delete_intent.timeout,
557
556
  metadata: metadata,
558
557
  retry_policy: @config.rpcs.delete_intent.retry_policy
559
- options.apply_defaults metadata: @config.metadata,
558
+
559
+ options.apply_defaults timeout: @config.timeout,
560
+ metadata: @config.metadata,
560
561
  retry_policy: @config.retry_policy
561
562
 
562
563
  @intents_stub.call_rpc :delete_intent, request, options: options do |response, operation|
@@ -570,6 +571,13 @@ module Google
570
571
  ##
571
572
  # Updates/Creates multiple intents in the specified agent.
572
573
  #
574
+ # This method is a [long-running
575
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
576
+ # The returned `Operation` type has the following method-specific fields:
577
+ #
578
+ # - `metadata`: An empty [Struct
579
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
580
+ # - `response`: {::Google::Cloud::Dialogflow::V2::BatchUpdateIntentsResponse BatchUpdateIntentsResponse}
573
581
  #
574
582
  # Note: You should always train an agent prior to sending it queries. See the
575
583
  # [training
@@ -644,7 +652,9 @@ module Google
644
652
  options.apply_defaults timeout: @config.rpcs.batch_update_intents.timeout,
645
653
  metadata: metadata,
646
654
  retry_policy: @config.rpcs.batch_update_intents.retry_policy
647
- options.apply_defaults metadata: @config.metadata,
655
+
656
+ options.apply_defaults timeout: @config.timeout,
657
+ metadata: @config.metadata,
648
658
  retry_policy: @config.retry_policy
649
659
 
650
660
  @intents_stub.call_rpc :batch_update_intents, request, options: options do |response, operation|
@@ -659,6 +669,14 @@ module Google
659
669
  ##
660
670
  # Deletes intents in the specified agent.
661
671
  #
672
+ # This method is a [long-running
673
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
674
+ # The returned `Operation` type has the following method-specific fields:
675
+ #
676
+ # - `metadata`: An empty [Struct
677
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
678
+ # - `response`: An [Empty
679
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
662
680
  #
663
681
  # Note: You should always train an agent prior to sending it queries. See the
664
682
  # [training
@@ -720,7 +738,9 @@ module Google
720
738
  options.apply_defaults timeout: @config.rpcs.batch_delete_intents.timeout,
721
739
  metadata: metadata,
722
740
  retry_policy: @config.rpcs.batch_delete_intents.retry_policy
723
- options.apply_defaults metadata: @config.metadata,
741
+
742
+ options.apply_defaults timeout: @config.timeout,
743
+ metadata: @config.metadata,
724
744
  retry_policy: @config.retry_policy
725
745
 
726
746
  @intents_stub.call_rpc :batch_delete_intents, request, options: options do |response, operation|
@@ -745,22 +765,21 @@ module Google
745
765
  # Configuration can be applied globally to all clients, or to a single client
746
766
  # on construction.
747
767
  #
748
- # # Examples
749
- #
750
- # To modify the global config, setting the timeout for list_intents
751
- # to 20 seconds, and all remaining timeouts to 10 seconds:
752
- #
753
- # ::Google::Cloud::Dialogflow::V2::Intents::Client.configure do |config|
754
- # config.timeout = 10.0
755
- # config.rpcs.list_intents.timeout = 20.0
756
- # end
757
- #
758
- # To apply the above configuration only to a new client:
759
- #
760
- # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config|
761
- # config.timeout = 10.0
762
- # config.rpcs.list_intents.timeout = 20.0
763
- # end
768
+ # @example
769
+ #
770
+ # # Modify the global config, setting the timeout for
771
+ # # list_intents to 20 seconds,
772
+ # # and all remaining timeouts to 10 seconds.
773
+ # ::Google::Cloud::Dialogflow::V2::Intents::Client.configure do |config|
774
+ # config.timeout = 10.0
775
+ # config.rpcs.list_intents.timeout = 20.0
776
+ # end
777
+ #
778
+ # # Apply the above configuration only to a new client.
779
+ # client = ::Google::Cloud::Dialogflow::V2::Intents::Client.new do |config|
780
+ # config.timeout = 10.0
781
+ # config.rpcs.list_intents.timeout = 20.0
782
+ # end
764
783
  #
765
784
  # @!attribute [rw] endpoint
766
785
  # The hostname or hostname:port of the service endpoint.
@@ -82,7 +82,7 @@ module Google
82
82
  # Create credentials
83
83
  credentials = @config.credentials
84
84
  credentials ||= Credentials.default scope: @config.scope
85
- if credentials.is_a?(String) || credentials.is_a?(Hash)
85
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
86
86
  credentials = Credentials.new credentials, scope: @config.scope
87
87
  end
88
88
  @quota_project_id = @config.quota_project
@@ -169,7 +169,9 @@ module Google
169
169
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
170
170
  metadata: metadata,
171
171
  retry_policy: @config.rpcs.list_operations.retry_policy
172
- options.apply_defaults metadata: @config.metadata,
172
+
173
+ options.apply_defaults timeout: @config.timeout,
174
+ metadata: @config.metadata,
173
175
  retry_policy: @config.retry_policy
174
176
 
175
177
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -239,7 +241,9 @@ module Google
239
241
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
240
242
  metadata: metadata,
241
243
  retry_policy: @config.rpcs.get_operation.retry_policy
242
- options.apply_defaults metadata: @config.metadata,
244
+
245
+ options.apply_defaults timeout: @config.timeout,
246
+ metadata: @config.metadata,
243
247
  retry_policy: @config.retry_policy
244
248
 
245
249
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -309,7 +313,9 @@ module Google
309
313
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
310
314
  metadata: metadata,
311
315
  retry_policy: @config.rpcs.delete_operation.retry_policy
312
- options.apply_defaults metadata: @config.metadata,
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
313
319
  retry_policy: @config.retry_policy
314
320
 
315
321
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -384,7 +390,9 @@ module Google
384
390
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
385
391
  metadata: metadata,
386
392
  retry_policy: @config.rpcs.cancel_operation.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
388
396
  retry_policy: @config.retry_policy
389
397
 
390
398
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -396,9 +404,9 @@ module Google
396
404
  end
397
405
 
398
406
  ##
399
- # Waits for the specified long-running operation until it is done or reaches
400
- # at most a specified timeout, returning the latest state. If the operation
401
- # is already done, the latest state is immediately returned. If the timeout
407
+ # Waits until the specified long-running operation is done or reaches at most
408
+ # a specified timeout, returning the latest state. If the operation is
409
+ # already done, the latest state is immediately returned. If the timeout
402
410
  # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
403
411
  # timeout is used. If the server does not support this method, it returns
404
412
  # `google.rpc.Code.UNIMPLEMENTED`.
@@ -456,7 +464,9 @@ module Google
456
464
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
457
465
  metadata: metadata,
458
466
  retry_policy: @config.rpcs.wait_operation.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
467
+
468
+ options.apply_defaults timeout: @config.timeout,
469
+ metadata: @config.metadata,
460
470
  retry_policy: @config.retry_policy
461
471
 
462
472
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -481,22 +491,21 @@ module Google
481
491
  # Configuration can be applied globally to all clients, or to a single client
482
492
  # on construction.
483
493
  #
484
- # # Examples
485
- #
486
- # To modify the global config, setting the timeout for list_operations
487
- # to 20 seconds, and all remaining timeouts to 10 seconds:
488
- #
489
- # ::Google::Longrunning::Operations::Client.configure do |config|
490
- # config.timeout = 10.0
491
- # config.rpcs.list_operations.timeout = 20.0
492
- # end
493
- #
494
- # To apply the above configuration only to a new client:
495
- #
496
- # client = ::Google::Longrunning::Operations::Client.new do |config|
497
- # config.timeout = 10.0
498
- # config.rpcs.list_operations.timeout = 20.0
499
- # end
494
+ # @example
495
+ #
496
+ # # Modify the global config, setting the timeout for
497
+ # # list_operations to 20 seconds,
498
+ # # and all remaining timeouts to 10 seconds.
499
+ # ::Google::Longrunning::Operations::Client.configure do |config|
500
+ # config.timeout = 10.0
501
+ # config.rpcs.list_operations.timeout = 20.0
502
+ # end
503
+ #
504
+ # # Apply the above configuration only to a new client.
505
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
506
+ # config.timeout = 10.0
507
+ # config.rpcs.list_operations.timeout = 20.0
508
+ # end
500
509
  #
501
510
  # @!attribute [rw] endpoint
502
511
  # The hostname or hostname:port of the service endpoint.
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase].
28
28
  class Service
29
29
 
30
- include ::GRPC::GenericService
30
+ include GRPC::GenericService
31
31
 
32
32
  self.marshal_class_method = :encode
33
33
  self.unmarshal_class_method = :decode
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all KnowledgeBases clients:
47
- #
48
- # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all KnowledgeBases clients
47
+ # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.configure do |config|
48
+ # config.timeout = 10.0
49
+ # end
51
50
  #
52
51
  # @yield [config] Configure the Client client.
53
52
  # @yieldparam config [Client::Configuration]
@@ -67,10 +66,7 @@ module Google
67
66
 
68
67
  default_config.timeout = 60.0
69
68
  default_config.retry_policy = {
70
- initial_delay: 0.1,
71
- max_delay: 60.0,
72
- multiplier: 1.3,
73
- retry_codes: [14]
69
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
74
70
  }
75
71
 
76
72
  default_config
@@ -102,19 +98,15 @@ module Google
102
98
  ##
103
99
  # Create a new KnowledgeBases client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new KnowledgeBases client with the default
108
- # configuration:
109
- #
110
- # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new
101
+ # @example
111
102
  #
112
- # To create a new KnowledgeBases client with a custom
113
- # configuration:
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new
114
105
  #
115
- # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config|
116
- # config.timeout = 10.0
117
- # end
106
+ # # Create a client using a custom configuration
107
+ # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the KnowledgeBases client.
120
112
  # @yieldparam config [Client::Configuration]
@@ -134,14 +126,13 @@ module Google
134
126
 
135
127
  # Create credentials
136
128
  credentials = @config.credentials
137
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
129
+ # Use self-signed JWT if the endpoint is unchanged from default,
138
130
  # but only if the default endpoint does not have a region prefix.
139
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
140
- @config.endpoint == Client.configure.endpoint &&
131
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
141
132
  !@config.endpoint.split(".").first.include?("-")
142
133
  credentials ||= Credentials.default scope: @config.scope,
143
134
  enable_self_signed_jwt: enable_self_signed_jwt
144
- if credentials.is_a?(String) || credentials.is_a?(Hash)
135
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
145
136
  credentials = Credentials.new credentials, scope: @config.scope
146
137
  end
147
138
  @quota_project_id = @config.quota_project
@@ -219,7 +210,9 @@ module Google
219
210
  options.apply_defaults timeout: @config.rpcs.list_knowledge_bases.timeout,
220
211
  metadata: metadata,
221
212
  retry_policy: @config.rpcs.list_knowledge_bases.retry_policy
222
- options.apply_defaults metadata: @config.metadata,
213
+
214
+ options.apply_defaults timeout: @config.timeout,
215
+ metadata: @config.metadata,
223
216
  retry_policy: @config.retry_policy
224
217
 
225
218
  @knowledge_bases_stub.call_rpc :list_knowledge_bases, request, options: options do |response, operation|
@@ -288,7 +281,9 @@ module Google
288
281
  options.apply_defaults timeout: @config.rpcs.get_knowledge_base.timeout,
289
282
  metadata: metadata,
290
283
  retry_policy: @config.rpcs.get_knowledge_base.retry_policy
291
- options.apply_defaults metadata: @config.metadata,
284
+
285
+ options.apply_defaults timeout: @config.timeout,
286
+ metadata: @config.metadata,
292
287
  retry_policy: @config.retry_policy
293
288
 
294
289
  @knowledge_bases_stub.call_rpc :get_knowledge_base, request, options: options do |response, operation|
@@ -357,7 +352,9 @@ module Google
357
352
  options.apply_defaults timeout: @config.rpcs.create_knowledge_base.timeout,
358
353
  metadata: metadata,
359
354
  retry_policy: @config.rpcs.create_knowledge_base.retry_policy
360
- options.apply_defaults metadata: @config.metadata,
355
+
356
+ options.apply_defaults timeout: @config.timeout,
357
+ metadata: @config.metadata,
361
358
  retry_policy: @config.retry_policy
362
359
 
363
360
  @knowledge_bases_stub.call_rpc :create_knowledge_base, request, options: options do |response, operation|
@@ -428,7 +425,9 @@ module Google
428
425
  options.apply_defaults timeout: @config.rpcs.delete_knowledge_base.timeout,
429
426
  metadata: metadata,
430
427
  retry_policy: @config.rpcs.delete_knowledge_base.retry_policy
431
- options.apply_defaults metadata: @config.metadata,
428
+
429
+ options.apply_defaults timeout: @config.timeout,
430
+ metadata: @config.metadata,
432
431
  retry_policy: @config.retry_policy
433
432
 
434
433
  @knowledge_bases_stub.call_rpc :delete_knowledge_base, request, options: options do |response, operation|
@@ -498,7 +497,9 @@ module Google
498
497
  options.apply_defaults timeout: @config.rpcs.update_knowledge_base.timeout,
499
498
  metadata: metadata,
500
499
  retry_policy: @config.rpcs.update_knowledge_base.retry_policy
501
- options.apply_defaults metadata: @config.metadata,
500
+
501
+ options.apply_defaults timeout: @config.timeout,
502
+ metadata: @config.metadata,
502
503
  retry_policy: @config.retry_policy
503
504
 
504
505
  @knowledge_bases_stub.call_rpc :update_knowledge_base, request, options: options do |response, operation|
@@ -522,22 +523,21 @@ module Google
522
523
  # Configuration can be applied globally to all clients, or to a single client
523
524
  # on construction.
524
525
  #
525
- # # Examples
526
- #
527
- # To modify the global config, setting the timeout for list_knowledge_bases
528
- # to 20 seconds, and all remaining timeouts to 10 seconds:
529
- #
530
- # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.configure do |config|
531
- # config.timeout = 10.0
532
- # config.rpcs.list_knowledge_bases.timeout = 20.0
533
- # end
534
- #
535
- # To apply the above configuration only to a new client:
536
- #
537
- # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config|
538
- # config.timeout = 10.0
539
- # config.rpcs.list_knowledge_bases.timeout = 20.0
540
- # end
526
+ # @example
527
+ #
528
+ # # Modify the global config, setting the timeout for
529
+ # # list_knowledge_bases to 20 seconds,
530
+ # # and all remaining timeouts to 10 seconds.
531
+ # ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.configure do |config|
532
+ # config.timeout = 10.0
533
+ # config.rpcs.list_knowledge_bases.timeout = 20.0
534
+ # end
535
+ #
536
+ # # Apply the above configuration only to a new client.
537
+ # client = ::Google::Cloud::Dialogflow::V2::KnowledgeBases::Client.new do |config|
538
+ # config.timeout = 10.0
539
+ # config.rpcs.list_knowledge_bases.timeout = 20.0
540
+ # end
541
541
  #
542
542
  # @!attribute [rw] endpoint
543
543
  # The hostname or hostname:port of the service endpoint.