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,13 +27,13 @@ module Google
27
27
  # Service for managing [Environments][google.cloud.dialogflow.v2.Environment].
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
34
34
  self.service_name = 'google.cloud.dialogflow.v2.Environments'
35
35
 
36
- # Returns the list of all non-draft environments of the specified agent.
36
+ # Returns the list of all non-default environments of the specified agent.
37
37
  rpc :ListEnvironments, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsRequest, ::Google::Cloud::Dialogflow::V2::ListEnvironmentsResponse
38
38
  # Retrieves the specified agent environment.
39
39
  rpc :GetEnvironment, ::Google::Cloud::Dialogflow::V2::GetEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment
@@ -44,13 +44,13 @@ module Google
44
44
  # This method allows you to deploy new agent versions into the environment.
45
45
  # When an environment is pointed to a new agent version by setting
46
46
  # `environment.agent_version`, the environment is temporarily set to the
47
- # `LOADING` state. During that time, the environment keeps on serving the
47
+ # `LOADING` state. During that time, the environment continues serving the
48
48
  # previous version of the agent. After the new agent version is done loading,
49
49
  # the environment is set back to the `RUNNING` state.
50
- # You can use "-" as Environment ID in environment name to update version
51
- # in "draft" environment. WARNING: this will negate all recent changes to
52
- # draft and can't be undone. You may want to save the draft to a version
53
- # before calling this function.
50
+ # You can use "-" as Environment ID in environment name to update an agent
51
+ # version in the default environment. WARNING: this will negate all recent
52
+ # changes to the draft agent and can't be undone. You may want to save the
53
+ # draft agent to a version before calling this method.
54
54
  rpc :UpdateEnvironment, ::Google::Cloud::Dialogflow::V2::UpdateEnvironmentRequest, ::Google::Cloud::Dialogflow::V2::Environment
55
55
  # Deletes the specified agent environment.
56
56
  rpc :DeleteEnvironment, ::Google::Cloud::Dialogflow::V2::DeleteEnvironmentRequest, ::Google::Protobuf::Empty
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Dialogflow::V2::Environments::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 Environments clients:
47
- #
48
- # ::Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all Environments clients
47
+ # ::Google::Cloud::Dialogflow::V2::Environments::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 Environments client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new Environments client with the default
108
- # configuration:
109
- #
110
- # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new
101
+ # @example
111
102
  #
112
- # To create a new Environments client with a custom
113
- # configuration:
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new
114
105
  #
115
- # client = ::Google::Cloud::Dialogflow::V2::Environments::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::Environments::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the Environments 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
@@ -159,7 +150,7 @@ module Google
159
150
  # Service calls
160
151
 
161
152
  ##
162
- # Returns the list of all non-draft environments of the specified agent.
153
+ # Returns the list of all non-default environments of the specified agent.
163
154
  #
164
155
  # @overload list_environments(request, options = nil)
165
156
  # Pass arguments to `list_environments` via a request object, either of type
@@ -179,6 +170,7 @@ module Google
179
170
  # @param parent [::String]
180
171
  # Required. The agent to list all environments from.
181
172
  # Format:
173
+ #
182
174
  # - `projects/<Project ID>/agent`
183
175
  # - `projects/<Project ID>/locations/<Location ID>/agent`
184
176
  # @param page_size [::Integer]
@@ -221,7 +213,9 @@ module Google
221
213
  options.apply_defaults timeout: @config.rpcs.list_environments.timeout,
222
214
  metadata: metadata,
223
215
  retry_policy: @config.rpcs.list_environments.retry_policy
224
- options.apply_defaults metadata: @config.metadata,
216
+
217
+ options.apply_defaults timeout: @config.timeout,
218
+ metadata: @config.metadata,
225
219
  retry_policy: @config.retry_policy
226
220
 
227
221
  @environments_stub.call_rpc :list_environments, request, options: options do |response, operation|
@@ -254,10 +248,13 @@ module Google
254
248
  # @param name [::String]
255
249
  # Required. The name of the environment.
256
250
  # Supported formats:
251
+ #
257
252
  # - `projects/<Project ID>/agent/environments/<Environment ID>`
258
253
  # - `projects/<Project ID>/locations/<Location
259
254
  # ID>/agent/environments/<Environment ID>`
260
255
  #
256
+ # The environment ID for the default environment is `-`.
257
+ #
261
258
  # @yield [response, operation] Access the result along with the RPC operation
262
259
  # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment]
263
260
  # @yieldparam operation [::GRPC::ActiveCall::Operation]
@@ -292,7 +289,9 @@ module Google
292
289
  options.apply_defaults timeout: @config.rpcs.get_environment.timeout,
293
290
  metadata: metadata,
294
291
  retry_policy: @config.rpcs.get_environment.retry_policy
295
- options.apply_defaults metadata: @config.metadata,
292
+
293
+ options.apply_defaults timeout: @config.timeout,
294
+ metadata: @config.metadata,
296
295
  retry_policy: @config.retry_policy
297
296
 
298
297
  @environments_stub.call_rpc :get_environment, request, options: options do |response, operation|
@@ -324,6 +323,7 @@ module Google
324
323
  # @param parent [::String]
325
324
  # Required. The agent to create an environment for.
326
325
  # Supported formats:
326
+ #
327
327
  # - `projects/<Project ID>/agent`
328
328
  # - `projects/<Project ID>/locations/<Location ID>/agent`
329
329
  # @param environment [::Google::Cloud::Dialogflow::V2::Environment, ::Hash]
@@ -365,7 +365,9 @@ module Google
365
365
  options.apply_defaults timeout: @config.rpcs.create_environment.timeout,
366
366
  metadata: metadata,
367
367
  retry_policy: @config.rpcs.create_environment.retry_policy
368
- options.apply_defaults metadata: @config.metadata,
368
+
369
+ options.apply_defaults timeout: @config.timeout,
370
+ metadata: @config.metadata,
369
371
  retry_policy: @config.retry_policy
370
372
 
371
373
  @environments_stub.call_rpc :create_environment, request, options: options do |response, operation|
@@ -382,13 +384,13 @@ module Google
382
384
  # This method allows you to deploy new agent versions into the environment.
383
385
  # When an environment is pointed to a new agent version by setting
384
386
  # `environment.agent_version`, the environment is temporarily set to the
385
- # `LOADING` state. During that time, the environment keeps on serving the
387
+ # `LOADING` state. During that time, the environment continues serving the
386
388
  # previous version of the agent. After the new agent version is done loading,
387
389
  # the environment is set back to the `RUNNING` state.
388
- # You can use "-" as Environment ID in environment name to update version
389
- # in "draft" environment. WARNING: this will negate all recent changes to
390
- # draft and can't be undone. You may want to save the draft to a version
391
- # before calling this function.
390
+ # You can use "-" as Environment ID in environment name to update an agent
391
+ # version in the default environment. WARNING: this will negate all recent
392
+ # changes to the draft agent and can't be undone. You may want to save the
393
+ # draft agent to a version before calling this method.
392
394
  #
393
395
  # @overload update_environment(request, options = nil)
394
396
  # Pass arguments to `update_environment` via a request object, either of type
@@ -410,10 +412,10 @@ module Google
410
412
  # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
411
413
  # Required. The mask to control which fields get updated.
412
414
  # @param allow_load_to_draft_and_discard_changes [::Boolean]
413
- # Optional. This field is used to prevent accidental overwrite of the draft
415
+ # Optional. This field is used to prevent accidental overwrite of the default
414
416
  # environment, which is an operation that cannot be undone. To confirm that
415
417
  # the caller desires this overwrite, this field must be explicitly set to
416
- # true when updating the draft environment (environment ID = `-`).
418
+ # true when updating the default environment (environment ID = `-`).
417
419
  #
418
420
  # @yield [response, operation] Access the result along with the RPC operation
419
421
  # @yieldparam response [::Google::Cloud::Dialogflow::V2::Environment]
@@ -449,7 +451,9 @@ module Google
449
451
  options.apply_defaults timeout: @config.rpcs.update_environment.timeout,
450
452
  metadata: metadata,
451
453
  retry_policy: @config.rpcs.update_environment.retry_policy
452
- options.apply_defaults metadata: @config.metadata,
454
+
455
+ options.apply_defaults timeout: @config.timeout,
456
+ metadata: @config.metadata,
453
457
  retry_policy: @config.retry_policy
454
458
 
455
459
  @environments_stub.call_rpc :update_environment, request, options: options do |response, operation|
@@ -481,9 +485,12 @@ module Google
481
485
  # @param name [::String]
482
486
  # Required. The name of the environment to delete.
483
487
  # / Format:
488
+ #
484
489
  # - `projects/<Project ID>/agent/environments/<Environment ID>`
485
490
  # - `projects/<Project ID>/locations/<Location
486
- # ID>/agent/environments/<Environment ID>`
491
+ # ID>/agent/environments/<Environment ID>`
492
+ #
493
+ # The environment ID for the default environment is `-`.
487
494
  #
488
495
  # @yield [response, operation] Access the result along with the RPC operation
489
496
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -519,7 +526,9 @@ module Google
519
526
  options.apply_defaults timeout: @config.rpcs.delete_environment.timeout,
520
527
  metadata: metadata,
521
528
  retry_policy: @config.rpcs.delete_environment.retry_policy
522
- options.apply_defaults metadata: @config.metadata,
529
+
530
+ options.apply_defaults timeout: @config.timeout,
531
+ metadata: @config.metadata,
523
532
  retry_policy: @config.retry_policy
524
533
 
525
534
  @environments_stub.call_rpc :delete_environment, request, options: options do |response, operation|
@@ -551,9 +560,12 @@ module Google
551
560
  # @param parent [::String]
552
561
  # Required. The name of the environment to retrieve history for.
553
562
  # Supported formats:
563
+ #
554
564
  # - `projects/<Project ID>/agent/environments/<Environment ID>`
555
565
  # - `projects/<Project ID>/locations/<Location
556
566
  # ID>/agent/environments/<Environment ID>`
567
+ #
568
+ # The environment ID for the default environment is `-`.
557
569
  # @param page_size [::Integer]
558
570
  # Optional. The maximum number of items to return in a single page. By default 100 and
559
571
  # at most 1000.
@@ -594,7 +606,9 @@ module Google
594
606
  options.apply_defaults timeout: @config.rpcs.get_environment_history.timeout,
595
607
  metadata: metadata,
596
608
  retry_policy: @config.rpcs.get_environment_history.retry_policy
597
- options.apply_defaults metadata: @config.metadata,
609
+
610
+ options.apply_defaults timeout: @config.timeout,
611
+ metadata: @config.metadata,
598
612
  retry_policy: @config.retry_policy
599
613
 
600
614
  @environments_stub.call_rpc :get_environment_history, request, options: options do |response, operation|
@@ -619,22 +633,21 @@ module Google
619
633
  # Configuration can be applied globally to all clients, or to a single client
620
634
  # on construction.
621
635
  #
622
- # # Examples
623
- #
624
- # To modify the global config, setting the timeout for list_environments
625
- # to 20 seconds, and all remaining timeouts to 10 seconds:
626
- #
627
- # ::Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config|
628
- # config.timeout = 10.0
629
- # config.rpcs.list_environments.timeout = 20.0
630
- # end
631
- #
632
- # To apply the above configuration only to a new client:
633
- #
634
- # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config|
635
- # config.timeout = 10.0
636
- # config.rpcs.list_environments.timeout = 20.0
637
- # end
636
+ # @example
637
+ #
638
+ # # Modify the global config, setting the timeout for
639
+ # # list_environments to 20 seconds,
640
+ # # and all remaining timeouts to 10 seconds.
641
+ # ::Google::Cloud::Dialogflow::V2::Environments::Client.configure do |config|
642
+ # config.timeout = 10.0
643
+ # config.rpcs.list_environments.timeout = 20.0
644
+ # end
645
+ #
646
+ # # Apply the above configuration only to a new client.
647
+ # client = ::Google::Cloud::Dialogflow::V2::Environments::Client.new do |config|
648
+ # config.timeout = 10.0
649
+ # config.rpcs.list_environments.timeout = 20.0
650
+ # end
638
651
  #
639
652
  # @!attribute [rw] endpoint
640
653
  # The hostname or hostname:port of the service endpoint.
@@ -137,6 +137,47 @@ module Google
137
137
  resource.call(**args)
138
138
  end
139
139
 
140
+ ##
141
+ # Create a fully-qualified Version resource string.
142
+ #
143
+ # @overload version_path(project:, version:)
144
+ # The resource will be in the following format:
145
+ #
146
+ # `projects/{project}/agent/versions/{version}`
147
+ #
148
+ # @param project [String]
149
+ # @param version [String]
150
+ #
151
+ # @overload version_path(project:, location:, version:)
152
+ # The resource will be in the following format:
153
+ #
154
+ # `projects/{project}/locations/{location}/agent/versions/{version}`
155
+ #
156
+ # @param project [String]
157
+ # @param location [String]
158
+ # @param version [String]
159
+ #
160
+ # @return [::String]
161
+ def version_path **args
162
+ resources = {
163
+ "project:version" => (proc do |project:, version:|
164
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
165
+
166
+ "projects/#{project}/agent/versions/#{version}"
167
+ end),
168
+ "location:project:version" => (proc do |project:, location:, version:|
169
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
170
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
171
+
172
+ "projects/#{project}/locations/#{location}/agent/versions/#{version}"
173
+ end)
174
+ }
175
+
176
+ resource = resources[args.keys.sort.join(":")]
177
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
178
+ resource.call(**args)
179
+ end
180
+
140
181
  extend self
141
182
  end
142
183
  end
@@ -27,7 +27,7 @@ module Google
27
27
  # Service for managing [Fulfillments][google.cloud.dialogflow.v2.Fulfillment].
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::Fulfillments::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 Fulfillments clients:
47
- #
48
- # ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all Fulfillments clients
47
+ # ::Google::Cloud::Dialogflow::V2::Fulfillments::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 Fulfillments client object.
104
100
  #
105
- # ## Examples
106
- #
107
- # To create a new Fulfillments client with the default
108
- # configuration:
109
- #
110
- # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new
101
+ # @example
111
102
  #
112
- # To create a new Fulfillments client with a custom
113
- # configuration:
103
+ # # Create a client using the default configuration
104
+ # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new
114
105
  #
115
- # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::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::Fulfillments::Client.new do |config|
108
+ # config.timeout = 10.0
109
+ # end
118
110
  #
119
111
  # @yield [config] Configure the Fulfillments 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
@@ -214,7 +205,9 @@ module Google
214
205
  options.apply_defaults timeout: @config.rpcs.get_fulfillment.timeout,
215
206
  metadata: metadata,
216
207
  retry_policy: @config.rpcs.get_fulfillment.retry_policy
217
- options.apply_defaults metadata: @config.metadata,
208
+
209
+ options.apply_defaults timeout: @config.timeout,
210
+ metadata: @config.metadata,
218
211
  retry_policy: @config.retry_policy
219
212
 
220
213
  @fulfillments_stub.call_rpc :get_fulfillment, request, options: options do |response, operation|
@@ -283,7 +276,9 @@ module Google
283
276
  options.apply_defaults timeout: @config.rpcs.update_fulfillment.timeout,
284
277
  metadata: metadata,
285
278
  retry_policy: @config.rpcs.update_fulfillment.retry_policy
286
- options.apply_defaults metadata: @config.metadata,
279
+
280
+ options.apply_defaults timeout: @config.timeout,
281
+ metadata: @config.metadata,
287
282
  retry_policy: @config.retry_policy
288
283
 
289
284
  @fulfillments_stub.call_rpc :update_fulfillment, request, options: options do |response, operation|
@@ -307,22 +302,21 @@ module Google
307
302
  # Configuration can be applied globally to all clients, or to a single client
308
303
  # on construction.
309
304
  #
310
- # # Examples
311
- #
312
- # To modify the global config, setting the timeout for get_fulfillment
313
- # to 20 seconds, and all remaining timeouts to 10 seconds:
314
- #
315
- # ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.configure do |config|
316
- # config.timeout = 10.0
317
- # config.rpcs.get_fulfillment.timeout = 20.0
318
- # end
319
- #
320
- # To apply the above configuration only to a new client:
321
- #
322
- # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config|
323
- # config.timeout = 10.0
324
- # config.rpcs.get_fulfillment.timeout = 20.0
325
- # end
305
+ # @example
306
+ #
307
+ # # Modify the global config, setting the timeout for
308
+ # # get_fulfillment to 20 seconds,
309
+ # # and all remaining timeouts to 10 seconds.
310
+ # ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.configure do |config|
311
+ # config.timeout = 10.0
312
+ # config.rpcs.get_fulfillment.timeout = 20.0
313
+ # end
314
+ #
315
+ # # Apply the above configuration only to a new client.
316
+ # client = ::Google::Cloud::Dialogflow::V2::Fulfillments::Client.new do |config|
317
+ # config.timeout = 10.0
318
+ # config.rpcs.get_fulfillment.timeout = 20.0
319
+ # end
326
320
  #
327
321
  # @!attribute [rw] endpoint
328
322
  # The hostname or hostname:port of the service endpoint.