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