google-cloud-dialogflow-v2 0.6.3 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.md +188 -190
  3. data/README.md +66 -2
  4. data/lib/google/cloud/dialogflow/v2.rb +13 -2
  5. data/lib/google/cloud/dialogflow/v2/agent_services_pb.rb +24 -12
  6. data/lib/google/cloud/dialogflow/v2/agents/client.rb +40 -72
  7. data/lib/google/cloud/dialogflow/v2/agents/operations.rb +96 -11
  8. data/lib/google/cloud/dialogflow/v2/agents/paths.rb +42 -3
  9. data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +100 -0
  10. data/lib/google/cloud/dialogflow/v2/answer_record_services_pb.rb +48 -0
  11. data/lib/google/cloud/dialogflow/v2/answer_records.rb +49 -0
  12. data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +478 -0
  13. data/lib/google/cloud/dialogflow/v2/answer_records/credentials.rb +52 -0
  14. data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +105 -0
  15. data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +7 -0
  16. data/lib/google/cloud/dialogflow/v2/context_services_pb.rb +8 -25
  17. data/lib/google/cloud/dialogflow/v2/contexts.rb +1 -18
  18. data/lib/google/cloud/dialogflow/v2/contexts/client.rb +24 -63
  19. data/lib/google/cloud/dialogflow/v2/contexts/paths.rb +74 -2
  20. data/lib/google/cloud/dialogflow/v2/conversation_event_pb.rb +39 -0
  21. data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +89 -0
  22. data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +182 -0
  23. data/lib/google/cloud/dialogflow/v2/conversation_profile_services_pb.rb +61 -0
  24. data/lib/google/cloud/dialogflow/v2/conversation_profiles.rb +49 -0
  25. data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +699 -0
  26. data/lib/google/cloud/dialogflow/v2/conversation_profiles/credentials.rb +52 -0
  27. data/lib/google/cloud/dialogflow/v2/conversation_profiles/paths.rb +246 -0
  28. data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +75 -0
  29. data/lib/google/cloud/dialogflow/v2/conversations.rb +49 -0
  30. data/lib/google/cloud/dialogflow/v2/conversations/client.rb +757 -0
  31. data/lib/google/cloud/dialogflow/v2/conversations/credentials.rb +52 -0
  32. data/lib/google/cloud/dialogflow/v2/conversations/paths.rb +146 -0
  33. data/lib/google/cloud/dialogflow/v2/document_pb.rb +99 -0
  34. data/lib/google/cloud/dialogflow/v2/document_services_pb.rb +73 -0
  35. data/lib/google/cloud/dialogflow/v2/documents.rb +50 -0
  36. data/lib/google/cloud/dialogflow/v2/documents/client.rb +810 -0
  37. data/lib/google/cloud/dialogflow/v2/documents/credentials.rb +52 -0
  38. data/lib/google/cloud/dialogflow/v2/documents/operations.rb +655 -0
  39. data/lib/google/cloud/dialogflow/v2/documents/paths.rb +119 -0
  40. data/lib/google/cloud/dialogflow/v2/entity_type_services_pb.rb +12 -39
  41. data/lib/google/cloud/dialogflow/v2/entity_types.rb +1 -28
  42. data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +28 -91
  43. data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +96 -11
  44. data/lib/google/cloud/dialogflow/v2/entity_types/paths.rb +58 -12
  45. data/lib/google/cloud/dialogflow/v2/environment_pb.rb +50 -1
  46. data/lib/google/cloud/dialogflow/v2/environment_services_pb.rb +24 -3
  47. data/lib/google/cloud/dialogflow/v2/environments.rb +1 -1
  48. data/lib/google/cloud/dialogflow/v2/environments/client.rb +430 -14
  49. data/lib/google/cloud/dialogflow/v2/environments/paths.rb +104 -5
  50. data/lib/google/cloud/dialogflow/v2/fulfillment_pb.rb +59 -0
  51. data/lib/google/cloud/dialogflow/v2/fulfillment_services_pb.rb +47 -0
  52. data/lib/google/cloud/dialogflow/v2/fulfillments.rb +49 -0
  53. data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +460 -0
  54. data/lib/google/cloud/dialogflow/v2/fulfillments/credentials.rb +52 -0
  55. data/lib/google/cloud/dialogflow/v2/fulfillments/paths.rb +69 -0
  56. data/lib/google/cloud/dialogflow/v2/gcs_pb.rb +20 -0
  57. data/lib/google/cloud/dialogflow/v2/human_agent_assistant_event_pb.rb +26 -0
  58. data/lib/google/cloud/dialogflow/v2/intent_pb.rb +2 -0
  59. data/lib/google/cloud/dialogflow/v2/intent_services_pb.rb +9 -40
  60. data/lib/google/cloud/dialogflow/v2/intents.rb +1 -32
  61. data/lib/google/cloud/dialogflow/v2/intents/client.rb +34 -81
  62. data/lib/google/cloud/dialogflow/v2/intents/operations.rb +96 -11
  63. data/lib/google/cloud/dialogflow/v2/intents/paths.rb +97 -13
  64. data/lib/google/cloud/dialogflow/v2/knowledge_base_pb.rb +60 -0
  65. data/lib/google/cloud/dialogflow/v2/knowledge_base_services_pb.rb +53 -0
  66. data/lib/google/cloud/dialogflow/v2/knowledge_bases.rb +49 -0
  67. data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +696 -0
  68. data/lib/google/cloud/dialogflow/v2/knowledge_bases/credentials.rb +52 -0
  69. data/lib/google/cloud/dialogflow/v2/knowledge_bases/paths.rb +105 -0
  70. data/lib/google/cloud/dialogflow/v2/participant_pb.rb +181 -0
  71. data/lib/google/cloud/dialogflow/v2/participant_services_pb.rb +64 -0
  72. data/lib/google/cloud/dialogflow/v2/participants.rb +49 -0
  73. data/lib/google/cloud/dialogflow/v2/participants/client.rb +894 -0
  74. data/lib/google/cloud/dialogflow/v2/participants/credentials.rb +52 -0
  75. data/lib/google/cloud/dialogflow/v2/participants/paths.rb +334 -0
  76. data/lib/google/cloud/dialogflow/v2/session_entity_type_services_pb.rb +7 -23
  77. data/lib/google/cloud/dialogflow/v2/session_entity_types.rb +1 -17
  78. data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +23 -53
  79. data/lib/google/cloud/dialogflow/v2/session_entity_types/paths.rb +74 -2
  80. data/lib/google/cloud/dialogflow/v2/session_pb.rb +2 -0
  81. data/lib/google/cloud/dialogflow/v2/session_services_pb.rb +15 -7
  82. data/lib/google/cloud/dialogflow/v2/sessions.rb +4 -4
  83. data/lib/google/cloud/dialogflow/v2/sessions/client.rb +51 -15
  84. data/lib/google/cloud/dialogflow/v2/sessions/paths.rb +113 -3
  85. data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
  86. data/lib/google/cloud/dialogflow/v2/version_pb.rb +69 -0
  87. data/lib/google/cloud/dialogflow/v2/version_services_pb.rb +59 -0
  88. data/lib/google/cloud/dialogflow/v2/versions.rb +49 -0
  89. data/lib/google/cloud/dialogflow/v2/versions/client.rb +709 -0
  90. data/lib/google/cloud/dialogflow/v2/versions/credentials.rb +52 -0
  91. data/lib/google/cloud/dialogflow/v2/versions/paths.rb +110 -0
  92. data/proto_docs/google/api/field_behavior.rb +6 -0
  93. data/proto_docs/google/api/resource.rb +50 -14
  94. data/proto_docs/google/cloud/dialogflow/v2/agent.rb +1 -2
  95. data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +252 -0
  96. data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +25 -0
  97. data/proto_docs/google/cloud/dialogflow/v2/context.rb +17 -2
  98. data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +253 -0
  99. data/proto_docs/google/cloud/dialogflow/v2/conversation_event.rb +83 -0
  100. data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +522 -0
  101. data/proto_docs/google/cloud/dialogflow/v2/document.rb +267 -0
  102. data/proto_docs/google/cloud/dialogflow/v2/entity_type.rb +12 -3
  103. data/proto_docs/google/cloud/dialogflow/v2/environment.rb +187 -5
  104. data/proto_docs/google/cloud/dialogflow/v2/fulfillment.rb +144 -0
  105. data/proto_docs/google/cloud/dialogflow/v2/human_agent_assistant_event.rb +45 -0
  106. data/proto_docs/google/cloud/dialogflow/v2/intent.rb +29 -4
  107. data/proto_docs/google/cloud/dialogflow/v2/knowledge_base.rb +139 -0
  108. data/proto_docs/google/cloud/dialogflow/v2/participant.rb +525 -0
  109. data/proto_docs/google/cloud/dialogflow/v2/session.rb +56 -7
  110. data/proto_docs/google/cloud/dialogflow/v2/session_entity_type.rb +7 -6
  111. data/proto_docs/google/cloud/dialogflow/v2/validation_result.rb +1 -1
  112. data/proto_docs/google/cloud/dialogflow/v2/version.rb +176 -0
  113. data/proto_docs/google/cloud/dialogflow/v2/webhook.rb +2 -2
  114. data/proto_docs/google/longrunning/operations.rb +17 -3
  115. data/proto_docs/google/protobuf/any.rb +5 -2
  116. data/proto_docs/google/protobuf/timestamp.rb +10 -1
  117. data/proto_docs/google/type/latlng.rb +2 -2
  118. metadata +81 -11
@@ -0,0 +1,894 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2021 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/participant_pb"
21
+
22
+ module Google
23
+ module Cloud
24
+ module Dialogflow
25
+ module V2
26
+ module Participants
27
+ ##
28
+ # Client for the Participants service.
29
+ #
30
+ # Service for managing {::Google::Cloud::Dialogflow::V2::Participant Participants}.
31
+ #
32
+ class Client
33
+ include Paths
34
+
35
+ # @private
36
+ attr_reader :participants_stub
37
+
38
+ ##
39
+ # Configure the Participants Client class.
40
+ #
41
+ # See {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration}
42
+ # for a description of the configuration fields.
43
+ #
44
+ # ## Example
45
+ #
46
+ # To modify the configuration for all Participants clients:
47
+ #
48
+ # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
49
+ # config.timeout = 10.0
50
+ # end
51
+ #
52
+ # @yield [config] Configure the Client client.
53
+ # @yieldparam config [Client::Configuration]
54
+ #
55
+ # @return [Client::Configuration]
56
+ #
57
+ def self.configure
58
+ @configure ||= begin
59
+ namespace = ["Google", "Cloud", "Dialogflow", "V2"]
60
+ parent_config = while namespace.any?
61
+ parent_name = namespace.join "::"
62
+ parent_const = const_get parent_name
63
+ break parent_const.configure if parent_const.respond_to? :configure
64
+ namespace.pop
65
+ end
66
+ default_config = Client::Configuration.new parent_config
67
+
68
+ default_config.timeout = 60.0
69
+ default_config.retry_policy = {
70
+ initial_delay: 0.1,
71
+ max_delay: 60.0,
72
+ multiplier: 1.3,
73
+ retry_codes: [14]
74
+ }
75
+
76
+ default_config.rpcs.analyze_content.timeout = 220.0
77
+ default_config.rpcs.analyze_content.retry_policy = {
78
+ initial_delay: 0.1,
79
+ max_delay: 60.0,
80
+ multiplier: 1.3,
81
+ retry_codes: [14]
82
+ }
83
+
84
+ default_config
85
+ end
86
+ yield @configure if block_given?
87
+ @configure
88
+ end
89
+
90
+ ##
91
+ # Configure the Participants Client instance.
92
+ #
93
+ # The configuration is set to the derived mode, meaning that values can be changed,
94
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
95
+ # should be made on {Client.configure}.
96
+ #
97
+ # See {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration}
98
+ # for a description of the configuration fields.
99
+ #
100
+ # @yield [config] Configure the Client client.
101
+ # @yieldparam config [Client::Configuration]
102
+ #
103
+ # @return [Client::Configuration]
104
+ #
105
+ def configure
106
+ yield @config if block_given?
107
+ @config
108
+ end
109
+
110
+ ##
111
+ # Create a new Participants client object.
112
+ #
113
+ # ## Examples
114
+ #
115
+ # To create a new Participants client with the default
116
+ # configuration:
117
+ #
118
+ # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new
119
+ #
120
+ # To create a new Participants client with a custom
121
+ # configuration:
122
+ #
123
+ # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the Participants client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/cloud/dialogflow/v2/participant_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the scope and endpoint are unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.scope == Client.configure.scope &&
148
+ @config.endpoint == Client.configure.endpoint &&
149
+ !@config.endpoint.split(".").first.include?("-")
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(String) || credentials.is_a?(Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @participants_stub = ::Gapic::ServiceStub.new(
159
+ ::Google::Cloud::Dialogflow::V2::Participants::Stub,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ channel_args: @config.channel_args,
163
+ interceptors: @config.interceptors
164
+ )
165
+ end
166
+
167
+ # Service calls
168
+
169
+ ##
170
+ # Creates a new participant in a conversation.
171
+ #
172
+ # @overload create_participant(request, options = nil)
173
+ # Pass arguments to `create_participant` via a request object, either of type
174
+ # {::Google::Cloud::Dialogflow::V2::CreateParticipantRequest} or an equivalent Hash.
175
+ #
176
+ # @param request [::Google::Cloud::Dialogflow::V2::CreateParticipantRequest, ::Hash]
177
+ # A request object representing the call parameters. Required. To specify no
178
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
179
+ # @param options [::Gapic::CallOptions, ::Hash]
180
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
181
+ #
182
+ # @overload create_participant(parent: nil, participant: nil)
183
+ # Pass arguments to `create_participant` via keyword arguments. Note that at
184
+ # least one keyword argument is required. To specify no parameters, or to keep all
185
+ # the default parameter values, pass an empty Hash as a request object (see above).
186
+ #
187
+ # @param parent [::String]
188
+ # Required. Resource identifier of the conversation adding the participant.
189
+ # Format: `projects/<Project ID>/locations/<Location
190
+ # ID>/conversations/<Conversation ID>`.
191
+ # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash]
192
+ # Required. The participant to create.
193
+ #
194
+ # @yield [response, operation] Access the result along with the RPC operation
195
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant]
196
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
197
+ #
198
+ # @return [::Google::Cloud::Dialogflow::V2::Participant]
199
+ #
200
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
201
+ #
202
+ def create_participant request, options = nil
203
+ raise ::ArgumentError, "request must be provided" if request.nil?
204
+
205
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::CreateParticipantRequest
206
+
207
+ # Converts hash and nil to an options object
208
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
209
+
210
+ # Customize the options with defaults
211
+ metadata = @config.rpcs.create_participant.metadata.to_h
212
+
213
+ # Set x-goog-api-client and x-goog-user-project headers
214
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
215
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
216
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
217
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
218
+
219
+ header_params = {
220
+ "parent" => request.parent
221
+ }
222
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
223
+ metadata[:"x-goog-request-params"] ||= request_params_header
224
+
225
+ options.apply_defaults timeout: @config.rpcs.create_participant.timeout,
226
+ metadata: metadata,
227
+ retry_policy: @config.rpcs.create_participant.retry_policy
228
+ options.apply_defaults metadata: @config.metadata,
229
+ retry_policy: @config.retry_policy
230
+
231
+ @participants_stub.call_rpc :create_participant, request, options: options do |response, operation|
232
+ yield response, operation if block_given?
233
+ return response
234
+ end
235
+ rescue ::GRPC::BadStatus => e
236
+ raise ::Google::Cloud::Error.from_error(e)
237
+ end
238
+
239
+ ##
240
+ # Retrieves a conversation participant.
241
+ #
242
+ # @overload get_participant(request, options = nil)
243
+ # Pass arguments to `get_participant` via a request object, either of type
244
+ # {::Google::Cloud::Dialogflow::V2::GetParticipantRequest} or an equivalent Hash.
245
+ #
246
+ # @param request [::Google::Cloud::Dialogflow::V2::GetParticipantRequest, ::Hash]
247
+ # A request object representing the call parameters. Required. To specify no
248
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
249
+ # @param options [::Gapic::CallOptions, ::Hash]
250
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
251
+ #
252
+ # @overload get_participant(name: nil)
253
+ # Pass arguments to `get_participant` via keyword arguments. Note that at
254
+ # least one keyword argument is required. To specify no parameters, or to keep all
255
+ # the default parameter values, pass an empty Hash as a request object (see above).
256
+ #
257
+ # @param name [::String]
258
+ # Required. The name of the participant. Format:
259
+ # `projects/<Project ID>/locations/<Location ID>/conversations/<Conversation
260
+ # ID>/participants/<Participant ID>`.
261
+ #
262
+ # @yield [response, operation] Access the result along with the RPC operation
263
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant]
264
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
265
+ #
266
+ # @return [::Google::Cloud::Dialogflow::V2::Participant]
267
+ #
268
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
269
+ #
270
+ def get_participant 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::GetParticipantRequest
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
+ metadata = @config.rpcs.get_participant.metadata.to_h
280
+
281
+ # Set x-goog-api-client and x-goog-user-project headers
282
+ 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
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
286
+
287
+ header_params = {
288
+ "name" => request.name
289
+ }
290
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
291
+ metadata[:"x-goog-request-params"] ||= request_params_header
292
+
293
+ options.apply_defaults timeout: @config.rpcs.get_participant.timeout,
294
+ metadata: metadata,
295
+ retry_policy: @config.rpcs.get_participant.retry_policy
296
+ options.apply_defaults metadata: @config.metadata,
297
+ retry_policy: @config.retry_policy
298
+
299
+ @participants_stub.call_rpc :get_participant, request, options: options do |response, operation|
300
+ yield response, operation if block_given?
301
+ return response
302
+ end
303
+ rescue ::GRPC::BadStatus => e
304
+ raise ::Google::Cloud::Error.from_error(e)
305
+ end
306
+
307
+ ##
308
+ # Returns the list of all participants in the specified conversation.
309
+ #
310
+ # @overload list_participants(request, options = nil)
311
+ # Pass arguments to `list_participants` via a request object, either of type
312
+ # {::Google::Cloud::Dialogflow::V2::ListParticipantsRequest} or an equivalent Hash.
313
+ #
314
+ # @param request [::Google::Cloud::Dialogflow::V2::ListParticipantsRequest, ::Hash]
315
+ # A request object representing the call parameters. Required. To specify no
316
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
317
+ # @param options [::Gapic::CallOptions, ::Hash]
318
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
319
+ #
320
+ # @overload list_participants(parent: nil, page_size: nil, page_token: nil)
321
+ # Pass arguments to `list_participants` via keyword arguments. Note that at
322
+ # least one keyword argument is required. To specify no parameters, or to keep all
323
+ # the default parameter values, pass an empty Hash as a request object (see above).
324
+ #
325
+ # @param parent [::String]
326
+ # Required. The conversation to list all participants from.
327
+ # Format: `projects/<Project ID>/locations/<Location
328
+ # ID>/conversations/<Conversation ID>`.
329
+ # @param page_size [::Integer]
330
+ # Optional. The maximum number of items to return in a single page. By
331
+ # default 100 and at most 1000.
332
+ # @param page_token [::String]
333
+ # Optional. The next_page_token value returned from a previous list request.
334
+ #
335
+ # @yield [response, operation] Access the result along with the RPC operation
336
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>]
337
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
338
+ #
339
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Dialogflow::V2::Participant>]
340
+ #
341
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
342
+ #
343
+ def list_participants request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::ListParticipantsRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ metadata = @config.rpcs.list_participants.metadata.to_h
353
+
354
+ # Set x-goog-api-client and x-goog-user-project headers
355
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
358
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
359
+
360
+ header_params = {
361
+ "parent" => request.parent
362
+ }
363
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
364
+ metadata[:"x-goog-request-params"] ||= request_params_header
365
+
366
+ options.apply_defaults timeout: @config.rpcs.list_participants.timeout,
367
+ metadata: metadata,
368
+ retry_policy: @config.rpcs.list_participants.retry_policy
369
+ options.apply_defaults metadata: @config.metadata,
370
+ retry_policy: @config.retry_policy
371
+
372
+ @participants_stub.call_rpc :list_participants, request, options: options do |response, operation|
373
+ response = ::Gapic::PagedEnumerable.new @participants_stub, :list_participants, request, response, operation, options
374
+ yield response, operation if block_given?
375
+ return response
376
+ end
377
+ rescue ::GRPC::BadStatus => e
378
+ raise ::Google::Cloud::Error.from_error(e)
379
+ end
380
+
381
+ ##
382
+ # Updates the specified participant.
383
+ #
384
+ # @overload update_participant(request, options = nil)
385
+ # Pass arguments to `update_participant` via a request object, either of type
386
+ # {::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest} or an equivalent Hash.
387
+ #
388
+ # @param request [::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest, ::Hash]
389
+ # A request object representing the call parameters. Required. To specify no
390
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
391
+ # @param options [::Gapic::CallOptions, ::Hash]
392
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
393
+ #
394
+ # @overload update_participant(participant: nil, update_mask: nil)
395
+ # Pass arguments to `update_participant` via keyword arguments. Note that at
396
+ # least one keyword argument is required. To specify no parameters, or to keep all
397
+ # the default parameter values, pass an empty Hash as a request object (see above).
398
+ #
399
+ # @param participant [::Google::Cloud::Dialogflow::V2::Participant, ::Hash]
400
+ # Required. The participant to update.
401
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
402
+ # Required. The mask to specify which fields to update.
403
+ #
404
+ # @yield [response, operation] Access the result along with the RPC operation
405
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::Participant]
406
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
407
+ #
408
+ # @return [::Google::Cloud::Dialogflow::V2::Participant]
409
+ #
410
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
411
+ #
412
+ def update_participant request, options = nil
413
+ raise ::ArgumentError, "request must be provided" if request.nil?
414
+
415
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::UpdateParticipantRequest
416
+
417
+ # Converts hash and nil to an options object
418
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
419
+
420
+ # Customize the options with defaults
421
+ metadata = @config.rpcs.update_participant.metadata.to_h
422
+
423
+ # Set x-goog-api-client and x-goog-user-project headers
424
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
425
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
426
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
427
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
428
+
429
+ header_params = {
430
+ "participant.name" => request.participant.name
431
+ }
432
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
433
+ metadata[:"x-goog-request-params"] ||= request_params_header
434
+
435
+ options.apply_defaults timeout: @config.rpcs.update_participant.timeout,
436
+ metadata: metadata,
437
+ retry_policy: @config.rpcs.update_participant.retry_policy
438
+ options.apply_defaults metadata: @config.metadata,
439
+ retry_policy: @config.retry_policy
440
+
441
+ @participants_stub.call_rpc :update_participant, request, options: options do |response, operation|
442
+ yield response, operation if block_given?
443
+ return response
444
+ end
445
+ rescue ::GRPC::BadStatus => e
446
+ raise ::Google::Cloud::Error.from_error(e)
447
+ end
448
+
449
+ ##
450
+ # Adds a text (chat, for example), or audio (phone recording, for example)
451
+ # message from a participant into the conversation.
452
+ #
453
+ # Note: Always use agent versions for production traffic
454
+ # sent to virtual agents. See [Versions and
455
+ # environments](https://cloud.google.com/dialogflow/es/docs/agents-versions).
456
+ #
457
+ # @overload analyze_content(request, options = nil)
458
+ # Pass arguments to `analyze_content` via a request object, either of type
459
+ # {::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest} or an equivalent Hash.
460
+ #
461
+ # @param request [::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest, ::Hash]
462
+ # A request object representing the call parameters. Required. To specify no
463
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
464
+ # @param options [::Gapic::CallOptions, ::Hash]
465
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
466
+ #
467
+ # @overload analyze_content(participant: nil, text_input: nil, event_input: nil, reply_audio_config: nil, query_params: nil, request_id: nil)
468
+ # Pass arguments to `analyze_content` via keyword arguments. Note that at
469
+ # least one keyword argument is required. To specify no parameters, or to keep all
470
+ # the default parameter values, pass an empty Hash as a request object (see above).
471
+ #
472
+ # @param participant [::String]
473
+ # Required. The name of the participant this text comes from.
474
+ # Format: `projects/<Project ID>/locations/<Location
475
+ # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
476
+ # @param text_input [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash]
477
+ # The natural language text to be processed.
478
+ # @param event_input [::Google::Cloud::Dialogflow::V2::EventInput, ::Hash]
479
+ # An input event to send to Dialogflow.
480
+ # @param reply_audio_config [::Google::Cloud::Dialogflow::V2::OutputAudioConfig, ::Hash]
481
+ # Speech synthesis configuration.
482
+ # The speech synthesis settings for a virtual agent that may be configured
483
+ # for the associated conversation profile are not used when calling
484
+ # AnalyzeContent. If this configuration is not supplied, speech synthesis
485
+ # is disabled.
486
+ # @param query_params [::Google::Cloud::Dialogflow::V2::QueryParameters, ::Hash]
487
+ # Parameters for a Dialogflow virtual-agent query.
488
+ # @param request_id [::String]
489
+ # A unique identifier for this request. Restricted to 36 ASCII characters.
490
+ # A random UUID is recommended.
491
+ # This request is only idempotent if a `request_id` is provided.
492
+ #
493
+ # @yield [response, operation] Access the result along with the RPC operation
494
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse]
495
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
496
+ #
497
+ # @return [::Google::Cloud::Dialogflow::V2::AnalyzeContentResponse]
498
+ #
499
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
500
+ #
501
+ def analyze_content request, options = nil
502
+ raise ::ArgumentError, "request must be provided" if request.nil?
503
+
504
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::AnalyzeContentRequest
505
+
506
+ # Converts hash and nil to an options object
507
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
508
+
509
+ # Customize the options with defaults
510
+ metadata = @config.rpcs.analyze_content.metadata.to_h
511
+
512
+ # Set x-goog-api-client and x-goog-user-project headers
513
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
514
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
515
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
516
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
517
+
518
+ header_params = {
519
+ "participant" => request.participant
520
+ }
521
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
522
+ metadata[:"x-goog-request-params"] ||= request_params_header
523
+
524
+ options.apply_defaults timeout: @config.rpcs.analyze_content.timeout,
525
+ metadata: metadata,
526
+ retry_policy: @config.rpcs.analyze_content.retry_policy
527
+ options.apply_defaults metadata: @config.metadata,
528
+ retry_policy: @config.retry_policy
529
+
530
+ @participants_stub.call_rpc :analyze_content, request, options: options do |response, operation|
531
+ yield response, operation if block_given?
532
+ return response
533
+ end
534
+ rescue ::GRPC::BadStatus => e
535
+ raise ::Google::Cloud::Error.from_error(e)
536
+ end
537
+
538
+ ##
539
+ # Gets suggested articles for a participant based on specific historical
540
+ # messages.
541
+ #
542
+ # @overload suggest_articles(request, options = nil)
543
+ # Pass arguments to `suggest_articles` via a request object, either of type
544
+ # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest} or an equivalent Hash.
545
+ #
546
+ # @param request [::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest, ::Hash]
547
+ # A request object representing the call parameters. Required. To specify no
548
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
549
+ # @param options [::Gapic::CallOptions, ::Hash]
550
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
551
+ #
552
+ # @overload suggest_articles(parent: nil, latest_message: nil, context_size: nil)
553
+ # Pass arguments to `suggest_articles` via keyword arguments. Note that at
554
+ # least one keyword argument is required. To specify no parameters, or to keep all
555
+ # the default parameter values, pass an empty Hash as a request object (see above).
556
+ #
557
+ # @param parent [::String]
558
+ # Required. The name of the participant to fetch suggestion for.
559
+ # Format: `projects/<Project ID>/locations/<Location
560
+ # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
561
+ # @param latest_message [::String]
562
+ # The name of the latest conversation message to compile suggestion
563
+ # for. If empty, it will be the latest message of the conversation.
564
+ #
565
+ # Format: `projects/<Project ID>/locations/<Location
566
+ # ID>/conversations/<Conversation ID>/messages/<Message ID>`.
567
+ # @param context_size [::Integer]
568
+ # Max number of messages prior to and including
569
+ # {::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest#latest_message latest_message} to use as context
570
+ # when compiling the suggestion. By default 20 and at most 50.
571
+ #
572
+ # @yield [response, operation] Access the result along with the RPC operation
573
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse]
574
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
575
+ #
576
+ # @return [::Google::Cloud::Dialogflow::V2::SuggestArticlesResponse]
577
+ #
578
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
579
+ #
580
+ def suggest_articles request, options = nil
581
+ raise ::ArgumentError, "request must be provided" if request.nil?
582
+
583
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestArticlesRequest
584
+
585
+ # Converts hash and nil to an options object
586
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
587
+
588
+ # Customize the options with defaults
589
+ metadata = @config.rpcs.suggest_articles.metadata.to_h
590
+
591
+ # Set x-goog-api-client and x-goog-user-project headers
592
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
593
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
594
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
595
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
596
+
597
+ header_params = {
598
+ "parent" => request.parent
599
+ }
600
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
601
+ metadata[:"x-goog-request-params"] ||= request_params_header
602
+
603
+ options.apply_defaults timeout: @config.rpcs.suggest_articles.timeout,
604
+ metadata: metadata,
605
+ retry_policy: @config.rpcs.suggest_articles.retry_policy
606
+ options.apply_defaults metadata: @config.metadata,
607
+ retry_policy: @config.retry_policy
608
+
609
+ @participants_stub.call_rpc :suggest_articles, request, options: options do |response, operation|
610
+ yield response, operation if block_given?
611
+ return response
612
+ end
613
+ rescue ::GRPC::BadStatus => e
614
+ raise ::Google::Cloud::Error.from_error(e)
615
+ end
616
+
617
+ ##
618
+ # Gets suggested faq answers for a participant based on specific historical
619
+ # messages.
620
+ #
621
+ # @overload suggest_faq_answers(request, options = nil)
622
+ # Pass arguments to `suggest_faq_answers` via a request object, either of type
623
+ # {::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest} or an equivalent Hash.
624
+ #
625
+ # @param request [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest, ::Hash]
626
+ # A request object representing the call parameters. Required. To specify no
627
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
628
+ # @param options [::Gapic::CallOptions, ::Hash]
629
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
630
+ #
631
+ # @overload suggest_faq_answers(parent: nil, latest_message: nil, context_size: nil)
632
+ # Pass arguments to `suggest_faq_answers` via keyword arguments. Note that at
633
+ # least one keyword argument is required. To specify no parameters, or to keep all
634
+ # the default parameter values, pass an empty Hash as a request object (see above).
635
+ #
636
+ # @param parent [::String]
637
+ # Required. The name of the participant to fetch suggestion for.
638
+ # Format: `projects/<Project ID>/locations/<Location
639
+ # ID>/conversations/<Conversation ID>/participants/<Participant ID>`.
640
+ # @param latest_message [::String]
641
+ # The name of the latest conversation message to compile suggestion
642
+ # for. If empty, it will be the latest message of the conversation.
643
+ #
644
+ # Format: `projects/<Project ID>/locations/<Location
645
+ # ID>/conversations/<Conversation ID>/messages/<Message ID>`.
646
+ # @param context_size [::Integer]
647
+ # Max number of messages prior to and including
648
+ # [latest_message] to use as context when compiling the
649
+ # suggestion. By default 20 and at most 50.
650
+ #
651
+ # @yield [response, operation] Access the result along with the RPC operation
652
+ # @yieldparam response [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse]
653
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
654
+ #
655
+ # @return [::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersResponse]
656
+ #
657
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
658
+ #
659
+ def suggest_faq_answers request, options = nil
660
+ raise ::ArgumentError, "request must be provided" if request.nil?
661
+
662
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SuggestFaqAnswersRequest
663
+
664
+ # Converts hash and nil to an options object
665
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
666
+
667
+ # Customize the options with defaults
668
+ metadata = @config.rpcs.suggest_faq_answers.metadata.to_h
669
+
670
+ # Set x-goog-api-client and x-goog-user-project headers
671
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
672
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
673
+ gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
674
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
675
+
676
+ header_params = {
677
+ "parent" => request.parent
678
+ }
679
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
680
+ metadata[:"x-goog-request-params"] ||= request_params_header
681
+
682
+ options.apply_defaults timeout: @config.rpcs.suggest_faq_answers.timeout,
683
+ metadata: metadata,
684
+ retry_policy: @config.rpcs.suggest_faq_answers.retry_policy
685
+ options.apply_defaults metadata: @config.metadata,
686
+ retry_policy: @config.retry_policy
687
+
688
+ @participants_stub.call_rpc :suggest_faq_answers, request, options: options do |response, operation|
689
+ yield response, operation if block_given?
690
+ return response
691
+ end
692
+ rescue ::GRPC::BadStatus => e
693
+ raise ::Google::Cloud::Error.from_error(e)
694
+ end
695
+
696
+ ##
697
+ # Configuration class for the Participants API.
698
+ #
699
+ # This class represents the configuration for Participants,
700
+ # providing control over timeouts, retry behavior, logging, transport
701
+ # parameters, and other low-level controls. Certain parameters can also be
702
+ # applied individually to specific RPCs. See
703
+ # {::Google::Cloud::Dialogflow::V2::Participants::Client::Configuration::Rpcs}
704
+ # for a list of RPCs that can be configured independently.
705
+ #
706
+ # Configuration can be applied globally to all clients, or to a single client
707
+ # on construction.
708
+ #
709
+ # # Examples
710
+ #
711
+ # To modify the global config, setting the timeout for create_participant
712
+ # to 20 seconds, and all remaining timeouts to 10 seconds:
713
+ #
714
+ # ::Google::Cloud::Dialogflow::V2::Participants::Client.configure do |config|
715
+ # config.timeout = 10.0
716
+ # config.rpcs.create_participant.timeout = 20.0
717
+ # end
718
+ #
719
+ # To apply the above configuration only to a new client:
720
+ #
721
+ # client = ::Google::Cloud::Dialogflow::V2::Participants::Client.new do |config|
722
+ # config.timeout = 10.0
723
+ # config.rpcs.create_participant.timeout = 20.0
724
+ # end
725
+ #
726
+ # @!attribute [rw] endpoint
727
+ # The hostname or hostname:port of the service endpoint.
728
+ # Defaults to `"dialogflow.googleapis.com"`.
729
+ # @return [::String]
730
+ # @!attribute [rw] credentials
731
+ # Credentials to send with calls. You may provide any of the following types:
732
+ # * (`String`) The path to a service account key file in JSON format
733
+ # * (`Hash`) A service account key as a Hash
734
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
735
+ # (see the [googleauth docs](https://googleapis.dev/ruby/googleauth/latest/index.html))
736
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
737
+ # (see the [signet docs](https://googleapis.dev/ruby/signet/latest/Signet/OAuth2/Client.html))
738
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
739
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
740
+ # * (`nil`) indicating no credentials
741
+ # @return [::Object]
742
+ # @!attribute [rw] scope
743
+ # The OAuth scopes
744
+ # @return [::Array<::String>]
745
+ # @!attribute [rw] lib_name
746
+ # The library name as recorded in instrumentation and logging
747
+ # @return [::String]
748
+ # @!attribute [rw] lib_version
749
+ # The library version as recorded in instrumentation and logging
750
+ # @return [::String]
751
+ # @!attribute [rw] channel_args
752
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
753
+ # `GRPC::Core::Channel` object is provided as the credential.
754
+ # @return [::Hash]
755
+ # @!attribute [rw] interceptors
756
+ # An array of interceptors that are run before calls are executed.
757
+ # @return [::Array<::GRPC::ClientInterceptor>]
758
+ # @!attribute [rw] timeout
759
+ # The call timeout in seconds.
760
+ # @return [::Numeric]
761
+ # @!attribute [rw] metadata
762
+ # Additional gRPC headers to be sent with the call.
763
+ # @return [::Hash{::Symbol=>::String}]
764
+ # @!attribute [rw] retry_policy
765
+ # The retry policy. The value is a hash with the following keys:
766
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
767
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
768
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
769
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
770
+ # trigger a retry.
771
+ # @return [::Hash]
772
+ # @!attribute [rw] quota_project
773
+ # A separate project against which to charge quota.
774
+ # @return [::String]
775
+ #
776
+ class Configuration
777
+ extend ::Gapic::Config
778
+
779
+ config_attr :endpoint, "dialogflow.googleapis.com", ::String
780
+ config_attr :credentials, nil do |value|
781
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
782
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
783
+ allowed.any? { |klass| klass === value }
784
+ end
785
+ config_attr :scope, nil, ::String, ::Array, nil
786
+ config_attr :lib_name, nil, ::String, nil
787
+ config_attr :lib_version, nil, ::String, nil
788
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
789
+ config_attr :interceptors, nil, ::Array, nil
790
+ config_attr :timeout, nil, ::Numeric, nil
791
+ config_attr :metadata, nil, ::Hash, nil
792
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
793
+ config_attr :quota_project, nil, ::String, nil
794
+
795
+ # @private
796
+ def initialize parent_config = nil
797
+ @parent_config = parent_config unless parent_config.nil?
798
+
799
+ yield self if block_given?
800
+ end
801
+
802
+ ##
803
+ # Configurations for individual RPCs
804
+ # @return [Rpcs]
805
+ #
806
+ def rpcs
807
+ @rpcs ||= begin
808
+ parent_rpcs = nil
809
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
810
+ Rpcs.new parent_rpcs
811
+ end
812
+ end
813
+
814
+ ##
815
+ # Configuration RPC class for the Participants API.
816
+ #
817
+ # Includes fields providing the configuration for each RPC in this service.
818
+ # Each configuration object is of type `Gapic::Config::Method` and includes
819
+ # the following configuration fields:
820
+ #
821
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
822
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
823
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
824
+ # include the following keys:
825
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
826
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
827
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
828
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
829
+ # trigger a retry.
830
+ #
831
+ class Rpcs
832
+ ##
833
+ # RPC-specific configuration for `create_participant`
834
+ # @return [::Gapic::Config::Method]
835
+ #
836
+ attr_reader :create_participant
837
+ ##
838
+ # RPC-specific configuration for `get_participant`
839
+ # @return [::Gapic::Config::Method]
840
+ #
841
+ attr_reader :get_participant
842
+ ##
843
+ # RPC-specific configuration for `list_participants`
844
+ # @return [::Gapic::Config::Method]
845
+ #
846
+ attr_reader :list_participants
847
+ ##
848
+ # RPC-specific configuration for `update_participant`
849
+ # @return [::Gapic::Config::Method]
850
+ #
851
+ attr_reader :update_participant
852
+ ##
853
+ # RPC-specific configuration for `analyze_content`
854
+ # @return [::Gapic::Config::Method]
855
+ #
856
+ attr_reader :analyze_content
857
+ ##
858
+ # RPC-specific configuration for `suggest_articles`
859
+ # @return [::Gapic::Config::Method]
860
+ #
861
+ attr_reader :suggest_articles
862
+ ##
863
+ # RPC-specific configuration for `suggest_faq_answers`
864
+ # @return [::Gapic::Config::Method]
865
+ #
866
+ attr_reader :suggest_faq_answers
867
+
868
+ # @private
869
+ def initialize parent_rpcs = nil
870
+ create_participant_config = parent_rpcs.create_participant if parent_rpcs.respond_to? :create_participant
871
+ @create_participant = ::Gapic::Config::Method.new create_participant_config
872
+ get_participant_config = parent_rpcs.get_participant if parent_rpcs.respond_to? :get_participant
873
+ @get_participant = ::Gapic::Config::Method.new get_participant_config
874
+ list_participants_config = parent_rpcs.list_participants if parent_rpcs.respond_to? :list_participants
875
+ @list_participants = ::Gapic::Config::Method.new list_participants_config
876
+ update_participant_config = parent_rpcs.update_participant if parent_rpcs.respond_to? :update_participant
877
+ @update_participant = ::Gapic::Config::Method.new update_participant_config
878
+ analyze_content_config = parent_rpcs.analyze_content if parent_rpcs.respond_to? :analyze_content
879
+ @analyze_content = ::Gapic::Config::Method.new analyze_content_config
880
+ suggest_articles_config = parent_rpcs.suggest_articles if parent_rpcs.respond_to? :suggest_articles
881
+ @suggest_articles = ::Gapic::Config::Method.new suggest_articles_config
882
+ suggest_faq_answers_config = parent_rpcs.suggest_faq_answers if parent_rpcs.respond_to? :suggest_faq_answers
883
+ @suggest_faq_answers = ::Gapic::Config::Method.new suggest_faq_answers_config
884
+
885
+ yield self if block_given?
886
+ end
887
+ end
888
+ end
889
+ end
890
+ end
891
+ end
892
+ end
893
+ end
894
+ end