google-cloud-gemini_data_analytics-v1 0.a → 0.1.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 (63) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +154 -8
  5. data/lib/google/cloud/gemini_data_analytics/v1/bindings_override.rb +75 -0
  6. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/client.rb +1635 -0
  7. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/credentials.rb +47 -0
  8. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/operations.rb +841 -0
  9. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/paths.rb +90 -0
  10. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/rest/client.rb +1523 -0
  11. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/rest/operations.rb +925 -0
  12. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/rest/service_stub.rb +758 -0
  13. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service/rest.rb +54 -0
  14. data/lib/google/cloud/gemini_data_analytics/v1/data_agent_service.rb +56 -0
  15. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service/client.rb +1063 -0
  16. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service/credentials.rb +47 -0
  17. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service/paths.rb +109 -0
  18. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service/rest/client.rb +988 -0
  19. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service/rest/service_stub.rb +443 -0
  20. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service/rest.rb +55 -0
  21. data/lib/google/cloud/gemini_data_analytics/v1/data_chat_service.rb +57 -0
  22. data/lib/google/cloud/gemini_data_analytics/v1/rest.rb +39 -0
  23. data/lib/google/cloud/gemini_data_analytics/v1/version.rb +7 -2
  24. data/lib/google/cloud/gemini_data_analytics/v1.rb +46 -0
  25. data/lib/google/cloud/geminidataanalytics/v1/context_pb.rb +49 -0
  26. data/lib/google/cloud/geminidataanalytics/v1/conversation_pb.rb +31 -0
  27. data/lib/google/cloud/geminidataanalytics/v1/credentials_pb.rb +26 -0
  28. data/lib/google/cloud/geminidataanalytics/v1/data_agent_pb.rb +26 -0
  29. data/lib/google/cloud/geminidataanalytics/v1/data_agent_service_pb.rb +43 -0
  30. data/lib/google/cloud/geminidataanalytics/v1/data_agent_service_services_pb.rb +66 -0
  31. data/lib/google/cloud/geminidataanalytics/v1/data_analytics_agent_pb.rb +24 -0
  32. data/lib/google/cloud/geminidataanalytics/v1/data_chat_service_pb.rb +64 -0
  33. data/lib/google/cloud/geminidataanalytics/v1/data_chat_service_services_pb.rb +59 -0
  34. data/lib/google/cloud/geminidataanalytics/v1/datasource_pb.rb +37 -0
  35. data/lib/google-cloud-gemini_data_analytics-v1.rb +21 -0
  36. data/proto_docs/README.md +4 -0
  37. data/proto_docs/google/api/client.rb +593 -0
  38. data/proto_docs/google/api/field_behavior.rb +85 -0
  39. data/proto_docs/google/api/field_info.rb +88 -0
  40. data/proto_docs/google/api/launch_stage.rb +71 -0
  41. data/proto_docs/google/api/resource.rb +227 -0
  42. data/proto_docs/google/cloud/geminidataanalytics/v1/context.rb +450 -0
  43. data/proto_docs/google/cloud/geminidataanalytics/v1/conversation.rb +167 -0
  44. data/proto_docs/google/cloud/geminidataanalytics/v1/credentials.rb +74 -0
  45. data/proto_docs/google/cloud/geminidataanalytics/v1/data_agent.rb +96 -0
  46. data/proto_docs/google/cloud/geminidataanalytics/v1/data_agent_service.rb +267 -0
  47. data/proto_docs/google/cloud/geminidataanalytics/v1/data_analytics_agent.rb +46 -0
  48. data/proto_docs/google/cloud/geminidataanalytics/v1/data_chat_service.rb +689 -0
  49. data/proto_docs/google/cloud/geminidataanalytics/v1/datasource.rb +304 -0
  50. data/proto_docs/google/iam/v1/iam_policy.rb +87 -0
  51. data/proto_docs/google/iam/v1/options.rb +50 -0
  52. data/proto_docs/google/iam/v1/policy.rb +426 -0
  53. data/proto_docs/google/longrunning/operations.rb +191 -0
  54. data/proto_docs/google/protobuf/any.rb +145 -0
  55. data/proto_docs/google/protobuf/duration.rb +98 -0
  56. data/proto_docs/google/protobuf/empty.rb +34 -0
  57. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  58. data/proto_docs/google/protobuf/struct.rb +108 -0
  59. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  60. data/proto_docs/google/protobuf/wrappers.rb +148 -0
  61. data/proto_docs/google/rpc/status.rb +48 -0
  62. data/proto_docs/google/type/expr.rb +75 -0
  63. metadata +127 -9
@@ -0,0 +1,988 @@
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/geminidataanalytics/v1/data_chat_service_pb"
21
+ require "google/cloud/gemini_data_analytics/v1/data_chat_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module GeminiDataAnalytics
27
+ module V1
28
+ module DataChatService
29
+ module Rest
30
+ ##
31
+ # REST client for the DataChatService service.
32
+ #
33
+ # Service to ask a natural language question on top of BigQuery
34
+ # and Looker Studio datasources to get back streamed responses of various kinds
35
+ # to help provide a rich conversational answer.
36
+ #
37
+ class Client
38
+ # @private
39
+ API_VERSION = ""
40
+
41
+ # @private
42
+ DEFAULT_ENDPOINT_TEMPLATE = "geminidataanalytics.$UNIVERSE_DOMAIN$"
43
+
44
+ include Paths
45
+
46
+ # @private
47
+ attr_reader :data_chat_service_stub
48
+
49
+ ##
50
+ # Configure the DataChatService Client class.
51
+ #
52
+ # See {::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client::Configuration}
53
+ # for a description of the configuration fields.
54
+ #
55
+ # @example
56
+ #
57
+ # # Modify the configuration for all DataChatService clients
58
+ # ::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.configure do |config|
59
+ # config.timeout = 10.0
60
+ # end
61
+ #
62
+ # @yield [config] Configure the Client client.
63
+ # @yieldparam config [Client::Configuration]
64
+ #
65
+ # @return [Client::Configuration]
66
+ #
67
+ def self.configure
68
+ @configure ||= begin
69
+ namespace = ["Google", "Cloud", "GeminiDataAnalytics", "V1"]
70
+ parent_config = while namespace.any?
71
+ parent_name = namespace.join "::"
72
+ parent_const = const_get parent_name
73
+ break parent_const.configure if parent_const.respond_to? :configure
74
+ namespace.pop
75
+ end
76
+ default_config = Client::Configuration.new parent_config
77
+
78
+ default_config.timeout = 600.0
79
+ default_config.retry_policy = {
80
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
81
+ }
82
+
83
+ default_config
84
+ end
85
+ yield @configure if block_given?
86
+ @configure
87
+ end
88
+
89
+ ##
90
+ # Configure the DataChatService Client instance.
91
+ #
92
+ # The configuration is set to the derived mode, meaning that values can be changed,
93
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
94
+ # should be made on {Client.configure}.
95
+ #
96
+ # See {::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client::Configuration}
97
+ # for a description of the configuration fields.
98
+ #
99
+ # @yield [config] Configure the Client client.
100
+ # @yieldparam config [Client::Configuration]
101
+ #
102
+ # @return [Client::Configuration]
103
+ #
104
+ def configure
105
+ yield @config if block_given?
106
+ @config
107
+ end
108
+
109
+ ##
110
+ # The effective universe domain
111
+ #
112
+ # @return [String]
113
+ #
114
+ def universe_domain
115
+ @data_chat_service_stub.universe_domain
116
+ end
117
+
118
+ ##
119
+ # Create a new DataChatService REST client object.
120
+ #
121
+ # @example
122
+ #
123
+ # # Create a client using the default configuration
124
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
125
+ #
126
+ # # Create a client using a custom configuration
127
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new do |config|
128
+ # config.timeout = 10.0
129
+ # end
130
+ #
131
+ # @yield [config] Configure the DataChatService client.
132
+ # @yieldparam config [Client::Configuration]
133
+ #
134
+ def initialize
135
+ # Create the configuration object
136
+ @config = Configuration.new Client.configure
137
+
138
+ # Yield the configuration if needed
139
+ yield @config if block_given?
140
+
141
+ # Create credentials
142
+ credentials = @config.credentials
143
+ # Use self-signed JWT if the endpoint is unchanged from default,
144
+ # but only if the default endpoint does not have a region prefix.
145
+ enable_self_signed_jwt = @config.endpoint.nil? ||
146
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
147
+ !@config.endpoint.split(".").first.include?("-"))
148
+ credentials ||= Credentials.default scope: @config.scope,
149
+ enable_self_signed_jwt: enable_self_signed_jwt
150
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
151
+ credentials = Credentials.new credentials, scope: @config.scope
152
+ end
153
+
154
+ @quota_project_id = @config.quota_project
155
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
156
+
157
+ @data_chat_service_stub = ::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::ServiceStub.new(
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ credentials: credentials,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @data_chat_service_stub.logger(stub: true)&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
175
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
176
+ config.credentials = credentials
177
+ config.quota_project = @quota_project_id
178
+ config.endpoint = @data_chat_service_stub.endpoint
179
+ config.universe_domain = @data_chat_service_stub.universe_domain
180
+ config.bindings_override = @config.bindings_override
181
+ config.logger = @data_chat_service_stub.logger if config.respond_to? :logger=
182
+ end
183
+ end
184
+
185
+ ##
186
+ # Get the associated client for mix-in of the Locations.
187
+ #
188
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
189
+ #
190
+ attr_reader :location_client
191
+
192
+ ##
193
+ # The logger used for request/response debug logging.
194
+ #
195
+ # @return [Logger]
196
+ #
197
+ def logger
198
+ @data_chat_service_stub.logger
199
+ end
200
+
201
+ # Service calls
202
+
203
+ ##
204
+ # Answers a data question by generating a stream of
205
+ # {::Google::Cloud::GeminiDataAnalytics::V1::Message Message} objects.
206
+ #
207
+ # @overload chat(request, options = nil)
208
+ # Pass arguments to `chat` via a request object, either of type
209
+ # {::Google::Cloud::GeminiDataAnalytics::V1::ChatRequest} or an equivalent Hash.
210
+ #
211
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::ChatRequest, ::Hash]
212
+ # A request object representing the call parameters. Required. To specify no
213
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
214
+ # @param options [::Gapic::CallOptions, ::Hash]
215
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
216
+ #
217
+ # @overload chat(inline_context: nil, conversation_reference: nil, data_agent_context: nil, client_managed_resource_context: nil, looker_settings: nil, parent: nil, messages: nil, credentials: nil, thinking_mode: nil, model: nil)
218
+ # Pass arguments to `chat` via keyword arguments. Note that at
219
+ # least one keyword argument is required. To specify no parameters, or to keep all
220
+ # the default parameter values, pass an empty Hash as a request object (see above).
221
+ #
222
+ # @param inline_context [::Google::Cloud::GeminiDataAnalytics::V1::Context, ::Hash]
223
+ # Optional. Inline context for the chat request. Use this to chat
224
+ # statelessly (without managed conversation persistence and without an
225
+ # Agent) by passing all context inline.
226
+ #
227
+ # Note: The following parameters are mutually exclusive: `inline_context`, `conversation_reference`, `data_agent_context`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
228
+ # @param conversation_reference [::Google::Cloud::GeminiDataAnalytics::V1::ConversationReference, ::Hash]
229
+ # Optional. Reference to a persisted conversation and agent context.
230
+ # Use this to chat with an Agent using managed conversation persistence.
231
+ #
232
+ # Note: The following parameters are mutually exclusive: `conversation_reference`, `inline_context`, `data_agent_context`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
233
+ # @param data_agent_context [::Google::Cloud::GeminiDataAnalytics::V1::DataAgentContext, ::Hash]
234
+ # Optional. Context for the chat request. Use this to chat with an Agent
235
+ # statelessly, without managed conversation persistence.
236
+ #
237
+ # Note: The following parameters are mutually exclusive: `data_agent_context`, `inline_context`, `conversation_reference`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
238
+ # @param client_managed_resource_context [::Google::Cloud::GeminiDataAnalytics::V1::ClientManagedResourceContext, ::Hash]
239
+ # Optional. Context with client managed resources.
240
+ # Some clients may not use GDA managed resources including
241
+ # conversations and agents, instead they create and manage their own
242
+ # conversations and agents resources.
243
+ #
244
+ # Note: The following parameters are mutually exclusive: `client_managed_resource_context`, `inline_context`, `conversation_reference`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
245
+ # @param looker_settings [::Google::Cloud::GeminiDataAnalytics::V1::LookerSettings, ::Hash]
246
+ # Optional. Looker specific settings.
247
+ # @param parent [::String]
248
+ # Required. The parent value for chat request.
249
+ # Pattern: `projects/{project}/locations/{location}`
250
+ # @param messages [::Array<::Google::Cloud::GeminiDataAnalytics::V1::Message, ::Hash>]
251
+ # Required. Content of current conversation.
252
+ # @param credentials [::Google::Cloud::GeminiDataAnalytics::V1::Credentials, ::Hash]
253
+ # Optional. The credentials to use when calling the data source(s) specified
254
+ # in the context.
255
+ #
256
+ # This field can be used to provide credentials for various data sources.
257
+ # For example, when connecting to Looker, it currently supports both OAuth
258
+ # token and API key-based credentials, as described in
259
+ # [Authentication with an
260
+ # SDK](https://cloud.google.com/looker/docs/api-auth#authentication_with_an_sdk).
261
+ # @param thinking_mode [::Google::Cloud::GeminiDataAnalytics::V1::ChatRequest::ThinkingMode]
262
+ # Optional. The thinking mode to use for the agent loop.
263
+ # Defaults to THINKING_MODE_UNSPECIFIED if not specified.
264
+ # @param model [::Google::Cloud::GeminiDataAnalytics::V1::ChatRequest::Model]
265
+ # Optional. The model to use for the agent loop when processing the request.
266
+ # This setting only has an effect when context.options.model is not set.
267
+ # @return [::Enumerable<::Google::Cloud::GeminiDataAnalytics::V1::Message>]
268
+ #
269
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
270
+ #
271
+ # @example Basic example
272
+ # require "google/cloud/gemini_data_analytics/v1"
273
+ #
274
+ # # Create a client object. The client can be reused for multiple calls.
275
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
276
+ #
277
+ # # Create a request. To set request fields, pass in keyword arguments.
278
+ # request = Google::Cloud::GeminiDataAnalytics::V1::ChatRequest.new
279
+ #
280
+ # # Call the chat method to start streaming.
281
+ # output = client.chat request
282
+ #
283
+ # # The returned object is a streamed enumerable yielding elements of type
284
+ # # ::Google::Cloud::GeminiDataAnalytics::V1::Message
285
+ # output.each do |current_response|
286
+ # p current_response
287
+ # end
288
+ #
289
+ def chat request, options = nil
290
+ raise ::ArgumentError, "request must be provided" if request.nil?
291
+
292
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::ChatRequest
293
+
294
+ # Converts hash and nil to an options object
295
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
296
+
297
+ # Customize the options with defaults
298
+ call_metadata = @config.rpcs.chat.metadata.to_h
299
+
300
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
301
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
302
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
303
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION,
304
+ transports_version_send: [:rest]
305
+
306
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
307
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
308
+
309
+ options.apply_defaults timeout: @config.rpcs.chat.timeout,
310
+ metadata: call_metadata,
311
+ retry_policy: @config.rpcs.chat.retry_policy
312
+
313
+ options.apply_defaults timeout: @config.timeout,
314
+ metadata: @config.metadata,
315
+ retry_policy: @config.retry_policy
316
+
317
+ ::Gapic::Rest::ServerStream.new(
318
+ ::Google::Cloud::GeminiDataAnalytics::V1::Message,
319
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
320
+ @data_chat_service_stub.chat request, options do |chunk|
321
+ in_q.deq
322
+ out_q.enq chunk
323
+ end
324
+ end
325
+ )
326
+ rescue ::Gapic::Rest::Error => e
327
+ raise ::Google::Cloud::Error.from_error(e)
328
+ end
329
+
330
+ ##
331
+ # Creates a new conversation to persist the conversation history. Each
332
+ # conversation will have multiple messages associated with it.
333
+ #
334
+ # @overload create_conversation(request, options = nil)
335
+ # Pass arguments to `create_conversation` via a request object, either of type
336
+ # {::Google::Cloud::GeminiDataAnalytics::V1::CreateConversationRequest} or an equivalent Hash.
337
+ #
338
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::CreateConversationRequest, ::Hash]
339
+ # A request object representing the call parameters. Required. To specify no
340
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
341
+ # @param options [::Gapic::CallOptions, ::Hash]
342
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
343
+ #
344
+ # @overload create_conversation(parent: nil, conversation_id: nil, conversation: nil, request_id: nil)
345
+ # Pass arguments to `create_conversation` via keyword arguments. Note that at
346
+ # least one keyword argument is required. To specify no parameters, or to keep all
347
+ # the default parameter values, pass an empty Hash as a request object (see above).
348
+ #
349
+ # @param parent [::String]
350
+ # Required. Parent value for CreateConversationRequest.
351
+ # Format: `projects/{project}/locations/{location}`
352
+ # @param conversation_id [::String]
353
+ # Optional. The conversation id of the conversation to create.
354
+ # Must be unique within the parent.
355
+ # The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
356
+ # If not provided, the server will auto-generate a value for the id.
357
+ # @param conversation [::Google::Cloud::GeminiDataAnalytics::V1::Conversation, ::Hash]
358
+ # Required. The conversation to create.
359
+ # @param request_id [::String]
360
+ # Optional. An optional request ID to identify requests. Specify a unique
361
+ # request ID so that if you must retry your request, the server will know to
362
+ # ignore the request if it has already been completed. The server will
363
+ # guarantee that for at least 60 minutes since the first request.
364
+ # @yield [result, operation] Access the result along with the TransportOperation object
365
+ # @yieldparam result [::Google::Cloud::GeminiDataAnalytics::V1::Conversation]
366
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
367
+ #
368
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1::Conversation]
369
+ #
370
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
371
+ #
372
+ # @example Basic example
373
+ # require "google/cloud/gemini_data_analytics/v1"
374
+ #
375
+ # # Create a client object. The client can be reused for multiple calls.
376
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
377
+ #
378
+ # # Create a request. To set request fields, pass in keyword arguments.
379
+ # request = Google::Cloud::GeminiDataAnalytics::V1::CreateConversationRequest.new
380
+ #
381
+ # # Call the create_conversation method.
382
+ # result = client.create_conversation request
383
+ #
384
+ # # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1::Conversation.
385
+ # p result
386
+ #
387
+ def create_conversation request, options = nil
388
+ raise ::ArgumentError, "request must be provided" if request.nil?
389
+
390
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::CreateConversationRequest
391
+
392
+ # Converts hash and nil to an options object
393
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
394
+
395
+ # Customize the options with defaults
396
+ call_metadata = @config.rpcs.create_conversation.metadata.to_h
397
+
398
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
399
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
400
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
401
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION,
402
+ transports_version_send: [:rest]
403
+
404
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
405
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
406
+
407
+ options.apply_defaults timeout: @config.rpcs.create_conversation.timeout,
408
+ metadata: call_metadata,
409
+ retry_policy: @config.rpcs.create_conversation.retry_policy
410
+
411
+ options.apply_defaults timeout: @config.timeout,
412
+ metadata: @config.metadata,
413
+ retry_policy: @config.retry_policy
414
+
415
+ @data_chat_service_stub.create_conversation request, options do |result, operation|
416
+ yield result, operation if block_given?
417
+ end
418
+ rescue ::Gapic::Rest::Error => e
419
+ raise ::Google::Cloud::Error.from_error(e)
420
+ end
421
+
422
+ ##
423
+ # Deletes a conversation.
424
+ #
425
+ # @overload delete_conversation(request, options = nil)
426
+ # Pass arguments to `delete_conversation` via a request object, either of type
427
+ # {::Google::Cloud::GeminiDataAnalytics::V1::DeleteConversationRequest} or an equivalent Hash.
428
+ #
429
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::DeleteConversationRequest, ::Hash]
430
+ # A request object representing the call parameters. Required. To specify no
431
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
432
+ # @param options [::Gapic::CallOptions, ::Hash]
433
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
434
+ #
435
+ # @overload delete_conversation(name: nil)
436
+ # Pass arguments to `delete_conversation` via keyword arguments. Note that at
437
+ # least one keyword argument is required. To specify no parameters, or to keep all
438
+ # the default parameter values, pass an empty Hash as a request object (see above).
439
+ #
440
+ # @param name [::String]
441
+ # Required. Name of the resource.
442
+ # Format:
443
+ # `projects/{project}/locations/{location}/conversations/{conversation}`
444
+ # @yield [result, operation] Access the result along with the TransportOperation object
445
+ # @yieldparam result [::Google::Protobuf::Empty]
446
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
447
+ #
448
+ # @return [::Google::Protobuf::Empty]
449
+ #
450
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
451
+ #
452
+ # @example Basic example
453
+ # require "google/cloud/gemini_data_analytics/v1"
454
+ #
455
+ # # Create a client object. The client can be reused for multiple calls.
456
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
457
+ #
458
+ # # Create a request. To set request fields, pass in keyword arguments.
459
+ # request = Google::Cloud::GeminiDataAnalytics::V1::DeleteConversationRequest.new
460
+ #
461
+ # # Call the delete_conversation method.
462
+ # result = client.delete_conversation request
463
+ #
464
+ # # The returned object is of type Google::Protobuf::Empty.
465
+ # p result
466
+ #
467
+ def delete_conversation request, options = nil
468
+ raise ::ArgumentError, "request must be provided" if request.nil?
469
+
470
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::DeleteConversationRequest
471
+
472
+ # Converts hash and nil to an options object
473
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
474
+
475
+ # Customize the options with defaults
476
+ call_metadata = @config.rpcs.delete_conversation.metadata.to_h
477
+
478
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
479
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
480
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
481
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION,
482
+ transports_version_send: [:rest]
483
+
484
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
485
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
486
+
487
+ options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout,
488
+ metadata: call_metadata,
489
+ retry_policy: @config.rpcs.delete_conversation.retry_policy
490
+
491
+ options.apply_defaults timeout: @config.timeout,
492
+ metadata: @config.metadata,
493
+ retry_policy: @config.retry_policy
494
+
495
+ @data_chat_service_stub.delete_conversation request, options do |result, operation|
496
+ yield result, operation if block_given?
497
+ end
498
+ rescue ::Gapic::Rest::Error => e
499
+ raise ::Google::Cloud::Error.from_error(e)
500
+ end
501
+
502
+ ##
503
+ # Gets details of a single conversation by using conversation id and parent.
504
+ #
505
+ # @overload get_conversation(request, options = nil)
506
+ # Pass arguments to `get_conversation` via a request object, either of type
507
+ # {::Google::Cloud::GeminiDataAnalytics::V1::GetConversationRequest} or an equivalent Hash.
508
+ #
509
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::GetConversationRequest, ::Hash]
510
+ # A request object representing the call parameters. Required. To specify no
511
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
512
+ # @param options [::Gapic::CallOptions, ::Hash]
513
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
514
+ #
515
+ # @overload get_conversation(name: nil)
516
+ # Pass arguments to `get_conversation` via keyword arguments. Note that at
517
+ # least one keyword argument is required. To specify no parameters, or to keep all
518
+ # the default parameter values, pass an empty Hash as a request object (see above).
519
+ #
520
+ # @param name [::String]
521
+ # Required. Name of the resource.
522
+ # Format:
523
+ # `projects/{project}/locations/{location}/conversations/{conversation}`
524
+ # @yield [result, operation] Access the result along with the TransportOperation object
525
+ # @yieldparam result [::Google::Cloud::GeminiDataAnalytics::V1::Conversation]
526
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
527
+ #
528
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1::Conversation]
529
+ #
530
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
531
+ #
532
+ # @example Basic example
533
+ # require "google/cloud/gemini_data_analytics/v1"
534
+ #
535
+ # # Create a client object. The client can be reused for multiple calls.
536
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
537
+ #
538
+ # # Create a request. To set request fields, pass in keyword arguments.
539
+ # request = Google::Cloud::GeminiDataAnalytics::V1::GetConversationRequest.new
540
+ #
541
+ # # Call the get_conversation method.
542
+ # result = client.get_conversation request
543
+ #
544
+ # # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1::Conversation.
545
+ # p result
546
+ #
547
+ def get_conversation request, options = nil
548
+ raise ::ArgumentError, "request must be provided" if request.nil?
549
+
550
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::GetConversationRequest
551
+
552
+ # Converts hash and nil to an options object
553
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
554
+
555
+ # Customize the options with defaults
556
+ call_metadata = @config.rpcs.get_conversation.metadata.to_h
557
+
558
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
559
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
560
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
561
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION,
562
+ transports_version_send: [:rest]
563
+
564
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
565
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
566
+
567
+ options.apply_defaults timeout: @config.rpcs.get_conversation.timeout,
568
+ metadata: call_metadata,
569
+ retry_policy: @config.rpcs.get_conversation.retry_policy
570
+
571
+ options.apply_defaults timeout: @config.timeout,
572
+ metadata: @config.metadata,
573
+ retry_policy: @config.retry_policy
574
+
575
+ @data_chat_service_stub.get_conversation request, options do |result, operation|
576
+ yield result, operation if block_given?
577
+ end
578
+ rescue ::Gapic::Rest::Error => e
579
+ raise ::Google::Cloud::Error.from_error(e)
580
+ end
581
+
582
+ ##
583
+ # Lists all conversations for a given parent.
584
+ #
585
+ # @overload list_conversations(request, options = nil)
586
+ # Pass arguments to `list_conversations` via a request object, either of type
587
+ # {::Google::Cloud::GeminiDataAnalytics::V1::ListConversationsRequest} or an equivalent Hash.
588
+ #
589
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::ListConversationsRequest, ::Hash]
590
+ # A request object representing the call parameters. Required. To specify no
591
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
592
+ # @param options [::Gapic::CallOptions, ::Hash]
593
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
594
+ #
595
+ # @overload list_conversations(parent: nil, page_size: nil, page_token: nil, filter: nil)
596
+ # Pass arguments to `list_conversations` via keyword arguments. Note that at
597
+ # least one keyword argument is required. To specify no parameters, or to keep all
598
+ # the default parameter values, pass an empty Hash as a request object (see above).
599
+ #
600
+ # @param parent [::String]
601
+ # Required. Parent value for ListConversationsRequest.
602
+ # Format: `projects/{project}/locations/{location}`
603
+ # @param page_size [::Integer]
604
+ # Optional. Requested page size. Server may return fewer items than
605
+ # requested. The max page size is `100`. All larger page sizes will be
606
+ # coerced to `100`. If unspecified, server will pick `50` as an appropriate
607
+ # default.
608
+ # @param page_token [::String]
609
+ # Optional. A token identifying a page of results the server should return.
610
+ # @param filter [::String]
611
+ # Optional. Returned conversations will match criteria specified within the
612
+ # filter. ListConversations allows filtering by:
613
+ # * agents
614
+ # * labels
615
+ # @yield [result, operation] Access the result along with the TransportOperation object
616
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::Conversation>]
617
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
618
+ #
619
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::Conversation>]
620
+ #
621
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
622
+ #
623
+ # @example Basic example
624
+ # require "google/cloud/gemini_data_analytics/v1"
625
+ #
626
+ # # Create a client object. The client can be reused for multiple calls.
627
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
628
+ #
629
+ # # Create a request. To set request fields, pass in keyword arguments.
630
+ # request = Google::Cloud::GeminiDataAnalytics::V1::ListConversationsRequest.new
631
+ #
632
+ # # Call the list_conversations method.
633
+ # result = client.list_conversations request
634
+ #
635
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
636
+ # # over elements, and API calls will be issued to fetch pages as needed.
637
+ # result.each do |item|
638
+ # # Each element is of type ::Google::Cloud::GeminiDataAnalytics::V1::Conversation.
639
+ # p item
640
+ # end
641
+ #
642
+ def list_conversations request, options = nil
643
+ raise ::ArgumentError, "request must be provided" if request.nil?
644
+
645
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::ListConversationsRequest
646
+
647
+ # Converts hash and nil to an options object
648
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
649
+
650
+ # Customize the options with defaults
651
+ call_metadata = @config.rpcs.list_conversations.metadata.to_h
652
+
653
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
654
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
655
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
656
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION,
657
+ transports_version_send: [:rest]
658
+
659
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
660
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
661
+
662
+ options.apply_defaults timeout: @config.rpcs.list_conversations.timeout,
663
+ metadata: call_metadata,
664
+ retry_policy: @config.rpcs.list_conversations.retry_policy
665
+
666
+ options.apply_defaults timeout: @config.timeout,
667
+ metadata: @config.metadata,
668
+ retry_policy: @config.retry_policy
669
+
670
+ @data_chat_service_stub.list_conversations request, options do |result, operation|
671
+ result = ::Gapic::Rest::PagedEnumerable.new @data_chat_service_stub, :list_conversations, "conversations", request, result, options
672
+ yield result, operation if block_given?
673
+ throw :response, result
674
+ end
675
+ rescue ::Gapic::Rest::Error => e
676
+ raise ::Google::Cloud::Error.from_error(e)
677
+ end
678
+
679
+ ##
680
+ # Lists all messages for a given conversation.
681
+ #
682
+ # @overload list_messages(request, options = nil)
683
+ # Pass arguments to `list_messages` via a request object, either of type
684
+ # {::Google::Cloud::GeminiDataAnalytics::V1::ListMessagesRequest} or an equivalent Hash.
685
+ #
686
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::ListMessagesRequest, ::Hash]
687
+ # A request object representing the call parameters. Required. To specify no
688
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
689
+ # @param options [::Gapic::CallOptions, ::Hash]
690
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
691
+ #
692
+ # @overload list_messages(parent: nil, page_size: nil, page_token: nil, filter: nil)
693
+ # Pass arguments to `list_messages` via keyword arguments. Note that at
694
+ # least one keyword argument is required. To specify no parameters, or to keep all
695
+ # the default parameter values, pass an empty Hash as a request object (see above).
696
+ #
697
+ # @param parent [::String]
698
+ # Required. The conversation to list messages under.
699
+ # Format:
700
+ # `projects/{project}/locations/{location}/conversations/{conversation_id}`
701
+ # @param page_size [::Integer]
702
+ # Optional. Requested page size. Server may return fewer items than
703
+ # requested. The max page size is `100`. All larger page sizes will be
704
+ # coerced to `100`. If unspecified, server will pick `50` as an appropriate
705
+ # default.
706
+ # @param page_token [::String]
707
+ # Optional. A token identifying a page of results the server should return.
708
+ # @param filter [::String]
709
+ # Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for
710
+ # syntax.
711
+ #
712
+ # ListMessages allows filtering by:
713
+ # * create_time (e.g., `createTime > "2025-01-28T06:51:56-08:00"`)
714
+ # * update_time
715
+ # @yield [result, operation] Access the result along with the TransportOperation object
716
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::StorageMessage>]
717
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
718
+ #
719
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::StorageMessage>]
720
+ #
721
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
722
+ #
723
+ # @example Basic example
724
+ # require "google/cloud/gemini_data_analytics/v1"
725
+ #
726
+ # # Create a client object. The client can be reused for multiple calls.
727
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new
728
+ #
729
+ # # Create a request. To set request fields, pass in keyword arguments.
730
+ # request = Google::Cloud::GeminiDataAnalytics::V1::ListMessagesRequest.new
731
+ #
732
+ # # Call the list_messages method.
733
+ # result = client.list_messages request
734
+ #
735
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
736
+ # # over elements, and API calls will be issued to fetch pages as needed.
737
+ # result.each do |item|
738
+ # # Each element is of type ::Google::Cloud::GeminiDataAnalytics::V1::StorageMessage.
739
+ # p item
740
+ # end
741
+ #
742
+ def list_messages request, options = nil
743
+ raise ::ArgumentError, "request must be provided" if request.nil?
744
+
745
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::ListMessagesRequest
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
+ call_metadata = @config.rpcs.list_messages.metadata.to_h
752
+
753
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
754
+ call_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::GeminiDataAnalytics::V1::VERSION,
757
+ transports_version_send: [:rest]
758
+
759
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
760
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
761
+
762
+ options.apply_defaults timeout: @config.rpcs.list_messages.timeout,
763
+ metadata: call_metadata,
764
+ retry_policy: @config.rpcs.list_messages.retry_policy
765
+
766
+ options.apply_defaults timeout: @config.timeout,
767
+ metadata: @config.metadata,
768
+ retry_policy: @config.retry_policy
769
+
770
+ @data_chat_service_stub.list_messages request, options do |result, operation|
771
+ result = ::Gapic::Rest::PagedEnumerable.new @data_chat_service_stub, :list_messages, "messages", request, result, options
772
+ yield result, operation if block_given?
773
+ throw :response, result
774
+ end
775
+ rescue ::Gapic::Rest::Error => e
776
+ raise ::Google::Cloud::Error.from_error(e)
777
+ end
778
+
779
+ ##
780
+ # Configuration class for the DataChatService REST API.
781
+ #
782
+ # This class represents the configuration for DataChatService REST,
783
+ # providing control over timeouts, retry behavior, logging, transport
784
+ # parameters, and other low-level controls. Certain parameters can also be
785
+ # applied individually to specific RPCs. See
786
+ # {::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client::Configuration::Rpcs}
787
+ # for a list of RPCs that can be configured independently.
788
+ #
789
+ # Configuration can be applied globally to all clients, or to a single client
790
+ # on construction.
791
+ #
792
+ # @example
793
+ #
794
+ # # Modify the global config, setting the timeout for
795
+ # # chat to 20 seconds,
796
+ # # and all remaining timeouts to 10 seconds.
797
+ # ::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.configure do |config|
798
+ # config.timeout = 10.0
799
+ # config.rpcs.chat.timeout = 20.0
800
+ # end
801
+ #
802
+ # # Apply the above configuration only to a new client.
803
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataChatService::Rest::Client.new do |config|
804
+ # config.timeout = 10.0
805
+ # config.rpcs.chat.timeout = 20.0
806
+ # end
807
+ #
808
+ # @!attribute [rw] endpoint
809
+ # A custom service endpoint, as a hostname or hostname:port. The default is
810
+ # nil, indicating to use the default endpoint in the current universe domain.
811
+ # @return [::String,nil]
812
+ # @!attribute [rw] credentials
813
+ # Credentials to send with calls. You may provide any of the following types:
814
+ # * (`String`) The path to a service account key file in JSON format
815
+ # * (`Hash`) A service account key as a Hash
816
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
817
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
818
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
819
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
820
+ # * (`nil`) indicating no credentials
821
+ #
822
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
823
+ # external source for authentication to Google Cloud, you must validate it before
824
+ # providing it to a Google API client library. Providing an unvalidated credential
825
+ # configuration to Google APIs can compromise the security of your systems and data.
826
+ # For more information, refer to [Validate credential configurations from external
827
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
828
+ # @return [::Object]
829
+ # @!attribute [rw] scope
830
+ # The OAuth scopes
831
+ # @return [::Array<::String>]
832
+ # @!attribute [rw] lib_name
833
+ # The library name as recorded in instrumentation and logging
834
+ # @return [::String]
835
+ # @!attribute [rw] lib_version
836
+ # The library version as recorded in instrumentation and logging
837
+ # @return [::String]
838
+ # @!attribute [rw] timeout
839
+ # The call timeout in seconds.
840
+ # @return [::Numeric]
841
+ # @!attribute [rw] metadata
842
+ # Additional headers to be sent with the call.
843
+ # @return [::Hash{::Symbol=>::String}]
844
+ # @!attribute [rw] retry_policy
845
+ # The retry policy. The value is a hash with the following keys:
846
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
847
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
848
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
849
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
850
+ # trigger a retry.
851
+ # @return [::Hash]
852
+ # @!attribute [rw] quota_project
853
+ # A separate project against which to charge quota.
854
+ # @return [::String]
855
+ # @!attribute [rw] universe_domain
856
+ # The universe domain within which to make requests. This determines the
857
+ # default endpoint URL. The default value of nil uses the environment
858
+ # universe (usually the default "googleapis.com" universe).
859
+ # @return [::String,nil]
860
+ # @!attribute [rw] logger
861
+ # A custom logger to use for request/response debug logging, or the value
862
+ # `:default` (the default) to construct a default logger, or `nil` to
863
+ # explicitly disable logging.
864
+ # @return [::Logger,:default,nil]
865
+ #
866
+ class Configuration
867
+ extend ::Gapic::Config
868
+
869
+ # @private
870
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
871
+ DEFAULT_ENDPOINT = "geminidataanalytics.googleapis.com"
872
+
873
+ config_attr :endpoint, nil, ::String, nil
874
+ config_attr :credentials, nil do |value|
875
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
876
+ allowed.any? { |klass| klass === value }
877
+ end
878
+ config_attr :scope, nil, ::String, ::Array, nil
879
+ config_attr :lib_name, nil, ::String, nil
880
+ config_attr :lib_version, nil, ::String, nil
881
+ config_attr :timeout, nil, ::Numeric, nil
882
+ config_attr :metadata, nil, ::Hash, nil
883
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
884
+ config_attr :quota_project, nil, ::String, nil
885
+ config_attr :universe_domain, nil, ::String, nil
886
+
887
+ # @private
888
+ # Overrides for http bindings for the RPCs of this service
889
+ # are only used when this service is used as mixin, and only
890
+ # by the host service.
891
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
892
+ config_attr :bindings_override, {}, ::Hash, nil
893
+ config_attr :logger, :default, ::Logger, nil, :default
894
+
895
+ # @private
896
+ def initialize parent_config = nil
897
+ @parent_config = parent_config unless parent_config.nil?
898
+
899
+ yield self if block_given?
900
+ end
901
+
902
+ ##
903
+ # Configurations for individual RPCs
904
+ # @return [Rpcs]
905
+ #
906
+ def rpcs
907
+ @rpcs ||= begin
908
+ parent_rpcs = nil
909
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
910
+ Rpcs.new parent_rpcs
911
+ end
912
+ end
913
+
914
+ ##
915
+ # Configuration RPC class for the DataChatService API.
916
+ #
917
+ # Includes fields providing the configuration for each RPC in this service.
918
+ # Each configuration object is of type `Gapic::Config::Method` and includes
919
+ # the following configuration fields:
920
+ #
921
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
922
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
923
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
924
+ # include the following keys:
925
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
926
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
927
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
928
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
929
+ # trigger a retry.
930
+ #
931
+ class Rpcs
932
+ ##
933
+ # RPC-specific configuration for `chat`
934
+ # @return [::Gapic::Config::Method]
935
+ #
936
+ attr_reader :chat
937
+ ##
938
+ # RPC-specific configuration for `create_conversation`
939
+ # @return [::Gapic::Config::Method]
940
+ #
941
+ attr_reader :create_conversation
942
+ ##
943
+ # RPC-specific configuration for `delete_conversation`
944
+ # @return [::Gapic::Config::Method]
945
+ #
946
+ attr_reader :delete_conversation
947
+ ##
948
+ # RPC-specific configuration for `get_conversation`
949
+ # @return [::Gapic::Config::Method]
950
+ #
951
+ attr_reader :get_conversation
952
+ ##
953
+ # RPC-specific configuration for `list_conversations`
954
+ # @return [::Gapic::Config::Method]
955
+ #
956
+ attr_reader :list_conversations
957
+ ##
958
+ # RPC-specific configuration for `list_messages`
959
+ # @return [::Gapic::Config::Method]
960
+ #
961
+ attr_reader :list_messages
962
+
963
+ # @private
964
+ def initialize parent_rpcs = nil
965
+ chat_config = parent_rpcs.chat if parent_rpcs.respond_to? :chat
966
+ @chat = ::Gapic::Config::Method.new chat_config
967
+ create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation
968
+ @create_conversation = ::Gapic::Config::Method.new create_conversation_config
969
+ delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation
970
+ @delete_conversation = ::Gapic::Config::Method.new delete_conversation_config
971
+ get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation
972
+ @get_conversation = ::Gapic::Config::Method.new get_conversation_config
973
+ list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
974
+ @list_conversations = ::Gapic::Config::Method.new list_conversations_config
975
+ list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages
976
+ @list_messages = ::Gapic::Config::Method.new list_messages_config
977
+
978
+ yield self if block_given?
979
+ end
980
+ end
981
+ end
982
+ end
983
+ end
984
+ end
985
+ end
986
+ end
987
+ end
988
+ end