google-cloud-dialogflow-v2 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +1078 -0
  4. data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +813 -0
  5. data/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +652 -0
  6. data/lib/google/cloud/dialogflow/v2/agents/rest.rb +54 -0
  7. data/lib/google/cloud/dialogflow/v2/agents.rb +6 -0
  8. data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +463 -0
  9. data/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +182 -0
  10. data/lib/google/cloud/dialogflow/v2/answer_records/rest.rb +54 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_records.rb +6 -0
  12. data/lib/google/cloud/dialogflow/v2/bindings_override.rb +102 -0
  13. data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +753 -0
  14. data/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +536 -0
  15. data/lib/google/cloud/dialogflow/v2/contexts/rest.rb +53 -0
  16. data/lib/google/cloud/dialogflow/v2/contexts.rb +6 -0
  17. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +714 -0
  18. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +813 -0
  19. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +367 -0
  20. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb +57 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_datasets.rb +6 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +1010 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +813 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +642 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb +54 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_models.rb +6 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +868 -0
  28. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +813 -0
  29. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +518 -0
  30. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb +55 -0
  31. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +6 -0
  32. data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +819 -0
  33. data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +450 -0
  34. data/lib/google/cloud/dialogflow/v2/conversations/rest.rb +54 -0
  35. data/lib/google/cloud/dialogflow/v2/conversations.rb +6 -0
  36. data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +1013 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +813 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +631 -0
  39. data/lib/google/cloud/dialogflow/v2/documents/rest.rb +55 -0
  40. data/lib/google/cloud/dialogflow/v2/documents.rb +6 -0
  41. data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +1178 -0
  42. data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +813 -0
  43. data/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +722 -0
  44. data/lib/google/cloud/dialogflow/v2/entity_types/rest.rb +54 -0
  45. data/lib/google/cloud/dialogflow/v2/entity_types.rb +6 -0
  46. data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +779 -0
  47. data/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +448 -0
  48. data/lib/google/cloud/dialogflow/v2/environments/rest.rb +53 -0
  49. data/lib/google/cloud/dialogflow/v2/environments.rb +6 -0
  50. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +444 -0
  51. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +182 -0
  52. data/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb +53 -0
  53. data/lib/google/cloud/dialogflow/v2/fulfillments.rb +6 -0
  54. data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +914 -0
  55. data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +813 -0
  56. data/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +532 -0
  57. data/lib/google/cloud/dialogflow/v2/intents/rest.rb +54 -0
  58. data/lib/google/cloud/dialogflow/v2/intents.rb +6 -0
  59. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +696 -0
  60. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb +419 -0
  61. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb +54 -0
  62. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +6 -0
  63. data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +955 -0
  64. data/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +588 -0
  65. data/lib/google/cloud/dialogflow/v2/participants/rest.rb +53 -0
  66. data/lib/google/cloud/dialogflow/v2/participants.rb +6 -0
  67. data/lib/google/cloud/dialogflow/v2/rest.rb +54 -0
  68. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +703 -0
  69. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +456 -0
  70. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb +54 -0
  71. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +6 -0
  72. data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +437 -0
  73. data/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +132 -0
  74. data/lib/google/cloud/dialogflow/v2/sessions/rest.rb +56 -0
  75. data/lib/google/cloud/dialogflow/v2/sessions.rb +6 -0
  76. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  77. data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +686 -0
  78. data/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb +382 -0
  79. data/lib/google/cloud/dialogflow/v2/versions/rest.rb +53 -0
  80. data/lib/google/cloud/dialogflow/v2/versions.rb +6 -0
  81. data/lib/google/cloud/dialogflow/v2.rb +5 -0
  82. metadata +66 -5
@@ -0,0 +1,1178 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/dialogflow/v2/entity_type_pb"
21
+ require "google/cloud/dialogflow/v2/entity_types/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Dialogflow
27
+ module V2
28
+ module EntityTypes
29
+ module Rest
30
+ ##
31
+ # REST client for the EntityTypes service.
32
+ #
33
+ # Service for managing {::Google::Cloud::Dialogflow::V2::EntityType EntityTypes}.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :entity_types_stub
40
+
41
+ ##
42
+ # Configure the EntityTypes Client class.
43
+ #
44
+ # See {::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all EntityTypes clients
50
+ # ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "Dialogflow", "V2"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config.timeout = 60.0
71
+ default_config.retry_policy = {
72
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
73
+ }
74
+
75
+ default_config
76
+ end
77
+ yield @configure if block_given?
78
+ @configure
79
+ end
80
+
81
+ ##
82
+ # Configure the EntityTypes Client instance.
83
+ #
84
+ # The configuration is set to the derived mode, meaning that values can be changed,
85
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
86
+ # should be made on {Client.configure}.
87
+ #
88
+ # See {::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration}
89
+ # for a description of the configuration fields.
90
+ #
91
+ # @yield [config] Configure the Client client.
92
+ # @yieldparam config [Client::Configuration]
93
+ #
94
+ # @return [Client::Configuration]
95
+ #
96
+ def configure
97
+ yield @config if block_given?
98
+ @config
99
+ end
100
+
101
+ ##
102
+ # Create a new EntityTypes REST client object.
103
+ #
104
+ # @example
105
+ #
106
+ # # Create a client using the default configuration
107
+ # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new
108
+ #
109
+ # # Create a client using a custom configuration
110
+ # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config|
111
+ # config.timeout = 10.0
112
+ # end
113
+ #
114
+ # @yield [config] Configure the EntityTypes client.
115
+ # @yieldparam config [Client::Configuration]
116
+ #
117
+ def initialize
118
+ # Create the configuration object
119
+ @config = Configuration.new Client.configure
120
+
121
+ # Yield the configuration if needed
122
+ yield @config if block_given?
123
+
124
+ # Create credentials
125
+ credentials = @config.credentials
126
+ # Use self-signed JWT if the endpoint is unchanged from default,
127
+ # but only if the default endpoint does not have a region prefix.
128
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
129
+ !@config.endpoint.split(".").first.include?("-")
130
+ credentials ||= Credentials.default scope: @config.scope,
131
+ enable_self_signed_jwt: enable_self_signed_jwt
132
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
133
+ credentials = Credentials.new credentials, scope: @config.scope
134
+ end
135
+
136
+ @quota_project_id = @config.quota_project
137
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
138
+
139
+ @operations_client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Operations.new do |config|
140
+ config.credentials = credentials
141
+ config.quota_project = @quota_project_id
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
145
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
146
+ config.credentials = credentials
147
+ config.quota_project = @quota_project_id
148
+ config.endpoint = @config.endpoint
149
+ config.bindings_override = @config.bindings_override
150
+ end
151
+
152
+ @entity_types_stub = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
153
+ end
154
+
155
+ ##
156
+ # Get the associated client for long-running operations.
157
+ #
158
+ # @return [::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Operations]
159
+ #
160
+ attr_reader :operations_client
161
+
162
+ ##
163
+ # Get the associated client for mix-in of the Locations.
164
+ #
165
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
166
+ #
167
+ attr_reader :location_client
168
+
169
+ # Service calls
170
+
171
+ ##
172
+ # Returns the list of all entity types in the specified agent.
173
+ #
174
+ # @overload list_entity_types(request, options = nil)
175
+ # Pass arguments to `list_entity_types` via a request object, either of type
176
+ # {::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest} or an equivalent Hash.
177
+ #
178
+ # @param request [::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest, ::Hash]
179
+ # A request object representing the call parameters. Required. To specify no
180
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
181
+ # @param options [::Gapic::CallOptions, ::Hash]
182
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
183
+ #
184
+ # @overload list_entity_types(parent: nil, language_code: nil, page_size: nil, page_token: nil)
185
+ # Pass arguments to `list_entity_types` via keyword arguments. Note that at
186
+ # least one keyword argument is required. To specify no parameters, or to keep all
187
+ # the default parameter values, pass an empty Hash as a request object (see above).
188
+ #
189
+ # @param parent [::String]
190
+ # Required. The agent to list all entity types from.
191
+ # Format: `projects/<Project ID>/agent`.
192
+ # @param language_code [::String]
193
+ # Optional. The language used to access language-specific data.
194
+ # If not specified, the agent's default language is used.
195
+ # For more information, see
196
+ # [Multilingual intent and entity
197
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
198
+ # @param page_size [::Integer]
199
+ # Optional. The maximum number of items to return in a single page. By
200
+ # default 100 and at most 1000.
201
+ # @param page_token [::String]
202
+ # Optional. The next_page_token value returned from a previous list request.
203
+ # @yield [result, operation] Access the result along with the TransportOperation object
204
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>]
205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
206
+ #
207
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::EntityType>]
208
+ #
209
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
210
+ def list_entity_types request, options = nil
211
+ raise ::ArgumentError, "request must be provided" if request.nil?
212
+
213
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListEntityTypesRequest
214
+
215
+ # Converts hash and nil to an options object
216
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
217
+
218
+ # Customize the options with defaults
219
+ call_metadata = @config.rpcs.list_entity_types.metadata.to_h
220
+
221
+ # Set x-goog-api-client and x-goog-user-project headers
222
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
223
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
224
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
225
+ transports_version_send: [:rest]
226
+
227
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
228
+
229
+ options.apply_defaults timeout: @config.rpcs.list_entity_types.timeout,
230
+ metadata: call_metadata,
231
+ retry_policy: @config.rpcs.list_entity_types.retry_policy
232
+
233
+ options.apply_defaults timeout: @config.timeout,
234
+ metadata: @config.metadata,
235
+ retry_policy: @config.retry_policy
236
+
237
+ @entity_types_stub.list_entity_types request, options do |result, operation|
238
+ result = ::Gapic::Rest::PagedEnumerable.new @entity_types_stub, :list_entity_types, "entity_types", request, result, options
239
+ yield result, operation if block_given?
240
+ return result
241
+ end
242
+ rescue ::Gapic::Rest::Error => e
243
+ raise ::Google::Cloud::Error.from_error(e)
244
+ end
245
+
246
+ ##
247
+ # Retrieves the specified entity type.
248
+ #
249
+ # @overload get_entity_type(request, options = nil)
250
+ # Pass arguments to `get_entity_type` via a request object, either of type
251
+ # {::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest} or an equivalent Hash.
252
+ #
253
+ # @param request [::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest, ::Hash]
254
+ # A request object representing the call parameters. Required. To specify no
255
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
256
+ # @param options [::Gapic::CallOptions, ::Hash]
257
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
258
+ #
259
+ # @overload get_entity_type(name: nil, language_code: nil)
260
+ # Pass arguments to `get_entity_type` via keyword arguments. Note that at
261
+ # least one keyword argument is required. To specify no parameters, or to keep all
262
+ # the default parameter values, pass an empty Hash as a request object (see above).
263
+ #
264
+ # @param name [::String]
265
+ # Required. The name of the entity type.
266
+ # Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
267
+ # @param language_code [::String]
268
+ # Optional. The language used to access language-specific data.
269
+ # If not specified, the agent's default language is used.
270
+ # For more information, see
271
+ # [Multilingual intent and entity
272
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
273
+ # @yield [result, operation] Access the result along with the TransportOperation object
274
+ # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType]
275
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
276
+ #
277
+ # @return [::Google::Cloud::Dialogflow::V2::EntityType]
278
+ #
279
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
280
+ def get_entity_type request, options = nil
281
+ raise ::ArgumentError, "request must be provided" if request.nil?
282
+
283
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetEntityTypeRequest
284
+
285
+ # Converts hash and nil to an options object
286
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
287
+
288
+ # Customize the options with defaults
289
+ call_metadata = @config.rpcs.get_entity_type.metadata.to_h
290
+
291
+ # Set x-goog-api-client and x-goog-user-project headers
292
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
293
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
294
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
295
+ transports_version_send: [:rest]
296
+
297
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
298
+
299
+ options.apply_defaults timeout: @config.rpcs.get_entity_type.timeout,
300
+ metadata: call_metadata,
301
+ retry_policy: @config.rpcs.get_entity_type.retry_policy
302
+
303
+ options.apply_defaults timeout: @config.timeout,
304
+ metadata: @config.metadata,
305
+ retry_policy: @config.retry_policy
306
+
307
+ @entity_types_stub.get_entity_type request, options do |result, operation|
308
+ yield result, operation if block_given?
309
+ return result
310
+ end
311
+ rescue ::Gapic::Rest::Error => e
312
+ raise ::Google::Cloud::Error.from_error(e)
313
+ end
314
+
315
+ ##
316
+ # Creates an entity type in the specified agent.
317
+ #
318
+ # Note: You should always train an agent prior to sending it queries. See the
319
+ # [training
320
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
321
+ #
322
+ # @overload create_entity_type(request, options = nil)
323
+ # Pass arguments to `create_entity_type` via a request object, either of type
324
+ # {::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest} or an equivalent Hash.
325
+ #
326
+ # @param request [::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest, ::Hash]
327
+ # A request object representing the call parameters. Required. To specify no
328
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
329
+ # @param options [::Gapic::CallOptions, ::Hash]
330
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
331
+ #
332
+ # @overload create_entity_type(parent: nil, entity_type: nil, language_code: nil)
333
+ # Pass arguments to `create_entity_type` via keyword arguments. Note that at
334
+ # least one keyword argument is required. To specify no parameters, or to keep all
335
+ # the default parameter values, pass an empty Hash as a request object (see above).
336
+ #
337
+ # @param parent [::String]
338
+ # Required. The agent to create a entity type for.
339
+ # Format: `projects/<Project ID>/agent`.
340
+ # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash]
341
+ # Required. The entity type to create.
342
+ # @param language_code [::String]
343
+ # Optional. The language used to access language-specific data.
344
+ # If not specified, the agent's default language is used.
345
+ # For more information, see
346
+ # [Multilingual intent and entity
347
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
348
+ # @yield [result, operation] Access the result along with the TransportOperation object
349
+ # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType]
350
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
351
+ #
352
+ # @return [::Google::Cloud::Dialogflow::V2::EntityType]
353
+ #
354
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
355
+ def create_entity_type request, options = nil
356
+ raise ::ArgumentError, "request must be provided" if request.nil?
357
+
358
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateEntityTypeRequest
359
+
360
+ # Converts hash and nil to an options object
361
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
362
+
363
+ # Customize the options with defaults
364
+ call_metadata = @config.rpcs.create_entity_type.metadata.to_h
365
+
366
+ # Set x-goog-api-client and x-goog-user-project headers
367
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
368
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
369
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
370
+ transports_version_send: [:rest]
371
+
372
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
373
+
374
+ options.apply_defaults timeout: @config.rpcs.create_entity_type.timeout,
375
+ metadata: call_metadata,
376
+ retry_policy: @config.rpcs.create_entity_type.retry_policy
377
+
378
+ options.apply_defaults timeout: @config.timeout,
379
+ metadata: @config.metadata,
380
+ retry_policy: @config.retry_policy
381
+
382
+ @entity_types_stub.create_entity_type request, options do |result, operation|
383
+ yield result, operation if block_given?
384
+ return result
385
+ end
386
+ rescue ::Gapic::Rest::Error => e
387
+ raise ::Google::Cloud::Error.from_error(e)
388
+ end
389
+
390
+ ##
391
+ # Updates the specified entity type.
392
+ #
393
+ # Note: You should always train an agent prior to sending it queries. See the
394
+ # [training
395
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
396
+ #
397
+ # @overload update_entity_type(request, options = nil)
398
+ # Pass arguments to `update_entity_type` via a request object, either of type
399
+ # {::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest} or an equivalent Hash.
400
+ #
401
+ # @param request [::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest, ::Hash]
402
+ # A request object representing the call parameters. Required. To specify no
403
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
404
+ # @param options [::Gapic::CallOptions, ::Hash]
405
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
406
+ #
407
+ # @overload update_entity_type(entity_type: nil, language_code: nil, update_mask: nil)
408
+ # Pass arguments to `update_entity_type` via keyword arguments. Note that at
409
+ # least one keyword argument is required. To specify no parameters, or to keep all
410
+ # the default parameter values, pass an empty Hash as a request object (see above).
411
+ #
412
+ # @param entity_type [::Google::Cloud::Dialogflow::V2::EntityType, ::Hash]
413
+ # Required. The entity type to update.
414
+ # @param language_code [::String]
415
+ # Optional. The language used to access language-specific data.
416
+ # If not specified, the agent's default language is used.
417
+ # For more information, see
418
+ # [Multilingual intent and entity
419
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
420
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
421
+ # Optional. The mask to control which fields get updated.
422
+ # @yield [result, operation] Access the result along with the TransportOperation object
423
+ # @yieldparam result [::Google::Cloud::Dialogflow::V2::EntityType]
424
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
425
+ #
426
+ # @return [::Google::Cloud::Dialogflow::V2::EntityType]
427
+ #
428
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
429
+ def update_entity_type request, options = nil
430
+ raise ::ArgumentError, "request must be provided" if request.nil?
431
+
432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateEntityTypeRequest
433
+
434
+ # Converts hash and nil to an options object
435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
436
+
437
+ # Customize the options with defaults
438
+ call_metadata = @config.rpcs.update_entity_type.metadata.to_h
439
+
440
+ # Set x-goog-api-client and x-goog-user-project headers
441
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
443
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
444
+ transports_version_send: [:rest]
445
+
446
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
447
+
448
+ options.apply_defaults timeout: @config.rpcs.update_entity_type.timeout,
449
+ metadata: call_metadata,
450
+ retry_policy: @config.rpcs.update_entity_type.retry_policy
451
+
452
+ options.apply_defaults timeout: @config.timeout,
453
+ metadata: @config.metadata,
454
+ retry_policy: @config.retry_policy
455
+
456
+ @entity_types_stub.update_entity_type request, options do |result, operation|
457
+ yield result, operation if block_given?
458
+ return result
459
+ end
460
+ rescue ::Gapic::Rest::Error => e
461
+ raise ::Google::Cloud::Error.from_error(e)
462
+ end
463
+
464
+ ##
465
+ # Deletes the specified entity type.
466
+ #
467
+ # Note: You should always train an agent prior to sending it queries. See the
468
+ # [training
469
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
470
+ #
471
+ # @overload delete_entity_type(request, options = nil)
472
+ # Pass arguments to `delete_entity_type` via a request object, either of type
473
+ # {::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest} or an equivalent Hash.
474
+ #
475
+ # @param request [::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest, ::Hash]
476
+ # A request object representing the call parameters. Required. To specify no
477
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
478
+ # @param options [::Gapic::CallOptions, ::Hash]
479
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
480
+ #
481
+ # @overload delete_entity_type(name: nil)
482
+ # Pass arguments to `delete_entity_type` via keyword arguments. Note that at
483
+ # least one keyword argument is required. To specify no parameters, or to keep all
484
+ # the default parameter values, pass an empty Hash as a request object (see above).
485
+ #
486
+ # @param name [::String]
487
+ # Required. The name of the entity type to delete.
488
+ # Format: `projects/<Project ID>/agent/entityTypes/<EntityType ID>`.
489
+ # @yield [result, operation] Access the result along with the TransportOperation object
490
+ # @yieldparam result [::Google::Protobuf::Empty]
491
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
492
+ #
493
+ # @return [::Google::Protobuf::Empty]
494
+ #
495
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
496
+ def delete_entity_type request, options = nil
497
+ raise ::ArgumentError, "request must be provided" if request.nil?
498
+
499
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteEntityTypeRequest
500
+
501
+ # Converts hash and nil to an options object
502
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
503
+
504
+ # Customize the options with defaults
505
+ call_metadata = @config.rpcs.delete_entity_type.metadata.to_h
506
+
507
+ # Set x-goog-api-client and x-goog-user-project headers
508
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
509
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
510
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
511
+ transports_version_send: [:rest]
512
+
513
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
514
+
515
+ options.apply_defaults timeout: @config.rpcs.delete_entity_type.timeout,
516
+ metadata: call_metadata,
517
+ retry_policy: @config.rpcs.delete_entity_type.retry_policy
518
+
519
+ options.apply_defaults timeout: @config.timeout,
520
+ metadata: @config.metadata,
521
+ retry_policy: @config.retry_policy
522
+
523
+ @entity_types_stub.delete_entity_type request, options do |result, operation|
524
+ yield result, operation if block_given?
525
+ return result
526
+ end
527
+ rescue ::Gapic::Rest::Error => e
528
+ raise ::Google::Cloud::Error.from_error(e)
529
+ end
530
+
531
+ ##
532
+ # Updates/Creates multiple entity types in the specified agent.
533
+ #
534
+ # This method is a [long-running
535
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
536
+ # The returned `Operation` type has the following method-specific fields:
537
+ #
538
+ # - `metadata`: An empty [Struct
539
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
540
+ # - `response`:
541
+ # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesResponse BatchUpdateEntityTypesResponse}
542
+ #
543
+ # Note: You should always train an agent prior to sending it queries. See the
544
+ # [training
545
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
546
+ #
547
+ # @overload batch_update_entity_types(request, options = nil)
548
+ # Pass arguments to `batch_update_entity_types` via a request object, either of type
549
+ # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest} or an equivalent Hash.
550
+ #
551
+ # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest, ::Hash]
552
+ # A request object representing the call parameters. Required. To specify no
553
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
554
+ # @param options [::Gapic::CallOptions, ::Hash]
555
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
556
+ #
557
+ # @overload batch_update_entity_types(parent: nil, entity_type_batch_uri: nil, entity_type_batch_inline: nil, language_code: nil, update_mask: nil)
558
+ # Pass arguments to `batch_update_entity_types` via keyword arguments. Note that at
559
+ # least one keyword argument is required. To specify no parameters, or to keep all
560
+ # the default parameter values, pass an empty Hash as a request object (see above).
561
+ #
562
+ # @param parent [::String]
563
+ # Required. The name of the agent to update or create entity types in.
564
+ # Format: `projects/<Project ID>/agent`.
565
+ # @param entity_type_batch_uri [::String]
566
+ # The URI to a Google Cloud Storage file containing entity types to update
567
+ # or create. The file format can either be a serialized proto (of
568
+ # EntityBatch type) or a JSON object. Note: The URI must start with
569
+ # "gs://".
570
+ # @param entity_type_batch_inline [::Google::Cloud::Dialogflow::V2::EntityTypeBatch, ::Hash]
571
+ # The collection of entity types to update or create.
572
+ # @param language_code [::String]
573
+ # Optional. The language used to access language-specific data.
574
+ # If not specified, the agent's default language is used.
575
+ # For more information, see
576
+ # [Multilingual intent and entity
577
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
578
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
579
+ # Optional. The mask to control which fields get updated.
580
+ # @yield [result, operation] Access the result along with the TransportOperation object
581
+ # @yieldparam result [::Gapic::Operation]
582
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
583
+ #
584
+ # @return [::Gapic::Operation]
585
+ #
586
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
587
+ def batch_update_entity_types request, options = nil
588
+ raise ::ArgumentError, "request must be provided" if request.nil?
589
+
590
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntityTypesRequest
591
+
592
+ # Converts hash and nil to an options object
593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
594
+
595
+ # Customize the options with defaults
596
+ call_metadata = @config.rpcs.batch_update_entity_types.metadata.to_h
597
+
598
+ # Set x-goog-api-client and x-goog-user-project headers
599
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
601
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
602
+ transports_version_send: [:rest]
603
+
604
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
605
+
606
+ options.apply_defaults timeout: @config.rpcs.batch_update_entity_types.timeout,
607
+ metadata: call_metadata,
608
+ retry_policy: @config.rpcs.batch_update_entity_types.retry_policy
609
+
610
+ options.apply_defaults timeout: @config.timeout,
611
+ metadata: @config.metadata,
612
+ retry_policy: @config.retry_policy
613
+
614
+ @entity_types_stub.batch_update_entity_types request, options do |result, operation|
615
+ result = ::Gapic::Operation.new result, @operations_client, options: options
616
+ yield result, operation if block_given?
617
+ return result
618
+ end
619
+ rescue ::Gapic::Rest::Error => e
620
+ raise ::Google::Cloud::Error.from_error(e)
621
+ end
622
+
623
+ ##
624
+ # Deletes entity types in the specified agent.
625
+ #
626
+ # This method is a [long-running
627
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
628
+ # The returned `Operation` type has the following method-specific fields:
629
+ #
630
+ # - `metadata`: An empty [Struct
631
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
632
+ # - `response`: An [Empty
633
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
634
+ #
635
+ # Note: You should always train an agent prior to sending it queries. See the
636
+ # [training
637
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
638
+ #
639
+ # @overload batch_delete_entity_types(request, options = nil)
640
+ # Pass arguments to `batch_delete_entity_types` via a request object, either of type
641
+ # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest} or an equivalent Hash.
642
+ #
643
+ # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest, ::Hash]
644
+ # A request object representing the call parameters. Required. To specify no
645
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
646
+ # @param options [::Gapic::CallOptions, ::Hash]
647
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
648
+ #
649
+ # @overload batch_delete_entity_types(parent: nil, entity_type_names: nil)
650
+ # Pass arguments to `batch_delete_entity_types` via keyword arguments. Note that at
651
+ # least one keyword argument is required. To specify no parameters, or to keep all
652
+ # the default parameter values, pass an empty Hash as a request object (see above).
653
+ #
654
+ # @param parent [::String]
655
+ # Required. The name of the agent to delete all entities types for. Format:
656
+ # `projects/<Project ID>/agent`.
657
+ # @param entity_type_names [::Array<::String>]
658
+ # Required. The names entity types to delete. All names must point to the
659
+ # same agent as `parent`.
660
+ # @yield [result, operation] Access the result along with the TransportOperation object
661
+ # @yieldparam result [::Gapic::Operation]
662
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
663
+ #
664
+ # @return [::Gapic::Operation]
665
+ #
666
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
667
+ def batch_delete_entity_types request, options = nil
668
+ raise ::ArgumentError, "request must be provided" if request.nil?
669
+
670
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntityTypesRequest
671
+
672
+ # Converts hash and nil to an options object
673
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
674
+
675
+ # Customize the options with defaults
676
+ call_metadata = @config.rpcs.batch_delete_entity_types.metadata.to_h
677
+
678
+ # Set x-goog-api-client and x-goog-user-project headers
679
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
680
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
681
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
682
+ transports_version_send: [:rest]
683
+
684
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
685
+
686
+ options.apply_defaults timeout: @config.rpcs.batch_delete_entity_types.timeout,
687
+ metadata: call_metadata,
688
+ retry_policy: @config.rpcs.batch_delete_entity_types.retry_policy
689
+
690
+ options.apply_defaults timeout: @config.timeout,
691
+ metadata: @config.metadata,
692
+ retry_policy: @config.retry_policy
693
+
694
+ @entity_types_stub.batch_delete_entity_types request, options do |result, operation|
695
+ result = ::Gapic::Operation.new result, @operations_client, options: options
696
+ yield result, operation if block_given?
697
+ return result
698
+ end
699
+ rescue ::Gapic::Rest::Error => e
700
+ raise ::Google::Cloud::Error.from_error(e)
701
+ end
702
+
703
+ ##
704
+ # Creates multiple new entities in the specified entity type.
705
+ #
706
+ # This method is a [long-running
707
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
708
+ # The returned `Operation` type has the following method-specific fields:
709
+ #
710
+ # - `metadata`: An empty [Struct
711
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
712
+ # - `response`: An [Empty
713
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
714
+ #
715
+ # Note: You should always train an agent prior to sending it queries. See the
716
+ # [training
717
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
718
+ #
719
+ # @overload batch_create_entities(request, options = nil)
720
+ # Pass arguments to `batch_create_entities` via a request object, either of type
721
+ # {::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest} or an equivalent Hash.
722
+ #
723
+ # @param request [::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest, ::Hash]
724
+ # A request object representing the call parameters. Required. To specify no
725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
726
+ # @param options [::Gapic::CallOptions, ::Hash]
727
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
728
+ #
729
+ # @overload batch_create_entities(parent: nil, entities: nil, language_code: nil)
730
+ # Pass arguments to `batch_create_entities` via keyword arguments. Note that at
731
+ # least one keyword argument is required. To specify no parameters, or to keep all
732
+ # the default parameter values, pass an empty Hash as a request object (see above).
733
+ #
734
+ # @param parent [::String]
735
+ # Required. The name of the entity type to create entities in. Format:
736
+ # `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
737
+ # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>]
738
+ # Required. The entities to create.
739
+ # @param language_code [::String]
740
+ # Optional. The language used to access language-specific data.
741
+ # If not specified, the agent's default language is used.
742
+ # For more information, see
743
+ # [Multilingual intent and entity
744
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
745
+ # @yield [result, operation] Access the result along with the TransportOperation object
746
+ # @yieldparam result [::Gapic::Operation]
747
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
748
+ #
749
+ # @return [::Gapic::Operation]
750
+ #
751
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
752
+ def batch_create_entities request, options = nil
753
+ raise ::ArgumentError, "request must be provided" if request.nil?
754
+
755
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchCreateEntitiesRequest
756
+
757
+ # Converts hash and nil to an options object
758
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
759
+
760
+ # Customize the options with defaults
761
+ call_metadata = @config.rpcs.batch_create_entities.metadata.to_h
762
+
763
+ # Set x-goog-api-client and x-goog-user-project headers
764
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
765
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
766
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
767
+ transports_version_send: [:rest]
768
+
769
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
770
+
771
+ options.apply_defaults timeout: @config.rpcs.batch_create_entities.timeout,
772
+ metadata: call_metadata,
773
+ retry_policy: @config.rpcs.batch_create_entities.retry_policy
774
+
775
+ options.apply_defaults timeout: @config.timeout,
776
+ metadata: @config.metadata,
777
+ retry_policy: @config.retry_policy
778
+
779
+ @entity_types_stub.batch_create_entities request, options do |result, operation|
780
+ result = ::Gapic::Operation.new result, @operations_client, options: options
781
+ yield result, operation if block_given?
782
+ return result
783
+ end
784
+ rescue ::Gapic::Rest::Error => e
785
+ raise ::Google::Cloud::Error.from_error(e)
786
+ end
787
+
788
+ ##
789
+ # Updates or creates multiple entities in the specified entity type. This
790
+ # method does not affect entities in the entity type that aren't explicitly
791
+ # specified in the request.
792
+ #
793
+ # This method is a [long-running
794
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
795
+ # The returned `Operation` type has the following method-specific fields:
796
+ #
797
+ # - `metadata`: An empty [Struct
798
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
799
+ # - `response`: An [Empty
800
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
801
+ #
802
+ # Note: You should always train an agent prior to sending it queries. See the
803
+ # [training
804
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
805
+ #
806
+ # @overload batch_update_entities(request, options = nil)
807
+ # Pass arguments to `batch_update_entities` via a request object, either of type
808
+ # {::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest} or an equivalent Hash.
809
+ #
810
+ # @param request [::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest, ::Hash]
811
+ # A request object representing the call parameters. Required. To specify no
812
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
813
+ # @param options [::Gapic::CallOptions, ::Hash]
814
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
815
+ #
816
+ # @overload batch_update_entities(parent: nil, entities: nil, language_code: nil, update_mask: nil)
817
+ # Pass arguments to `batch_update_entities` via keyword arguments. Note that at
818
+ # least one keyword argument is required. To specify no parameters, or to keep all
819
+ # the default parameter values, pass an empty Hash as a request object (see above).
820
+ #
821
+ # @param parent [::String]
822
+ # Required. The name of the entity type to update or create entities in.
823
+ # Format: `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
824
+ # @param entities [::Array<::Google::Cloud::Dialogflow::V2::EntityType::Entity, ::Hash>]
825
+ # Required. The entities to update or create.
826
+ # @param language_code [::String]
827
+ # Optional. The language used to access language-specific data.
828
+ # If not specified, the agent's default language is used.
829
+ # For more information, see
830
+ # [Multilingual intent and entity
831
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
832
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
833
+ # Optional. The mask to control which fields get updated.
834
+ # @yield [result, operation] Access the result along with the TransportOperation object
835
+ # @yieldparam result [::Gapic::Operation]
836
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
837
+ #
838
+ # @return [::Gapic::Operation]
839
+ #
840
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
841
+ def batch_update_entities request, options = nil
842
+ raise ::ArgumentError, "request must be provided" if request.nil?
843
+
844
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchUpdateEntitiesRequest
845
+
846
+ # Converts hash and nil to an options object
847
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
848
+
849
+ # Customize the options with defaults
850
+ call_metadata = @config.rpcs.batch_update_entities.metadata.to_h
851
+
852
+ # Set x-goog-api-client and x-goog-user-project headers
853
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
854
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
855
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
856
+ transports_version_send: [:rest]
857
+
858
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
859
+
860
+ options.apply_defaults timeout: @config.rpcs.batch_update_entities.timeout,
861
+ metadata: call_metadata,
862
+ retry_policy: @config.rpcs.batch_update_entities.retry_policy
863
+
864
+ options.apply_defaults timeout: @config.timeout,
865
+ metadata: @config.metadata,
866
+ retry_policy: @config.retry_policy
867
+
868
+ @entity_types_stub.batch_update_entities request, options do |result, operation|
869
+ result = ::Gapic::Operation.new result, @operations_client, options: options
870
+ yield result, operation if block_given?
871
+ return result
872
+ end
873
+ rescue ::Gapic::Rest::Error => e
874
+ raise ::Google::Cloud::Error.from_error(e)
875
+ end
876
+
877
+ ##
878
+ # Deletes entities in the specified entity type.
879
+ #
880
+ # This method is a [long-running
881
+ # operation](https://cloud.google.com/dialogflow/es/docs/how/long-running-operations).
882
+ # The returned `Operation` type has the following method-specific fields:
883
+ #
884
+ # - `metadata`: An empty [Struct
885
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#struct)
886
+ # - `response`: An [Empty
887
+ # message](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#empty)
888
+ #
889
+ # Note: You should always train an agent prior to sending it queries. See the
890
+ # [training
891
+ # documentation](https://cloud.google.com/dialogflow/es/docs/training).
892
+ #
893
+ # @overload batch_delete_entities(request, options = nil)
894
+ # Pass arguments to `batch_delete_entities` via a request object, either of type
895
+ # {::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest} or an equivalent Hash.
896
+ #
897
+ # @param request [::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest, ::Hash]
898
+ # A request object representing the call parameters. Required. To specify no
899
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
900
+ # @param options [::Gapic::CallOptions, ::Hash]
901
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
902
+ #
903
+ # @overload batch_delete_entities(parent: nil, entity_values: nil, language_code: nil)
904
+ # Pass arguments to `batch_delete_entities` via keyword arguments. Note that at
905
+ # least one keyword argument is required. To specify no parameters, or to keep all
906
+ # the default parameter values, pass an empty Hash as a request object (see above).
907
+ #
908
+ # @param parent [::String]
909
+ # Required. The name of the entity type to delete entries for. Format:
910
+ # `projects/<Project ID>/agent/entityTypes/<Entity Type ID>`.
911
+ # @param entity_values [::Array<::String>]
912
+ # Required. The reference `values` of the entities to delete. Note that
913
+ # these are not fully-qualified names, i.e. they don't start with
914
+ # `projects/<Project ID>`.
915
+ # @param language_code [::String]
916
+ # Optional. The language used to access language-specific data.
917
+ # If not specified, the agent's default language is used.
918
+ # For more information, see
919
+ # [Multilingual intent and entity
920
+ # data](https://cloud.google.com/dialogflow/docs/agents-multilingual#intent-entity).
921
+ # @yield [result, operation] Access the result along with the TransportOperation object
922
+ # @yieldparam result [::Gapic::Operation]
923
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
924
+ #
925
+ # @return [::Gapic::Operation]
926
+ #
927
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
928
+ def batch_delete_entities request, options = nil
929
+ raise ::ArgumentError, "request must be provided" if request.nil?
930
+
931
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::BatchDeleteEntitiesRequest
932
+
933
+ # Converts hash and nil to an options object
934
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
935
+
936
+ # Customize the options with defaults
937
+ call_metadata = @config.rpcs.batch_delete_entities.metadata.to_h
938
+
939
+ # Set x-goog-api-client and x-goog-user-project headers
940
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
941
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
942
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
943
+ transports_version_send: [:rest]
944
+
945
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
946
+
947
+ options.apply_defaults timeout: @config.rpcs.batch_delete_entities.timeout,
948
+ metadata: call_metadata,
949
+ retry_policy: @config.rpcs.batch_delete_entities.retry_policy
950
+
951
+ options.apply_defaults timeout: @config.timeout,
952
+ metadata: @config.metadata,
953
+ retry_policy: @config.retry_policy
954
+
955
+ @entity_types_stub.batch_delete_entities request, options do |result, operation|
956
+ result = ::Gapic::Operation.new result, @operations_client, options: options
957
+ yield result, operation if block_given?
958
+ return result
959
+ end
960
+ rescue ::Gapic::Rest::Error => e
961
+ raise ::Google::Cloud::Error.from_error(e)
962
+ end
963
+
964
+ ##
965
+ # Configuration class for the EntityTypes REST API.
966
+ #
967
+ # This class represents the configuration for EntityTypes REST,
968
+ # providing control over timeouts, retry behavior, logging, transport
969
+ # parameters, and other low-level controls. Certain parameters can also be
970
+ # applied individually to specific RPCs. See
971
+ # {::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client::Configuration::Rpcs}
972
+ # for a list of RPCs that can be configured independently.
973
+ #
974
+ # Configuration can be applied globally to all clients, or to a single client
975
+ # on construction.
976
+ #
977
+ # @example
978
+ #
979
+ # # Modify the global config, setting the timeout for
980
+ # # list_entity_types to 20 seconds,
981
+ # # and all remaining timeouts to 10 seconds.
982
+ # ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.configure do |config|
983
+ # config.timeout = 10.0
984
+ # config.rpcs.list_entity_types.timeout = 20.0
985
+ # end
986
+ #
987
+ # # Apply the above configuration only to a new client.
988
+ # client = ::Google::Cloud::Dialogflow::V2::EntityTypes::Rest::Client.new do |config|
989
+ # config.timeout = 10.0
990
+ # config.rpcs.list_entity_types.timeout = 20.0
991
+ # end
992
+ #
993
+ # @!attribute [rw] endpoint
994
+ # The hostname or hostname:port of the service endpoint.
995
+ # Defaults to `"dialogflow.googleapis.com"`.
996
+ # @return [::String]
997
+ # @!attribute [rw] credentials
998
+ # Credentials to send with calls. You may provide any of the following types:
999
+ # * (`String`) The path to a service account key file in JSON format
1000
+ # * (`Hash`) A service account key as a Hash
1001
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1002
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
1003
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1004
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
1005
+ # * (`nil`) indicating no credentials
1006
+ # @return [::Object]
1007
+ # @!attribute [rw] scope
1008
+ # The OAuth scopes
1009
+ # @return [::Array<::String>]
1010
+ # @!attribute [rw] lib_name
1011
+ # The library name as recorded in instrumentation and logging
1012
+ # @return [::String]
1013
+ # @!attribute [rw] lib_version
1014
+ # The library version as recorded in instrumentation and logging
1015
+ # @return [::String]
1016
+ # @!attribute [rw] timeout
1017
+ # The call timeout in seconds.
1018
+ # @return [::Numeric]
1019
+ # @!attribute [rw] metadata
1020
+ # Additional headers to be sent with the call.
1021
+ # @return [::Hash{::Symbol=>::String}]
1022
+ # @!attribute [rw] retry_policy
1023
+ # The retry policy. The value is a hash with the following keys:
1024
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1025
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1026
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1027
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1028
+ # trigger a retry.
1029
+ # @return [::Hash]
1030
+ # @!attribute [rw] quota_project
1031
+ # A separate project against which to charge quota.
1032
+ # @return [::String]
1033
+ #
1034
+ class Configuration
1035
+ extend ::Gapic::Config
1036
+
1037
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
1038
+ config_attr :credentials, nil do |value|
1039
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1040
+ allowed.any? { |klass| klass === value }
1041
+ end
1042
+ config_attr :scope, nil, ::String, ::Array, nil
1043
+ config_attr :lib_name, nil, ::String, nil
1044
+ config_attr :lib_version, nil, ::String, nil
1045
+ config_attr :timeout, nil, ::Numeric, nil
1046
+ config_attr :metadata, nil, ::Hash, nil
1047
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1048
+ config_attr :quota_project, nil, ::String, nil
1049
+
1050
+ # @private
1051
+ # Overrides for http bindings for the RPCs of this service
1052
+ # are only used when this service is used as mixin, and only
1053
+ # by the host service.
1054
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1055
+ config_attr :bindings_override, {}, ::Hash, nil
1056
+
1057
+ # @private
1058
+ def initialize parent_config = nil
1059
+ @parent_config = parent_config unless parent_config.nil?
1060
+
1061
+ yield self if block_given?
1062
+ end
1063
+
1064
+ ##
1065
+ # Configurations for individual RPCs
1066
+ # @return [Rpcs]
1067
+ #
1068
+ def rpcs
1069
+ @rpcs ||= begin
1070
+ parent_rpcs = nil
1071
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1072
+ Rpcs.new parent_rpcs
1073
+ end
1074
+ end
1075
+
1076
+ ##
1077
+ # Configuration RPC class for the EntityTypes API.
1078
+ #
1079
+ # Includes fields providing the configuration for each RPC in this service.
1080
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1081
+ # the following configuration fields:
1082
+ #
1083
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1084
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1085
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1086
+ # include the following keys:
1087
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1088
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1089
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1090
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1091
+ # trigger a retry.
1092
+ #
1093
+ class Rpcs
1094
+ ##
1095
+ # RPC-specific configuration for `list_entity_types`
1096
+ # @return [::Gapic::Config::Method]
1097
+ #
1098
+ attr_reader :list_entity_types
1099
+ ##
1100
+ # RPC-specific configuration for `get_entity_type`
1101
+ # @return [::Gapic::Config::Method]
1102
+ #
1103
+ attr_reader :get_entity_type
1104
+ ##
1105
+ # RPC-specific configuration for `create_entity_type`
1106
+ # @return [::Gapic::Config::Method]
1107
+ #
1108
+ attr_reader :create_entity_type
1109
+ ##
1110
+ # RPC-specific configuration for `update_entity_type`
1111
+ # @return [::Gapic::Config::Method]
1112
+ #
1113
+ attr_reader :update_entity_type
1114
+ ##
1115
+ # RPC-specific configuration for `delete_entity_type`
1116
+ # @return [::Gapic::Config::Method]
1117
+ #
1118
+ attr_reader :delete_entity_type
1119
+ ##
1120
+ # RPC-specific configuration for `batch_update_entity_types`
1121
+ # @return [::Gapic::Config::Method]
1122
+ #
1123
+ attr_reader :batch_update_entity_types
1124
+ ##
1125
+ # RPC-specific configuration for `batch_delete_entity_types`
1126
+ # @return [::Gapic::Config::Method]
1127
+ #
1128
+ attr_reader :batch_delete_entity_types
1129
+ ##
1130
+ # RPC-specific configuration for `batch_create_entities`
1131
+ # @return [::Gapic::Config::Method]
1132
+ #
1133
+ attr_reader :batch_create_entities
1134
+ ##
1135
+ # RPC-specific configuration for `batch_update_entities`
1136
+ # @return [::Gapic::Config::Method]
1137
+ #
1138
+ attr_reader :batch_update_entities
1139
+ ##
1140
+ # RPC-specific configuration for `batch_delete_entities`
1141
+ # @return [::Gapic::Config::Method]
1142
+ #
1143
+ attr_reader :batch_delete_entities
1144
+
1145
+ # @private
1146
+ def initialize parent_rpcs = nil
1147
+ list_entity_types_config = parent_rpcs.list_entity_types if parent_rpcs.respond_to? :list_entity_types
1148
+ @list_entity_types = ::Gapic::Config::Method.new list_entity_types_config
1149
+ get_entity_type_config = parent_rpcs.get_entity_type if parent_rpcs.respond_to? :get_entity_type
1150
+ @get_entity_type = ::Gapic::Config::Method.new get_entity_type_config
1151
+ create_entity_type_config = parent_rpcs.create_entity_type if parent_rpcs.respond_to? :create_entity_type
1152
+ @create_entity_type = ::Gapic::Config::Method.new create_entity_type_config
1153
+ update_entity_type_config = parent_rpcs.update_entity_type if parent_rpcs.respond_to? :update_entity_type
1154
+ @update_entity_type = ::Gapic::Config::Method.new update_entity_type_config
1155
+ delete_entity_type_config = parent_rpcs.delete_entity_type if parent_rpcs.respond_to? :delete_entity_type
1156
+ @delete_entity_type = ::Gapic::Config::Method.new delete_entity_type_config
1157
+ batch_update_entity_types_config = parent_rpcs.batch_update_entity_types if parent_rpcs.respond_to? :batch_update_entity_types
1158
+ @batch_update_entity_types = ::Gapic::Config::Method.new batch_update_entity_types_config
1159
+ batch_delete_entity_types_config = parent_rpcs.batch_delete_entity_types if parent_rpcs.respond_to? :batch_delete_entity_types
1160
+ @batch_delete_entity_types = ::Gapic::Config::Method.new batch_delete_entity_types_config
1161
+ batch_create_entities_config = parent_rpcs.batch_create_entities if parent_rpcs.respond_to? :batch_create_entities
1162
+ @batch_create_entities = ::Gapic::Config::Method.new batch_create_entities_config
1163
+ batch_update_entities_config = parent_rpcs.batch_update_entities if parent_rpcs.respond_to? :batch_update_entities
1164
+ @batch_update_entities = ::Gapic::Config::Method.new batch_update_entities_config
1165
+ batch_delete_entities_config = parent_rpcs.batch_delete_entities if parent_rpcs.respond_to? :batch_delete_entities
1166
+ @batch_delete_entities = ::Gapic::Config::Method.new batch_delete_entities_config
1167
+
1168
+ yield self if block_given?
1169
+ end
1170
+ end
1171
+ end
1172
+ end
1173
+ end
1174
+ end
1175
+ end
1176
+ end
1177
+ end
1178
+ end