google-cloud-dialogflow-v2 0.9.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +8 -8
  3. data/README.md +1 -1
  4. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +17 -6
  5. data/lib/google/cloud/dialogflow/v2/agents/client.rb +74 -55
  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/context_services_pb.rb +1 -1
  10. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +49 -47
  11. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +1 -1
  12. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +46 -46
  13. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +1 -1
  14. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +46 -46
  15. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +1 -1
  16. data/lib/google/cloud/dialogflow/v2/documents/client.rb +49 -47
  17. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +34 -25
  18. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +29 -8
  19. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +89 -58
  20. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +34 -25
  21. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +7 -7
  22. data/lib/google/cloud/dialogflow/v2/environments/client.rb +69 -56
  23. data/lib/google/cloud/dialogflow/v2/environments/paths.rb +41 -0
  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 +21 -3
  27. data/lib/google/cloud/dialogflow/v2/intents/client.rb +72 -50
  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 +21 -3
  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 +4 -4
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [Participants][google.cloud.dialogflow.v2.Participant].
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::Participants::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 Participants clients:
47
- #
48
- # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all Participants clients
47
+ # ::Google::Cloud::Dialogflow::V2::Participants::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,18 +66,12 @@ 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.rpcs.analyze_content.timeout = 220.0
77
73
  default_config.rpcs.analyze_content.retry_policy = {
78
- initial_delay: 0.1,
79
- max_delay: 60.0,
80
- multiplier: 1.3,
81
- retry_codes: [14]
74
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
82
75
  }
83
76
 
84
77
  default_config
@@ -110,19 +103,15 @@ module Google
110
103
  ##
111
104
  # Create a new Participants client object.
112
105
  #
113
- # ## Examples
114
- #
115
- # To create a new Participants client with the default
116
- # configuration:
106
+ # @example
117
107
  #
118
- # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new
108
+ # # Create a client using the default configuration
109
+ # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new
119
110
  #
120
- # To create a new Participants client with a custom
121
- # configuration:
122
- #
123
- # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
124
- # config.timeout = 10.0
125
- # end
111
+ # # Create a client using a custom configuration
112
+ # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
113
+ # config.timeout = 10.0
114
+ # end
126
115
  #
127
116
  # @yield [config] Configure the Participants client.
128
117
  # @yieldparam config [Client::Configuration]
@@ -142,14 +131,13 @@ module Google
142
131
 
143
132
  # Create credentials
144
133
  credentials = @config.credentials
145
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
134
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
135
  # but only if the default endpoint does not have a region prefix.
147
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
148
- @config.endpoint == Client.configure.endpoint &&
136
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
149
137
  !@config.endpoint.split(".").first.include?("-")
150
138
  credentials ||= Credentials.default scope: @config.scope,
151
139
  enable_self_signed_jwt: enable_self_signed_jwt
152
- if credentials.is_a?(String) || credentials.is_a?(Hash)
140
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
141
  credentials = Credentials.new credentials, scope: @config.scope
154
142
  end
155
143
  @quota_project_id = @config.quota_project
@@ -225,7 +213,9 @@ module Google
225
213
  options.apply_defaults timeout: @config.rpcs.create_participant.timeout,
226
214
  metadata: metadata,
227
215
  retry_policy: @config.rpcs.create_participant.retry_policy
228
- options.apply_defaults metadata: @config.metadata,
216
+
217
+ options.apply_defaults timeout: @config.timeout,
218
+ metadata: @config.metadata,
229
219
  retry_policy: @config.retry_policy
230
220
 
231
221
  @participants_stub.call_rpc :create_participant, request, options: options do |response, operation|
@@ -293,7 +283,9 @@ module Google
293
283
  options.apply_defaults timeout: @config.rpcs.get_participant.timeout,
294
284
  metadata: metadata,
295
285
  retry_policy: @config.rpcs.get_participant.retry_policy
296
- options.apply_defaults metadata: @config.metadata,
286
+
287
+ options.apply_defaults timeout: @config.timeout,
288
+ metadata: @config.metadata,
297
289
  retry_policy: @config.retry_policy
298
290
 
299
291
  @participants_stub.call_rpc :get_participant, request, options: options do |response, operation|
@@ -366,7 +358,9 @@ module Google
366
358
  options.apply_defaults timeout: @config.rpcs.list_participants.timeout,
367
359
  metadata: metadata,
368
360
  retry_policy: @config.rpcs.list_participants.retry_policy
369
- options.apply_defaults metadata: @config.metadata,
361
+
362
+ options.apply_defaults timeout: @config.timeout,
363
+ metadata: @config.metadata,
370
364
  retry_policy: @config.retry_policy
371
365
 
372
366
  @participants_stub.call_rpc :list_participants, request, options: options do |response, operation|
@@ -435,7 +429,9 @@ module Google
435
429
  options.apply_defaults timeout: @config.rpcs.update_participant.timeout,
436
430
  metadata: metadata,
437
431
  retry_policy: @config.rpcs.update_participant.retry_policy
438
- options.apply_defaults metadata: @config.metadata,
432
+
433
+ options.apply_defaults timeout: @config.timeout,
434
+ metadata: @config.metadata,
439
435
  retry_policy: @config.retry_policy
440
436
 
441
437
  @participants_stub.call_rpc :update_participant, request, options: options do |response, operation|
@@ -524,7 +520,9 @@ module Google
524
520
  options.apply_defaults timeout: @config.rpcs.analyze_content.timeout,
525
521
  metadata: metadata,
526
522
  retry_policy: @config.rpcs.analyze_content.retry_policy
527
- options.apply_defaults metadata: @config.metadata,
523
+
524
+ options.apply_defaults timeout: @config.timeout,
525
+ metadata: @config.metadata,
528
526
  retry_policy: @config.retry_policy
529
527
 
530
528
  @participants_stub.call_rpc :analyze_content, request, options: options do |response, operation|
@@ -603,7 +601,9 @@ module Google
603
601
  options.apply_defaults timeout: @config.rpcs.suggest_articles.timeout,
604
602
  metadata: metadata,
605
603
  retry_policy: @config.rpcs.suggest_articles.retry_policy
606
- options.apply_defaults metadata: @config.metadata,
604
+
605
+ options.apply_defaults timeout: @config.timeout,
606
+ metadata: @config.metadata,
607
607
  retry_policy: @config.retry_policy
608
608
 
609
609
  @participants_stub.call_rpc :suggest_articles, request, options: options do |response, operation|
@@ -682,7 +682,9 @@ module Google
682
682
  options.apply_defaults timeout: @config.rpcs.suggest_faq_answers.timeout,
683
683
  metadata: metadata,
684
684
  retry_policy: @config.rpcs.suggest_faq_answers.retry_policy
685
- options.apply_defaults metadata: @config.metadata,
685
+
686
+ options.apply_defaults timeout: @config.timeout,
687
+ metadata: @config.metadata,
686
688
  retry_policy: @config.retry_policy
687
689
 
688
690
  @participants_stub.call_rpc :suggest_faq_answers, request, options: options do |response, operation|
@@ -706,22 +708,21 @@ module Google
706
708
  # Configuration can be applied globally to all clients, or to a single client
707
709
  # on construction.
708
710
  #
709
- # # Examples
710
- #
711
- # To modify the global config, setting the timeout for create_participant
712
- # to 20 seconds, and all remaining timeouts to 10 seconds:
713
- #
714
- # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
715
- # config.timeout = 10.0
716
- # config.rpcs.create_participant.timeout = 20.0
717
- # end
718
- #
719
- # To apply the above configuration only to a new client:
720
- #
721
- # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
722
- # config.timeout = 10.0
723
- # config.rpcs.create_participant.timeout = 20.0
724
- # end
711
+ # @example
712
+ #
713
+ # # Modify the global config, setting the timeout for
714
+ # # create_participant to 20 seconds,
715
+ # # and all remaining timeouts to 10 seconds.
716
+ # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
717
+ # config.timeout = 10.0
718
+ # config.rpcs.create_participant.timeout = 20.0
719
+ # end
720
+ #
721
+ # # Apply the above configuration only to a new client.
722
+ # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
723
+ # config.timeout = 10.0
724
+ # config.rpcs.create_participant.timeout = 20.0
725
+ # end
725
726
  #
726
727
  # @!attribute [rw] endpoint
727
728
  # The hostname or hostname:port of the service endpoint.
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [SessionEntityTypes][google.cloud.dialogflow.v2.SessionEntityType].
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::SessionEntityTypes::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 SessionEntityTypes clients:
47
- #
48
- # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all SessionEntityTypes clients
47
+ # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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 SessionEntityTypes client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new SessionEntityTypes client with the default
108
- # configuration:
109
- #
110
- # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
101
+ # @example
111
102
  #
112
- # To create a new SessionEntityTypes client with a custom
113
- # configuration:
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new
114
105
  #
115
- # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::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::SessionEntityTypes::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the SessionEntityTypes 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
@@ -227,7 +218,9 @@ module Google
227
218
  options.apply_defaults timeout: @config.rpcs.list_session_entity_types.timeout,
228
219
  metadata: metadata,
229
220
  retry_policy: @config.rpcs.list_session_entity_types.retry_policy
230
- options.apply_defaults metadata: @config.metadata,
221
+
222
+ options.apply_defaults timeout: @config.timeout,
223
+ metadata: @config.metadata,
231
224
  retry_policy: @config.retry_policy
232
225
 
233
226
  @session_entity_types_stub.call_rpc :list_session_entity_types, request, options: options do |response, operation|
@@ -304,7 +297,9 @@ module Google
304
297
  options.apply_defaults timeout: @config.rpcs.get_session_entity_type.timeout,
305
298
  metadata: metadata,
306
299
  retry_policy: @config.rpcs.get_session_entity_type.retry_policy
307
- options.apply_defaults metadata: @config.metadata,
300
+
301
+ options.apply_defaults timeout: @config.timeout,
302
+ metadata: @config.metadata,
308
303
  retry_policy: @config.retry_policy
309
304
 
310
305
  @session_entity_types_stub.call_rpc :get_session_entity_type, request, options: options do |response, operation|
@@ -384,7 +379,9 @@ module Google
384
379
  options.apply_defaults timeout: @config.rpcs.create_session_entity_type.timeout,
385
380
  metadata: metadata,
386
381
  retry_policy: @config.rpcs.create_session_entity_type.retry_policy
387
- options.apply_defaults metadata: @config.metadata,
382
+
383
+ options.apply_defaults timeout: @config.timeout,
384
+ metadata: @config.metadata,
388
385
  retry_policy: @config.retry_policy
389
386
 
390
387
  @session_entity_types_stub.call_rpc :create_session_entity_type, request, options: options do |response, operation|
@@ -456,7 +453,9 @@ module Google
456
453
  options.apply_defaults timeout: @config.rpcs.update_session_entity_type.timeout,
457
454
  metadata: metadata,
458
455
  retry_policy: @config.rpcs.update_session_entity_type.retry_policy
459
- options.apply_defaults metadata: @config.metadata,
456
+
457
+ options.apply_defaults timeout: @config.timeout,
458
+ metadata: @config.metadata,
460
459
  retry_policy: @config.retry_policy
461
460
 
462
461
  @session_entity_types_stub.call_rpc :update_session_entity_type, request, options: options do |response, operation|
@@ -532,7 +531,9 @@ module Google
532
531
  options.apply_defaults timeout: @config.rpcs.delete_session_entity_type.timeout,
533
532
  metadata: metadata,
534
533
  retry_policy: @config.rpcs.delete_session_entity_type.retry_policy
535
- options.apply_defaults metadata: @config.metadata,
534
+
535
+ options.apply_defaults timeout: @config.timeout,
536
+ metadata: @config.metadata,
536
537
  retry_policy: @config.retry_policy
537
538
 
538
539
  @session_entity_types_stub.call_rpc :delete_session_entity_type, request, options: options do |response, operation|
@@ -556,22 +557,21 @@ module Google
556
557
  # Configuration can be applied globally to all clients, or to a single client
557
558
  # on construction.
558
559
  #
559
- # # Examples
560
- #
561
- # To modify the global config, setting the timeout for list_session_entity_types
562
- # to 20 seconds, and all remaining timeouts to 10 seconds:
563
- #
564
- # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.configure do |config|
565
- # config.timeout = 10.0
566
- # config.rpcs.list_session_entity_types.timeout = 20.0
567
- # end
568
- #
569
- # To apply the above configuration only to a new client:
570
- #
571
- # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config|
572
- # config.timeout = 10.0
573
- # config.rpcs.list_session_entity_types.timeout = 20.0
574
- # end
560
+ # @example
561
+ #
562
+ # # Modify the global config, setting the timeout for
563
+ # # list_session_entity_types to 20 seconds,
564
+ # # and all remaining timeouts to 10 seconds.
565
+ # ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.configure do |config|
566
+ # config.timeout = 10.0
567
+ # config.rpcs.list_session_entity_types.timeout = 20.0
568
+ # end
569
+ #
570
+ # # Apply the above configuration only to a new client.
571
+ # client = ::Google::Cloud::Dialogflow::V2::SessionEntityTypes::Client.new do |config|
572
+ # config.timeout = 10.0
573
+ # config.rpcs.list_session_entity_types.timeout = 20.0
574
+ # end
575
575
  #
576
576
  # @!attribute [rw] endpoint
577
577
  # The hostname or hostname:port of the service endpoint.
@@ -92,6 +92,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
92
92
  optional :confidence, :float, 4
93
93
  repeated :speech_word_info, :message, 7, "google.cloud.dialogflow.v2.SpeechWordInfo"
94
94
  optional :speech_end_offset, :message, 8, "google.protobuf.Duration"
95
+ optional :language_code, :string, 10
95
96
  end
96
97
  add_enum "google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType" do
97
98
  value :MESSAGE_TYPE_UNSPECIFIED, 0
@@ -30,7 +30,7 @@ module Google
30
30
  # guide](https://cloud.google.com/dialogflow/docs/api-overview).
31
31
  class Service
32
32
 
33
- include ::GRPC::GenericService
33
+ include GRPC::GenericService
34
34
 
35
35
  self.marshal_class_method = :encode
36
36
  self.unmarshal_class_method = :decode
@@ -44,13 +44,12 @@ module Google
44
44
  # See {::Google::Cloud::Dialogflow::V2::Sessions::Client::Configuration}
45
45
  # for a description of the configuration fields.
46
46
  #
47
- # ## Example
47
+ # @example
48
48
  #
49
- # To modify the configuration for all Sessions clients:
50
- #
51
- # ::Google::Cloud::Dialogflow::V2::Sessions::Client.configure do |config|
52
- # config.timeout = 10.0
53
- # end
49
+ # # Modify the configuration for all Sessions clients
50
+ # ::Google::Cloud::Dialogflow::V2::Sessions::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
54
53
  #
55
54
  # @yield [config] Configure the Client client.
56
55
  # @yieldparam config [Client::Configuration]
@@ -70,18 +69,12 @@ module Google
70
69
 
71
70
  default_config.timeout = 60.0
72
71
  default_config.retry_policy = {
73
- initial_delay: 0.1,
74
- max_delay: 60.0,
75
- multiplier: 1.3,
76
- retry_codes: [14]
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
77
73
  }
78
74
 
79
75
  default_config.rpcs.detect_intent.timeout = 220.0
80
76
  default_config.rpcs.detect_intent.retry_policy = {
81
- initial_delay: 0.1,
82
- max_delay: 60.0,
83
- multiplier: 1.3,
84
- retry_codes: [14]
77
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
85
78
  }
86
79
 
87
80
  default_config.rpcs.streaming_detect_intent.timeout = 220.0
@@ -115,19 +108,15 @@ module Google
115
108
  ##
116
109
  # Create a new Sessions client object.
117
110
  #
118
- # ## Examples
119
- #
120
- # To create a new Sessions client with the default
121
- # configuration:
122
- #
123
- # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new
111
+ # @example
124
112
  #
125
- # To create a new Sessions client with a custom
126
- # configuration:
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new
127
115
  #
128
- # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config|
129
- # config.timeout = 10.0
130
- # end
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
131
120
  #
132
121
  # @yield [config] Configure the Sessions client.
133
122
  # @yieldparam config [Client::Configuration]
@@ -147,14 +136,13 @@ module Google
147
136
 
148
137
  # Create credentials
149
138
  credentials = @config.credentials
150
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
139
+ # Use self-signed JWT if the endpoint is unchanged from default,
151
140
  # but only if the default endpoint does not have a region prefix.
152
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
153
- @config.endpoint == Client.configure.endpoint &&
141
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
154
142
  !@config.endpoint.split(".").first.include?("-")
155
143
  credentials ||= Credentials.default scope: @config.scope,
156
144
  enable_self_signed_jwt: enable_self_signed_jwt
157
- if credentials.is_a?(String) || credentials.is_a?(Hash)
145
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
158
146
  credentials = Credentials.new credentials, scope: @config.scope
159
147
  end
160
148
  @quota_project_id = @config.quota_project
@@ -275,7 +263,9 @@ module Google
275
263
  options.apply_defaults timeout: @config.rpcs.detect_intent.timeout,
276
264
  metadata: metadata,
277
265
  retry_policy: @config.rpcs.detect_intent.retry_policy
278
- options.apply_defaults metadata: @config.metadata,
266
+
267
+ options.apply_defaults timeout: @config.timeout,
268
+ metadata: @config.metadata,
279
269
  retry_policy: @config.retry_policy
280
270
 
281
271
  @sessions_stub.call_rpc :detect_intent, request, options: options do |response, operation|
@@ -333,7 +323,9 @@ module Google
333
323
  options.apply_defaults timeout: @config.rpcs.streaming_detect_intent.timeout,
334
324
  metadata: metadata,
335
325
  retry_policy: @config.rpcs.streaming_detect_intent.retry_policy
336
- options.apply_defaults metadata: @config.metadata,
326
+
327
+ options.apply_defaults timeout: @config.timeout,
328
+ metadata: @config.metadata,
337
329
  retry_policy: @config.retry_policy
338
330
 
339
331
  @sessions_stub.call_rpc :streaming_detect_intent, request, options: options do |response, operation|
@@ -357,22 +349,21 @@ module Google
357
349
  # Configuration can be applied globally to all clients, or to a single client
358
350
  # on construction.
359
351
  #
360
- # # Examples
361
- #
362
- # To modify the global config, setting the timeout for detect_intent
363
- # to 20 seconds, and all remaining timeouts to 10 seconds:
364
- #
365
- # ::Google::Cloud::Dialogflow::V2::Sessions::Client.configure do |config|
366
- # config.timeout = 10.0
367
- # config.rpcs.detect_intent.timeout = 20.0
368
- # end
369
- #
370
- # To apply the above configuration only to a new client:
371
- #
372
- # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config|
373
- # config.timeout = 10.0
374
- # config.rpcs.detect_intent.timeout = 20.0
375
- # end
352
+ # @example
353
+ #
354
+ # # Modify the global config, setting the timeout for
355
+ # # detect_intent to 20 seconds,
356
+ # # and all remaining timeouts to 10 seconds.
357
+ # ::Google::Cloud::Dialogflow::V2::Sessions::Client.configure do |config|
358
+ # config.timeout = 10.0
359
+ # config.rpcs.detect_intent.timeout = 20.0
360
+ # end
361
+ #
362
+ # # Apply the above configuration only to a new client.
363
+ # client = ::Google::Cloud::Dialogflow::V2::Sessions::Client.new do |config|
364
+ # config.timeout = 10.0
365
+ # config.rpcs.detect_intent.timeout = 20.0
366
+ # end
376
367
  #
377
368
  # @!attribute [rw] endpoint
378
369
  # The hostname or hostname:port of the service endpoint.