google-cloud-dialogflow-v2 1.12.1 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/dialogflow/v2/agent_coaching_instruction_pb.rb +47 -0
  3. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +3 -1
  4. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +19 -0
  5. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +3 -1
  6. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +3 -1
  7. data/lib/google/cloud/dialogflow/v2/conversation_model_pb.rb +1 -1
  8. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +1 -1
  9. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +3 -1
  10. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +10 -1
  11. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +19 -0
  12. data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +10 -1
  13. data/lib/google/cloud/dialogflow/v2/document_pb.rb +1 -1
  14. data/lib/google/cloud/dialogflow/v2/generator_evaluation_pb.rb +82 -0
  15. data/lib/google/cloud/dialogflow/v2/generator_evaluation_services_pb.rb +51 -0
  16. data/lib/google/cloud/dialogflow/v2/generator_evaluations/client.rb +815 -0
  17. data/lib/google/cloud/dialogflow/v2/generator_evaluations/credentials.rb +52 -0
  18. data/lib/google/cloud/dialogflow/v2/generator_evaluations/operations.rb +841 -0
  19. data/lib/google/cloud/dialogflow/v2/generator_evaluations/paths.rb +92 -0
  20. data/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/client.rb +752 -0
  21. data/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/operations.rb +945 -0
  22. data/lib/google/cloud/dialogflow/v2/generator_evaluations/rest/service_stub.rb +326 -0
  23. data/lib/google/cloud/dialogflow/v2/generator_evaluations/rest.rb +54 -0
  24. data/lib/google/cloud/dialogflow/v2/generator_evaluations.rb +56 -0
  25. data/lib/google/cloud/dialogflow/v2/generator_pb.rb +18 -1
  26. data/lib/google/cloud/dialogflow/v2/generators/paths.rb +19 -0
  27. data/lib/google/cloud/dialogflow/v2/operations_pb.rb +45 -0
  28. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +3 -1
  29. data/lib/google/cloud/dialogflow/v2/rest.rb +3 -0
  30. data/lib/google/cloud/dialogflow/v2/sip_trunk_pb.rb +62 -0
  31. data/lib/google/cloud/dialogflow/v2/sip_trunk_services_pb.rb +53 -0
  32. data/lib/google/cloud/dialogflow/v2/sip_trunks/client.rb +885 -0
  33. data/lib/google/cloud/dialogflow/v2/sip_trunks/credentials.rb +52 -0
  34. data/lib/google/cloud/dialogflow/v2/sip_trunks/paths.rb +69 -0
  35. data/lib/google/cloud/dialogflow/v2/sip_trunks/rest/client.rb +815 -0
  36. data/lib/google/cloud/dialogflow/v2/sip_trunks/rest/service_stub.rb +388 -0
  37. data/lib/google/cloud/dialogflow/v2/sip_trunks/rest.rb +53 -0
  38. data/lib/google/cloud/dialogflow/v2/sip_trunks.rb +55 -0
  39. data/lib/google/cloud/dialogflow/v2/tool_call_pb.rb +52 -0
  40. data/lib/google/cloud/dialogflow/v2/tool_pb.rb +80 -0
  41. data/lib/google/cloud/dialogflow/v2/tool_services_pb.rb +55 -0
  42. data/lib/google/cloud/dialogflow/v2/tools/client.rb +897 -0
  43. data/lib/google/cloud/dialogflow/v2/tools/credentials.rb +52 -0
  44. data/lib/google/cloud/dialogflow/v2/tools/paths.rb +109 -0
  45. data/lib/google/cloud/dialogflow/v2/tools/rest/client.rb +827 -0
  46. data/lib/google/cloud/dialogflow/v2/tools/rest/service_stub.rb +388 -0
  47. data/lib/google/cloud/dialogflow/v2/tools/rest.rb +55 -0
  48. data/lib/google/cloud/dialogflow/v2/tools.rb +57 -0
  49. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  50. data/lib/google/cloud/dialogflow/v2/webhook_pb.rb +2 -1
  51. data/lib/google/cloud/dialogflow/v2.rb +3 -0
  52. data/proto_docs/google/cloud/dialogflow/v2/agent_coaching_instruction.rb +109 -0
  53. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +8 -3
  54. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +40 -0
  55. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +19 -2
  56. data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +2 -0
  57. data/proto_docs/google/cloud/dialogflow/v2/conversation_model.rb +12 -0
  58. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +38 -6
  59. data/proto_docs/google/cloud/dialogflow/v2/document.rb +3 -0
  60. data/proto_docs/google/cloud/dialogflow/v2/generator.rb +220 -4
  61. data/proto_docs/google/cloud/dialogflow/v2/generator_evaluation.rb +539 -0
  62. data/proto_docs/google/cloud/dialogflow/v2/operations.rb +39 -0
  63. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +70 -7
  64. data/proto_docs/google/cloud/dialogflow/v2/sip_trunk.rb +211 -0
  65. data/proto_docs/google/cloud/dialogflow/v2/tool.rb +552 -0
  66. data/proto_docs/google/cloud/dialogflow/v2/tool_call.rb +115 -0
  67. metadata +39 -1
@@ -0,0 +1,815 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/generator_evaluation_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Dialogflow
26
+ module V2
27
+ module GeneratorEvaluations
28
+ ##
29
+ # Client for the GeneratorEvaluations service.
30
+ #
31
+ # Service for managing generator evaluations.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "dialogflow.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :generator_evaluations_stub
44
+
45
+ ##
46
+ # Configure the GeneratorEvaluations Client class.
47
+ #
48
+ # See {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all GeneratorEvaluations clients
54
+ # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Dialogflow", "V2"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 60.0
75
+ default_config.retry_policy = {
76
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the GeneratorEvaluations Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @generator_evaluations_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new GeneratorEvaluations client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the GeneratorEvaluations client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/cloud/dialogflow/v2/generator_evaluation_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ config.universe_domain = @config.universe_domain
163
+ end
164
+
165
+ @generator_evaluations_stub = ::Gapic::ServiceStub.new(
166
+ ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Stub,
167
+ credentials: credentials,
168
+ endpoint: @config.endpoint,
169
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
+ universe_domain: @config.universe_domain,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @generator_evaluations_stub.stub_logger&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
187
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @generator_evaluations_stub.endpoint
191
+ config.universe_domain = @generator_evaluations_stub.universe_domain
192
+ config.logger = @generator_evaluations_stub.logger if config.respond_to? :logger=
193
+ end
194
+ end
195
+
196
+ ##
197
+ # Get the associated client for long-running operations.
198
+ #
199
+ # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Operations]
200
+ #
201
+ attr_reader :operations_client
202
+
203
+ ##
204
+ # Get the associated client for mix-in of the Locations.
205
+ #
206
+ # @return [Google::Cloud::Location::Locations::Client]
207
+ #
208
+ attr_reader :location_client
209
+
210
+ ##
211
+ # The logger used for request/response debug logging.
212
+ #
213
+ # @return [Logger]
214
+ #
215
+ def logger
216
+ @generator_evaluations_stub.logger
217
+ end
218
+
219
+ # Service calls
220
+
221
+ ##
222
+ # Creates evaluation of a generator.
223
+ #
224
+ # @overload create_generator_evaluation(request, options = nil)
225
+ # Pass arguments to `create_generator_evaluation` via a request object, either of type
226
+ # {::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest} or an equivalent Hash.
227
+ #
228
+ # @param request [::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest, ::Hash]
229
+ # A request object representing the call parameters. Required. To specify no
230
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
231
+ # @param options [::Gapic::CallOptions, ::Hash]
232
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
233
+ #
234
+ # @overload create_generator_evaluation(parent: nil, generator_evaluation: nil)
235
+ # Pass arguments to `create_generator_evaluation` via keyword arguments. Note that at
236
+ # least one keyword argument is required. To specify no parameters, or to keep all
237
+ # the default parameter values, pass an empty Hash as a request object (see above).
238
+ #
239
+ # @param parent [::String]
240
+ # Required. The generator resource name. Format:
241
+ # `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
242
+ # @param generator_evaluation [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation, ::Hash]
243
+ # Required. The generator evaluation to be created.
244
+ #
245
+ # @yield [response, operation] Access the result along with the RPC operation
246
+ # @yieldparam response [::Gapic::Operation]
247
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
248
+ #
249
+ # @return [::Gapic::Operation]
250
+ #
251
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
252
+ #
253
+ # @example Basic example
254
+ # require "google/cloud/dialogflow/v2"
255
+ #
256
+ # # Create a client object. The client can be reused for multiple calls.
257
+ # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new
258
+ #
259
+ # # Create a request. To set request fields, pass in keyword arguments.
260
+ # request = Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest.new
261
+ #
262
+ # # Call the create_generator_evaluation method.
263
+ # result = client.create_generator_evaluation request
264
+ #
265
+ # # The returned object is of type Gapic::Operation. You can use it to
266
+ # # check the status of an operation, cancel it, or wait for results.
267
+ # # Here is how to wait for a response.
268
+ # result.wait_until_done! timeout: 60
269
+ # if result.response?
270
+ # p result.response
271
+ # else
272
+ # puts "No response received."
273
+ # end
274
+ #
275
+ def create_generator_evaluation request, options = nil
276
+ raise ::ArgumentError, "request must be provided" if request.nil?
277
+
278
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateGeneratorEvaluationRequest
279
+
280
+ # Converts hash and nil to an options object
281
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
282
+
283
+ # Customize the options with defaults
284
+ metadata = @config.rpcs.create_generator_evaluation.metadata.to_h
285
+
286
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
287
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
288
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
289
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
290
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
291
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
292
+
293
+ header_params = {}
294
+ if request.parent
295
+ header_params["parent"] = request.parent
296
+ end
297
+
298
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
299
+ metadata[:"x-goog-request-params"] ||= request_params_header
300
+
301
+ options.apply_defaults timeout: @config.rpcs.create_generator_evaluation.timeout,
302
+ metadata: metadata,
303
+ retry_policy: @config.rpcs.create_generator_evaluation.retry_policy
304
+
305
+ options.apply_defaults timeout: @config.timeout,
306
+ metadata: @config.metadata,
307
+ retry_policy: @config.retry_policy
308
+
309
+ @generator_evaluations_stub.call_rpc :create_generator_evaluation, request, options: options do |response, operation|
310
+ response = ::Gapic::Operation.new response, @operations_client, options: options
311
+ yield response, operation if block_given?
312
+ throw :response, response
313
+ end
314
+ rescue ::GRPC::BadStatus => e
315
+ raise ::Google::Cloud::Error.from_error(e)
316
+ end
317
+
318
+ ##
319
+ # Gets an evaluation of generator.
320
+ #
321
+ # @overload get_generator_evaluation(request, options = nil)
322
+ # Pass arguments to `get_generator_evaluation` via a request object, either of type
323
+ # {::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest} or an equivalent Hash.
324
+ #
325
+ # @param request [::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest, ::Hash]
326
+ # A request object representing the call parameters. Required. To specify no
327
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
328
+ # @param options [::Gapic::CallOptions, ::Hash]
329
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
330
+ #
331
+ # @overload get_generator_evaluation(name: nil)
332
+ # Pass arguments to `get_generator_evaluation` via keyword arguments. Note that at
333
+ # least one keyword argument is required. To specify no parameters, or to keep all
334
+ # the default parameter values, pass an empty Hash as a request object (see above).
335
+ #
336
+ # @param name [::String]
337
+ # Required. The generator evaluation resource name. Format:
338
+ # `projects/<Project ID>/locations/<Location ID>/generators/<Generator
339
+ # ID>/evaluations/<Evaluation ID>`
340
+ #
341
+ # @yield [response, operation] Access the result along with the RPC operation
342
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation]
343
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
344
+ #
345
+ # @return [::Google::Cloud::Dialogflow::V2::GeneratorEvaluation]
346
+ #
347
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
348
+ #
349
+ # @example Basic example
350
+ # require "google/cloud/dialogflow/v2"
351
+ #
352
+ # # Create a client object. The client can be reused for multiple calls.
353
+ # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new
354
+ #
355
+ # # Create a request. To set request fields, pass in keyword arguments.
356
+ # request = Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest.new
357
+ #
358
+ # # Call the get_generator_evaluation method.
359
+ # result = client.get_generator_evaluation request
360
+ #
361
+ # # The returned object is of type Google::Cloud::Dialogflow::V2::GeneratorEvaluation.
362
+ # p result
363
+ #
364
+ def get_generator_evaluation request, options = nil
365
+ raise ::ArgumentError, "request must be provided" if request.nil?
366
+
367
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::GetGeneratorEvaluationRequest
368
+
369
+ # Converts hash and nil to an options object
370
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
371
+
372
+ # Customize the options with defaults
373
+ metadata = @config.rpcs.get_generator_evaluation.metadata.to_h
374
+
375
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
376
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
377
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
378
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
379
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
380
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
381
+
382
+ header_params = {}
383
+ if request.name
384
+ header_params["name"] = request.name
385
+ end
386
+
387
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
388
+ metadata[:"x-goog-request-params"] ||= request_params_header
389
+
390
+ options.apply_defaults timeout: @config.rpcs.get_generator_evaluation.timeout,
391
+ metadata: metadata,
392
+ retry_policy: @config.rpcs.get_generator_evaluation.retry_policy
393
+
394
+ options.apply_defaults timeout: @config.timeout,
395
+ metadata: @config.metadata,
396
+ retry_policy: @config.retry_policy
397
+
398
+ @generator_evaluations_stub.call_rpc :get_generator_evaluation, request, options: options do |response, operation|
399
+ yield response, operation if block_given?
400
+ end
401
+ rescue ::GRPC::BadStatus => e
402
+ raise ::Google::Cloud::Error.from_error(e)
403
+ end
404
+
405
+ ##
406
+ # Lists evaluations of generator.
407
+ #
408
+ # @overload list_generator_evaluations(request, options = nil)
409
+ # Pass arguments to `list_generator_evaluations` via a request object, either of type
410
+ # {::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest} or an equivalent Hash.
411
+ #
412
+ # @param request [::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest, ::Hash]
413
+ # A request object representing the call parameters. Required. To specify no
414
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
415
+ # @param options [::Gapic::CallOptions, ::Hash]
416
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
417
+ #
418
+ # @overload list_generator_evaluations(parent: nil, page_size: nil, page_token: nil)
419
+ # Pass arguments to `list_generator_evaluations` via keyword arguments. Note that at
420
+ # least one keyword argument is required. To specify no parameters, or to keep all
421
+ # the default parameter values, pass an empty Hash as a request object (see above).
422
+ #
423
+ # @param parent [::String]
424
+ # Required. The generator resource name. Format:
425
+ # `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>`
426
+ # Wildcard value `-` is supported on generator_id to list evaluations across
427
+ # all generators under same project.
428
+ # @param page_size [::Integer]
429
+ # Optional. Maximum number of evaluations to return in a
430
+ # single page. By default 100 and at most 1000.
431
+ # @param page_token [::String]
432
+ # Optional. The next_page_token value returned from a previous list request.
433
+ #
434
+ # @yield [response, operation] Access the result along with the RPC operation
435
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>]
436
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
437
+ #
438
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::GeneratorEvaluation>]
439
+ #
440
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
441
+ #
442
+ # @example Basic example
443
+ # require "google/cloud/dialogflow/v2"
444
+ #
445
+ # # Create a client object. The client can be reused for multiple calls.
446
+ # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new
447
+ #
448
+ # # Create a request. To set request fields, pass in keyword arguments.
449
+ # request = Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest.new
450
+ #
451
+ # # Call the list_generator_evaluations method.
452
+ # result = client.list_generator_evaluations request
453
+ #
454
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
455
+ # # over elements, and API calls will be issued to fetch pages as needed.
456
+ # result.each do |item|
457
+ # # Each element is of type ::Google::Cloud::Dialogflow::V2::GeneratorEvaluation.
458
+ # p item
459
+ # end
460
+ #
461
+ def list_generator_evaluations request, options = nil
462
+ raise ::ArgumentError, "request must be provided" if request.nil?
463
+
464
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListGeneratorEvaluationsRequest
465
+
466
+ # Converts hash and nil to an options object
467
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
468
+
469
+ # Customize the options with defaults
470
+ metadata = @config.rpcs.list_generator_evaluations.metadata.to_h
471
+
472
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
473
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
474
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
475
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
476
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
477
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
+
479
+ header_params = {}
480
+ if request.parent
481
+ header_params["parent"] = request.parent
482
+ end
483
+
484
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
485
+ metadata[:"x-goog-request-params"] ||= request_params_header
486
+
487
+ options.apply_defaults timeout: @config.rpcs.list_generator_evaluations.timeout,
488
+ metadata: metadata,
489
+ retry_policy: @config.rpcs.list_generator_evaluations.retry_policy
490
+
491
+ options.apply_defaults timeout: @config.timeout,
492
+ metadata: @config.metadata,
493
+ retry_policy: @config.retry_policy
494
+
495
+ @generator_evaluations_stub.call_rpc :list_generator_evaluations, request, options: options do |response, operation|
496
+ response = ::Gapic::PagedEnumerable.new @generator_evaluations_stub, :list_generator_evaluations, request, response, operation, options
497
+ yield response, operation if block_given?
498
+ throw :response, response
499
+ end
500
+ rescue ::GRPC::BadStatus => e
501
+ raise ::Google::Cloud::Error.from_error(e)
502
+ end
503
+
504
+ ##
505
+ # Deletes an evaluation of generator.
506
+ #
507
+ # @overload delete_generator_evaluation(request, options = nil)
508
+ # Pass arguments to `delete_generator_evaluation` via a request object, either of type
509
+ # {::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest} or an equivalent Hash.
510
+ #
511
+ # @param request [::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest, ::Hash]
512
+ # A request object representing the call parameters. Required. To specify no
513
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
514
+ # @param options [::Gapic::CallOptions, ::Hash]
515
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
516
+ #
517
+ # @overload delete_generator_evaluation(name: nil)
518
+ # Pass arguments to `delete_generator_evaluation` via keyword arguments. Note that at
519
+ # least one keyword argument is required. To specify no parameters, or to keep all
520
+ # the default parameter values, pass an empty Hash as a request object (see above).
521
+ #
522
+ # @param name [::String]
523
+ # Required. The generator evaluation resource name. Format:
524
+ # `projects/<Project ID>/locations/<Location ID>/generators/<Generator ID>/
525
+ # evaluations/<Evaluation ID>`
526
+ #
527
+ # @yield [response, operation] Access the result along with the RPC operation
528
+ # @yieldparam response [::Google::Protobuf::Empty]
529
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
530
+ #
531
+ # @return [::Google::Protobuf::Empty]
532
+ #
533
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
534
+ #
535
+ # @example Basic example
536
+ # require "google/cloud/dialogflow/v2"
537
+ #
538
+ # # Create a client object. The client can be reused for multiple calls.
539
+ # client = Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new
540
+ #
541
+ # # Create a request. To set request fields, pass in keyword arguments.
542
+ # request = Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest.new
543
+ #
544
+ # # Call the delete_generator_evaluation method.
545
+ # result = client.delete_generator_evaluation request
546
+ #
547
+ # # The returned object is of type Google::Protobuf::Empty.
548
+ # p result
549
+ #
550
+ def delete_generator_evaluation request, options = nil
551
+ raise ::ArgumentError, "request must be provided" if request.nil?
552
+
553
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::DeleteGeneratorEvaluationRequest
554
+
555
+ # Converts hash and nil to an options object
556
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
557
+
558
+ # Customize the options with defaults
559
+ metadata = @config.rpcs.delete_generator_evaluation.metadata.to_h
560
+
561
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
562
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
563
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
564
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
565
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
566
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
567
+
568
+ header_params = {}
569
+ if request.name
570
+ header_params["name"] = request.name
571
+ end
572
+
573
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
574
+ metadata[:"x-goog-request-params"] ||= request_params_header
575
+
576
+ options.apply_defaults timeout: @config.rpcs.delete_generator_evaluation.timeout,
577
+ metadata: metadata,
578
+ retry_policy: @config.rpcs.delete_generator_evaluation.retry_policy
579
+
580
+ options.apply_defaults timeout: @config.timeout,
581
+ metadata: @config.metadata,
582
+ retry_policy: @config.retry_policy
583
+
584
+ @generator_evaluations_stub.call_rpc :delete_generator_evaluation, request, options: options do |response, operation|
585
+ yield response, operation if block_given?
586
+ end
587
+ rescue ::GRPC::BadStatus => e
588
+ raise ::Google::Cloud::Error.from_error(e)
589
+ end
590
+
591
+ ##
592
+ # Configuration class for the GeneratorEvaluations API.
593
+ #
594
+ # This class represents the configuration for GeneratorEvaluations,
595
+ # providing control over timeouts, retry behavior, logging, transport
596
+ # parameters, and other low-level controls. Certain parameters can also be
597
+ # applied individually to specific RPCs. See
598
+ # {::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client::Configuration::Rpcs}
599
+ # for a list of RPCs that can be configured independently.
600
+ #
601
+ # Configuration can be applied globally to all clients, or to a single client
602
+ # on construction.
603
+ #
604
+ # @example
605
+ #
606
+ # # Modify the global config, setting the timeout for
607
+ # # create_generator_evaluation to 20 seconds,
608
+ # # and all remaining timeouts to 10 seconds.
609
+ # ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.configure do |config|
610
+ # config.timeout = 10.0
611
+ # config.rpcs.create_generator_evaluation.timeout = 20.0
612
+ # end
613
+ #
614
+ # # Apply the above configuration only to a new client.
615
+ # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config|
616
+ # config.timeout = 10.0
617
+ # config.rpcs.create_generator_evaluation.timeout = 20.0
618
+ # end
619
+ #
620
+ # @!attribute [rw] endpoint
621
+ # A custom service endpoint, as a hostname or hostname:port. The default is
622
+ # nil, indicating to use the default endpoint in the current universe domain.
623
+ # @return [::String,nil]
624
+ # @!attribute [rw] credentials
625
+ # Credentials to send with calls. You may provide any of the following types:
626
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
627
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
628
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
629
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
630
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
631
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
632
+ # * (`nil`) indicating no credentials
633
+ #
634
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
635
+ # is deprecated. Providing an unvalidated credential configuration to
636
+ # Google APIs can compromise the security of your systems and data.
637
+ #
638
+ # @example
639
+ #
640
+ # # The recommended way to provide credentials is to use the `make_creds` method
641
+ # # on the appropriate credentials class for your environment.
642
+ #
643
+ # require "googleauth"
644
+ #
645
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
646
+ # json_key_io: ::File.open("/path/to/keyfile.json")
647
+ # )
648
+ #
649
+ # client = ::Google::Cloud::Dialogflow::V2::GeneratorEvaluations::Client.new do |config|
650
+ # config.credentials = credentials
651
+ # end
652
+ #
653
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
654
+ # external source for authentication to Google Cloud, you must validate it before
655
+ # providing it to a Google API client library. Providing an unvalidated credential
656
+ # configuration to Google APIs can compromise the security of your systems and data.
657
+ # For more information, refer to [Validate credential configurations from external
658
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
659
+ # @return [::Object]
660
+ # @!attribute [rw] scope
661
+ # The OAuth scopes
662
+ # @return [::Array<::String>]
663
+ # @!attribute [rw] lib_name
664
+ # The library name as recorded in instrumentation and logging
665
+ # @return [::String]
666
+ # @!attribute [rw] lib_version
667
+ # The library version as recorded in instrumentation and logging
668
+ # @return [::String]
669
+ # @!attribute [rw] channel_args
670
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
671
+ # `GRPC::Core::Channel` object is provided as the credential.
672
+ # @return [::Hash]
673
+ # @!attribute [rw] interceptors
674
+ # An array of interceptors that are run before calls are executed.
675
+ # @return [::Array<::GRPC::ClientInterceptor>]
676
+ # @!attribute [rw] timeout
677
+ # The call timeout in seconds.
678
+ # @return [::Numeric]
679
+ # @!attribute [rw] metadata
680
+ # Additional gRPC headers to be sent with the call.
681
+ # @return [::Hash{::Symbol=>::String}]
682
+ # @!attribute [rw] retry_policy
683
+ # The retry policy. The value is a hash with the following keys:
684
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
685
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
686
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
687
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
688
+ # trigger a retry.
689
+ # @return [::Hash]
690
+ # @!attribute [rw] quota_project
691
+ # A separate project against which to charge quota.
692
+ # @return [::String]
693
+ # @!attribute [rw] universe_domain
694
+ # The universe domain within which to make requests. This determines the
695
+ # default endpoint URL. The default value of nil uses the environment
696
+ # universe (usually the default "googleapis.com" universe).
697
+ # @return [::String,nil]
698
+ # @!attribute [rw] logger
699
+ # A custom logger to use for request/response debug logging, or the value
700
+ # `:default` (the default) to construct a default logger, or `nil` to
701
+ # explicitly disable logging.
702
+ # @return [::Logger,:default,nil]
703
+ #
704
+ class Configuration
705
+ extend ::Gapic::Config
706
+
707
+ # @private
708
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
709
+ DEFAULT_ENDPOINT = "dialogflow.googleapis.com"
710
+
711
+ config_attr :endpoint, nil, ::String, nil
712
+ config_attr :credentials, nil do |value|
713
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
714
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
715
+ allowed.any? { |klass| klass === value }
716
+ end
717
+ config_attr :scope, nil, ::String, ::Array, nil
718
+ config_attr :lib_name, nil, ::String, nil
719
+ config_attr :lib_version, nil, ::String, nil
720
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
721
+ config_attr :interceptors, nil, ::Array, nil
722
+ config_attr :timeout, nil, ::Numeric, nil
723
+ config_attr :metadata, nil, ::Hash, nil
724
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
725
+ config_attr :quota_project, nil, ::String, nil
726
+ config_attr :universe_domain, nil, ::String, nil
727
+ config_attr :logger, :default, ::Logger, nil, :default
728
+
729
+ # @private
730
+ def initialize parent_config = nil
731
+ @parent_config = parent_config unless parent_config.nil?
732
+
733
+ yield self if block_given?
734
+ end
735
+
736
+ ##
737
+ # Configurations for individual RPCs
738
+ # @return [Rpcs]
739
+ #
740
+ def rpcs
741
+ @rpcs ||= begin
742
+ parent_rpcs = nil
743
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
744
+ Rpcs.new parent_rpcs
745
+ end
746
+ end
747
+
748
+ ##
749
+ # Configuration for the channel pool
750
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
751
+ #
752
+ def channel_pool
753
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
754
+ end
755
+
756
+ ##
757
+ # Configuration RPC class for the GeneratorEvaluations API.
758
+ #
759
+ # Includes fields providing the configuration for each RPC in this service.
760
+ # Each configuration object is of type `Gapic::Config::Method` and includes
761
+ # the following configuration fields:
762
+ #
763
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
764
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
765
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
766
+ # include the following keys:
767
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
768
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
769
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
770
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
771
+ # trigger a retry.
772
+ #
773
+ class Rpcs
774
+ ##
775
+ # RPC-specific configuration for `create_generator_evaluation`
776
+ # @return [::Gapic::Config::Method]
777
+ #
778
+ attr_reader :create_generator_evaluation
779
+ ##
780
+ # RPC-specific configuration for `get_generator_evaluation`
781
+ # @return [::Gapic::Config::Method]
782
+ #
783
+ attr_reader :get_generator_evaluation
784
+ ##
785
+ # RPC-specific configuration for `list_generator_evaluations`
786
+ # @return [::Gapic::Config::Method]
787
+ #
788
+ attr_reader :list_generator_evaluations
789
+ ##
790
+ # RPC-specific configuration for `delete_generator_evaluation`
791
+ # @return [::Gapic::Config::Method]
792
+ #
793
+ attr_reader :delete_generator_evaluation
794
+
795
+ # @private
796
+ def initialize parent_rpcs = nil
797
+ create_generator_evaluation_config = parent_rpcs.create_generator_evaluation if parent_rpcs.respond_to? :create_generator_evaluation
798
+ @create_generator_evaluation = ::Gapic::Config::Method.new create_generator_evaluation_config
799
+ get_generator_evaluation_config = parent_rpcs.get_generator_evaluation if parent_rpcs.respond_to? :get_generator_evaluation
800
+ @get_generator_evaluation = ::Gapic::Config::Method.new get_generator_evaluation_config
801
+ list_generator_evaluations_config = parent_rpcs.list_generator_evaluations if parent_rpcs.respond_to? :list_generator_evaluations
802
+ @list_generator_evaluations = ::Gapic::Config::Method.new list_generator_evaluations_config
803
+ delete_generator_evaluation_config = parent_rpcs.delete_generator_evaluation if parent_rpcs.respond_to? :delete_generator_evaluation
804
+ @delete_generator_evaluation = ::Gapic::Config::Method.new delete_generator_evaluation_config
805
+
806
+ yield self if block_given?
807
+ end
808
+ end
809
+ end
810
+ end
811
+ end
812
+ end
813
+ end
814
+ end
815
+ end