google-cloud-ces-v1beta 1.0.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/ces/v1beta/agent_card_pb.rb +3 -1
  3. data/lib/google/cloud/ces/v1beta/agent_pb.rb +3 -1
  4. data/lib/google/cloud/ces/v1beta/agent_service/client.rb +105 -1
  5. data/lib/google/cloud/ces/v1beta/agent_service/paths.rb +54 -11
  6. data/lib/google/cloud/ces/v1beta/agent_service/rest/client.rb +98 -1
  7. data/lib/google/cloud/ces/v1beta/agent_service/rest/service_stub.rb +62 -0
  8. data/lib/google/cloud/ces/v1beta/agent_service_pb.rb +3 -1
  9. data/lib/google/cloud/ces/v1beta/agent_service_services_pb.rb +2 -0
  10. data/lib/google/cloud/ces/v1beta/agent_tool_pb.rb +1 -1
  11. data/lib/google/cloud/ces/v1beta/agent_transfers_pb.rb +1 -1
  12. data/lib/google/cloud/ces/v1beta/app_pb.rb +6 -1
  13. data/lib/google/cloud/ces/v1beta/app_version_pb.rb +1 -1
  14. data/lib/google/cloud/ces/v1beta/assistant_service/client.rb +1023 -0
  15. data/lib/google/cloud/ces/v1beta/assistant_service/credentials.rb +48 -0
  16. data/lib/google/cloud/ces/v1beta/assistant_service/paths.rb +73 -0
  17. data/lib/google/cloud/ces/v1beta/assistant_service/rest/client.rb +946 -0
  18. data/lib/google/cloud/ces/v1beta/assistant_service/rest/service_stub.rb +450 -0
  19. data/lib/google/cloud/ces/v1beta/assistant_service/rest.rb +55 -0
  20. data/lib/google/cloud/ces/v1beta/assistant_service.rb +57 -0
  21. data/lib/google/cloud/ces/v1beta/assistant_service_pb.rb +49 -0
  22. data/lib/google/cloud/ces/v1beta/assistant_service_services_pb.rb +57 -0
  23. data/lib/google/cloud/ces/v1beta/auth_pb.rb +1 -1
  24. data/lib/google/cloud/ces/v1beta/bigquery_export_pb.rb +1 -1
  25. data/lib/google/cloud/ces/v1beta/changelog_pb.rb +1 -1
  26. data/lib/google/cloud/ces/v1beta/client_function_pb.rb +1 -1
  27. data/lib/google/cloud/ces/v1beta/common_pb.rb +4 -1
  28. data/lib/google/cloud/ces/v1beta/connector_tool_pb.rb +1 -1
  29. data/lib/google/cloud/ces/v1beta/connector_toolset_pb.rb +1 -1
  30. data/lib/google/cloud/ces/v1beta/conversation_pb.rb +1 -1
  31. data/lib/google/cloud/ces/v1beta/data_store_pb.rb +1 -1
  32. data/lib/google/cloud/ces/v1beta/data_store_tool_pb.rb +2 -1
  33. data/lib/google/cloud/ces/v1beta/deployment_pb.rb +3 -1
  34. data/lib/google/cloud/ces/v1beta/evaluation_metrics_config_pb.rb +1 -1
  35. data/lib/google/cloud/ces/v1beta/evaluation_pb.rb +2 -1
  36. data/lib/google/cloud/ces/v1beta/evaluation_service/client.rb +2 -2
  37. data/lib/google/cloud/ces/v1beta/evaluation_service/rest/client.rb +2 -2
  38. data/lib/google/cloud/ces/v1beta/evaluation_service_pb.rb +1 -1
  39. data/lib/google/cloud/ces/v1beta/example_pb.rb +1 -1
  40. data/lib/google/cloud/ces/v1beta/fakes_pb.rb +1 -1
  41. data/lib/google/cloud/ces/v1beta/file_context_pb.rb +1 -1
  42. data/lib/google/cloud/ces/v1beta/file_search_tool_pb.rb +1 -1
  43. data/lib/google/cloud/ces/v1beta/google_search_tool_pb.rb +1 -1
  44. data/lib/google/cloud/ces/v1beta/guardrail_pb.rb +4 -1
  45. data/lib/google/cloud/ces/v1beta/mcp_tool_pb.rb +1 -1
  46. data/lib/google/cloud/ces/v1beta/mcp_toolset_pb.rb +1 -1
  47. data/lib/google/cloud/ces/v1beta/mocks_pb.rb +1 -1
  48. data/lib/google/cloud/ces/v1beta/omnichannel_pb.rb +1 -1
  49. data/lib/google/cloud/ces/v1beta/omnichannel_service_pb.rb +1 -1
  50. data/lib/google/cloud/ces/v1beta/open_api_tool_pb.rb +1 -1
  51. data/lib/google/cloud/ces/v1beta/open_api_toolset_pb.rb +1 -1
  52. data/lib/google/cloud/ces/v1beta/python_function_pb.rb +1 -1
  53. data/lib/google/cloud/ces/v1beta/rest.rb +1 -0
  54. data/lib/google/cloud/ces/v1beta/schema_pb.rb +1 -1
  55. data/lib/google/cloud/ces/v1beta/security_settings_pb.rb +1 -1
  56. data/lib/google/cloud/ces/v1beta/session_service/client.rb +333 -0
  57. data/lib/google/cloud/ces/v1beta/session_service/paths.rb +40 -0
  58. data/lib/google/cloud/ces/v1beta/session_service/rest/client.rb +314 -0
  59. data/lib/google/cloud/ces/v1beta/session_service/rest/service_stub.rb +180 -0
  60. data/lib/google/cloud/ces/v1beta/session_service_pb.rb +33 -1
  61. data/lib/google/cloud/ces/v1beta/session_service_services_pb.rb +14 -0
  62. data/lib/google/cloud/ces/v1beta/system_tool_pb.rb +1 -1
  63. data/lib/google/cloud/ces/v1beta/tool_pb.rb +1 -1
  64. data/lib/google/cloud/ces/v1beta/tool_service_pb.rb +1 -1
  65. data/lib/google/cloud/ces/v1beta/toolset_pb.rb +1 -1
  66. data/lib/google/cloud/ces/v1beta/toolset_tool_pb.rb +1 -1
  67. data/lib/google/cloud/ces/v1beta/version.rb +1 -1
  68. data/lib/google/cloud/ces/v1beta/widget_service_pb.rb +1 -1
  69. data/lib/google/cloud/ces/v1beta/widget_tool_pb.rb +1 -1
  70. data/lib/google/cloud/ces/v1beta.rb +1 -0
  71. data/proto_docs/google/api/field_info.rb +88 -0
  72. data/proto_docs/google/cloud/ces/v1beta/agent.rb +18 -2
  73. data/proto_docs/google/cloud/ces/v1beta/agent_card.rb +91 -0
  74. data/proto_docs/google/cloud/ces/v1beta/agent_service.rb +40 -0
  75. data/proto_docs/google/cloud/ces/v1beta/app.rb +113 -4
  76. data/proto_docs/google/cloud/ces/v1beta/app_version.rb +3 -0
  77. data/proto_docs/google/cloud/ces/v1beta/assistant_service.rb +452 -0
  78. data/proto_docs/google/cloud/ces/v1beta/common.rb +44 -0
  79. data/proto_docs/google/cloud/ces/v1beta/conversation.rb +4 -0
  80. data/proto_docs/google/cloud/ces/v1beta/data_store_tool.rb +16 -0
  81. data/proto_docs/google/cloud/ces/v1beta/deployment.rb +43 -2
  82. data/proto_docs/google/cloud/ces/v1beta/evaluation.rb +21 -5
  83. data/proto_docs/google/cloud/ces/v1beta/example.rb +23 -0
  84. data/proto_docs/google/cloud/ces/v1beta/guardrail.rb +88 -6
  85. data/proto_docs/google/cloud/ces/v1beta/session_service.rb +749 -11
  86. data/proto_docs/google/cloud/ces/v1beta/tool.rb +4 -0
  87. data/proto_docs/google/protobuf/timestamp.rb +7 -6
  88. metadata +14 -3
@@ -0,0 +1,1023 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 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/ces/v1beta/assistant_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Ces
26
+ module V1beta
27
+ module AssistantService
28
+ ##
29
+ # Client for the AssistantService service.
30
+ #
31
+ # The service that manages assistant-related resources in Customer Engagement
32
+ # Suite (CES). The assistant, Arc, is a conversational agent embedded in CES
33
+ # applications to help users with building their agents.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "ces.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :assistant_service_stub
46
+
47
+ ##
48
+ # Configure the AssistantService Client class.
49
+ #
50
+ # See {::Google::Cloud::Ces::V1beta::AssistantService::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all AssistantService clients
56
+ # ::Google::Cloud::Ces::V1beta::AssistantService::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "Ces", "V1beta"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 60.0
77
+ default_config.retry_policy = {
78
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
79
+ }
80
+
81
+ default_config.rpcs.chat_ai_assistant.timeout = 300.0
82
+ default_config.rpcs.chat_ai_assistant.retry_policy = {
83
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14]
84
+ }
85
+
86
+ default_config
87
+ end
88
+ yield @configure if block_given?
89
+ @configure
90
+ end
91
+
92
+ ##
93
+ # Configure the AssistantService Client instance.
94
+ #
95
+ # The configuration is set to the derived mode, meaning that values can be changed,
96
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
97
+ # should be made on {Client.configure}.
98
+ #
99
+ # See {::Google::Cloud::Ces::V1beta::AssistantService::Client::Configuration}
100
+ # for a description of the configuration fields.
101
+ #
102
+ # @yield [config] Configure the Client client.
103
+ # @yieldparam config [Client::Configuration]
104
+ #
105
+ # @return [Client::Configuration]
106
+ #
107
+ def configure
108
+ yield @config if block_given?
109
+ @config
110
+ end
111
+
112
+ ##
113
+ # The effective universe domain
114
+ #
115
+ # @return [String]
116
+ #
117
+ def universe_domain
118
+ @assistant_service_stub.universe_domain
119
+ end
120
+
121
+ ##
122
+ # Create a new AssistantService client object.
123
+ #
124
+ # @example
125
+ #
126
+ # # Create a client using the default configuration
127
+ # client = ::Google::Cloud::Ces::V1beta::AssistantService::Client.new
128
+ #
129
+ # # Create a client using a custom configuration
130
+ # client = ::Google::Cloud::Ces::V1beta::AssistantService::Client.new do |config|
131
+ # config.timeout = 10.0
132
+ # end
133
+ #
134
+ # @yield [config] Configure the AssistantService client.
135
+ # @yieldparam config [Client::Configuration]
136
+ #
137
+ def initialize
138
+ # These require statements are intentionally placed here to initialize
139
+ # the gRPC module only when it's required.
140
+ # See https://github.com/googleapis/toolkit/issues/446
141
+ require "gapic/grpc"
142
+ require "google/cloud/ces/v1beta/assistant_service_services_pb"
143
+
144
+ # Create the configuration object
145
+ @config = Configuration.new Client.configure
146
+
147
+ # Yield the configuration if needed
148
+ yield @config if block_given?
149
+
150
+ # Create credentials
151
+ credentials = @config.credentials
152
+ # Use self-signed JWT if the endpoint is unchanged from default,
153
+ # but only if the default endpoint does not have a region prefix.
154
+ enable_self_signed_jwt = @config.endpoint.nil? ||
155
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
156
+ !@config.endpoint.split(".").first.include?("-"))
157
+ credentials ||= Credentials.default scope: @config.scope,
158
+ enable_self_signed_jwt: enable_self_signed_jwt
159
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
160
+ credentials = Credentials.new credentials, scope: @config.scope
161
+ end
162
+ @quota_project_id = @config.quota_project
163
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
164
+
165
+ @assistant_service_stub = ::Gapic::ServiceStub.new(
166
+ ::Google::Cloud::Ces::V1beta::AssistantService::Stub,
167
+ credentials: credentials,
168
+ endpoint: @config.endpoint,
169
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
+ universe_domain: @config.universe_domain,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @assistant_service_stub.stub_logger&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
187
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @assistant_service_stub.endpoint
191
+ config.universe_domain = @assistant_service_stub.universe_domain
192
+ config.logger = @assistant_service_stub.logger if config.respond_to? :logger=
193
+ end
194
+ end
195
+
196
+ ##
197
+ # Get the associated client for mix-in of the Locations.
198
+ #
199
+ # @return [Google::Cloud::Location::Locations::Client]
200
+ #
201
+ attr_reader :location_client
202
+
203
+ ##
204
+ # The logger used for request/response debug logging.
205
+ #
206
+ # @return [Logger]
207
+ #
208
+ def logger
209
+ @assistant_service_stub.logger
210
+ end
211
+
212
+ # Service calls
213
+
214
+ ##
215
+ # Lists all assistant sessions in the given app.
216
+ #
217
+ # @overload list_assistant_sessions(request, options = nil)
218
+ # Pass arguments to `list_assistant_sessions` via a request object, either of type
219
+ # {::Google::Cloud::Ces::V1beta::ListAssistantSessionsRequest} or an equivalent Hash.
220
+ #
221
+ # @param request [::Google::Cloud::Ces::V1beta::ListAssistantSessionsRequest, ::Hash]
222
+ # A request object representing the call parameters. Required. To specify no
223
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
224
+ # @param options [::Gapic::CallOptions, ::Hash]
225
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
226
+ #
227
+ # @overload list_assistant_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil)
228
+ # Pass arguments to `list_assistant_sessions` via keyword arguments. Note that at
229
+ # least one keyword argument is required. To specify no parameters, or to keep all
230
+ # the default parameter values, pass an empty Hash as a request object (see above).
231
+ #
232
+ # @param parent [::String]
233
+ # Required. The app to list assistant sessions from.
234
+ # Format:
235
+ # `projects/{project}/locations/{location}/apps/{app}`
236
+ # @param page_size [::Integer]
237
+ # Optional. Requested page size. Server may return fewer items than
238
+ # requested. If unspecified, server will pick an appropriate default.
239
+ # @param page_token [::String]
240
+ # Optional. The
241
+ # {::Google::Cloud::Ces::V1beta::ListAssistantSessionsResponse#next_page_token next_page_token}
242
+ # value returned from a previous list
243
+ # {::Google::Cloud::Ces::V1beta::AssistantService::Client#list_assistant_sessions AssistantService.ListAssistantSessions}
244
+ # call.
245
+ # @param filter [::String]
246
+ # Optional. Filter to be applied when listing the assistant sessions.
247
+ # See https://google.aip.dev/160 for more details.
248
+ #
249
+ # @yield [response, operation] Access the result along with the RPC operation
250
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>]
251
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
252
+ #
253
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::Ces::V1beta::AssistantSession>]
254
+ #
255
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
256
+ #
257
+ # @example Basic example
258
+ # require "google/cloud/ces/v1beta"
259
+ #
260
+ # # Create a client object. The client can be reused for multiple calls.
261
+ # client = Google::Cloud::Ces::V1beta::AssistantService::Client.new
262
+ #
263
+ # # Create a request. To set request fields, pass in keyword arguments.
264
+ # request = Google::Cloud::Ces::V1beta::ListAssistantSessionsRequest.new
265
+ #
266
+ # # Call the list_assistant_sessions method.
267
+ # result = client.list_assistant_sessions request
268
+ #
269
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
270
+ # # over elements, and API calls will be issued to fetch pages as needed.
271
+ # result.each do |item|
272
+ # # Each element is of type ::Google::Cloud::Ces::V1beta::AssistantSession.
273
+ # p item
274
+ # end
275
+ #
276
+ def list_assistant_sessions request, options = nil
277
+ raise ::ArgumentError, "request must be provided" if request.nil?
278
+
279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::ListAssistantSessionsRequest
280
+
281
+ # Converts hash and nil to an options object
282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
283
+
284
+ # Customize the options with defaults
285
+ metadata = @config.rpcs.list_assistant_sessions.metadata.to_h
286
+
287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
288
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
290
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
291
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
292
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
293
+
294
+ header_params = {}
295
+ if request.parent
296
+ header_params["parent"] = request.parent
297
+ end
298
+
299
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
300
+ metadata[:"x-goog-request-params"] ||= request_params_header
301
+
302
+ options.apply_defaults timeout: @config.rpcs.list_assistant_sessions.timeout,
303
+ metadata: metadata,
304
+ retry_policy: @config.rpcs.list_assistant_sessions.retry_policy
305
+
306
+ options.apply_defaults timeout: @config.timeout,
307
+ metadata: @config.metadata,
308
+ retry_policy: @config.retry_policy
309
+
310
+ @assistant_service_stub.call_rpc :list_assistant_sessions, request, options: options do |response, operation|
311
+ response = ::Gapic::PagedEnumerable.new @assistant_service_stub, :list_assistant_sessions, request, response, operation, options
312
+ yield response, operation if block_given?
313
+ throw :response, response
314
+ end
315
+ rescue ::GRPC::BadStatus => e
316
+ raise ::Google::Cloud::Error.from_error(e)
317
+ end
318
+
319
+ ##
320
+ # Gets details of the specified assistant session.
321
+ #
322
+ # @overload get_assistant_session(request, options = nil)
323
+ # Pass arguments to `get_assistant_session` via a request object, either of type
324
+ # {::Google::Cloud::Ces::V1beta::GetAssistantSessionRequest} or an equivalent Hash.
325
+ #
326
+ # @param request [::Google::Cloud::Ces::V1beta::GetAssistantSessionRequest, ::Hash]
327
+ # A request object representing the call parameters. Required. To specify no
328
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
329
+ # @param options [::Gapic::CallOptions, ::Hash]
330
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
331
+ #
332
+ # @overload get_assistant_session(name: nil)
333
+ # Pass arguments to `get_assistant_session` via keyword arguments. Note that at
334
+ # least one keyword argument is required. To specify no parameters, or to keep all
335
+ # the default parameter values, pass an empty Hash as a request object (see above).
336
+ #
337
+ # @param name [::String]
338
+ # Required. The name of the assistant session to retrieve.
339
+ # Format:
340
+ # `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}`
341
+ #
342
+ # @yield [response, operation] Access the result along with the RPC operation
343
+ # @yieldparam response [::Google::Cloud::Ces::V1beta::AssistantSession]
344
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
345
+ #
346
+ # @return [::Google::Cloud::Ces::V1beta::AssistantSession]
347
+ #
348
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
349
+ #
350
+ # @example Basic example
351
+ # require "google/cloud/ces/v1beta"
352
+ #
353
+ # # Create a client object. The client can be reused for multiple calls.
354
+ # client = Google::Cloud::Ces::V1beta::AssistantService::Client.new
355
+ #
356
+ # # Create a request. To set request fields, pass in keyword arguments.
357
+ # request = Google::Cloud::Ces::V1beta::GetAssistantSessionRequest.new
358
+ #
359
+ # # Call the get_assistant_session method.
360
+ # result = client.get_assistant_session request
361
+ #
362
+ # # The returned object is of type Google::Cloud::Ces::V1beta::AssistantSession.
363
+ # p result
364
+ #
365
+ def get_assistant_session request, options = nil
366
+ raise ::ArgumentError, "request must be provided" if request.nil?
367
+
368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::GetAssistantSessionRequest
369
+
370
+ # Converts hash and nil to an options object
371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
372
+
373
+ # Customize the options with defaults
374
+ metadata = @config.rpcs.get_assistant_session.metadata.to_h
375
+
376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
377
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
379
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
380
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
381
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
382
+
383
+ header_params = {}
384
+ if request.name
385
+ header_params["name"] = request.name
386
+ end
387
+
388
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
389
+ metadata[:"x-goog-request-params"] ||= request_params_header
390
+
391
+ options.apply_defaults timeout: @config.rpcs.get_assistant_session.timeout,
392
+ metadata: metadata,
393
+ retry_policy: @config.rpcs.get_assistant_session.retry_policy
394
+
395
+ options.apply_defaults timeout: @config.timeout,
396
+ metadata: @config.metadata,
397
+ retry_policy: @config.retry_policy
398
+
399
+ @assistant_service_stub.call_rpc :get_assistant_session, request, options: options do |response, operation|
400
+ yield response, operation if block_given?
401
+ end
402
+ rescue ::GRPC::BadStatus => e
403
+ raise ::Google::Cloud::Error.from_error(e)
404
+ end
405
+
406
+ ##
407
+ # Creates a new assistant session in the given app.
408
+ #
409
+ # @overload create_assistant_session(request, options = nil)
410
+ # Pass arguments to `create_assistant_session` via a request object, either of type
411
+ # {::Google::Cloud::Ces::V1beta::CreateAssistantSessionRequest} or an equivalent Hash.
412
+ #
413
+ # @param request [::Google::Cloud::Ces::V1beta::CreateAssistantSessionRequest, ::Hash]
414
+ # A request object representing the call parameters. Required. To specify no
415
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
416
+ # @param options [::Gapic::CallOptions, ::Hash]
417
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
418
+ #
419
+ # @overload create_assistant_session(parent: nil, assistant_session_id: nil, assistant_session_messages: nil)
420
+ # Pass arguments to `create_assistant_session` via keyword arguments. Note that at
421
+ # least one keyword argument is required. To specify no parameters, or to keep all
422
+ # the default parameter values, pass an empty Hash as a request object (see above).
423
+ #
424
+ # @param parent [::String]
425
+ # Required. The app to create the assistant session in
426
+ # Format:
427
+ # `projects/{project}/locations/{location}/apps/{app}`
428
+ # @param assistant_session_id [::String]
429
+ # Optional. The ID to use for the assistant session, which will become the
430
+ # final component of the assistant session's resource name. If not provided,
431
+ # a unique ID will be automatically assigned for the assistant session.
432
+ # @param assistant_session_messages [::Array<::Google::Cloud::Ces::V1beta::AssistantMessage, ::Hash>]
433
+ # Optional. The messages to seed the assistant session with.
434
+ #
435
+ # @yield [response, operation] Access the result along with the RPC operation
436
+ # @yieldparam response [::Google::Cloud::Ces::V1beta::AssistantSession]
437
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
438
+ #
439
+ # @return [::Google::Cloud::Ces::V1beta::AssistantSession]
440
+ #
441
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
442
+ #
443
+ # @example Basic example
444
+ # require "google/cloud/ces/v1beta"
445
+ #
446
+ # # Create a client object. The client can be reused for multiple calls.
447
+ # client = Google::Cloud::Ces::V1beta::AssistantService::Client.new
448
+ #
449
+ # # Create a request. To set request fields, pass in keyword arguments.
450
+ # request = Google::Cloud::Ces::V1beta::CreateAssistantSessionRequest.new
451
+ #
452
+ # # Call the create_assistant_session method.
453
+ # result = client.create_assistant_session request
454
+ #
455
+ # # The returned object is of type Google::Cloud::Ces::V1beta::AssistantSession.
456
+ # p result
457
+ #
458
+ def create_assistant_session request, options = nil
459
+ raise ::ArgumentError, "request must be provided" if request.nil?
460
+
461
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::CreateAssistantSessionRequest
462
+
463
+ # Converts hash and nil to an options object
464
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
465
+
466
+ # Customize the options with defaults
467
+ metadata = @config.rpcs.create_assistant_session.metadata.to_h
468
+
469
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
470
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
471
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
472
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
473
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
474
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
475
+
476
+ header_params = {}
477
+ if request.parent
478
+ header_params["parent"] = request.parent
479
+ end
480
+
481
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
482
+ metadata[:"x-goog-request-params"] ||= request_params_header
483
+
484
+ options.apply_defaults timeout: @config.rpcs.create_assistant_session.timeout,
485
+ metadata: metadata,
486
+ retry_policy: @config.rpcs.create_assistant_session.retry_policy
487
+
488
+ options.apply_defaults timeout: @config.timeout,
489
+ metadata: @config.metadata,
490
+ retry_policy: @config.retry_policy
491
+
492
+ @assistant_service_stub.call_rpc :create_assistant_session, request, options: options do |response, operation|
493
+ yield response, operation if block_given?
494
+ end
495
+ rescue ::GRPC::BadStatus => e
496
+ raise ::Google::Cloud::Error.from_error(e)
497
+ end
498
+
499
+ ##
500
+ # Deletes the specified assistant session.
501
+ #
502
+ # @overload delete_assistant_session(request, options = nil)
503
+ # Pass arguments to `delete_assistant_session` via a request object, either of type
504
+ # {::Google::Cloud::Ces::V1beta::DeleteAssistantSessionRequest} or an equivalent Hash.
505
+ #
506
+ # @param request [::Google::Cloud::Ces::V1beta::DeleteAssistantSessionRequest, ::Hash]
507
+ # A request object representing the call parameters. Required. To specify no
508
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
509
+ # @param options [::Gapic::CallOptions, ::Hash]
510
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
511
+ #
512
+ # @overload delete_assistant_session(name: nil)
513
+ # Pass arguments to `delete_assistant_session` via keyword arguments. Note that at
514
+ # least one keyword argument is required. To specify no parameters, or to keep all
515
+ # the default parameter values, pass an empty Hash as a request object (see above).
516
+ #
517
+ # @param name [::String]
518
+ # Required. The name of the assistant session to delete.
519
+ # Format:
520
+ # `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}`
521
+ #
522
+ # @yield [response, operation] Access the result along with the RPC operation
523
+ # @yieldparam response [::Google::Protobuf::Empty]
524
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
525
+ #
526
+ # @return [::Google::Protobuf::Empty]
527
+ #
528
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
529
+ #
530
+ # @example Basic example
531
+ # require "google/cloud/ces/v1beta"
532
+ #
533
+ # # Create a client object. The client can be reused for multiple calls.
534
+ # client = Google::Cloud::Ces::V1beta::AssistantService::Client.new
535
+ #
536
+ # # Create a request. To set request fields, pass in keyword arguments.
537
+ # request = Google::Cloud::Ces::V1beta::DeleteAssistantSessionRequest.new
538
+ #
539
+ # # Call the delete_assistant_session method.
540
+ # result = client.delete_assistant_session request
541
+ #
542
+ # # The returned object is of type Google::Protobuf::Empty.
543
+ # p result
544
+ #
545
+ def delete_assistant_session request, options = nil
546
+ raise ::ArgumentError, "request must be provided" if request.nil?
547
+
548
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::DeleteAssistantSessionRequest
549
+
550
+ # Converts hash and nil to an options object
551
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
552
+
553
+ # Customize the options with defaults
554
+ metadata = @config.rpcs.delete_assistant_session.metadata.to_h
555
+
556
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
557
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
558
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
559
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
560
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
561
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
562
+
563
+ header_params = {}
564
+ if request.name
565
+ header_params["name"] = request.name
566
+ end
567
+
568
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
569
+ metadata[:"x-goog-request-params"] ||= request_params_header
570
+
571
+ options.apply_defaults timeout: @config.rpcs.delete_assistant_session.timeout,
572
+ metadata: metadata,
573
+ retry_policy: @config.rpcs.delete_assistant_session.retry_policy
574
+
575
+ options.apply_defaults timeout: @config.timeout,
576
+ metadata: @config.metadata,
577
+ retry_policy: @config.retry_policy
578
+
579
+ @assistant_service_stub.call_rpc :delete_assistant_session, request, options: options do |response, operation|
580
+ yield response, operation if block_given?
581
+ end
582
+ rescue ::GRPC::BadStatus => e
583
+ raise ::Google::Cloud::Error.from_error(e)
584
+ end
585
+
586
+ ##
587
+ # Runs the assistant agent for the specified assistant session.
588
+ #
589
+ # @overload run_assistant(request, options = nil)
590
+ # Pass arguments to `run_assistant` via a request object, either of type
591
+ # {::Google::Cloud::Ces::V1beta::RunAssistantRequest} or an equivalent Hash.
592
+ #
593
+ # @param request [::Google::Cloud::Ces::V1beta::RunAssistantRequest, ::Hash]
594
+ # A request object representing the call parameters. Required. To specify no
595
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
596
+ # @param options [::Gapic::CallOptions, ::Hash]
597
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
598
+ #
599
+ # @overload run_assistant(app: nil, assistant_session: nil, message: nil, interaction_type: nil)
600
+ # Pass arguments to `run_assistant` via keyword arguments. Note that at
601
+ # least one keyword argument is required. To specify no parameters, or to keep all
602
+ # the default parameter values, pass an empty Hash as a request object (see above).
603
+ #
604
+ # @param app [::String]
605
+ # Required. The app to run assistant for.
606
+ # Format:
607
+ # `projects/{project}/locations/{location}/apps/{app}`
608
+ # @param assistant_session [::String]
609
+ # Required. The assistant session to be used to run the assistant.
610
+ # Format:
611
+ # `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}`
612
+ # @param message [::Google::Cloud::Ces::V1beta::AssistantMessage, ::Hash]
613
+ # Required. The message to send to the assistant agent.
614
+ # @param interaction_type [::Google::Cloud::Ces::V1beta::RunAssistantRequest::InteractionType]
615
+ # Optional. Different interaction types for the assistant message.
616
+ #
617
+ # @yield [response, operation] Access the result along with the RPC operation
618
+ # @yieldparam response [::Google::Cloud::Ces::V1beta::RunAssistantResponse]
619
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
620
+ #
621
+ # @return [::Google::Cloud::Ces::V1beta::RunAssistantResponse]
622
+ #
623
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
624
+ #
625
+ # @example Basic example
626
+ # require "google/cloud/ces/v1beta"
627
+ #
628
+ # # Create a client object. The client can be reused for multiple calls.
629
+ # client = Google::Cloud::Ces::V1beta::AssistantService::Client.new
630
+ #
631
+ # # Create a request. To set request fields, pass in keyword arguments.
632
+ # request = Google::Cloud::Ces::V1beta::RunAssistantRequest.new
633
+ #
634
+ # # Call the run_assistant method.
635
+ # result = client.run_assistant request
636
+ #
637
+ # # The returned object is of type Google::Cloud::Ces::V1beta::RunAssistantResponse.
638
+ # p result
639
+ #
640
+ def run_assistant request, options = nil
641
+ raise ::ArgumentError, "request must be provided" if request.nil?
642
+
643
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::RunAssistantRequest
644
+
645
+ # Converts hash and nil to an options object
646
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
647
+
648
+ # Customize the options with defaults
649
+ metadata = @config.rpcs.run_assistant.metadata.to_h
650
+
651
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
652
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
653
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
654
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
655
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
656
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
657
+
658
+ header_params = {}
659
+ if request.app
660
+ header_params["app"] = request.app
661
+ end
662
+
663
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
664
+ metadata[:"x-goog-request-params"] ||= request_params_header
665
+
666
+ options.apply_defaults timeout: @config.rpcs.run_assistant.timeout,
667
+ metadata: metadata,
668
+ retry_policy: @config.rpcs.run_assistant.retry_policy
669
+
670
+ options.apply_defaults timeout: @config.timeout,
671
+ metadata: @config.metadata,
672
+ retry_policy: @config.retry_policy
673
+
674
+ @assistant_service_stub.call_rpc :run_assistant, request, options: options do |response, operation|
675
+ yield response, operation if block_given?
676
+ end
677
+ rescue ::GRPC::BadStatus => e
678
+ raise ::Google::Cloud::Error.from_error(e)
679
+ end
680
+
681
+ ##
682
+ # Runs Arc, the AI assistant, for the specified assistant session.
683
+ #
684
+ # @overload chat_ai_assistant(request, options = nil)
685
+ # Pass arguments to `chat_ai_assistant` via a request object, either of type
686
+ # {::Google::Cloud::Ces::V1beta::ChatAiAssistantRequest} or an equivalent Hash.
687
+ #
688
+ # @param request [::Google::Cloud::Ces::V1beta::ChatAiAssistantRequest, ::Hash]
689
+ # A request object representing the call parameters. Required. To specify no
690
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
691
+ # @param options [::Gapic::CallOptions, ::Hash]
692
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
693
+ #
694
+ # @overload chat_ai_assistant(app: nil, assistant_session: nil, message: nil, attached_gcs_uris: nil, context_token: nil)
695
+ # Pass arguments to `chat_ai_assistant` via keyword arguments. Note that at
696
+ # least one keyword argument is required. To specify no parameters, or to keep all
697
+ # the default parameter values, pass an empty Hash as a request object (see above).
698
+ #
699
+ # @param app [::String]
700
+ # Required. The app to run assistant for.
701
+ # Format:
702
+ # `projects/{project}/locations/{location}/apps/{app}`
703
+ # @param assistant_session [::String]
704
+ # Required. The assistant session to be used to run the assistant.
705
+ # Format:
706
+ # `projects/{project}/locations/{location}/apps/{app}/assistantSessions/{assistant_session}`
707
+ # @param message [::String]
708
+ # Required. The message to send to the assistant agent.
709
+ # @param attached_gcs_uris [::Array<::String>]
710
+ # Optional. Cloud Storage URIs for files uploaded by the user during this
711
+ # turn. Example: "gs://cxas-transient-uploads/uuid/prd.pdf"
712
+ # @param context_token [::String]
713
+ # Optional. Opaque onboarding context token returned by
714
+ # {::Google::Cloud::Ces::V1beta::SessionService::Client#generate_onboarding_suggestions SessionService.GenerateOnboardingSuggestions}.
715
+ # When set and still fresh, the server reuses the onboarding snapshot
716
+ # computed for the zero state instead of recomputing it for the first
717
+ # conversation turn.
718
+ #
719
+ # @yield [response, operation] Access the result along with the RPC operation
720
+ # @yieldparam response [::Google::Cloud::Ces::V1beta::ChatAiAssistantResponse]
721
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
722
+ #
723
+ # @return [::Google::Cloud::Ces::V1beta::ChatAiAssistantResponse]
724
+ #
725
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
726
+ #
727
+ # @example Basic example
728
+ # require "google/cloud/ces/v1beta"
729
+ #
730
+ # # Create a client object. The client can be reused for multiple calls.
731
+ # client = Google::Cloud::Ces::V1beta::AssistantService::Client.new
732
+ #
733
+ # # Create a request. To set request fields, pass in keyword arguments.
734
+ # request = Google::Cloud::Ces::V1beta::ChatAiAssistantRequest.new
735
+ #
736
+ # # Call the chat_ai_assistant method.
737
+ # result = client.chat_ai_assistant request
738
+ #
739
+ # # The returned object is of type Google::Cloud::Ces::V1beta::ChatAiAssistantResponse.
740
+ # p result
741
+ #
742
+ def chat_ai_assistant request, options = nil
743
+ raise ::ArgumentError, "request must be provided" if request.nil?
744
+
745
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Ces::V1beta::ChatAiAssistantRequest
746
+
747
+ # Converts hash and nil to an options object
748
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
749
+
750
+ # Customize the options with defaults
751
+ metadata = @config.rpcs.chat_ai_assistant.metadata.to_h
752
+
753
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
754
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
755
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
756
+ gapic_version: ::Google::Cloud::Ces::V1beta::VERSION
757
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
758
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
759
+
760
+ header_params = {}
761
+ if request.app
762
+ header_params["app"] = request.app
763
+ end
764
+
765
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
766
+ metadata[:"x-goog-request-params"] ||= request_params_header
767
+
768
+ options.apply_defaults timeout: @config.rpcs.chat_ai_assistant.timeout,
769
+ metadata: metadata,
770
+ retry_policy: @config.rpcs.chat_ai_assistant.retry_policy
771
+
772
+ options.apply_defaults timeout: @config.timeout,
773
+ metadata: @config.metadata,
774
+ retry_policy: @config.retry_policy
775
+
776
+ @assistant_service_stub.call_rpc :chat_ai_assistant, request, options: options do |response, operation|
777
+ yield response, operation if block_given?
778
+ end
779
+ rescue ::GRPC::BadStatus => e
780
+ raise ::Google::Cloud::Error.from_error(e)
781
+ end
782
+
783
+ ##
784
+ # Configuration class for the AssistantService API.
785
+ #
786
+ # This class represents the configuration for AssistantService,
787
+ # providing control over timeouts, retry behavior, logging, transport
788
+ # parameters, and other low-level controls. Certain parameters can also be
789
+ # applied individually to specific RPCs. See
790
+ # {::Google::Cloud::Ces::V1beta::AssistantService::Client::Configuration::Rpcs}
791
+ # for a list of RPCs that can be configured independently.
792
+ #
793
+ # Configuration can be applied globally to all clients, or to a single client
794
+ # on construction.
795
+ #
796
+ # @example
797
+ #
798
+ # # Modify the global config, setting the timeout for
799
+ # # list_assistant_sessions to 20 seconds,
800
+ # # and all remaining timeouts to 10 seconds.
801
+ # ::Google::Cloud::Ces::V1beta::AssistantService::Client.configure do |config|
802
+ # config.timeout = 10.0
803
+ # config.rpcs.list_assistant_sessions.timeout = 20.0
804
+ # end
805
+ #
806
+ # # Apply the above configuration only to a new client.
807
+ # client = ::Google::Cloud::Ces::V1beta::AssistantService::Client.new do |config|
808
+ # config.timeout = 10.0
809
+ # config.rpcs.list_assistant_sessions.timeout = 20.0
810
+ # end
811
+ #
812
+ # @!attribute [rw] endpoint
813
+ # A custom service endpoint, as a hostname or hostname:port. The default is
814
+ # nil, indicating to use the default endpoint in the current universe domain.
815
+ # @return [::String,nil]
816
+ # @!attribute [rw] credentials
817
+ # Credentials to send with calls. You may provide any of the following types:
818
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
819
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
820
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
821
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
822
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
823
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
824
+ # * (`nil`) indicating no credentials
825
+ #
826
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
827
+ # is deprecated. Providing an unvalidated credential configuration to
828
+ # Google APIs can compromise the security of your systems and data.
829
+ #
830
+ # @example
831
+ #
832
+ # # The recommended way to provide credentials is to use the `make_creds` method
833
+ # # on the appropriate credentials class for your environment.
834
+ #
835
+ # require "googleauth"
836
+ #
837
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
838
+ # json_key_io: ::File.open("/path/to/keyfile.json")
839
+ # )
840
+ #
841
+ # client = ::Google::Cloud::Ces::V1beta::AssistantService::Client.new do |config|
842
+ # config.credentials = credentials
843
+ # end
844
+ #
845
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
846
+ # external source for authentication to Google Cloud, you must validate it before
847
+ # providing it to a Google API client library. Providing an unvalidated credential
848
+ # configuration to Google APIs can compromise the security of your systems and data.
849
+ # For more information, refer to [Validate credential configurations from external
850
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
851
+ # @return [::Object]
852
+ # @!attribute [rw] scope
853
+ # The OAuth scopes
854
+ # @return [::Array<::String>]
855
+ # @!attribute [rw] lib_name
856
+ # The library name as recorded in instrumentation and logging
857
+ # @return [::String]
858
+ # @!attribute [rw] lib_version
859
+ # The library version as recorded in instrumentation and logging
860
+ # @return [::String]
861
+ # @!attribute [rw] channel_args
862
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
863
+ # `GRPC::Core::Channel` object is provided as the credential.
864
+ # @return [::Hash]
865
+ # @!attribute [rw] interceptors
866
+ # An array of interceptors that are run before calls are executed.
867
+ # @return [::Array<::GRPC::ClientInterceptor>]
868
+ # @!attribute [rw] timeout
869
+ # The call timeout in seconds.
870
+ # @return [::Numeric]
871
+ # @!attribute [rw] metadata
872
+ # Additional gRPC headers to be sent with the call.
873
+ # @return [::Hash{::Symbol=>::String}]
874
+ # @!attribute [rw] retry_policy
875
+ # The retry policy. The value is a hash with the following keys:
876
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
877
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
878
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
879
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
880
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
881
+ # trigger a retry.
882
+ # @return [::Hash]
883
+ # @!attribute [rw] quota_project
884
+ # A separate project against which to charge quota.
885
+ # @return [::String]
886
+ # @!attribute [rw] universe_domain
887
+ # The universe domain within which to make requests. This determines the
888
+ # default endpoint URL. The default value of nil uses the environment
889
+ # universe (usually the default "googleapis.com" universe).
890
+ # @return [::String,nil]
891
+ # @!attribute [rw] logger
892
+ # A custom logger to use for request/response debug logging, or the value
893
+ # `:default` (the default) to construct a default logger, or `nil` to
894
+ # explicitly disable logging.
895
+ # @return [::Logger,:default,nil]
896
+ #
897
+ class Configuration
898
+ extend ::Gapic::Config
899
+
900
+ # @private
901
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
902
+ DEFAULT_ENDPOINT = "ces.googleapis.com"
903
+
904
+ config_attr :endpoint, nil, ::String, nil
905
+ config_attr :credentials, nil do |value|
906
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
907
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
908
+ allowed.any? { |klass| klass === value }
909
+ end
910
+ config_attr :scope, nil, ::String, ::Array, nil
911
+ config_attr :lib_name, nil, ::String, nil
912
+ config_attr :lib_version, nil, ::String, nil
913
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
914
+ config_attr :interceptors, nil, ::Array, nil
915
+ config_attr :timeout, nil, ::Numeric, nil
916
+ config_attr :metadata, nil, ::Hash, nil
917
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
918
+ config_attr :quota_project, nil, ::String, nil
919
+ config_attr :universe_domain, nil, ::String, nil
920
+ config_attr :logger, :default, ::Logger, nil, :default
921
+
922
+ # @private
923
+ def initialize parent_config = nil
924
+ @parent_config = parent_config unless parent_config.nil?
925
+
926
+ yield self if block_given?
927
+ end
928
+
929
+ ##
930
+ # Configurations for individual RPCs
931
+ # @return [Rpcs]
932
+ #
933
+ def rpcs
934
+ @rpcs ||= begin
935
+ parent_rpcs = nil
936
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
937
+ Rpcs.new parent_rpcs
938
+ end
939
+ end
940
+
941
+ ##
942
+ # Configuration for the channel pool
943
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
944
+ #
945
+ def channel_pool
946
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
947
+ end
948
+
949
+ ##
950
+ # Configuration RPC class for the AssistantService API.
951
+ #
952
+ # Includes fields providing the configuration for each RPC in this service.
953
+ # Each configuration object is of type `Gapic::Config::Method` and includes
954
+ # the following configuration fields:
955
+ #
956
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
957
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
958
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
959
+ # include the following keys:
960
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
961
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
962
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
963
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
964
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
965
+ # trigger a retry.
966
+ #
967
+ class Rpcs
968
+ ##
969
+ # RPC-specific configuration for `list_assistant_sessions`
970
+ # @return [::Gapic::Config::Method]
971
+ #
972
+ attr_reader :list_assistant_sessions
973
+ ##
974
+ # RPC-specific configuration for `get_assistant_session`
975
+ # @return [::Gapic::Config::Method]
976
+ #
977
+ attr_reader :get_assistant_session
978
+ ##
979
+ # RPC-specific configuration for `create_assistant_session`
980
+ # @return [::Gapic::Config::Method]
981
+ #
982
+ attr_reader :create_assistant_session
983
+ ##
984
+ # RPC-specific configuration for `delete_assistant_session`
985
+ # @return [::Gapic::Config::Method]
986
+ #
987
+ attr_reader :delete_assistant_session
988
+ ##
989
+ # RPC-specific configuration for `run_assistant`
990
+ # @return [::Gapic::Config::Method]
991
+ #
992
+ attr_reader :run_assistant
993
+ ##
994
+ # RPC-specific configuration for `chat_ai_assistant`
995
+ # @return [::Gapic::Config::Method]
996
+ #
997
+ attr_reader :chat_ai_assistant
998
+
999
+ # @private
1000
+ def initialize parent_rpcs = nil
1001
+ list_assistant_sessions_config = parent_rpcs.list_assistant_sessions if parent_rpcs.respond_to? :list_assistant_sessions
1002
+ @list_assistant_sessions = ::Gapic::Config::Method.new list_assistant_sessions_config
1003
+ get_assistant_session_config = parent_rpcs.get_assistant_session if parent_rpcs.respond_to? :get_assistant_session
1004
+ @get_assistant_session = ::Gapic::Config::Method.new get_assistant_session_config
1005
+ create_assistant_session_config = parent_rpcs.create_assistant_session if parent_rpcs.respond_to? :create_assistant_session
1006
+ @create_assistant_session = ::Gapic::Config::Method.new create_assistant_session_config
1007
+ delete_assistant_session_config = parent_rpcs.delete_assistant_session if parent_rpcs.respond_to? :delete_assistant_session
1008
+ @delete_assistant_session = ::Gapic::Config::Method.new delete_assistant_session_config
1009
+ run_assistant_config = parent_rpcs.run_assistant if parent_rpcs.respond_to? :run_assistant
1010
+ @run_assistant = ::Gapic::Config::Method.new run_assistant_config
1011
+ chat_ai_assistant_config = parent_rpcs.chat_ai_assistant if parent_rpcs.respond_to? :chat_ai_assistant
1012
+ @chat_ai_assistant = ::Gapic::Config::Method.new chat_ai_assistant_config
1013
+
1014
+ yield self if block_given?
1015
+ end
1016
+ end
1017
+ end
1018
+ end
1019
+ end
1020
+ end
1021
+ end
1022
+ end
1023
+ end