google-cloud-dialogflow-v2 0.22.0 → 0.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +1078 -0
  4. data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +813 -0
  5. data/lib/google/cloud/dialogflow/v2/agents/rest/service_stub.rb +652 -0
  6. data/lib/google/cloud/dialogflow/v2/agents/rest.rb +54 -0
  7. data/lib/google/cloud/dialogflow/v2/agents.rb +6 -0
  8. data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +463 -0
  9. data/lib/google/cloud/dialogflow/v2/answer_records/rest/service_stub.rb +182 -0
  10. data/lib/google/cloud/dialogflow/v2/answer_records/rest.rb +54 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_records.rb +6 -0
  12. data/lib/google/cloud/dialogflow/v2/bindings_override.rb +102 -0
  13. data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +753 -0
  14. data/lib/google/cloud/dialogflow/v2/contexts/rest/service_stub.rb +536 -0
  15. data/lib/google/cloud/dialogflow/v2/contexts/rest.rb +53 -0
  16. data/lib/google/cloud/dialogflow/v2/contexts.rb +6 -0
  17. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +714 -0
  18. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +813 -0
  19. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/service_stub.rb +367 -0
  20. data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest.rb +57 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_datasets.rb +6 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +1010 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +813 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_models/rest/service_stub.rb +642 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_models/rest.rb +54 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_models.rb +6 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +868 -0
  28. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +813 -0
  29. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/service_stub.rb +518 -0
  30. data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest.rb +55 -0
  31. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +6 -0
  32. data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +819 -0
  33. data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +450 -0
  34. data/lib/google/cloud/dialogflow/v2/conversations/rest.rb +54 -0
  35. data/lib/google/cloud/dialogflow/v2/conversations.rb +6 -0
  36. data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +1013 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +813 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/rest/service_stub.rb +631 -0
  39. data/lib/google/cloud/dialogflow/v2/documents/rest.rb +55 -0
  40. data/lib/google/cloud/dialogflow/v2/documents.rb +6 -0
  41. data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +1178 -0
  42. data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +813 -0
  43. data/lib/google/cloud/dialogflow/v2/entity_types/rest/service_stub.rb +722 -0
  44. data/lib/google/cloud/dialogflow/v2/entity_types/rest.rb +54 -0
  45. data/lib/google/cloud/dialogflow/v2/entity_types.rb +6 -0
  46. data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +779 -0
  47. data/lib/google/cloud/dialogflow/v2/environments/rest/service_stub.rb +448 -0
  48. data/lib/google/cloud/dialogflow/v2/environments/rest.rb +53 -0
  49. data/lib/google/cloud/dialogflow/v2/environments.rb +6 -0
  50. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +444 -0
  51. data/lib/google/cloud/dialogflow/v2/fulfillments/rest/service_stub.rb +182 -0
  52. data/lib/google/cloud/dialogflow/v2/fulfillments/rest.rb +53 -0
  53. data/lib/google/cloud/dialogflow/v2/fulfillments.rb +6 -0
  54. data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +914 -0
  55. data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +813 -0
  56. data/lib/google/cloud/dialogflow/v2/intents/rest/service_stub.rb +532 -0
  57. data/lib/google/cloud/dialogflow/v2/intents/rest.rb +54 -0
  58. data/lib/google/cloud/dialogflow/v2/intents.rb +6 -0
  59. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +696 -0
  60. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/service_stub.rb +419 -0
  61. data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest.rb +54 -0
  62. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +6 -0
  63. data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +955 -0
  64. data/lib/google/cloud/dialogflow/v2/participants/rest/service_stub.rb +588 -0
  65. data/lib/google/cloud/dialogflow/v2/participants/rest.rb +53 -0
  66. data/lib/google/cloud/dialogflow/v2/participants.rb +6 -0
  67. data/lib/google/cloud/dialogflow/v2/rest.rb +54 -0
  68. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +703 -0
  69. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/service_stub.rb +456 -0
  70. data/lib/google/cloud/dialogflow/v2/session_entity_types/rest.rb +54 -0
  71. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +6 -0
  72. data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +437 -0
  73. data/lib/google/cloud/dialogflow/v2/sessions/rest/service_stub.rb +132 -0
  74. data/lib/google/cloud/dialogflow/v2/sessions/rest.rb +56 -0
  75. data/lib/google/cloud/dialogflow/v2/sessions.rb +6 -0
  76. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  77. data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +686 -0
  78. data/lib/google/cloud/dialogflow/v2/versions/rest/service_stub.rb +382 -0
  79. data/lib/google/cloud/dialogflow/v2/versions/rest.rb +53 -0
  80. data/lib/google/cloud/dialogflow/v2/versions.rb +6 -0
  81. data/lib/google/cloud/dialogflow/v2.rb +5 -0
  82. metadata +66 -5
@@ -0,0 +1,54 @@
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 "gapic/rest"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/dialogflow/v2/version"
24
+ require "google/cloud/dialogflow/v2/bindings_override"
25
+
26
+ require "google/cloud/dialogflow/v2/agents/credentials"
27
+ require "google/cloud/dialogflow/v2/agents/paths"
28
+ require "google/cloud/dialogflow/v2/agents/rest/operations"
29
+ require "google/cloud/dialogflow/v2/agents/rest/client"
30
+
31
+ module Google
32
+ module Cloud
33
+ module Dialogflow
34
+ module V2
35
+ ##
36
+ # Service for managing {::Google::Cloud::Dialogflow::V2::Agent Agents}.
37
+ #
38
+ # To load this service and instantiate a REST client:
39
+ #
40
+ # require "google/cloud/dialogflow/v2/agents/rest"
41
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new
42
+ #
43
+ module Agents
44
+ # Client for the REST transport
45
+ module Rest
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+
53
+ helper_path = ::File.join __dir__, "rest", "helpers.rb"
54
+ require "google/cloud/dialogflow/v2/agents/rest/helpers" if ::File.file? helper_path
@@ -26,6 +26,7 @@ require "google/cloud/dialogflow/v2/agents/credentials"
26
26
  require "google/cloud/dialogflow/v2/agents/paths"
27
27
  require "google/cloud/dialogflow/v2/agents/operations"
28
28
  require "google/cloud/dialogflow/v2/agents/client"
29
+ require "google/cloud/dialogflow/v2/agents/rest"
29
30
 
30
31
  module Google
31
32
  module Cloud
@@ -39,6 +40,11 @@ module Google
39
40
  # require "google/cloud/dialogflow/v2/agents"
40
41
  # client = ::Google::Cloud::Dialogflow::V2::Agents::Client.new
41
42
  #
43
+ # @example Load this service and instantiate a REST client
44
+ #
45
+ # require "google/cloud/dialogflow/v2/agents/rest"
46
+ # client = ::Google::Cloud::Dialogflow::V2::Agents::Rest::Client.new
47
+ #
42
48
  module Agents
43
49
  end
44
50
  end
@@ -0,0 +1,463 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/dialogflow/v2/answer_record_pb"
21
+ require "google/cloud/dialogflow/v2/answer_records/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Dialogflow
27
+ module V2
28
+ module AnswerRecords
29
+ module Rest
30
+ ##
31
+ # REST client for the AnswerRecords service.
32
+ #
33
+ # Service for managing
34
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecord AnswerRecords}.
35
+ #
36
+ class Client
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :answer_records_stub
41
+
42
+ ##
43
+ # Configure the AnswerRecords Client class.
44
+ #
45
+ # See {::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all AnswerRecords clients
51
+ # ::Google::Cloud::Dialogflow::V2::AnswerRecords::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", "V2"]
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 AnswerRecords 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::V2::AnswerRecords::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 AnswerRecords REST client object.
104
+ #
105
+ # @example
106
+ #
107
+ # # Create a client using the default configuration
108
+ # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new
109
+ #
110
+ # # Create a client using a custom configuration
111
+ # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config|
112
+ # config.timeout = 10.0
113
+ # end
114
+ #
115
+ # @yield [config] Configure the AnswerRecords 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
+ @answer_records_stub = ::Google::Cloud::Dialogflow::V2::AnswerRecords::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 answer records in the specified project in reverse
161
+ # chronological order.
162
+ #
163
+ # @overload list_answer_records(request, options = nil)
164
+ # Pass arguments to `list_answer_records` via a request object, either of type
165
+ # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest} or an equivalent Hash.
166
+ #
167
+ # @param request [::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest, ::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_answer_records(parent: nil, filter: nil, page_size: nil, page_token: nil)
174
+ # Pass arguments to `list_answer_records` 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 project to list all answer records for in reverse
180
+ # chronological order. Format: `projects/<Project ID>/locations/<Location
181
+ # ID>`.
182
+ # @param filter [::String]
183
+ # Optional. Filters to restrict results to specific answer records.
184
+ #
185
+ # Marked deprecated as it hasn't been, and isn't currently, supported.
186
+ #
187
+ # For more information about filtering, see
188
+ # [API Filtering](https://aip.dev/160).
189
+ # @param page_size [::Integer]
190
+ # Optional. The maximum number of records to return in a single page.
191
+ # The server may return fewer records than this. If unspecified, we use 10.
192
+ # The maximum is 100.
193
+ # @param page_token [::String]
194
+ # Optional. The
195
+ # {::Google::Cloud::Dialogflow::V2::ListAnswerRecordsResponse#next_page_token ListAnswerRecordsResponse.next_page_token}
196
+ # value returned from a previous list request used to continue listing on
197
+ # the next page.
198
+ # @yield [result, operation] Access the result along with the TransportOperation object
199
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>]
200
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
201
+ #
202
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::AnswerRecord>]
203
+ #
204
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
205
+ def list_answer_records request, options = nil
206
+ raise ::ArgumentError, "request must be provided" if request.nil?
207
+
208
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListAnswerRecordsRequest
209
+
210
+ # Converts hash and nil to an options object
211
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
212
+
213
+ # Customize the options with defaults
214
+ call_metadata = @config.rpcs.list_answer_records.metadata.to_h
215
+
216
+ # Set x-goog-api-client and x-goog-user-project headers
217
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
218
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
219
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
220
+ transports_version_send: [:rest]
221
+
222
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
223
+
224
+ options.apply_defaults timeout: @config.rpcs.list_answer_records.timeout,
225
+ metadata: call_metadata,
226
+ retry_policy: @config.rpcs.list_answer_records.retry_policy
227
+
228
+ options.apply_defaults timeout: @config.timeout,
229
+ metadata: @config.metadata,
230
+ retry_policy: @config.retry_policy
231
+
232
+ @answer_records_stub.list_answer_records request, options do |result, operation|
233
+ result = ::Gapic::Rest::PagedEnumerable.new @answer_records_stub, :list_answer_records, "answer_records", request, result, options
234
+ yield result, operation if block_given?
235
+ return result
236
+ end
237
+ rescue ::Gapic::Rest::Error => e
238
+ raise ::Google::Cloud::Error.from_error(e)
239
+ end
240
+
241
+ ##
242
+ # Updates the specified answer record.
243
+ #
244
+ # @overload update_answer_record(request, options = nil)
245
+ # Pass arguments to `update_answer_record` via a request object, either of type
246
+ # {::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest} or an equivalent Hash.
247
+ #
248
+ # @param request [::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest, ::Hash]
249
+ # A request object representing the call parameters. Required. To specify no
250
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
251
+ # @param options [::Gapic::CallOptions, ::Hash]
252
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
253
+ #
254
+ # @overload update_answer_record(answer_record: nil, update_mask: nil)
255
+ # Pass arguments to `update_answer_record` via keyword arguments. Note that at
256
+ # least one keyword argument is required. To specify no parameters, or to keep all
257
+ # the default parameter values, pass an empty Hash as a request object (see above).
258
+ #
259
+ # @param answer_record [::Google::Cloud::Dialogflow::V2::AnswerRecord, ::Hash]
260
+ # Required. Answer record to update.
261
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
262
+ # Required. The mask to control which fields get updated.
263
+ # @yield [result, operation] Access the result along with the TransportOperation object
264
+ # @yieldparam result [::Google::Cloud::Dialogflow::V2::AnswerRecord]
265
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
266
+ #
267
+ # @return [::Google::Cloud::Dialogflow::V2::AnswerRecord]
268
+ #
269
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
270
+ def update_answer_record request, options = nil
271
+ raise ::ArgumentError, "request must be provided" if request.nil?
272
+
273
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateAnswerRecordRequest
274
+
275
+ # Converts hash and nil to an options object
276
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
277
+
278
+ # Customize the options with defaults
279
+ call_metadata = @config.rpcs.update_answer_record.metadata.to_h
280
+
281
+ # Set x-goog-api-client and x-goog-user-project headers
282
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
283
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
284
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION,
285
+ transports_version_send: [:rest]
286
+
287
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
288
+
289
+ options.apply_defaults timeout: @config.rpcs.update_answer_record.timeout,
290
+ metadata: call_metadata,
291
+ retry_policy: @config.rpcs.update_answer_record.retry_policy
292
+
293
+ options.apply_defaults timeout: @config.timeout,
294
+ metadata: @config.metadata,
295
+ retry_policy: @config.retry_policy
296
+
297
+ @answer_records_stub.update_answer_record request, options do |result, operation|
298
+ yield result, operation if block_given?
299
+ return result
300
+ end
301
+ rescue ::Gapic::Rest::Error => e
302
+ raise ::Google::Cloud::Error.from_error(e)
303
+ end
304
+
305
+ ##
306
+ # Configuration class for the AnswerRecords REST API.
307
+ #
308
+ # This class represents the configuration for AnswerRecords REST,
309
+ # providing control over timeouts, retry behavior, logging, transport
310
+ # parameters, and other low-level controls. Certain parameters can also be
311
+ # applied individually to specific RPCs. See
312
+ # {::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client::Configuration::Rpcs}
313
+ # for a list of RPCs that can be configured independently.
314
+ #
315
+ # Configuration can be applied globally to all clients, or to a single client
316
+ # on construction.
317
+ #
318
+ # @example
319
+ #
320
+ # # Modify the global config, setting the timeout for
321
+ # # list_answer_records to 20 seconds,
322
+ # # and all remaining timeouts to 10 seconds.
323
+ # ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.configure do |config|
324
+ # config.timeout = 10.0
325
+ # config.rpcs.list_answer_records.timeout = 20.0
326
+ # end
327
+ #
328
+ # # Apply the above configuration only to a new client.
329
+ # client = ::Google::Cloud::Dialogflow::V2::AnswerRecords::Rest::Client.new do |config|
330
+ # config.timeout = 10.0
331
+ # config.rpcs.list_answer_records.timeout = 20.0
332
+ # end
333
+ #
334
+ # @!attribute [rw] endpoint
335
+ # The hostname or hostname:port of the service endpoint.
336
+ # Defaults to `"dialogflow.googleapis.com"`.
337
+ # @return [::String]
338
+ # @!attribute [rw] credentials
339
+ # Credentials to send with calls. You may provide any of the following types:
340
+ # * (`String`) The path to a service account key file in JSON format
341
+ # * (`Hash`) A service account key as a Hash
342
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
343
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
344
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
345
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
346
+ # * (`nil`) indicating no credentials
347
+ # @return [::Object]
348
+ # @!attribute [rw] scope
349
+ # The OAuth scopes
350
+ # @return [::Array<::String>]
351
+ # @!attribute [rw] lib_name
352
+ # The library name as recorded in instrumentation and logging
353
+ # @return [::String]
354
+ # @!attribute [rw] lib_version
355
+ # The library version as recorded in instrumentation and logging
356
+ # @return [::String]
357
+ # @!attribute [rw] timeout
358
+ # The call timeout in seconds.
359
+ # @return [::Numeric]
360
+ # @!attribute [rw] metadata
361
+ # Additional headers to be sent with the call.
362
+ # @return [::Hash{::Symbol=>::String}]
363
+ # @!attribute [rw] retry_policy
364
+ # The retry policy. The value is a hash with the following keys:
365
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
366
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
367
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
368
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
369
+ # trigger a retry.
370
+ # @return [::Hash]
371
+ # @!attribute [rw] quota_project
372
+ # A separate project against which to charge quota.
373
+ # @return [::String]
374
+ #
375
+ class Configuration
376
+ extend ::Gapic::Config
377
+
378
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
379
+ config_attr :credentials, nil do |value|
380
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
381
+ allowed.any? { |klass| klass === value }
382
+ end
383
+ config_attr :scope, nil, ::String, ::Array, nil
384
+ config_attr :lib_name, nil, ::String, nil
385
+ config_attr :lib_version, nil, ::String, nil
386
+ config_attr :timeout, nil, ::Numeric, nil
387
+ config_attr :metadata, nil, ::Hash, nil
388
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
389
+ config_attr :quota_project, nil, ::String, nil
390
+
391
+ # @private
392
+ # Overrides for http bindings for the RPCs of this service
393
+ # are only used when this service is used as mixin, and only
394
+ # by the host service.
395
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
396
+ config_attr :bindings_override, {}, ::Hash, nil
397
+
398
+ # @private
399
+ def initialize parent_config = nil
400
+ @parent_config = parent_config unless parent_config.nil?
401
+
402
+ yield self if block_given?
403
+ end
404
+
405
+ ##
406
+ # Configurations for individual RPCs
407
+ # @return [Rpcs]
408
+ #
409
+ def rpcs
410
+ @rpcs ||= begin
411
+ parent_rpcs = nil
412
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
413
+ Rpcs.new parent_rpcs
414
+ end
415
+ end
416
+
417
+ ##
418
+ # Configuration RPC class for the AnswerRecords API.
419
+ #
420
+ # Includes fields providing the configuration for each RPC in this service.
421
+ # Each configuration object is of type `Gapic::Config::Method` and includes
422
+ # the following configuration fields:
423
+ #
424
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
425
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
426
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
427
+ # include the following keys:
428
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
429
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
430
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
431
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
432
+ # trigger a retry.
433
+ #
434
+ class Rpcs
435
+ ##
436
+ # RPC-specific configuration for `list_answer_records`
437
+ # @return [::Gapic::Config::Method]
438
+ #
439
+ attr_reader :list_answer_records
440
+ ##
441
+ # RPC-specific configuration for `update_answer_record`
442
+ # @return [::Gapic::Config::Method]
443
+ #
444
+ attr_reader :update_answer_record
445
+
446
+ # @private
447
+ def initialize parent_rpcs = nil
448
+ list_answer_records_config = parent_rpcs.list_answer_records if parent_rpcs.respond_to? :list_answer_records
449
+ @list_answer_records = ::Gapic::Config::Method.new list_answer_records_config
450
+ update_answer_record_config = parent_rpcs.update_answer_record if parent_rpcs.respond_to? :update_answer_record
451
+ @update_answer_record = ::Gapic::Config::Method.new update_answer_record_config
452
+
453
+ yield self if block_given?
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end
459
+ end
460
+ end
461
+ end
462
+ end
463
+ end