google-cloud-dialogflow-cx-v3 0.13.0 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/client.rb +1032 -0
  4. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/operations.rb +815 -0
  5. data/lib/google/cloud/dialogflow/cx/v3/agents/rest/service_stub.rb +586 -0
  6. data/lib/google/cloud/dialogflow/cx/v3/agents/rest.rb +56 -0
  7. data/lib/google/cloud/dialogflow/cx/v3/agents.rb +6 -0
  8. data/lib/google/cloud/dialogflow/cx/v3/bindings_override.rb +104 -0
  9. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/client.rb +472 -0
  10. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest/service_stub.rb +168 -0
  11. data/lib/google/cloud/dialogflow/cx/v3/changelogs/rest.rb +55 -0
  12. data/lib/google/cloud/dialogflow/cx/v3/changelogs.rb +6 -0
  13. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/client.rb +456 -0
  14. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest/service_stub.rb +168 -0
  15. data/lib/google/cloud/dialogflow/cx/v3/deployments/rest.rb +55 -0
  16. data/lib/google/cloud/dialogflow/cx/v3/deployments.rb +6 -0
  17. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/client.rb +740 -0
  18. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest/service_stub.rb +347 -0
  19. data/lib/google/cloud/dialogflow/cx/v3/entity_types/rest.rb +55 -0
  20. data/lib/google/cloud/dialogflow/cx/v3/entity_types.rb +6 -0
  21. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/client.rb +1028 -0
  22. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/operations.rb +815 -0
  23. data/lib/google/cloud/dialogflow/cx/v3/environments/rest/service_stub.rb +585 -0
  24. data/lib/google/cloud/dialogflow/cx/v3/environments/rest.rb +57 -0
  25. data/lib/google/cloud/dialogflow/cx/v3/environments.rb +6 -0
  26. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/client.rb +821 -0
  27. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest/service_stub.rb +467 -0
  28. data/lib/google/cloud/dialogflow/cx/v3/experiments/rest.rb +55 -0
  29. data/lib/google/cloud/dialogflow/cx/v3/experiments.rb +6 -0
  30. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/client.rb +1182 -0
  31. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/operations.rb +815 -0
  32. data/lib/google/cloud/dialogflow/cx/v3/flows/rest/service_stub.rb +646 -0
  33. data/lib/google/cloud/dialogflow/cx/v3/flows/rest.rb +56 -0
  34. data/lib/google/cloud/dialogflow/cx/v3/flows.rb +6 -0
  35. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/client.rb +722 -0
  36. data/lib/google/cloud/dialogflow/cx/v3/intents/rest/service_stub.rb +347 -0
  37. data/lib/google/cloud/dialogflow/cx/v3/intents/rest.rb +55 -0
  38. data/lib/google/cloud/dialogflow/cx/v3/intents.rb +6 -0
  39. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/client.rb +777 -0
  40. data/lib/google/cloud/dialogflow/cx/v3/pages/rest/service_stub.rb +347 -0
  41. data/lib/google/cloud/dialogflow/cx/v3/pages/rest.rb +55 -0
  42. data/lib/google/cloud/dialogflow/cx/v3/pages.rb +6 -0
  43. data/lib/google/cloud/dialogflow/cx/v3/rest.rb +55 -0
  44. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/client.rb +673 -0
  45. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest/service_stub.rb +347 -0
  46. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service/rest.rb +55 -0
  47. data/lib/google/cloud/dialogflow/cx/v3/security_settings_service.rb +6 -0
  48. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/client.rb +688 -0
  49. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest/service_stub.rb +384 -0
  50. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types/rest.rb +56 -0
  51. data/lib/google/cloud/dialogflow/cx/v3/session_entity_types.rb +6 -0
  52. data/lib/google/cloud/dialogflow/cx/v3/session_pb.rb +1 -0
  53. data/lib/google/cloud/dialogflow/cx/v3/sessions/client.rb +3 -1
  54. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/client.rb +576 -0
  55. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest/service_stub.rb +254 -0
  56. data/lib/google/cloud/dialogflow/cx/v3/sessions/rest.rb +58 -0
  57. data/lib/google/cloud/dialogflow/cx/v3/sessions.rb +6 -0
  58. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/client.rb +1304 -0
  59. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/operations.rb +815 -0
  60. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest/service_stub.rb +765 -0
  61. data/lib/google/cloud/dialogflow/cx/v3/test_cases/rest.rb +57 -0
  62. data/lib/google/cloud/dialogflow/cx/v3/test_cases.rb +6 -0
  63. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/client.rb +748 -0
  64. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest/service_stub.rb +347 -0
  65. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups/rest.rb +56 -0
  66. data/lib/google/cloud/dialogflow/cx/v3/transition_route_groups.rb +6 -0
  67. data/lib/google/cloud/dialogflow/cx/v3/version.rb +1 -1
  68. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/client.rb +865 -0
  69. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/operations.rb +815 -0
  70. data/lib/google/cloud/dialogflow/cx/v3/versions/rest/service_stub.rb +467 -0
  71. data/lib/google/cloud/dialogflow/cx/v3/versions/rest.rb +56 -0
  72. data/lib/google/cloud/dialogflow/cx/v3/versions.rb +6 -0
  73. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/client.rb +677 -0
  74. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest/service_stub.rb +347 -0
  75. data/lib/google/cloud/dialogflow/cx/v3/webhooks/rest.rb +55 -0
  76. data/lib/google/cloud/dialogflow/cx/v3/webhooks.rb +6 -0
  77. data/lib/google/cloud/dialogflow/cx/v3.rb +5 -0
  78. data/proto_docs/google/cloud/dialogflow/cx/v3/session.rb +3 -0
  79. metadata +61 -5
@@ -0,0 +1,821 @@
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/cx/v3/experiment_pb"
21
+ require "google/cloud/dialogflow/cx/v3/experiments/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Dialogflow
27
+ module CX
28
+ module V3
29
+ module Experiments
30
+ module Rest
31
+ ##
32
+ # REST client for the Experiments service.
33
+ #
34
+ # Service for managing {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiments}.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :experiments_stub
41
+
42
+ ##
43
+ # Configure the Experiments Client class.
44
+ #
45
+ # See {::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all Experiments clients
51
+ # ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "Dialogflow", "CX", "V3"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 60.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the Experiments Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # Create a new Experiments REST client object.
104
+ #
105
+ # @example
106
+ #
107
+ # # Create a client using the default configuration
108
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new
109
+ #
110
+ # # Create a client using a custom configuration
111
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config|
112
+ # config.timeout = 10.0
113
+ # end
114
+ #
115
+ # @yield [config] Configure the Experiments client.
116
+ # @yieldparam config [Client::Configuration]
117
+ #
118
+ def initialize
119
+ # Create the configuration object
120
+ @config = Configuration.new Client.configure
121
+
122
+ # Yield the configuration if needed
123
+ yield @config if block_given?
124
+
125
+ # Create credentials
126
+ credentials = @config.credentials
127
+ # Use self-signed JWT if the endpoint is unchanged from default,
128
+ # but only if the default endpoint does not have a region prefix.
129
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
130
+ !@config.endpoint.split(".").first.include?("-")
131
+ credentials ||= Credentials.default scope: @config.scope,
132
+ enable_self_signed_jwt: enable_self_signed_jwt
133
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
134
+ credentials = Credentials.new credentials, scope: @config.scope
135
+ end
136
+
137
+ @quota_project_id = @config.quota_project
138
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
139
+
140
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
141
+ config.credentials = credentials
142
+ config.quota_project = @quota_project_id
143
+ config.endpoint = @config.endpoint
144
+ config.bindings_override = @config.bindings_override
145
+ end
146
+
147
+ @experiments_stub = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
148
+ end
149
+
150
+ ##
151
+ # Get the associated client for mix-in of the Locations.
152
+ #
153
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
154
+ #
155
+ attr_reader :location_client
156
+
157
+ # Service calls
158
+
159
+ ##
160
+ # Returns the list of all experiments in the specified
161
+ # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}.
162
+ #
163
+ # @overload list_experiments(request, options = nil)
164
+ # Pass arguments to `list_experiments` via a request object, either of type
165
+ # {::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest} or an equivalent Hash.
166
+ #
167
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest, ::Hash]
168
+ # A request object representing the call parameters. Required. To specify no
169
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
170
+ # @param options [::Gapic::CallOptions, ::Hash]
171
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
172
+ #
173
+ # @overload list_experiments(parent: nil, page_size: nil, page_token: nil)
174
+ # Pass arguments to `list_experiments` via keyword arguments. Note that at
175
+ # least one keyword argument is required. To specify no parameters, or to keep all
176
+ # the default parameter values, pass an empty Hash as a request object (see above).
177
+ #
178
+ # @param parent [::String]
179
+ # Required. The {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to
180
+ # list all environments for. Format: `projects/<Project
181
+ # ID>/locations/<Location ID>/agents/<Agent ID>/environments/<Environment
182
+ # ID>`.
183
+ # @param page_size [::Integer]
184
+ # The maximum number of items to return in a single page. By default 20 and
185
+ # at most 100.
186
+ # @param page_token [::String]
187
+ # The next_page_token value returned from a previous list request.
188
+ # @yield [result, operation] Access the result along with the TransportOperation object
189
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>]
190
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
191
+ #
192
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::CX::V3::Experiment>]
193
+ #
194
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
195
+ def list_experiments request, options = nil
196
+ raise ::ArgumentError, "request must be provided" if request.nil?
197
+
198
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::ListExperimentsRequest
199
+
200
+ # Converts hash and nil to an options object
201
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
202
+
203
+ # Customize the options with defaults
204
+ call_metadata = @config.rpcs.list_experiments.metadata.to_h
205
+
206
+ # Set x-goog-api-client and x-goog-user-project headers
207
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
208
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
209
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
210
+ transports_version_send: [:rest]
211
+
212
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
213
+
214
+ options.apply_defaults timeout: @config.rpcs.list_experiments.timeout,
215
+ metadata: call_metadata,
216
+ retry_policy: @config.rpcs.list_experiments.retry_policy
217
+
218
+ options.apply_defaults timeout: @config.timeout,
219
+ metadata: @config.metadata,
220
+ retry_policy: @config.retry_policy
221
+
222
+ @experiments_stub.list_experiments request, options do |result, operation|
223
+ result = ::Gapic::Rest::PagedEnumerable.new @experiments_stub, :list_experiments, "experiments", request, result, options
224
+ yield result, operation if block_given?
225
+ return result
226
+ end
227
+ rescue ::Gapic::Rest::Error => e
228
+ raise ::Google::Cloud::Error.from_error(e)
229
+ end
230
+
231
+ ##
232
+ # Retrieves the specified
233
+ # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}.
234
+ #
235
+ # @overload get_experiment(request, options = nil)
236
+ # Pass arguments to `get_experiment` via a request object, either of type
237
+ # {::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest} or an equivalent Hash.
238
+ #
239
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest, ::Hash]
240
+ # A request object representing the call parameters. Required. To specify no
241
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
242
+ # @param options [::Gapic::CallOptions, ::Hash]
243
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
244
+ #
245
+ # @overload get_experiment(name: nil)
246
+ # Pass arguments to `get_experiment` via keyword arguments. Note that at
247
+ # least one keyword argument is required. To specify no parameters, or to keep all
248
+ # the default parameter values, pass an empty Hash as a request object (see above).
249
+ #
250
+ # @param name [::String]
251
+ # Required. The name of the
252
+ # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}. Format:
253
+ # `projects/<Project ID>/locations/<Location ID>/agents/<Agent
254
+ # ID>/environments/<Environment ID>/experiments/<Experiment ID>`.
255
+ # @yield [result, operation] Access the result along with the TransportOperation object
256
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment]
257
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
258
+ #
259
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment]
260
+ #
261
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
262
+ def get_experiment request, options = nil
263
+ raise ::ArgumentError, "request must be provided" if request.nil?
264
+
265
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::GetExperimentRequest
266
+
267
+ # Converts hash and nil to an options object
268
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
269
+
270
+ # Customize the options with defaults
271
+ call_metadata = @config.rpcs.get_experiment.metadata.to_h
272
+
273
+ # Set x-goog-api-client and x-goog-user-project headers
274
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
275
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
276
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
277
+ transports_version_send: [:rest]
278
+
279
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
280
+
281
+ options.apply_defaults timeout: @config.rpcs.get_experiment.timeout,
282
+ metadata: call_metadata,
283
+ retry_policy: @config.rpcs.get_experiment.retry_policy
284
+
285
+ options.apply_defaults timeout: @config.timeout,
286
+ metadata: @config.metadata,
287
+ retry_policy: @config.retry_policy
288
+
289
+ @experiments_stub.get_experiment request, options do |result, operation|
290
+ yield result, operation if block_given?
291
+ return result
292
+ end
293
+ rescue ::Gapic::Rest::Error => e
294
+ raise ::Google::Cloud::Error.from_error(e)
295
+ end
296
+
297
+ ##
298
+ # Creates an {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment} in the
299
+ # specified {::Google::Cloud::Dialogflow::CX::V3::Environment Environment}.
300
+ #
301
+ # @overload create_experiment(request, options = nil)
302
+ # Pass arguments to `create_experiment` via a request object, either of type
303
+ # {::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest} or an equivalent Hash.
304
+ #
305
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest, ::Hash]
306
+ # A request object representing the call parameters. Required. To specify no
307
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
308
+ # @param options [::Gapic::CallOptions, ::Hash]
309
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
310
+ #
311
+ # @overload create_experiment(parent: nil, experiment: nil)
312
+ # Pass arguments to `create_experiment` via keyword arguments. Note that at
313
+ # least one keyword argument is required. To specify no parameters, or to keep all
314
+ # the default parameter values, pass an empty Hash as a request object (see above).
315
+ #
316
+ # @param parent [::String]
317
+ # Required. The {::Google::Cloud::Dialogflow::CX::V3::Agent Agent} to create an
318
+ # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} for. Format:
319
+ # `projects/<Project ID>/locations/<Location ID>/agents/<Agent
320
+ # ID>/environments/<Environment ID>`.
321
+ # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash]
322
+ # Required. The experiment to create.
323
+ # @yield [result, operation] Access the result along with the TransportOperation object
324
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment]
325
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
326
+ #
327
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment]
328
+ #
329
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
330
+ def create_experiment request, options = nil
331
+ raise ::ArgumentError, "request must be provided" if request.nil?
332
+
333
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::CreateExperimentRequest
334
+
335
+ # Converts hash and nil to an options object
336
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
337
+
338
+ # Customize the options with defaults
339
+ call_metadata = @config.rpcs.create_experiment.metadata.to_h
340
+
341
+ # Set x-goog-api-client and x-goog-user-project headers
342
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
343
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
344
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
345
+ transports_version_send: [:rest]
346
+
347
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
348
+
349
+ options.apply_defaults timeout: @config.rpcs.create_experiment.timeout,
350
+ metadata: call_metadata,
351
+ retry_policy: @config.rpcs.create_experiment.retry_policy
352
+
353
+ options.apply_defaults timeout: @config.timeout,
354
+ metadata: @config.metadata,
355
+ retry_policy: @config.retry_policy
356
+
357
+ @experiments_stub.create_experiment request, options do |result, operation|
358
+ yield result, operation if block_given?
359
+ return result
360
+ end
361
+ rescue ::Gapic::Rest::Error => e
362
+ raise ::Google::Cloud::Error.from_error(e)
363
+ end
364
+
365
+ ##
366
+ # Updates the specified
367
+ # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}.
368
+ #
369
+ # @overload update_experiment(request, options = nil)
370
+ # Pass arguments to `update_experiment` via a request object, either of type
371
+ # {::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest} or an equivalent Hash.
372
+ #
373
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest, ::Hash]
374
+ # A request object representing the call parameters. Required. To specify no
375
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
376
+ # @param options [::Gapic::CallOptions, ::Hash]
377
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
378
+ #
379
+ # @overload update_experiment(experiment: nil, update_mask: nil)
380
+ # Pass arguments to `update_experiment` via keyword arguments. Note that at
381
+ # least one keyword argument is required. To specify no parameters, or to keep all
382
+ # the default parameter values, pass an empty Hash as a request object (see above).
383
+ #
384
+ # @param experiment [::Google::Cloud::Dialogflow::CX::V3::Experiment, ::Hash]
385
+ # Required. The experiment to update.
386
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
387
+ # Required. The mask to control which fields get updated.
388
+ # @yield [result, operation] Access the result along with the TransportOperation object
389
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment]
390
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
391
+ #
392
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment]
393
+ #
394
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
395
+ def update_experiment request, options = nil
396
+ raise ::ArgumentError, "request must be provided" if request.nil?
397
+
398
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::UpdateExperimentRequest
399
+
400
+ # Converts hash and nil to an options object
401
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
402
+
403
+ # Customize the options with defaults
404
+ call_metadata = @config.rpcs.update_experiment.metadata.to_h
405
+
406
+ # Set x-goog-api-client and x-goog-user-project headers
407
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
408
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
409
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
410
+ transports_version_send: [:rest]
411
+
412
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
413
+
414
+ options.apply_defaults timeout: @config.rpcs.update_experiment.timeout,
415
+ metadata: call_metadata,
416
+ retry_policy: @config.rpcs.update_experiment.retry_policy
417
+
418
+ options.apply_defaults timeout: @config.timeout,
419
+ metadata: @config.metadata,
420
+ retry_policy: @config.retry_policy
421
+
422
+ @experiments_stub.update_experiment request, options do |result, operation|
423
+ yield result, operation if block_given?
424
+ return result
425
+ end
426
+ rescue ::Gapic::Rest::Error => e
427
+ raise ::Google::Cloud::Error.from_error(e)
428
+ end
429
+
430
+ ##
431
+ # Deletes the specified
432
+ # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}.
433
+ #
434
+ # @overload delete_experiment(request, options = nil)
435
+ # Pass arguments to `delete_experiment` via a request object, either of type
436
+ # {::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest} or an equivalent Hash.
437
+ #
438
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest, ::Hash]
439
+ # A request object representing the call parameters. Required. To specify no
440
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
441
+ # @param options [::Gapic::CallOptions, ::Hash]
442
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
443
+ #
444
+ # @overload delete_experiment(name: nil)
445
+ # Pass arguments to `delete_experiment` via keyword arguments. Note that at
446
+ # least one keyword argument is required. To specify no parameters, or to keep all
447
+ # the default parameter values, pass an empty Hash as a request object (see above).
448
+ #
449
+ # @param name [::String]
450
+ # Required. The name of the
451
+ # {::Google::Cloud::Dialogflow::CX::V3::Environment Environment} to delete. Format:
452
+ # `projects/<Project ID>/locations/<Location ID>/agents/<Agent
453
+ # ID>/environments/<Environment ID>/experiments/<Experiment ID>`.
454
+ # @yield [result, operation] Access the result along with the TransportOperation object
455
+ # @yieldparam result [::Google::Protobuf::Empty]
456
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
457
+ #
458
+ # @return [::Google::Protobuf::Empty]
459
+ #
460
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
461
+ def delete_experiment request, options = nil
462
+ raise ::ArgumentError, "request must be provided" if request.nil?
463
+
464
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::DeleteExperimentRequest
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
+ call_metadata = @config.rpcs.delete_experiment.metadata.to_h
471
+
472
+ # Set x-goog-api-client and x-goog-user-project headers
473
+ call_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::CX::V3::VERSION,
476
+ transports_version_send: [:rest]
477
+
478
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
479
+
480
+ options.apply_defaults timeout: @config.rpcs.delete_experiment.timeout,
481
+ metadata: call_metadata,
482
+ retry_policy: @config.rpcs.delete_experiment.retry_policy
483
+
484
+ options.apply_defaults timeout: @config.timeout,
485
+ metadata: @config.metadata,
486
+ retry_policy: @config.retry_policy
487
+
488
+ @experiments_stub.delete_experiment request, options do |result, operation|
489
+ yield result, operation if block_given?
490
+ return result
491
+ end
492
+ rescue ::Gapic::Rest::Error => e
493
+ raise ::Google::Cloud::Error.from_error(e)
494
+ end
495
+
496
+ ##
497
+ # Starts the specified
498
+ # {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}. This rpc only
499
+ # changes the state of experiment from PENDING to RUNNING.
500
+ #
501
+ # @overload start_experiment(request, options = nil)
502
+ # Pass arguments to `start_experiment` via a request object, either of type
503
+ # {::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest} or an equivalent Hash.
504
+ #
505
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest, ::Hash]
506
+ # A request object representing the call parameters. Required. To specify no
507
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
508
+ # @param options [::Gapic::CallOptions, ::Hash]
509
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
510
+ #
511
+ # @overload start_experiment(name: nil)
512
+ # Pass arguments to `start_experiment` via keyword arguments. Note that at
513
+ # least one keyword argument is required. To specify no parameters, or to keep all
514
+ # the default parameter values, pass an empty Hash as a request object (see above).
515
+ #
516
+ # @param name [::String]
517
+ # Required. Resource name of the experiment to start.
518
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
519
+ # ID>/environments/<Environment ID>/experiments/<Experiment ID>`.
520
+ # @yield [result, operation] Access the result along with the TransportOperation object
521
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment]
522
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
523
+ #
524
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment]
525
+ #
526
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
527
+ def start_experiment request, options = nil
528
+ raise ::ArgumentError, "request must be provided" if request.nil?
529
+
530
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StartExperimentRequest
531
+
532
+ # Converts hash and nil to an options object
533
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
534
+
535
+ # Customize the options with defaults
536
+ call_metadata = @config.rpcs.start_experiment.metadata.to_h
537
+
538
+ # Set x-goog-api-client and x-goog-user-project headers
539
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
540
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
541
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
542
+ transports_version_send: [:rest]
543
+
544
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
545
+
546
+ options.apply_defaults timeout: @config.rpcs.start_experiment.timeout,
547
+ metadata: call_metadata,
548
+ retry_policy: @config.rpcs.start_experiment.retry_policy
549
+
550
+ options.apply_defaults timeout: @config.timeout,
551
+ metadata: @config.metadata,
552
+ retry_policy: @config.retry_policy
553
+
554
+ @experiments_stub.start_experiment request, options do |result, operation|
555
+ yield result, operation if block_given?
556
+ return result
557
+ end
558
+ rescue ::Gapic::Rest::Error => e
559
+ raise ::Google::Cloud::Error.from_error(e)
560
+ end
561
+
562
+ ##
563
+ # Stops the specified {::Google::Cloud::Dialogflow::CX::V3::Experiment Experiment}.
564
+ # This rpc only changes the state of experiment from RUNNING to DONE.
565
+ #
566
+ # @overload stop_experiment(request, options = nil)
567
+ # Pass arguments to `stop_experiment` via a request object, either of type
568
+ # {::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest} or an equivalent Hash.
569
+ #
570
+ # @param request [::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest, ::Hash]
571
+ # A request object representing the call parameters. Required. To specify no
572
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
573
+ # @param options [::Gapic::CallOptions, ::Hash]
574
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
575
+ #
576
+ # @overload stop_experiment(name: nil)
577
+ # Pass arguments to `stop_experiment` via keyword arguments. Note that at
578
+ # least one keyword argument is required. To specify no parameters, or to keep all
579
+ # the default parameter values, pass an empty Hash as a request object (see above).
580
+ #
581
+ # @param name [::String]
582
+ # Required. Resource name of the experiment to stop.
583
+ # Format: `projects/<Project ID>/locations/<Location ID>/agents/<Agent
584
+ # ID>/environments/<Environment ID>/experiments/<Experiment ID>`.
585
+ # @yield [result, operation] Access the result along with the TransportOperation object
586
+ # @yieldparam result [::Google::Cloud::Dialogflow::CX::V3::Experiment]
587
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
588
+ #
589
+ # @return [::Google::Cloud::Dialogflow::CX::V3::Experiment]
590
+ #
591
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
592
+ def stop_experiment request, options = nil
593
+ raise ::ArgumentError, "request must be provided" if request.nil?
594
+
595
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::CX::V3::StopExperimentRequest
596
+
597
+ # Converts hash and nil to an options object
598
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
599
+
600
+ # Customize the options with defaults
601
+ call_metadata = @config.rpcs.stop_experiment.metadata.to_h
602
+
603
+ # Set x-goog-api-client and x-goog-user-project headers
604
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
605
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
606
+ gapic_version: ::Google::Cloud::Dialogflow::CX::V3::VERSION,
607
+ transports_version_send: [:rest]
608
+
609
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
610
+
611
+ options.apply_defaults timeout: @config.rpcs.stop_experiment.timeout,
612
+ metadata: call_metadata,
613
+ retry_policy: @config.rpcs.stop_experiment.retry_policy
614
+
615
+ options.apply_defaults timeout: @config.timeout,
616
+ metadata: @config.metadata,
617
+ retry_policy: @config.retry_policy
618
+
619
+ @experiments_stub.stop_experiment request, options do |result, operation|
620
+ yield result, operation if block_given?
621
+ return result
622
+ end
623
+ rescue ::Gapic::Rest::Error => e
624
+ raise ::Google::Cloud::Error.from_error(e)
625
+ end
626
+
627
+ ##
628
+ # Configuration class for the Experiments REST API.
629
+ #
630
+ # This class represents the configuration for Experiments REST,
631
+ # providing control over timeouts, retry behavior, logging, transport
632
+ # parameters, and other low-level controls. Certain parameters can also be
633
+ # applied individually to specific RPCs. See
634
+ # {::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client::Configuration::Rpcs}
635
+ # for a list of RPCs that can be configured independently.
636
+ #
637
+ # Configuration can be applied globally to all clients, or to a single client
638
+ # on construction.
639
+ #
640
+ # @example
641
+ #
642
+ # # Modify the global config, setting the timeout for
643
+ # # list_experiments to 20 seconds,
644
+ # # and all remaining timeouts to 10 seconds.
645
+ # ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.configure do |config|
646
+ # config.timeout = 10.0
647
+ # config.rpcs.list_experiments.timeout = 20.0
648
+ # end
649
+ #
650
+ # # Apply the above configuration only to a new client.
651
+ # client = ::Google::Cloud::Dialogflow::CX::V3::Experiments::Rest::Client.new do |config|
652
+ # config.timeout = 10.0
653
+ # config.rpcs.list_experiments.timeout = 20.0
654
+ # end
655
+ #
656
+ # @!attribute [rw] endpoint
657
+ # The hostname or hostname:port of the service endpoint.
658
+ # Defaults to `"dialogflow.googleapis.com"`.
659
+ # @return [::String]
660
+ # @!attribute [rw] credentials
661
+ # Credentials to send with calls. You may provide any of the following types:
662
+ # * (`String`) The path to a service account key file in JSON format
663
+ # * (`Hash`) A service account key as a Hash
664
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
665
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
666
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
667
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
668
+ # * (`nil`) indicating no credentials
669
+ # @return [::Object]
670
+ # @!attribute [rw] scope
671
+ # The OAuth scopes
672
+ # @return [::Array<::String>]
673
+ # @!attribute [rw] lib_name
674
+ # The library name as recorded in instrumentation and logging
675
+ # @return [::String]
676
+ # @!attribute [rw] lib_version
677
+ # The library version as recorded in instrumentation and logging
678
+ # @return [::String]
679
+ # @!attribute [rw] timeout
680
+ # The call timeout in seconds.
681
+ # @return [::Numeric]
682
+ # @!attribute [rw] metadata
683
+ # Additional headers to be sent with the call.
684
+ # @return [::Hash{::Symbol=>::String}]
685
+ # @!attribute [rw] retry_policy
686
+ # The retry policy. The value is a hash with the following keys:
687
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
688
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
689
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
690
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
691
+ # trigger a retry.
692
+ # @return [::Hash]
693
+ # @!attribute [rw] quota_project
694
+ # A separate project against which to charge quota.
695
+ # @return [::String]
696
+ #
697
+ class Configuration
698
+ extend ::Gapic::Config
699
+
700
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
701
+ config_attr :credentials, nil do |value|
702
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
703
+ allowed.any? { |klass| klass === value }
704
+ end
705
+ config_attr :scope, nil, ::String, ::Array, nil
706
+ config_attr :lib_name, nil, ::String, nil
707
+ config_attr :lib_version, nil, ::String, nil
708
+ config_attr :timeout, nil, ::Numeric, nil
709
+ config_attr :metadata, nil, ::Hash, nil
710
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
711
+ config_attr :quota_project, nil, ::String, nil
712
+
713
+ # @private
714
+ # Overrides for http bindings for the RPCs of this service
715
+ # are only used when this service is used as mixin, and only
716
+ # by the host service.
717
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
718
+ config_attr :bindings_override, {}, ::Hash, nil
719
+
720
+ # @private
721
+ def initialize parent_config = nil
722
+ @parent_config = parent_config unless parent_config.nil?
723
+
724
+ yield self if block_given?
725
+ end
726
+
727
+ ##
728
+ # Configurations for individual RPCs
729
+ # @return [Rpcs]
730
+ #
731
+ def rpcs
732
+ @rpcs ||= begin
733
+ parent_rpcs = nil
734
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
735
+ Rpcs.new parent_rpcs
736
+ end
737
+ end
738
+
739
+ ##
740
+ # Configuration RPC class for the Experiments API.
741
+ #
742
+ # Includes fields providing the configuration for each RPC in this service.
743
+ # Each configuration object is of type `Gapic::Config::Method` and includes
744
+ # the following configuration fields:
745
+ #
746
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
747
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
748
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
749
+ # include the following keys:
750
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
751
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
752
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
753
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
754
+ # trigger a retry.
755
+ #
756
+ class Rpcs
757
+ ##
758
+ # RPC-specific configuration for `list_experiments`
759
+ # @return [::Gapic::Config::Method]
760
+ #
761
+ attr_reader :list_experiments
762
+ ##
763
+ # RPC-specific configuration for `get_experiment`
764
+ # @return [::Gapic::Config::Method]
765
+ #
766
+ attr_reader :get_experiment
767
+ ##
768
+ # RPC-specific configuration for `create_experiment`
769
+ # @return [::Gapic::Config::Method]
770
+ #
771
+ attr_reader :create_experiment
772
+ ##
773
+ # RPC-specific configuration for `update_experiment`
774
+ # @return [::Gapic::Config::Method]
775
+ #
776
+ attr_reader :update_experiment
777
+ ##
778
+ # RPC-specific configuration for `delete_experiment`
779
+ # @return [::Gapic::Config::Method]
780
+ #
781
+ attr_reader :delete_experiment
782
+ ##
783
+ # RPC-specific configuration for `start_experiment`
784
+ # @return [::Gapic::Config::Method]
785
+ #
786
+ attr_reader :start_experiment
787
+ ##
788
+ # RPC-specific configuration for `stop_experiment`
789
+ # @return [::Gapic::Config::Method]
790
+ #
791
+ attr_reader :stop_experiment
792
+
793
+ # @private
794
+ def initialize parent_rpcs = nil
795
+ list_experiments_config = parent_rpcs.list_experiments if parent_rpcs.respond_to? :list_experiments
796
+ @list_experiments = ::Gapic::Config::Method.new list_experiments_config
797
+ get_experiment_config = parent_rpcs.get_experiment if parent_rpcs.respond_to? :get_experiment
798
+ @get_experiment = ::Gapic::Config::Method.new get_experiment_config
799
+ create_experiment_config = parent_rpcs.create_experiment if parent_rpcs.respond_to? :create_experiment
800
+ @create_experiment = ::Gapic::Config::Method.new create_experiment_config
801
+ update_experiment_config = parent_rpcs.update_experiment if parent_rpcs.respond_to? :update_experiment
802
+ @update_experiment = ::Gapic::Config::Method.new update_experiment_config
803
+ delete_experiment_config = parent_rpcs.delete_experiment if parent_rpcs.respond_to? :delete_experiment
804
+ @delete_experiment = ::Gapic::Config::Method.new delete_experiment_config
805
+ start_experiment_config = parent_rpcs.start_experiment if parent_rpcs.respond_to? :start_experiment
806
+ @start_experiment = ::Gapic::Config::Method.new start_experiment_config
807
+ stop_experiment_config = parent_rpcs.stop_experiment if parent_rpcs.respond_to? :stop_experiment
808
+ @stop_experiment = ::Gapic::Config::Method.new stop_experiment_config
809
+
810
+ yield self if block_given?
811
+ end
812
+ end
813
+ end
814
+ end
815
+ end
816
+ end
817
+ end
818
+ end
819
+ end
820
+ end
821
+ end