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