google-cloud-dialogflow-v2 0.4.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +6 -6
  3. data/README.md +1 -1
  4. data/lib/google/cloud/dialogflow/v2.rb +2 -1
  5. data/lib/google/cloud/dialogflow/v2/agents.rb +5 -5
  6. data/lib/google/cloud/dialogflow/v2/agents/client.rb +218 -205
  7. data/lib/google/cloud/dialogflow/v2/agents/credentials.rb +1 -1
  8. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +108 -102
  9. data/lib/google/cloud/dialogflow/v2/agents/paths.rb +2 -2
  10. data/lib/google/cloud/dialogflow/v2/contexts.rb +3 -3
  11. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +147 -142
  12. data/lib/google/cloud/dialogflow/v2/contexts/credentials.rb +1 -1
  13. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +14 -14
  14. data/lib/google/cloud/dialogflow/v2/entity_types.rb +2 -2
  15. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +244 -231
  16. data/lib/google/cloud/dialogflow/v2/entity_types/credentials.rb +1 -1
  17. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +108 -102
  18. data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +3 -3
  19. data/lib/google/cloud/dialogflow/v2/environment_pb.rb +51 -0
  20. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +45 -0
  21. data/lib/google/cloud/dialogflow/v2/environments.rb +49 -0
  22. data/lib/google/cloud/dialogflow/v2/environments/client.rb +384 -0
  23. data/lib/google/cloud/dialogflow/v2/environments/credentials.rb +52 -0
  24. data/lib/google/cloud/dialogflow/v2/environments/paths.rb +47 -0
  25. data/lib/google/cloud/dialogflow/v2/intents.rb +3 -3
  26. data/lib/google/cloud/dialogflow/v2/intents/client.rb +189 -176
  27. data/lib/google/cloud/dialogflow/v2/intents/credentials.rb +1 -1
  28. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +108 -102
  29. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +11 -11
  30. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -1
  31. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +129 -124
  32. data/lib/google/cloud/dialogflow/v2/session_entity_types/credentials.rb +1 -1
  33. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +14 -14
  34. data/lib/google/cloud/dialogflow/v2/sessions.rb +3 -3
  35. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +85 -80
  36. data/lib/google/cloud/dialogflow/v2/sessions/credentials.rb +1 -1
  37. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +22 -22
  38. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  39. data/proto_docs/google/api/resource.rb +12 -12
  40. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +69 -69
  41. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +45 -44
  42. data/proto_docs/google/cloud/dialogflow/v2/context.rb +38 -38
  43. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +86 -86
  44. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +103 -0
  45. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +251 -250
  46. data/proto_docs/google/cloud/dialogflow/v2/session.rb +114 -106
  47. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +35 -35
  48. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +8 -8
  49. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +43 -36
  50. data/proto_docs/google/longrunning/operations.rb +30 -30
  51. data/proto_docs/google/protobuf/any.rb +4 -4
  52. data/proto_docs/google/protobuf/duration.rb +4 -4
  53. data/proto_docs/google/protobuf/empty.rb +2 -2
  54. data/proto_docs/google/protobuf/field_mask.rb +3 -3
  55. data/proto_docs/google/protobuf/struct.rb +18 -18
  56. data/proto_docs/google/protobuf/timestamp.rb +120 -0
  57. data/proto_docs/google/rpc/status.rb +6 -6
  58. data/proto_docs/google/type/latlng.rb +4 -4
  59. metadata +40 -5
  60. data/lib/google/cloud/common_resources_pb.rb +0 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e7b82709afedacbe0f56ca44aa0672e496501f7f577724b4ecd6f254935712ae
4
- data.tar.gz: d2fb17fecc2e54e01e3ab7c0ddc39e298ce4597f088c66e894fec5432230f48b
3
+ metadata.gz: 59428cfb38624cf82c09f43a2a22feb715c79ef5abe26fd3c0add74e7b68cdc2
4
+ data.tar.gz: 5c6cc39a4873713eae72a73467ea85e1e535230d8e6e1f784c2e7663770b4d7f
5
5
  SHA512:
6
- metadata.gz: bf6ae2afc93029fdc525c22c5ef785880c2493bfff9edce2370b65a4d6bb8f9ca6043f14006da9a7b35ebf95b8dfca510778eebdf91edef7143745aa1d6e2e2c
7
- data.tar.gz: e5227e577dc00c5945c161278e54b09ee8895206bb8abd4b4e8d18afed3a52a9fd37edfae9067b0e7757d2d19f58bfeb172ba0d1dac74474baef3396bb412767
6
+ metadata.gz: a65693b9d6ccdaa7819ece604a80043bef4fd51cdf0023d5ef4e995c65c5ed0eceebc57aa11ad8aa0637311fd1b26f898bcf9832ce98eae1b75e7eab7f6b05df
7
+ data.tar.gz: 1f04dc95651a085a45c7420dfefcf750b6c7491c10dc7896a89fe11c6d9be3dd037dd1866496fcd313b5162890475dc4431d5890adb96493273bce2474b19415
@@ -27,7 +27,7 @@ export DIALOGFLOW_CREDENTIALS=path/to/keyfile.json
27
27
  ```ruby
28
28
  require "google/cloud/dialogflow/v2"
29
29
 
30
- client = Google::Cloud::Dialogflow::V2::Agents::Client.new
30
+ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
31
31
  ```
32
32
 
33
33
  ## Credential Lookup
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
64
64
 
65
65
  The environment variables that google-cloud-dialogflow-v2
66
66
  checks for credentials are configured on the service Credentials class (such as
67
- {Google::Cloud::Dialogflow::V2::Agents::Credentials}):
67
+ {::Google::Cloud::Dialogflow::V2::Agents::Credentials}):
68
68
 
69
69
  1. `DIALOGFLOW_CREDENTIALS` - Path to JSON file, or JSON contents
70
70
  2. `DIALOGFLOW_KEYFILE` - Path to JSON file, or JSON contents
@@ -77,7 +77,7 @@ require "google/cloud/dialogflow/v2"
77
77
 
78
78
  ENV["DIALOGFLOW_CREDENTIALS"] = "path/to/keyfile.json"
79
79
 
80
- client = Google::Cloud::Dialogflow::V2::Agents::Client.new
80
+ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
81
81
  ```
82
82
 
83
83
  ### Configuration
@@ -88,7 +88,7 @@ environment variables. Either on an individual client initialization:
88
88
  ```ruby
89
89
  require "google/cloud/dialogflow/v2"
90
90
 
91
- client = Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
91
+ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
92
92
  config.credentials = "path/to/keyfile.json"
93
93
  end
94
94
  ```
@@ -98,11 +98,11 @@ Or configured globally for all clients:
98
98
  ```ruby
99
99
  require "google/cloud/dialogflow/v2"
100
100
 
101
- Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config|
101
+ ::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config|
102
102
  config.credentials = "path/to/keyfile.json"
103
103
  end
104
104
 
105
- client = Google::Cloud::Dialogflow::V2::Agents::Client.new
105
+ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
106
106
  ```
107
107
 
108
108
  ### Cloud SDK
data/README.md CHANGED
@@ -25,7 +25,7 @@ In order to use this library, you first need to go through the following steps:
25
25
  ```ruby
26
26
  require "google/cloud/dialogflow/v2"
27
27
 
28
- client = Google::Cloud::Dialogflow::V2::Agents::Client.new
28
+ client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
29
29
  request = my_create_request
30
30
  response = client.get_agent request
31
31
  ```
@@ -19,6 +19,7 @@
19
19
  require "google/cloud/dialogflow/v2/agents"
20
20
  require "google/cloud/dialogflow/v2/contexts"
21
21
  require "google/cloud/dialogflow/v2/entity_types"
22
+ require "google/cloud/dialogflow/v2/environments"
22
23
  require "google/cloud/dialogflow/v2/intents"
23
24
  require "google/cloud/dialogflow/v2/session_entity_types"
24
25
  require "google/cloud/dialogflow/v2/sessions"
@@ -31,7 +32,7 @@ module Google
31
32
  # To load this package, including all its services, and instantiate a client:
32
33
  #
33
34
  # require "google/cloud/dialogflow/v2"
34
- # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
35
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
35
36
  #
36
37
  module V2
37
38
  end
@@ -37,8 +37,8 @@ module Google
37
37
  # in your app, product, or service to determine user intent and respond to the
38
38
  # user in a natural way.
39
39
  #
40
- # After you create an agent, you can add {Google::Cloud::Dialogflow::V2::Intents::Client Intents}, {Google::Cloud::Dialogflow::V2::Contexts::Client Contexts},
41
- # [Entity Types][google.cloud.dialogflow.v2.EntityTypes], {Google::Cloud::Dialogflow::V2::WebhookRequest Webhooks}, and so on to
40
+ # After you create an agent, you can add {::Google::Cloud::Dialogflow::V2::Intents::Client Intents}, {::Google::Cloud::Dialogflow::V2::Contexts::Client Contexts},
41
+ # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client Entity Types}, {::Google::Cloud::Dialogflow::V2::WebhookRequest Webhooks}, and so on to
42
42
  # manage the flow of a conversation and match user input to predefined intents
43
43
  # and actions.
44
44
  #
@@ -48,8 +48,8 @@ module Google
48
48
  # Editions](https://cloud.google.com/dialogflow/docs/editions).
49
49
  #
50
50
  # You can save your agent for backup or versioning by exporting the agent by
51
- # using the {Google::Cloud::Dialogflow::V2::Agents::Client#export_agent ExportAgent} method. You can import a saved
52
- # agent by using the {Google::Cloud::Dialogflow::V2::Agents::Client#import_agent ImportAgent} method.
51
+ # using the {::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent ExportAgent} method. You can import a saved
52
+ # agent by using the {::Google::Cloud::Dialogflow::V2::Agents::Client#import_agent ImportAgent} method.
53
53
  #
54
54
  # Dialogflow provides several
55
55
  # [prebuilt
@@ -64,7 +64,7 @@ module Google
64
64
  # To load this service and instantiate a client:
65
65
  #
66
66
  # require "google/cloud/dialogflow/v2/agents"
67
- # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
67
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
68
68
  #
69
69
  module Agents
70
70
  end
@@ -32,8 +32,8 @@ module Google
32
32
  # in your app, product, or service to determine user intent and respond to the
33
33
  # user in a natural way.
34
34
  #
35
- # After you create an agent, you can add {Google::Cloud::Dialogflow::V2::Intents::Client Intents}, {Google::Cloud::Dialogflow::V2::Contexts::Client Contexts},
36
- # [Entity Types][google.cloud.dialogflow.v2.EntityTypes], {Google::Cloud::Dialogflow::V2::WebhookRequest Webhooks}, and so on to
35
+ # After you create an agent, you can add {::Google::Cloud::Dialogflow::V2::Intents::Client Intents}, {::Google::Cloud::Dialogflow::V2::Contexts::Client Contexts},
36
+ # {::Google::Cloud::Dialogflow::V2::EntityTypes::Client Entity Types}, {::Google::Cloud::Dialogflow::V2::WebhookRequest Webhooks}, and so on to
37
37
  # manage the flow of a conversation and match user input to predefined intents
38
38
  # and actions.
39
39
  #
@@ -43,8 +43,8 @@ module Google
43
43
  # Editions](https://cloud.google.com/dialogflow/docs/editions).
44
44
  #
45
45
  # You can save your agent for backup or versioning by exporting the agent by
46
- # using the {Google::Cloud::Dialogflow::V2::Agents::Client#export_agent ExportAgent} method. You can import a saved
47
- # agent by using the {Google::Cloud::Dialogflow::V2::Agents::Client#import_agent ImportAgent} method.
46
+ # using the {::Google::Cloud::Dialogflow::V2::Agents::Client#export_agent ExportAgent} method. You can import a saved
47
+ # agent by using the {::Google::Cloud::Dialogflow::V2::Agents::Client#import_agent ImportAgent} method.
48
48
  #
49
49
  # Dialogflow provides several
50
50
  # [prebuilt
@@ -65,15 +65,15 @@ module Google
65
65
  ##
66
66
  # Configure the Agents Client class.
67
67
  #
68
- # See {Google::Cloud::Dialogflow::V2::Agents::Client::Configuration}
68
+ # See {::Google::Cloud::Dialogflow::V2::Agents::Client::Configuration}
69
69
  # for a description of the configuration fields.
70
70
  #
71
71
  # ## Example
72
72
  #
73
73
  # To modify the configuration for all Agents clients:
74
74
  #
75
- # Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config|
76
- # config.timeout = 10_000
75
+ # ::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config|
76
+ # config.timeout = 10.0
77
77
  # end
78
78
  #
79
79
  # @yield [config] Configure the Client client.
@@ -163,7 +163,7 @@ module Google
163
163
  # but structural changes (adding new fields, etc.) are not allowed. Structural changes
164
164
  # should be made on {Client.configure}.
165
165
  #
166
- # See {Google::Cloud::Dialogflow::V2::Agents::Client::Configuration}
166
+ # See {::Google::Cloud::Dialogflow::V2::Agents::Client::Configuration}
167
167
  # for a description of the configuration fields.
168
168
  #
169
169
  # @yield [config] Configure the Client client.
@@ -184,13 +184,13 @@ module Google
184
184
  # To create a new Agents client with the default
185
185
  # configuration:
186
186
  #
187
- # client = Google::Cloud::Dialogflow::V2::Agents::Client.new
187
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
188
188
  #
189
189
  # To create a new Agents client with a custom
190
190
  # configuration:
191
191
  #
192
- # client = Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
193
- # config.timeout = 10_000
192
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
193
+ # config.timeout = 10.0
194
194
  # end
195
195
  #
196
196
  # @yield [config] Configure the Agents client.
@@ -215,14 +215,16 @@ module Google
215
215
  if credentials.is_a?(String) || credentials.is_a?(Hash)
216
216
  credentials = Credentials.new credentials, scope: @config.scope
217
217
  end
218
- @quota_project_id = credentials.respond_to?(:quota_project_id) ? credentials.quota_project_id : nil
218
+ @quota_project_id = @config.quota_project
219
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
219
220
 
220
221
  @operations_client = Operations.new do |config|
221
222
  config.credentials = credentials
223
+ config.endpoint = @config.endpoint
222
224
  end
223
225
 
224
- @agents_stub = Gapic::ServiceStub.new(
225
- Google::Cloud::Dialogflow::V2::Agents::Stub,
226
+ @agents_stub = ::Gapic::ServiceStub.new(
227
+ ::Google::Cloud::Dialogflow::V2::Agents::Stub,
226
228
  credentials: credentials,
227
229
  endpoint: @config.endpoint,
228
230
  channel_args: @config.channel_args,
@@ -230,6 +232,13 @@ module Google
230
232
  )
231
233
  end
232
234
 
235
+ ##
236
+ # Get the associated client for long-running operations.
237
+ #
238
+ # @return [::Google::Cloud::Dialogflow::V2::Agents::Operations]
239
+ #
240
+ attr_reader :operations_client
241
+
233
242
  # Service calls
234
243
 
235
244
  ##
@@ -237,12 +246,12 @@ module Google
237
246
  #
238
247
  # @overload get_agent(request, options = nil)
239
248
  # Pass arguments to `get_agent` via a request object, either of type
240
- # {Google::Cloud::Dialogflow::V2::GetAgentRequest} or an equivalent Hash.
249
+ # {::Google::Cloud::Dialogflow::V2::GetAgentRequest} or an equivalent Hash.
241
250
  #
242
- # @param request [Google::Cloud::Dialogflow::V2::GetAgentRequest, Hash]
251
+ # @param request [::Google::Cloud::Dialogflow::V2::GetAgentRequest, ::Hash]
243
252
  # A request object representing the call parameters. Required. To specify no
244
253
  # parameters, or to keep all the default parameter values, pass an empty Hash.
245
- # @param options [Gapic::CallOptions, Hash]
254
+ # @param options [::Gapic::CallOptions, ::Hash]
246
255
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
247
256
  #
248
257
  # @overload get_agent(parent: nil)
@@ -250,31 +259,31 @@ module Google
250
259
  # least one keyword argument is required. To specify no parameters, or to keep all
251
260
  # the default parameter values, pass an empty Hash as a request object (see above).
252
261
  #
253
- # @param parent [String]
262
+ # @param parent [::String]
254
263
  # Required. The project that the agent to fetch is associated with.
255
264
  # Format: `projects/<Project ID>`.
256
265
  #
257
266
  # @yield [response, operation] Access the result along with the RPC operation
258
- # @yieldparam response [Google::Cloud::Dialogflow::V2::Agent]
259
- # @yieldparam operation [GRPC::ActiveCall::Operation]
267
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Agent]
268
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
260
269
  #
261
- # @return [Google::Cloud::Dialogflow::V2::Agent]
270
+ # @return [::Google::Cloud::Dialogflow::V2::Agent]
262
271
  #
263
- # @raise [Google::Cloud::Error] if the RPC is aborted.
272
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
264
273
  #
265
274
  def get_agent request, options = nil
266
- raise ArgumentError, "request must be provided" if request.nil?
275
+ raise ::ArgumentError, "request must be provided" if request.nil?
267
276
 
268
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::GetAgentRequest
277
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetAgentRequest
269
278
 
270
279
  # Converts hash and nil to an options object
271
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
280
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
272
281
 
273
282
  # Customize the options with defaults
274
283
  metadata = @config.rpcs.get_agent.metadata.to_h
275
284
 
276
285
  # Set x-goog-api-client and x-goog-user-project headers
277
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
286
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
278
287
  lib_name: @config.lib_name, lib_version: @config.lib_version,
279
288
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
280
289
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -295,8 +304,8 @@ module Google
295
304
  yield response, operation if block_given?
296
305
  return response
297
306
  end
298
- rescue GRPC::BadStatus => e
299
- raise Google::Cloud::Error.from_error(e)
307
+ rescue ::GRPC::BadStatus => e
308
+ raise ::Google::Cloud::Error.from_error(e)
300
309
  end
301
310
 
302
311
  ##
@@ -304,12 +313,12 @@ module Google
304
313
  #
305
314
  # @overload set_agent(request, options = nil)
306
315
  # Pass arguments to `set_agent` via a request object, either of type
307
- # {Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash.
316
+ # {::Google::Cloud::Dialogflow::V2::SetAgentRequest} or an equivalent Hash.
308
317
  #
309
- # @param request [Google::Cloud::Dialogflow::V2::SetAgentRequest, Hash]
318
+ # @param request [::Google::Cloud::Dialogflow::V2::SetAgentRequest, ::Hash]
310
319
  # A request object representing the call parameters. Required. To specify no
311
320
  # parameters, or to keep all the default parameter values, pass an empty Hash.
312
- # @param options [Gapic::CallOptions, Hash]
321
+ # @param options [::Gapic::CallOptions, ::Hash]
313
322
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
314
323
  #
315
324
  # @overload set_agent(agent: nil, update_mask: nil)
@@ -317,32 +326,32 @@ module Google
317
326
  # least one keyword argument is required. To specify no parameters, or to keep all
318
327
  # the default parameter values, pass an empty Hash as a request object (see above).
319
328
  #
320
- # @param agent [Google::Cloud::Dialogflow::V2::Agent, Hash]
329
+ # @param agent [::Google::Cloud::Dialogflow::V2::Agent, ::Hash]
321
330
  # Required. The agent to update.
322
- # @param update_mask [Google::Protobuf::FieldMask, Hash]
331
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
323
332
  # Optional. The mask to control which fields get updated.
324
333
  #
325
334
  # @yield [response, operation] Access the result along with the RPC operation
326
- # @yieldparam response [Google::Cloud::Dialogflow::V2::Agent]
327
- # @yieldparam operation [GRPC::ActiveCall::Operation]
335
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Agent]
336
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
328
337
  #
329
- # @return [Google::Cloud::Dialogflow::V2::Agent]
338
+ # @return [::Google::Cloud::Dialogflow::V2::Agent]
330
339
  #
331
- # @raise [Google::Cloud::Error] if the RPC is aborted.
340
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
332
341
  #
333
342
  def set_agent request, options = nil
334
- raise ArgumentError, "request must be provided" if request.nil?
343
+ raise ::ArgumentError, "request must be provided" if request.nil?
335
344
 
336
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::SetAgentRequest
345
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SetAgentRequest
337
346
 
338
347
  # Converts hash and nil to an options object
339
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
348
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
340
349
 
341
350
  # Customize the options with defaults
342
351
  metadata = @config.rpcs.set_agent.metadata.to_h
343
352
 
344
353
  # Set x-goog-api-client and x-goog-user-project headers
345
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
354
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
346
355
  lib_name: @config.lib_name, lib_version: @config.lib_version,
347
356
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
348
357
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -363,8 +372,8 @@ module Google
363
372
  yield response, operation if block_given?
364
373
  return response
365
374
  end
366
- rescue GRPC::BadStatus => e
367
- raise Google::Cloud::Error.from_error(e)
375
+ rescue ::GRPC::BadStatus => e
376
+ raise ::Google::Cloud::Error.from_error(e)
368
377
  end
369
378
 
370
379
  ##
@@ -372,12 +381,12 @@ module Google
372
381
  #
373
382
  # @overload delete_agent(request, options = nil)
374
383
  # Pass arguments to `delete_agent` via a request object, either of type
375
- # {Google::Cloud::Dialogflow::V2::DeleteAgentRequest} or an equivalent Hash.
384
+ # {::Google::Cloud::Dialogflow::V2::DeleteAgentRequest} or an equivalent Hash.
376
385
  #
377
- # @param request [Google::Cloud::Dialogflow::V2::DeleteAgentRequest, Hash]
386
+ # @param request [::Google::Cloud::Dialogflow::V2::DeleteAgentRequest, ::Hash]
378
387
  # A request object representing the call parameters. Required. To specify no
379
388
  # parameters, or to keep all the default parameter values, pass an empty Hash.
380
- # @param options [Gapic::CallOptions, Hash]
389
+ # @param options [::Gapic::CallOptions, ::Hash]
381
390
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
382
391
  #
383
392
  # @overload delete_agent(parent: nil)
@@ -385,31 +394,31 @@ module Google
385
394
  # least one keyword argument is required. To specify no parameters, or to keep all
386
395
  # the default parameter values, pass an empty Hash as a request object (see above).
387
396
  #
388
- # @param parent [String]
397
+ # @param parent [::String]
389
398
  # Required. The project that the agent to delete is associated with.
390
399
  # Format: `projects/<Project ID>`.
391
400
  #
392
401
  # @yield [response, operation] Access the result along with the RPC operation
393
- # @yieldparam response [Google::Protobuf::Empty]
394
- # @yieldparam operation [GRPC::ActiveCall::Operation]
402
+ # @yieldparam response [::Google::Protobuf::Empty]
403
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
395
404
  #
396
- # @return [Google::Protobuf::Empty]
405
+ # @return [::Google::Protobuf::Empty]
397
406
  #
398
- # @raise [Google::Cloud::Error] if the RPC is aborted.
407
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
399
408
  #
400
409
  def delete_agent request, options = nil
401
- raise ArgumentError, "request must be provided" if request.nil?
410
+ raise ::ArgumentError, "request must be provided" if request.nil?
402
411
 
403
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::DeleteAgentRequest
412
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteAgentRequest
404
413
 
405
414
  # Converts hash and nil to an options object
406
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
415
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
407
416
 
408
417
  # Customize the options with defaults
409
418
  metadata = @config.rpcs.delete_agent.metadata.to_h
410
419
 
411
420
  # Set x-goog-api-client and x-goog-user-project headers
412
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
421
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
413
422
  lib_name: @config.lib_name, lib_version: @config.lib_version,
414
423
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
415
424
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -430,8 +439,8 @@ module Google
430
439
  yield response, operation if block_given?
431
440
  return response
432
441
  end
433
- rescue GRPC::BadStatus => e
434
- raise Google::Cloud::Error.from_error(e)
442
+ rescue ::GRPC::BadStatus => e
443
+ raise ::Google::Cloud::Error.from_error(e)
435
444
  end
436
445
 
437
446
  ##
@@ -445,12 +454,12 @@ module Google
445
454
  #
446
455
  # @overload search_agents(request, options = nil)
447
456
  # Pass arguments to `search_agents` via a request object, either of type
448
- # {Google::Cloud::Dialogflow::V2::SearchAgentsRequest} or an equivalent Hash.
457
+ # {::Google::Cloud::Dialogflow::V2::SearchAgentsRequest} or an equivalent Hash.
449
458
  #
450
- # @param request [Google::Cloud::Dialogflow::V2::SearchAgentsRequest, Hash]
459
+ # @param request [::Google::Cloud::Dialogflow::V2::SearchAgentsRequest, ::Hash]
451
460
  # A request object representing the call parameters. Required. To specify no
452
461
  # parameters, or to keep all the default parameter values, pass an empty Hash.
453
- # @param options [Gapic::CallOptions, Hash]
462
+ # @param options [::Gapic::CallOptions, ::Hash]
454
463
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
455
464
  #
456
465
  # @overload search_agents(parent: nil, page_size: nil, page_token: nil)
@@ -458,36 +467,36 @@ module Google
458
467
  # least one keyword argument is required. To specify no parameters, or to keep all
459
468
  # the default parameter values, pass an empty Hash as a request object (see above).
460
469
  #
461
- # @param parent [String]
470
+ # @param parent [::String]
462
471
  # Required. The project to list agents from.
463
472
  # Format: `projects/<Project ID or '-'>`.
464
- # @param page_size [Integer]
473
+ # @param page_size [::Integer]
465
474
  # Optional. The maximum number of items to return in a single page. By
466
475
  # default 100 and at most 1000.
467
- # @param page_token [String]
476
+ # @param page_token [::String]
468
477
  # The next_page_token value returned from a previous list request.
469
478
  #
470
479
  # @yield [response, operation] Access the result along with the RPC operation
471
- # @yieldparam response [Gapic::PagedEnumerable<Google::Cloud::Dialogflow::V2::Agent>]
472
- # @yieldparam operation [GRPC::ActiveCall::Operation]
480
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>]
481
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
473
482
  #
474
- # @return [Gapic::PagedEnumerable<Google::Cloud::Dialogflow::V2::Agent>]
483
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Agent>]
475
484
  #
476
- # @raise [Google::Cloud::Error] if the RPC is aborted.
485
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
477
486
  #
478
487
  def search_agents request, options = nil
479
- raise ArgumentError, "request must be provided" if request.nil?
488
+ raise ::ArgumentError, "request must be provided" if request.nil?
480
489
 
481
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::SearchAgentsRequest
490
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchAgentsRequest
482
491
 
483
492
  # Converts hash and nil to an options object
484
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
493
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
485
494
 
486
495
  # Customize the options with defaults
487
496
  metadata = @config.rpcs.search_agents.metadata.to_h
488
497
 
489
498
  # Set x-goog-api-client and x-goog-user-project headers
490
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
499
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
491
500
  lib_name: @config.lib_name, lib_version: @config.lib_version,
492
501
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
493
502
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -505,27 +514,27 @@ module Google
505
514
  retry_policy: @config.retry_policy
506
515
 
507
516
  @agents_stub.call_rpc :search_agents, request, options: options do |response, operation|
508
- response = Gapic::PagedEnumerable.new @agents_stub, :search_agents, request, response, operation, options
517
+ response = ::Gapic::PagedEnumerable.new @agents_stub, :search_agents, request, response, operation, options
509
518
  yield response, operation if block_given?
510
519
  return response
511
520
  end
512
- rescue GRPC::BadStatus => e
513
- raise Google::Cloud::Error.from_error(e)
521
+ rescue ::GRPC::BadStatus => e
522
+ raise ::Google::Cloud::Error.from_error(e)
514
523
  end
515
524
 
516
525
  ##
517
526
  # Trains the specified agent.
518
527
  #
519
- # Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
528
+ # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
520
529
  #
521
530
  # @overload train_agent(request, options = nil)
522
531
  # Pass arguments to `train_agent` via a request object, either of type
523
- # {Google::Cloud::Dialogflow::V2::TrainAgentRequest} or an equivalent Hash.
532
+ # {::Google::Cloud::Dialogflow::V2::TrainAgentRequest} or an equivalent Hash.
524
533
  #
525
- # @param request [Google::Cloud::Dialogflow::V2::TrainAgentRequest, Hash]
534
+ # @param request [::Google::Cloud::Dialogflow::V2::TrainAgentRequest, ::Hash]
526
535
  # A request object representing the call parameters. Required. To specify no
527
536
  # parameters, or to keep all the default parameter values, pass an empty Hash.
528
- # @param options [Gapic::CallOptions, Hash]
537
+ # @param options [::Gapic::CallOptions, ::Hash]
529
538
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
530
539
  #
531
540
  # @overload train_agent(parent: nil)
@@ -533,31 +542,31 @@ module Google
533
542
  # least one keyword argument is required. To specify no parameters, or to keep all
534
543
  # the default parameter values, pass an empty Hash as a request object (see above).
535
544
  #
536
- # @param parent [String]
545
+ # @param parent [::String]
537
546
  # Required. The project that the agent to train is associated with.
538
547
  # Format: `projects/<Project ID>`.
539
548
  #
540
549
  # @yield [response, operation] Access the result along with the RPC operation
541
- # @yieldparam response [Gapic::Operation]
542
- # @yieldparam operation [GRPC::ActiveCall::Operation]
550
+ # @yieldparam response [::Gapic::Operation]
551
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
543
552
  #
544
- # @return [Gapic::Operation]
553
+ # @return [::Gapic::Operation]
545
554
  #
546
- # @raise [Google::Cloud::Error] if the RPC is aborted.
555
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
547
556
  #
548
557
  def train_agent request, options = nil
549
- raise ArgumentError, "request must be provided" if request.nil?
558
+ raise ::ArgumentError, "request must be provided" if request.nil?
550
559
 
551
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::TrainAgentRequest
560
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::TrainAgentRequest
552
561
 
553
562
  # Converts hash and nil to an options object
554
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
555
564
 
556
565
  # Customize the options with defaults
557
566
  metadata = @config.rpcs.train_agent.metadata.to_h
558
567
 
559
568
  # Set x-goog-api-client and x-goog-user-project headers
560
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
569
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
561
570
  lib_name: @config.lib_name, lib_version: @config.lib_version,
562
571
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
563
572
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -575,27 +584,27 @@ module Google
575
584
  retry_policy: @config.retry_policy
576
585
 
577
586
  @agents_stub.call_rpc :train_agent, request, options: options do |response, operation|
578
- response = Gapic::Operation.new response, @operations_client, options: options
587
+ response = ::Gapic::Operation.new response, @operations_client, options: options
579
588
  yield response, operation if block_given?
580
589
  return response
581
590
  end
582
- rescue GRPC::BadStatus => e
583
- raise Google::Cloud::Error.from_error(e)
591
+ rescue ::GRPC::BadStatus => e
592
+ raise ::Google::Cloud::Error.from_error(e)
584
593
  end
585
594
 
586
595
  ##
587
596
  # Exports the specified agent to a ZIP file.
588
597
  #
589
- # Operation <response: {Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse}>
598
+ # Operation <response: {::Google::Cloud::Dialogflow::V2::ExportAgentResponse ExportAgentResponse}>
590
599
  #
591
600
  # @overload export_agent(request, options = nil)
592
601
  # Pass arguments to `export_agent` via a request object, either of type
593
- # {Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash.
602
+ # {::Google::Cloud::Dialogflow::V2::ExportAgentRequest} or an equivalent Hash.
594
603
  #
595
- # @param request [Google::Cloud::Dialogflow::V2::ExportAgentRequest, Hash]
604
+ # @param request [::Google::Cloud::Dialogflow::V2::ExportAgentRequest, ::Hash]
596
605
  # A request object representing the call parameters. Required. To specify no
597
606
  # parameters, or to keep all the default parameter values, pass an empty Hash.
598
- # @param options [Gapic::CallOptions, Hash]
607
+ # @param options [::Gapic::CallOptions, ::Hash]
599
608
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
600
609
  #
601
610
  # @overload export_agent(parent: nil, agent_uri: nil)
@@ -603,36 +612,36 @@ module Google
603
612
  # least one keyword argument is required. To specify no parameters, or to keep all
604
613
  # the default parameter values, pass an empty Hash as a request object (see above).
605
614
  #
606
- # @param parent [String]
615
+ # @param parent [::String]
607
616
  # Required. The project that the agent to export is associated with.
608
617
  # Format: `projects/<Project ID>`.
609
- # @param agent_uri [String]
618
+ # @param agent_uri [::String]
610
619
  # Required. The [Google Cloud Storage](https://cloud.google.com/storage/docs/)
611
620
  # URI to export the agent to.
612
621
  # The format of this URI must be `gs://<bucket-name>/<object-name>`.
613
622
  # If left unspecified, the serialized agent is returned inline.
614
623
  #
615
624
  # @yield [response, operation] Access the result along with the RPC operation
616
- # @yieldparam response [Gapic::Operation]
617
- # @yieldparam operation [GRPC::ActiveCall::Operation]
625
+ # @yieldparam response [::Gapic::Operation]
626
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
618
627
  #
619
- # @return [Gapic::Operation]
628
+ # @return [::Gapic::Operation]
620
629
  #
621
- # @raise [Google::Cloud::Error] if the RPC is aborted.
630
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
622
631
  #
623
632
  def export_agent request, options = nil
624
- raise ArgumentError, "request must be provided" if request.nil?
633
+ raise ::ArgumentError, "request must be provided" if request.nil?
625
634
 
626
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::ExportAgentRequest
635
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ExportAgentRequest
627
636
 
628
637
  # Converts hash and nil to an options object
629
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
638
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
630
639
 
631
640
  # Customize the options with defaults
632
641
  metadata = @config.rpcs.export_agent.metadata.to_h
633
642
 
634
643
  # Set x-goog-api-client and x-goog-user-project headers
635
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
644
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
636
645
  lib_name: @config.lib_name, lib_version: @config.lib_version,
637
646
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
638
647
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -650,12 +659,12 @@ module Google
650
659
  retry_policy: @config.retry_policy
651
660
 
652
661
  @agents_stub.call_rpc :export_agent, request, options: options do |response, operation|
653
- response = Gapic::Operation.new response, @operations_client, options: options
662
+ response = ::Gapic::Operation.new response, @operations_client, options: options
654
663
  yield response, operation if block_given?
655
664
  return response
656
665
  end
657
- rescue GRPC::BadStatus => e
658
- raise Google::Cloud::Error.from_error(e)
666
+ rescue ::GRPC::BadStatus => e
667
+ raise ::Google::Cloud::Error.from_error(e)
659
668
  end
660
669
 
661
670
  ##
@@ -665,16 +674,16 @@ module Google
665
674
  # Intents and entity types with the same name are replaced with the new
666
675
  # versions from ImportAgentRequest.
667
676
  #
668
- # Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
677
+ # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
669
678
  #
670
679
  # @overload import_agent(request, options = nil)
671
680
  # Pass arguments to `import_agent` via a request object, either of type
672
- # {Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash.
681
+ # {::Google::Cloud::Dialogflow::V2::ImportAgentRequest} or an equivalent Hash.
673
682
  #
674
- # @param request [Google::Cloud::Dialogflow::V2::ImportAgentRequest, Hash]
683
+ # @param request [::Google::Cloud::Dialogflow::V2::ImportAgentRequest, ::Hash]
675
684
  # A request object representing the call parameters. Required. To specify no
676
685
  # parameters, or to keep all the default parameter values, pass an empty Hash.
677
- # @param options [Gapic::CallOptions, Hash]
686
+ # @param options [::Gapic::CallOptions, ::Hash]
678
687
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
679
688
  #
680
689
  # @overload import_agent(parent: nil, agent_uri: nil, agent_content: nil)
@@ -682,36 +691,36 @@ module Google
682
691
  # least one keyword argument is required. To specify no parameters, or to keep all
683
692
  # the default parameter values, pass an empty Hash as a request object (see above).
684
693
  #
685
- # @param parent [String]
694
+ # @param parent [::String]
686
695
  # Required. The project that the agent to import is associated with.
687
696
  # Format: `projects/<Project ID>`.
688
- # @param agent_uri [String]
697
+ # @param agent_uri [::String]
689
698
  # The URI to a Google Cloud Storage file containing the agent to import.
690
699
  # Note: The URI must start with "gs://".
691
- # @param agent_content [String]
700
+ # @param agent_content [::String]
692
701
  # Zip compressed raw byte content for agent.
693
702
  #
694
703
  # @yield [response, operation] Access the result along with the RPC operation
695
- # @yieldparam response [Gapic::Operation]
696
- # @yieldparam operation [GRPC::ActiveCall::Operation]
704
+ # @yieldparam response [::Gapic::Operation]
705
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
697
706
  #
698
- # @return [Gapic::Operation]
707
+ # @return [::Gapic::Operation]
699
708
  #
700
- # @raise [Google::Cloud::Error] if the RPC is aborted.
709
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
701
710
  #
702
711
  def import_agent request, options = nil
703
- raise ArgumentError, "request must be provided" if request.nil?
712
+ raise ::ArgumentError, "request must be provided" if request.nil?
704
713
 
705
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::ImportAgentRequest
714
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ImportAgentRequest
706
715
 
707
716
  # Converts hash and nil to an options object
708
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
717
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
709
718
 
710
719
  # Customize the options with defaults
711
720
  metadata = @config.rpcs.import_agent.metadata.to_h
712
721
 
713
722
  # Set x-goog-api-client and x-goog-user-project headers
714
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
723
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
715
724
  lib_name: @config.lib_name, lib_version: @config.lib_version,
716
725
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
717
726
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -729,12 +738,12 @@ module Google
729
738
  retry_policy: @config.retry_policy
730
739
 
731
740
  @agents_stub.call_rpc :import_agent, request, options: options do |response, operation|
732
- response = Gapic::Operation.new response, @operations_client, options: options
741
+ response = ::Gapic::Operation.new response, @operations_client, options: options
733
742
  yield response, operation if block_given?
734
743
  return response
735
744
  end
736
- rescue GRPC::BadStatus => e
737
- raise Google::Cloud::Error.from_error(e)
745
+ rescue ::GRPC::BadStatus => e
746
+ raise ::Google::Cloud::Error.from_error(e)
738
747
  end
739
748
 
740
749
  ##
@@ -743,16 +752,16 @@ module Google
743
752
  # Replaces the current agent version with a new one. All the intents and
744
753
  # entity types in the older version are deleted.
745
754
  #
746
- # Operation <response: {Google::Protobuf::Empty google.protobuf.Empty}>
755
+ # Operation <response: {::Google::Protobuf::Empty google.protobuf.Empty}>
747
756
  #
748
757
  # @overload restore_agent(request, options = nil)
749
758
  # Pass arguments to `restore_agent` via a request object, either of type
750
- # {Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash.
759
+ # {::Google::Cloud::Dialogflow::V2::RestoreAgentRequest} or an equivalent Hash.
751
760
  #
752
- # @param request [Google::Cloud::Dialogflow::V2::RestoreAgentRequest, Hash]
761
+ # @param request [::Google::Cloud::Dialogflow::V2::RestoreAgentRequest, ::Hash]
753
762
  # A request object representing the call parameters. Required. To specify no
754
763
  # parameters, or to keep all the default parameter values, pass an empty Hash.
755
- # @param options [Gapic::CallOptions, Hash]
764
+ # @param options [::Gapic::CallOptions, ::Hash]
756
765
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
757
766
  #
758
767
  # @overload restore_agent(parent: nil, agent_uri: nil, agent_content: nil)
@@ -760,36 +769,36 @@ module Google
760
769
  # least one keyword argument is required. To specify no parameters, or to keep all
761
770
  # the default parameter values, pass an empty Hash as a request object (see above).
762
771
  #
763
- # @param parent [String]
772
+ # @param parent [::String]
764
773
  # Required. The project that the agent to restore is associated with.
765
774
  # Format: `projects/<Project ID>`.
766
- # @param agent_uri [String]
775
+ # @param agent_uri [::String]
767
776
  # The URI to a Google Cloud Storage file containing the agent to restore.
768
777
  # Note: The URI must start with "gs://".
769
- # @param agent_content [String]
778
+ # @param agent_content [::String]
770
779
  # Zip compressed raw byte content for agent.
771
780
  #
772
781
  # @yield [response, operation] Access the result along with the RPC operation
773
- # @yieldparam response [Gapic::Operation]
774
- # @yieldparam operation [GRPC::ActiveCall::Operation]
782
+ # @yieldparam response [::Gapic::Operation]
783
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
775
784
  #
776
- # @return [Gapic::Operation]
785
+ # @return [::Gapic::Operation]
777
786
  #
778
- # @raise [Google::Cloud::Error] if the RPC is aborted.
787
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
779
788
  #
780
789
  def restore_agent request, options = nil
781
- raise ArgumentError, "request must be provided" if request.nil?
790
+ raise ::ArgumentError, "request must be provided" if request.nil?
782
791
 
783
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::RestoreAgentRequest
792
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::RestoreAgentRequest
784
793
 
785
794
  # Converts hash and nil to an options object
786
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
795
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
787
796
 
788
797
  # Customize the options with defaults
789
798
  metadata = @config.rpcs.restore_agent.metadata.to_h
790
799
 
791
800
  # Set x-goog-api-client and x-goog-user-project headers
792
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
801
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
793
802
  lib_name: @config.lib_name, lib_version: @config.lib_version,
794
803
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
795
804
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -807,12 +816,12 @@ module Google
807
816
  retry_policy: @config.retry_policy
808
817
 
809
818
  @agents_stub.call_rpc :restore_agent, request, options: options do |response, operation|
810
- response = Gapic::Operation.new response, @operations_client, options: options
819
+ response = ::Gapic::Operation.new response, @operations_client, options: options
811
820
  yield response, operation if block_given?
812
821
  return response
813
822
  end
814
- rescue GRPC::BadStatus => e
815
- raise Google::Cloud::Error.from_error(e)
823
+ rescue ::GRPC::BadStatus => e
824
+ raise ::Google::Cloud::Error.from_error(e)
816
825
  end
817
826
 
818
827
  ##
@@ -821,12 +830,12 @@ module Google
821
830
  #
822
831
  # @overload get_validation_result(request, options = nil)
823
832
  # Pass arguments to `get_validation_result` via a request object, either of type
824
- # {Google::Cloud::Dialogflow::V2::GetValidationResultRequest} or an equivalent Hash.
833
+ # {::Google::Cloud::Dialogflow::V2::GetValidationResultRequest} or an equivalent Hash.
825
834
  #
826
- # @param request [Google::Cloud::Dialogflow::V2::GetValidationResultRequest, Hash]
835
+ # @param request [::Google::Cloud::Dialogflow::V2::GetValidationResultRequest, ::Hash]
827
836
  # A request object representing the call parameters. Required. To specify no
828
837
  # parameters, or to keep all the default parameter values, pass an empty Hash.
829
- # @param options [Gapic::CallOptions, Hash]
838
+ # @param options [::Gapic::CallOptions, ::Hash]
830
839
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
831
840
  #
832
841
  # @overload get_validation_result(parent: nil, language_code: nil)
@@ -834,10 +843,10 @@ module Google
834
843
  # least one keyword argument is required. To specify no parameters, or to keep all
835
844
  # the default parameter values, pass an empty Hash as a request object (see above).
836
845
  #
837
- # @param parent [String]
846
+ # @param parent [::String]
838
847
  # Required. The project that the agent is associated with.
839
848
  # Format: `projects/<Project ID>`.
840
- # @param language_code [String]
849
+ # @param language_code [::String]
841
850
  # Optional. The language for which you want a validation result. If not
842
851
  # specified, the agent's default language is used. [Many
843
852
  # languages](https://cloud.google.com/dialogflow/docs/reference/language)
@@ -845,26 +854,26 @@ module Google
845
854
  # be used.
846
855
  #
847
856
  # @yield [response, operation] Access the result along with the RPC operation
848
- # @yieldparam response [Google::Cloud::Dialogflow::V2::ValidationResult]
849
- # @yieldparam operation [GRPC::ActiveCall::Operation]
857
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::ValidationResult]
858
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
850
859
  #
851
- # @return [Google::Cloud::Dialogflow::V2::ValidationResult]
860
+ # @return [::Google::Cloud::Dialogflow::V2::ValidationResult]
852
861
  #
853
- # @raise [Google::Cloud::Error] if the RPC is aborted.
862
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
854
863
  #
855
864
  def get_validation_result request, options = nil
856
- raise ArgumentError, "request must be provided" if request.nil?
865
+ raise ::ArgumentError, "request must be provided" if request.nil?
857
866
 
858
- request = Gapic::Protobuf.coerce request, to: Google::Cloud::Dialogflow::V2::GetValidationResultRequest
867
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetValidationResultRequest
859
868
 
860
869
  # Converts hash and nil to an options object
861
- options = Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
870
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
862
871
 
863
872
  # Customize the options with defaults
864
873
  metadata = @config.rpcs.get_validation_result.metadata.to_h
865
874
 
866
875
  # Set x-goog-api-client and x-goog-user-project headers
867
- metadata[:"x-goog-api-client"] ||= Gapic::Headers.x_goog_api_client \
876
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
868
877
  lib_name: @config.lib_name, lib_version: @config.lib_version,
869
878
  gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
870
879
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
@@ -885,8 +894,8 @@ module Google
885
894
  yield response, operation if block_given?
886
895
  return response
887
896
  end
888
- rescue GRPC::BadStatus => e
889
- raise Google::Cloud::Error.from_error(e)
897
+ rescue ::GRPC::BadStatus => e
898
+ raise ::Google::Cloud::Error.from_error(e)
890
899
  end
891
900
 
892
901
  ##
@@ -896,7 +905,7 @@ module Google
896
905
  # providing control over timeouts, retry behavior, logging, transport
897
906
  # parameters, and other low-level controls. Certain parameters can also be
898
907
  # applied individually to specific RPCs. See
899
- # {Google::Cloud::Dialogflow::V2::Agents::Client::Configuration::Rpcs}
908
+ # {::Google::Cloud::Dialogflow::V2::Agents::Client::Configuration::Rpcs}
900
909
  # for a list of RPCs that can be configured independently.
901
910
  #
902
911
  # Configuration can be applied globally to all clients, or to a single client
@@ -907,22 +916,22 @@ module Google
907
916
  # To modify the global config, setting the timeout for get_agent
908
917
  # to 20 seconds, and all remaining timeouts to 10 seconds:
909
918
  #
910
- # Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config|
911
- # config.timeout = 10_000
912
- # config.rpcs.get_agent.timeout = 20_000
919
+ # ::Google::Cloud::Dialogflow::V2::Agents::Client.configure do |config|
920
+ # config.timeout = 10.0
921
+ # config.rpcs.get_agent.timeout = 20.0
913
922
  # end
914
923
  #
915
924
  # To apply the above configuration only to a new client:
916
925
  #
917
- # client = Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
918
- # config.timeout = 10_000
919
- # config.rpcs.get_agent.timeout = 20_000
926
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new do |config|
927
+ # config.timeout = 10.0
928
+ # config.rpcs.get_agent.timeout = 20.0
920
929
  # end
921
930
  #
922
931
  # @!attribute [rw] endpoint
923
932
  # The hostname or hostname:port of the service endpoint.
924
933
  # Defaults to `"dialogflow.googleapis.com"`.
925
- # @return [String]
934
+ # @return [::String]
926
935
  # @!attribute [rw] credentials
927
936
  # Credentials to send with calls. You may provide any of the following types:
928
937
  # * (`String`) The path to a service account key file in JSON format
@@ -934,29 +943,29 @@ module Google
934
943
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
935
944
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
936
945
  # * (`nil`) indicating no credentials
937
- # @return [Object]
946
+ # @return [::Object]
938
947
  # @!attribute [rw] scope
939
948
  # The OAuth scopes
940
- # @return [Array<String>]
949
+ # @return [::Array<::String>]
941
950
  # @!attribute [rw] lib_name
942
951
  # The library name as recorded in instrumentation and logging
943
- # @return [String]
952
+ # @return [::String]
944
953
  # @!attribute [rw] lib_version
945
954
  # The library version as recorded in instrumentation and logging
946
- # @return [String]
955
+ # @return [::String]
947
956
  # @!attribute [rw] channel_args
948
957
  # Extra parameters passed to the gRPC channel. Note: this is ignored if a
949
958
  # `GRPC::Core::Channel` object is provided as the credential.
950
- # @return [Hash]
959
+ # @return [::Hash]
951
960
  # @!attribute [rw] interceptors
952
961
  # An array of interceptors that are run before calls are executed.
953
- # @return [Array<GRPC::ClientInterceptor>]
962
+ # @return [::Array<::GRPC::ClientInterceptor>]
954
963
  # @!attribute [rw] timeout
955
- # The call timeout in milliseconds.
956
- # @return [Numeric]
964
+ # The call timeout in seconds.
965
+ # @return [::Numeric]
957
966
  # @!attribute [rw] metadata
958
967
  # Additional gRPC headers to be sent with the call.
959
- # @return [Hash{Symbol=>String}]
968
+ # @return [::Hash{::Symbol=>::String}]
960
969
  # @!attribute [rw] retry_policy
961
970
  # The retry policy. The value is a hash with the following keys:
962
971
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
@@ -964,25 +973,29 @@ module Google
964
973
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
965
974
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
966
975
  # trigger a retry.
967
- # @return [Hash]
976
+ # @return [::Hash]
977
+ # @!attribute [rw] quota_project
978
+ # A separate project against which to charge quota.
979
+ # @return [::String]
968
980
  #
969
981
  class Configuration
970
- extend Gapic::Config
982
+ extend ::Gapic::Config
971
983
 
972
- config_attr :endpoint, "dialogflow.googleapis.com", String
973
- config_attr :credentials, nil do |value|
984
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
985
+ config_attr :credentials, nil do |value|
974
986
  allowed = [::String, ::Hash, ::Proc, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
975
987
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
976
988
  allowed.any? { |klass| klass === value }
977
989
  end
978
- config_attr :scope, nil, String, Array, nil
979
- config_attr :lib_name, nil, String, nil
980
- config_attr :lib_version, nil, String, nil
981
- config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, Hash, nil)
982
- config_attr :interceptors, nil, Array, nil
983
- config_attr :timeout, nil, Numeric, nil
984
- config_attr :metadata, nil, Hash, nil
985
- config_attr :retry_policy, nil, Hash, Proc, nil
990
+ config_attr :scope, nil, ::String, ::Array, nil
991
+ config_attr :lib_name, nil, ::String, nil
992
+ config_attr :lib_version, nil, ::String, nil
993
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution"=>1 }, ::Hash, nil)
994
+ config_attr :interceptors, nil, ::Array, nil
995
+ config_attr :timeout, nil, ::Numeric, nil
996
+ config_attr :metadata, nil, ::Hash, nil
997
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
998
+ config_attr :quota_project, nil, ::String, nil
986
999
 
987
1000
  # @private
988
1001
  def initialize parent_config = nil
@@ -1023,70 +1036,70 @@ module Google
1023
1036
  class Rpcs
1024
1037
  ##
1025
1038
  # RPC-specific configuration for `get_agent`
1026
- # @return [Gapic::Config::Method]
1039
+ # @return [::Gapic::Config::Method]
1027
1040
  #
1028
1041
  attr_reader :get_agent
1029
1042
  ##
1030
1043
  # RPC-specific configuration for `set_agent`
1031
- # @return [Gapic::Config::Method]
1044
+ # @return [::Gapic::Config::Method]
1032
1045
  #
1033
1046
  attr_reader :set_agent
1034
1047
  ##
1035
1048
  # RPC-specific configuration for `delete_agent`
1036
- # @return [Gapic::Config::Method]
1049
+ # @return [::Gapic::Config::Method]
1037
1050
  #
1038
1051
  attr_reader :delete_agent
1039
1052
  ##
1040
1053
  # RPC-specific configuration for `search_agents`
1041
- # @return [Gapic::Config::Method]
1054
+ # @return [::Gapic::Config::Method]
1042
1055
  #
1043
1056
  attr_reader :search_agents
1044
1057
  ##
1045
1058
  # RPC-specific configuration for `train_agent`
1046
- # @return [Gapic::Config::Method]
1059
+ # @return [::Gapic::Config::Method]
1047
1060
  #
1048
1061
  attr_reader :train_agent
1049
1062
  ##
1050
1063
  # RPC-specific configuration for `export_agent`
1051
- # @return [Gapic::Config::Method]
1064
+ # @return [::Gapic::Config::Method]
1052
1065
  #
1053
1066
  attr_reader :export_agent
1054
1067
  ##
1055
1068
  # RPC-specific configuration for `import_agent`
1056
- # @return [Gapic::Config::Method]
1069
+ # @return [::Gapic::Config::Method]
1057
1070
  #
1058
1071
  attr_reader :import_agent
1059
1072
  ##
1060
1073
  # RPC-specific configuration for `restore_agent`
1061
- # @return [Gapic::Config::Method]
1074
+ # @return [::Gapic::Config::Method]
1062
1075
  #
1063
1076
  attr_reader :restore_agent
1064
1077
  ##
1065
1078
  # RPC-specific configuration for `get_validation_result`
1066
- # @return [Gapic::Config::Method]
1079
+ # @return [::Gapic::Config::Method]
1067
1080
  #
1068
1081
  attr_reader :get_validation_result
1069
1082
 
1070
1083
  # @private
1071
1084
  def initialize parent_rpcs = nil
1072
1085
  get_agent_config = parent_rpcs&.get_agent if parent_rpcs&.respond_to? :get_agent
1073
- @get_agent = Gapic::Config::Method.new get_agent_config
1086
+ @get_agent = ::Gapic::Config::Method.new get_agent_config
1074
1087
  set_agent_config = parent_rpcs&.set_agent if parent_rpcs&.respond_to? :set_agent
1075
- @set_agent = Gapic::Config::Method.new set_agent_config
1088
+ @set_agent = ::Gapic::Config::Method.new set_agent_config
1076
1089
  delete_agent_config = parent_rpcs&.delete_agent if parent_rpcs&.respond_to? :delete_agent
1077
- @delete_agent = Gapic::Config::Method.new delete_agent_config
1090
+ @delete_agent = ::Gapic::Config::Method.new delete_agent_config
1078
1091
  search_agents_config = parent_rpcs&.search_agents if parent_rpcs&.respond_to? :search_agents
1079
- @search_agents = Gapic::Config::Method.new search_agents_config
1092
+ @search_agents = ::Gapic::Config::Method.new search_agents_config
1080
1093
  train_agent_config = parent_rpcs&.train_agent if parent_rpcs&.respond_to? :train_agent
1081
- @train_agent = Gapic::Config::Method.new train_agent_config
1094
+ @train_agent = ::Gapic::Config::Method.new train_agent_config
1082
1095
  export_agent_config = parent_rpcs&.export_agent if parent_rpcs&.respond_to? :export_agent
1083
- @export_agent = Gapic::Config::Method.new export_agent_config
1096
+ @export_agent = ::Gapic::Config::Method.new export_agent_config
1084
1097
  import_agent_config = parent_rpcs&.import_agent if parent_rpcs&.respond_to? :import_agent
1085
- @import_agent = Gapic::Config::Method.new import_agent_config
1098
+ @import_agent = ::Gapic::Config::Method.new import_agent_config
1086
1099
  restore_agent_config = parent_rpcs&.restore_agent if parent_rpcs&.respond_to? :restore_agent
1087
- @restore_agent = Gapic::Config::Method.new restore_agent_config
1100
+ @restore_agent = ::Gapic::Config::Method.new restore_agent_config
1088
1101
  get_validation_result_config = parent_rpcs&.get_validation_result if parent_rpcs&.respond_to? :get_validation_result
1089
- @get_validation_result = Gapic::Config::Method.new get_validation_result_config
1102
+ @get_validation_result = ::Gapic::Config::Method.new get_validation_result_config
1090
1103
 
1091
1104
  yield self if block_given?
1092
1105
  end