google-cloud-dialogflow-cx-v3 0.14.0 → 0.15.1

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