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,1635 @@
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_agent_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module GeminiDataAnalytics
26
+ module V1
27
+ module DataAgentService
28
+ ##
29
+ # Client for the DataAgentService service.
30
+ #
31
+ # Service describing handlers for resources.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "geminidataanalytics.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :data_agent_service_stub
44
+
45
+ ##
46
+ # Configure the DataAgentService Client class.
47
+ #
48
+ # See {::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all DataAgentService clients
54
+ # ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "GeminiDataAnalytics", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 600.0
75
+ default_config.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config
80
+ end
81
+ yield @configure if block_given?
82
+ @configure
83
+ end
84
+
85
+ ##
86
+ # Configure the DataAgentService Client instance.
87
+ #
88
+ # The configuration is set to the derived mode, meaning that values can be changed,
89
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
90
+ # should be made on {Client.configure}.
91
+ #
92
+ # See {::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client::Configuration}
93
+ # for a description of the configuration fields.
94
+ #
95
+ # @yield [config] Configure the Client client.
96
+ # @yieldparam config [Client::Configuration]
97
+ #
98
+ # @return [Client::Configuration]
99
+ #
100
+ def configure
101
+ yield @config if block_given?
102
+ @config
103
+ end
104
+
105
+ ##
106
+ # The effective universe domain
107
+ #
108
+ # @return [String]
109
+ #
110
+ def universe_domain
111
+ @data_agent_service_stub.universe_domain
112
+ end
113
+
114
+ ##
115
+ # Create a new DataAgentService client object.
116
+ #
117
+ # @example
118
+ #
119
+ # # Create a client using the default configuration
120
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new do |config|
124
+ # config.timeout = 10.0
125
+ # end
126
+ #
127
+ # @yield [config] Configure the DataAgentService client.
128
+ # @yieldparam config [Client::Configuration]
129
+ #
130
+ def initialize
131
+ # These require statements are intentionally placed here to initialize
132
+ # the gRPC module only when it's required.
133
+ # See https://github.com/googleapis/toolkit/issues/446
134
+ require "gapic/grpc"
135
+ require "google/cloud/geminidataanalytics/v1/data_agent_service_services_pb"
136
+
137
+ # Create the configuration object
138
+ @config = Configuration.new Client.configure
139
+
140
+ # Yield the configuration if needed
141
+ yield @config if block_given?
142
+
143
+ # Create credentials
144
+ credentials = @config.credentials
145
+ # Use self-signed JWT if the endpoint is unchanged from default,
146
+ # but only if the default endpoint does not have a region prefix.
147
+ enable_self_signed_jwt = @config.endpoint.nil? ||
148
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
149
+ !@config.endpoint.split(".").first.include?("-"))
150
+ credentials ||= Credentials.default scope: @config.scope,
151
+ enable_self_signed_jwt: enable_self_signed_jwt
152
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
153
+ credentials = Credentials.new credentials, scope: @config.scope
154
+ end
155
+ @quota_project_id = @config.quota_project
156
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
157
+
158
+ @operations_client = Operations.new do |config|
159
+ config.credentials = credentials
160
+ config.quota_project = @quota_project_id
161
+ config.endpoint = @config.endpoint
162
+ config.universe_domain = @config.universe_domain
163
+ end
164
+
165
+ @data_agent_service_stub = ::Gapic::ServiceStub.new(
166
+ ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Stub,
167
+ credentials: credentials,
168
+ endpoint: @config.endpoint,
169
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
170
+ universe_domain: @config.universe_domain,
171
+ channel_args: @config.channel_args,
172
+ interceptors: @config.interceptors,
173
+ channel_pool_config: @config.channel_pool,
174
+ logger: @config.logger
175
+ )
176
+
177
+ @data_agent_service_stub.stub_logger&.info do |entry|
178
+ entry.set_system_name
179
+ entry.set_service
180
+ entry.message = "Created client for #{entry.service}"
181
+ entry.set_credentials_fields credentials
182
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
183
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
184
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
185
+ end
186
+
187
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
188
+ config.credentials = credentials
189
+ config.quota_project = @quota_project_id
190
+ config.endpoint = @data_agent_service_stub.endpoint
191
+ config.universe_domain = @data_agent_service_stub.universe_domain
192
+ config.logger = @data_agent_service_stub.logger if config.respond_to? :logger=
193
+ end
194
+ end
195
+
196
+ ##
197
+ # Get the associated client for long-running operations.
198
+ #
199
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Operations]
200
+ #
201
+ attr_reader :operations_client
202
+
203
+ ##
204
+ # Get the associated client for mix-in of the Locations.
205
+ #
206
+ # @return [Google::Cloud::Location::Locations::Client]
207
+ #
208
+ attr_reader :location_client
209
+
210
+ ##
211
+ # The logger used for request/response debug logging.
212
+ #
213
+ # @return [Logger]
214
+ #
215
+ def logger
216
+ @data_agent_service_stub.logger
217
+ end
218
+
219
+ # Service calls
220
+
221
+ ##
222
+ # Lists DataAgents in a given project and location.
223
+ #
224
+ # @overload list_data_agents(request, options = nil)
225
+ # Pass arguments to `list_data_agents` via a request object, either of type
226
+ # {::Google::Cloud::GeminiDataAnalytics::V1::ListDataAgentsRequest} or an equivalent Hash.
227
+ #
228
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::ListDataAgentsRequest, ::Hash]
229
+ # A request object representing the call parameters. Required. To specify no
230
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
231
+ # @param options [::Gapic::CallOptions, ::Hash]
232
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
233
+ #
234
+ # @overload list_data_agents(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil)
235
+ # Pass arguments to `list_data_agents` via keyword arguments. Note that at
236
+ # least one keyword argument is required. To specify no parameters, or to keep all
237
+ # the default parameter values, pass an empty Hash as a request object (see above).
238
+ #
239
+ # @param parent [::String]
240
+ # Required. Parent value for ListDataAgentsRequest.
241
+ # @param page_size [::Integer]
242
+ # Optional. Server may return fewer items than requested.
243
+ # If unspecified, server will pick an appropriate default.
244
+ # @param page_token [::String]
245
+ # Optional. A page token, received from a previous `ListDataAgents` call.
246
+ # Provide this to retrieve the subsequent page.
247
+ #
248
+ # When paginating, all other parameters provided to `ListDataAgents` must
249
+ # match the call that provided the page token. The service may return fewer
250
+ # than this value.
251
+ # @param filter [::String]
252
+ # Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for
253
+ # syntax.
254
+ # @param order_by [::String]
255
+ # Optional. User specification for how to order the results.
256
+ # @param show_deleted [::Boolean]
257
+ # Optional. If true, the list results will include soft-deleted DataAgents.
258
+ # Defaults to false.
259
+ #
260
+ # @yield [response, operation] Access the result along with the RPC operation
261
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::DataAgent>]
262
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
263
+ #
264
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::DataAgent>]
265
+ #
266
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
267
+ #
268
+ # @example Basic example
269
+ # require "google/cloud/gemini_data_analytics/v1"
270
+ #
271
+ # # Create a client object. The client can be reused for multiple calls.
272
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
273
+ #
274
+ # # Create a request. To set request fields, pass in keyword arguments.
275
+ # request = Google::Cloud::GeminiDataAnalytics::V1::ListDataAgentsRequest.new
276
+ #
277
+ # # Call the list_data_agents method.
278
+ # result = client.list_data_agents request
279
+ #
280
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
281
+ # # over elements, and API calls will be issued to fetch pages as needed.
282
+ # result.each do |item|
283
+ # # Each element is of type ::Google::Cloud::GeminiDataAnalytics::V1::DataAgent.
284
+ # p item
285
+ # end
286
+ #
287
+ def list_data_agents request, options = nil
288
+ raise ::ArgumentError, "request must be provided" if request.nil?
289
+
290
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::ListDataAgentsRequest
291
+
292
+ # Converts hash and nil to an options object
293
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
294
+
295
+ # Customize the options with defaults
296
+ metadata = @config.rpcs.list_data_agents.metadata.to_h
297
+
298
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
299
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
300
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
301
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
302
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
303
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
304
+
305
+ header_params = {}
306
+ if request.parent
307
+ header_params["parent"] = request.parent
308
+ end
309
+
310
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
311
+ metadata[:"x-goog-request-params"] ||= request_params_header
312
+
313
+ options.apply_defaults timeout: @config.rpcs.list_data_agents.timeout,
314
+ metadata: metadata,
315
+ retry_policy: @config.rpcs.list_data_agents.retry_policy
316
+
317
+ options.apply_defaults timeout: @config.timeout,
318
+ metadata: @config.metadata,
319
+ retry_policy: @config.retry_policy
320
+
321
+ @data_agent_service_stub.call_rpc :list_data_agents, request, options: options do |response, operation|
322
+ response = ::Gapic::PagedEnumerable.new @data_agent_service_stub, :list_data_agents, request, response, operation, options
323
+ yield response, operation if block_given?
324
+ throw :response, response
325
+ end
326
+ rescue ::GRPC::BadStatus => e
327
+ raise ::Google::Cloud::Error.from_error(e)
328
+ end
329
+
330
+ ##
331
+ # Lists DataAgents that are accessible to the caller in a given project and
332
+ # location.
333
+ #
334
+ # @overload list_accessible_data_agents(request, options = nil)
335
+ # Pass arguments to `list_accessible_data_agents` via a request object, either of type
336
+ # {::Google::Cloud::GeminiDataAnalytics::V1::ListAccessibleDataAgentsRequest} or an equivalent Hash.
337
+ #
338
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::ListAccessibleDataAgentsRequest, ::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 list_accessible_data_agents(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil, creator_filter: nil)
345
+ # Pass arguments to `list_accessible_data_agents` 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 ListAccessibleDataAgentsRequest.
351
+ # @param page_size [::Integer]
352
+ # Optional. Server may return fewer items than requested.
353
+ # If unspecified, server will pick an appropriate default.
354
+ # @param page_token [::String]
355
+ # Optional. A page token, received from a previous `ListAccessibleDataAgents`
356
+ # call. Provide this to retrieve the subsequent page.
357
+ #
358
+ # When paginating, all other parameters provided to
359
+ # `ListAccessibleDataAgents` must match the call that provided the page
360
+ # token. The service may return fewer than this value.
361
+ # @param filter [::String]
362
+ # Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for
363
+ # syntax.
364
+ # @param order_by [::String]
365
+ # Optional. User specification for how to order the results.
366
+ # @param show_deleted [::Boolean]
367
+ # Optional. If true, the list results will include soft-deleted DataAgents.
368
+ # Defaults to false.
369
+ # @param creator_filter [::Google::Cloud::GeminiDataAnalytics::V1::ListAccessibleDataAgentsRequest::CreatorFilter]
370
+ # Optional. Filter for the creator of the agent.
371
+ #
372
+ # @yield [response, operation] Access the result along with the RPC operation
373
+ # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::DataAgent>]
374
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
375
+ #
376
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1::DataAgent>]
377
+ #
378
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
379
+ #
380
+ # @example Basic example
381
+ # require "google/cloud/gemini_data_analytics/v1"
382
+ #
383
+ # # Create a client object. The client can be reused for multiple calls.
384
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
385
+ #
386
+ # # Create a request. To set request fields, pass in keyword arguments.
387
+ # request = Google::Cloud::GeminiDataAnalytics::V1::ListAccessibleDataAgentsRequest.new
388
+ #
389
+ # # Call the list_accessible_data_agents method.
390
+ # result = client.list_accessible_data_agents request
391
+ #
392
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
393
+ # # over elements, and API calls will be issued to fetch pages as needed.
394
+ # result.each do |item|
395
+ # # Each element is of type ::Google::Cloud::GeminiDataAnalytics::V1::DataAgent.
396
+ # p item
397
+ # end
398
+ #
399
+ def list_accessible_data_agents 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::ListAccessibleDataAgentsRequest
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.list_accessible_data_agents.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.list_accessible_data_agents.timeout,
426
+ metadata: metadata,
427
+ retry_policy: @config.rpcs.list_accessible_data_agents.retry_policy
428
+
429
+ options.apply_defaults timeout: @config.timeout,
430
+ metadata: @config.metadata,
431
+ retry_policy: @config.retry_policy
432
+
433
+ @data_agent_service_stub.call_rpc :list_accessible_data_agents, request, options: options do |response, operation|
434
+ response = ::Gapic::PagedEnumerable.new @data_agent_service_stub, :list_accessible_data_agents, request, response, operation, options
435
+ yield response, operation if block_given?
436
+ throw :response, response
437
+ end
438
+ rescue ::GRPC::BadStatus => e
439
+ raise ::Google::Cloud::Error.from_error(e)
440
+ end
441
+
442
+ ##
443
+ # Gets details of a single DataAgent.
444
+ #
445
+ # @overload get_data_agent(request, options = nil)
446
+ # Pass arguments to `get_data_agent` via a request object, either of type
447
+ # {::Google::Cloud::GeminiDataAnalytics::V1::GetDataAgentRequest} or an equivalent Hash.
448
+ #
449
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::GetDataAgentRequest, ::Hash]
450
+ # A request object representing the call parameters. Required. To specify no
451
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
452
+ # @param options [::Gapic::CallOptions, ::Hash]
453
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
454
+ #
455
+ # @overload get_data_agent(name: nil)
456
+ # Pass arguments to `get_data_agent` via keyword arguments. Note that at
457
+ # least one keyword argument is required. To specify no parameters, or to keep all
458
+ # the default parameter values, pass an empty Hash as a request object (see above).
459
+ #
460
+ # @param name [::String]
461
+ # Required. Name of the resource.
462
+ #
463
+ # @yield [response, operation] Access the result along with the RPC operation
464
+ # @yieldparam response [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent]
465
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
466
+ #
467
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent]
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::DataAgentService::Client.new
476
+ #
477
+ # # Create a request. To set request fields, pass in keyword arguments.
478
+ # request = Google::Cloud::GeminiDataAnalytics::V1::GetDataAgentRequest.new
479
+ #
480
+ # # Call the get_data_agent method.
481
+ # result = client.get_data_agent request
482
+ #
483
+ # # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1::DataAgent.
484
+ # p result
485
+ #
486
+ def get_data_agent 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::GetDataAgentRequest
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.get_data_agent.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.get_data_agent.timeout,
513
+ metadata: metadata,
514
+ retry_policy: @config.rpcs.get_data_agent.retry_policy
515
+
516
+ options.apply_defaults timeout: @config.timeout,
517
+ metadata: @config.metadata,
518
+ retry_policy: @config.retry_policy
519
+
520
+ @data_agent_service_stub.call_rpc :get_data_agent, 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
+ # Creates a new DataAgent in a given project and location.
529
+ #
530
+ # @overload create_data_agent(request, options = nil)
531
+ # Pass arguments to `create_data_agent` via a request object, either of type
532
+ # {::Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest} or an equivalent Hash.
533
+ #
534
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest, ::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 create_data_agent(parent: nil, data_agent_id: nil, data_agent: nil, request_id: nil)
541
+ # Pass arguments to `create_data_agent` 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 parent [::String]
546
+ # Required. Value for parent.
547
+ # @param data_agent_id [::String]
548
+ # Optional. Id of the requesting object. Must be unique within the parent.
549
+ # The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
550
+ # If not provided, the server will auto-generate a value for the id.
551
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent, ::Hash]
552
+ # Required. The resource being created.
553
+ # @param request_id [::String]
554
+ # Optional. An optional request ID to identify requests. Specify a unique
555
+ # request ID so that if you must retry your request, the server will know to
556
+ # ignore the request if it has already been completed. The server will
557
+ # guarantee that for at least 60 minutes since the first request.
558
+ #
559
+ # For example, consider a situation where you make an initial request and the
560
+ # request times out. If you make the request again with the same request
561
+ # ID, the server can check if original operation with the same request ID
562
+ # was received, and if so, will ignore the second request. This prevents
563
+ # clients from accidentally creating duplicate commitments.
564
+ #
565
+ # The request ID must be a valid UUID with the exception that zero UUID is
566
+ # not supported (00000000-0000-0000-0000-000000000000).
567
+ #
568
+ # @yield [response, operation] Access the result along with the RPC operation
569
+ # @yieldparam response [::Gapic::Operation]
570
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
571
+ #
572
+ # @return [::Gapic::Operation]
573
+ #
574
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
575
+ #
576
+ # @example Basic example
577
+ # require "google/cloud/gemini_data_analytics/v1"
578
+ #
579
+ # # Create a client object. The client can be reused for multiple calls.
580
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
581
+ #
582
+ # # Create a request. To set request fields, pass in keyword arguments.
583
+ # request = Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest.new
584
+ #
585
+ # # Call the create_data_agent method.
586
+ # result = client.create_data_agent request
587
+ #
588
+ # # The returned object is of type Gapic::Operation. You can use it to
589
+ # # check the status of an operation, cancel it, or wait for results.
590
+ # # Here is how to wait for a response.
591
+ # result.wait_until_done! timeout: 60
592
+ # if result.response?
593
+ # p result.response
594
+ # else
595
+ # puts "No response received."
596
+ # end
597
+ #
598
+ def create_data_agent request, options = nil
599
+ raise ::ArgumentError, "request must be provided" if request.nil?
600
+
601
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest
602
+
603
+ # Converts hash and nil to an options object
604
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
605
+
606
+ # Customize the options with defaults
607
+ metadata = @config.rpcs.create_data_agent.metadata.to_h
608
+
609
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
610
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
611
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
612
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
613
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
614
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
615
+
616
+ header_params = {}
617
+ if request.parent
618
+ header_params["parent"] = request.parent
619
+ end
620
+
621
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
622
+ metadata[:"x-goog-request-params"] ||= request_params_header
623
+
624
+ options.apply_defaults timeout: @config.rpcs.create_data_agent.timeout,
625
+ metadata: metadata,
626
+ retry_policy: @config.rpcs.create_data_agent.retry_policy
627
+
628
+ options.apply_defaults timeout: @config.timeout,
629
+ metadata: @config.metadata,
630
+ retry_policy: @config.retry_policy
631
+
632
+ @data_agent_service_stub.call_rpc :create_data_agent, request, options: options do |response, operation|
633
+ response = ::Gapic::Operation.new response, @operations_client, options: options
634
+ yield response, operation if block_given?
635
+ throw :response, response
636
+ end
637
+ rescue ::GRPC::BadStatus => e
638
+ raise ::Google::Cloud::Error.from_error(e)
639
+ end
640
+
641
+ ##
642
+ # Creates a new DataAgent in a given project and location synchronously.
643
+ #
644
+ # @overload create_data_agent_sync(request, options = nil)
645
+ # Pass arguments to `create_data_agent_sync` via a request object, either of type
646
+ # {::Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest} or an equivalent Hash.
647
+ #
648
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest, ::Hash]
649
+ # A request object representing the call parameters. Required. To specify no
650
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
651
+ # @param options [::Gapic::CallOptions, ::Hash]
652
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
653
+ #
654
+ # @overload create_data_agent_sync(parent: nil, data_agent_id: nil, data_agent: nil, request_id: nil)
655
+ # Pass arguments to `create_data_agent_sync` via keyword arguments. Note that at
656
+ # least one keyword argument is required. To specify no parameters, or to keep all
657
+ # the default parameter values, pass an empty Hash as a request object (see above).
658
+ #
659
+ # @param parent [::String]
660
+ # Required. Value for parent.
661
+ # @param data_agent_id [::String]
662
+ # Optional. Id of the requesting object. Must be unique within the parent.
663
+ # The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
664
+ # If not provided, the server will auto-generate a value for the id.
665
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent, ::Hash]
666
+ # Required. The resource being created.
667
+ # @param request_id [::String]
668
+ # Optional. An optional request ID to identify requests. Specify a unique
669
+ # request ID so that if you must retry your request, the server will know to
670
+ # ignore the request if it has already been completed. The server will
671
+ # guarantee that for at least 60 minutes since the first request.
672
+ #
673
+ # For example, consider a situation where you make an initial request and the
674
+ # request times out. If you make the request again with the same request
675
+ # ID, the server can check if original operation with the same request ID
676
+ # was received, and if so, will ignore the second request. This prevents
677
+ # clients from accidentally creating duplicate commitments.
678
+ #
679
+ # The request ID must be a valid UUID with the exception that zero UUID is
680
+ # not supported (00000000-0000-0000-0000-000000000000).
681
+ #
682
+ # @yield [response, operation] Access the result along with the RPC operation
683
+ # @yieldparam response [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent]
684
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
685
+ #
686
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent]
687
+ #
688
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
689
+ #
690
+ # @example Basic example
691
+ # require "google/cloud/gemini_data_analytics/v1"
692
+ #
693
+ # # Create a client object. The client can be reused for multiple calls.
694
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
695
+ #
696
+ # # Create a request. To set request fields, pass in keyword arguments.
697
+ # request = Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest.new
698
+ #
699
+ # # Call the create_data_agent_sync method.
700
+ # result = client.create_data_agent_sync request
701
+ #
702
+ # # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1::DataAgent.
703
+ # p result
704
+ #
705
+ def create_data_agent_sync request, options = nil
706
+ raise ::ArgumentError, "request must be provided" if request.nil?
707
+
708
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::CreateDataAgentRequest
709
+
710
+ # Converts hash and nil to an options object
711
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
712
+
713
+ # Customize the options with defaults
714
+ metadata = @config.rpcs.create_data_agent_sync.metadata.to_h
715
+
716
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
717
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
718
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
719
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
720
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
721
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
722
+
723
+ header_params = {}
724
+ if request.parent
725
+ header_params["parent"] = request.parent
726
+ end
727
+
728
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
729
+ metadata[:"x-goog-request-params"] ||= request_params_header
730
+
731
+ options.apply_defaults timeout: @config.rpcs.create_data_agent_sync.timeout,
732
+ metadata: metadata,
733
+ retry_policy: @config.rpcs.create_data_agent_sync.retry_policy
734
+
735
+ options.apply_defaults timeout: @config.timeout,
736
+ metadata: @config.metadata,
737
+ retry_policy: @config.retry_policy
738
+
739
+ @data_agent_service_stub.call_rpc :create_data_agent_sync, request, options: options do |response, operation|
740
+ yield response, operation if block_given?
741
+ end
742
+ rescue ::GRPC::BadStatus => e
743
+ raise ::Google::Cloud::Error.from_error(e)
744
+ end
745
+
746
+ ##
747
+ # Updates the parameters of a single DataAgent.
748
+ #
749
+ # @overload update_data_agent(request, options = nil)
750
+ # Pass arguments to `update_data_agent` via a request object, either of type
751
+ # {::Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest} or an equivalent Hash.
752
+ #
753
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest, ::Hash]
754
+ # A request object representing the call parameters. Required. To specify no
755
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
756
+ # @param options [::Gapic::CallOptions, ::Hash]
757
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
758
+ #
759
+ # @overload update_data_agent(update_mask: nil, data_agent: nil, request_id: nil)
760
+ # Pass arguments to `update_data_agent` via keyword arguments. Note that at
761
+ # least one keyword argument is required. To specify no parameters, or to keep all
762
+ # the default parameter values, pass an empty Hash as a request object (see above).
763
+ #
764
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
765
+ # Optional. Field mask is used to specify the fields to be overwritten in the
766
+ # DataAgent resource by the update.
767
+ # The fields specified in the update_mask are relative to the resource, not
768
+ # the full request. A field will be overwritten if it is in the mask. If the
769
+ # user does not provide a mask then all fields with non-default values
770
+ # present in the request will be overwritten. If a wildcard mask is provided,
771
+ # all fields will be overwritten.
772
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent, ::Hash]
773
+ # Required. The resource being updated.
774
+ # @param request_id [::String]
775
+ # Optional. An optional request ID to identify requests. Specify a unique
776
+ # request ID so that if you must retry your request, the server will know to
777
+ # ignore the request if it has already been completed. The server will
778
+ # guarantee that for at least 60 minutes since the first request.
779
+ #
780
+ # For example, consider a situation where you make an initial request and the
781
+ # request times out. If you make the request again with the same request
782
+ # ID, the server can check if original operation with the same request ID
783
+ # was received, and if so, will ignore the second request. This prevents
784
+ # clients from accidentally creating duplicate commitments.
785
+ #
786
+ # The request ID must be a valid UUID with the exception that zero UUID is
787
+ # not supported (00000000-0000-0000-0000-000000000000).
788
+ #
789
+ # @yield [response, operation] Access the result along with the RPC operation
790
+ # @yieldparam response [::Gapic::Operation]
791
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
792
+ #
793
+ # @return [::Gapic::Operation]
794
+ #
795
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
796
+ #
797
+ # @example Basic example
798
+ # require "google/cloud/gemini_data_analytics/v1"
799
+ #
800
+ # # Create a client object. The client can be reused for multiple calls.
801
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
802
+ #
803
+ # # Create a request. To set request fields, pass in keyword arguments.
804
+ # request = Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest.new
805
+ #
806
+ # # Call the update_data_agent method.
807
+ # result = client.update_data_agent request
808
+ #
809
+ # # The returned object is of type Gapic::Operation. You can use it to
810
+ # # check the status of an operation, cancel it, or wait for results.
811
+ # # Here is how to wait for a response.
812
+ # result.wait_until_done! timeout: 60
813
+ # if result.response?
814
+ # p result.response
815
+ # else
816
+ # puts "No response received."
817
+ # end
818
+ #
819
+ def update_data_agent request, options = nil
820
+ raise ::ArgumentError, "request must be provided" if request.nil?
821
+
822
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest
823
+
824
+ # Converts hash and nil to an options object
825
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
826
+
827
+ # Customize the options with defaults
828
+ metadata = @config.rpcs.update_data_agent.metadata.to_h
829
+
830
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
831
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
832
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
833
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
834
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
835
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
836
+
837
+ header_params = {}
838
+ if request.data_agent&.name
839
+ header_params["data_agent.name"] = request.data_agent.name
840
+ end
841
+
842
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
843
+ metadata[:"x-goog-request-params"] ||= request_params_header
844
+
845
+ options.apply_defaults timeout: @config.rpcs.update_data_agent.timeout,
846
+ metadata: metadata,
847
+ retry_policy: @config.rpcs.update_data_agent.retry_policy
848
+
849
+ options.apply_defaults timeout: @config.timeout,
850
+ metadata: @config.metadata,
851
+ retry_policy: @config.retry_policy
852
+
853
+ @data_agent_service_stub.call_rpc :update_data_agent, request, options: options do |response, operation|
854
+ response = ::Gapic::Operation.new response, @operations_client, options: options
855
+ yield response, operation if block_given?
856
+ throw :response, response
857
+ end
858
+ rescue ::GRPC::BadStatus => e
859
+ raise ::Google::Cloud::Error.from_error(e)
860
+ end
861
+
862
+ ##
863
+ # Updates the parameters of a single DataAgent synchronously.
864
+ #
865
+ # @overload update_data_agent_sync(request, options = nil)
866
+ # Pass arguments to `update_data_agent_sync` via a request object, either of type
867
+ # {::Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest} or an equivalent Hash.
868
+ #
869
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest, ::Hash]
870
+ # A request object representing the call parameters. Required. To specify no
871
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
872
+ # @param options [::Gapic::CallOptions, ::Hash]
873
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
874
+ #
875
+ # @overload update_data_agent_sync(update_mask: nil, data_agent: nil, request_id: nil)
876
+ # Pass arguments to `update_data_agent_sync` via keyword arguments. Note that at
877
+ # least one keyword argument is required. To specify no parameters, or to keep all
878
+ # the default parameter values, pass an empty Hash as a request object (see above).
879
+ #
880
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
881
+ # Optional. Field mask is used to specify the fields to be overwritten in the
882
+ # DataAgent resource by the update.
883
+ # The fields specified in the update_mask are relative to the resource, not
884
+ # the full request. A field will be overwritten if it is in the mask. If the
885
+ # user does not provide a mask then all fields with non-default values
886
+ # present in the request will be overwritten. If a wildcard mask is provided,
887
+ # all fields will be overwritten.
888
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent, ::Hash]
889
+ # Required. The resource being updated.
890
+ # @param request_id [::String]
891
+ # Optional. An optional request ID to identify requests. Specify a unique
892
+ # request ID so that if you must retry your request, the server will know to
893
+ # ignore the request if it has already been completed. The server will
894
+ # guarantee that for at least 60 minutes since the first request.
895
+ #
896
+ # For example, consider a situation where you make an initial request and the
897
+ # request times out. If you make the request again with the same request
898
+ # ID, the server can check if original operation with the same request ID
899
+ # was received, and if so, will ignore the second request. This prevents
900
+ # clients from accidentally creating duplicate commitments.
901
+ #
902
+ # The request ID must be a valid UUID with the exception that zero UUID is
903
+ # not supported (00000000-0000-0000-0000-000000000000).
904
+ #
905
+ # @yield [response, operation] Access the result along with the RPC operation
906
+ # @yieldparam response [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent]
907
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
908
+ #
909
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1::DataAgent]
910
+ #
911
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
912
+ #
913
+ # @example Basic example
914
+ # require "google/cloud/gemini_data_analytics/v1"
915
+ #
916
+ # # Create a client object. The client can be reused for multiple calls.
917
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
918
+ #
919
+ # # Create a request. To set request fields, pass in keyword arguments.
920
+ # request = Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest.new
921
+ #
922
+ # # Call the update_data_agent_sync method.
923
+ # result = client.update_data_agent_sync request
924
+ #
925
+ # # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1::DataAgent.
926
+ # p result
927
+ #
928
+ def update_data_agent_sync request, options = nil
929
+ raise ::ArgumentError, "request must be provided" if request.nil?
930
+
931
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::UpdateDataAgentRequest
932
+
933
+ # Converts hash and nil to an options object
934
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
935
+
936
+ # Customize the options with defaults
937
+ metadata = @config.rpcs.update_data_agent_sync.metadata.to_h
938
+
939
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
940
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
941
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
942
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
943
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
944
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
945
+
946
+ header_params = {}
947
+ if request.data_agent&.name
948
+ header_params["data_agent.name"] = request.data_agent.name
949
+ end
950
+
951
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
952
+ metadata[:"x-goog-request-params"] ||= request_params_header
953
+
954
+ options.apply_defaults timeout: @config.rpcs.update_data_agent_sync.timeout,
955
+ metadata: metadata,
956
+ retry_policy: @config.rpcs.update_data_agent_sync.retry_policy
957
+
958
+ options.apply_defaults timeout: @config.timeout,
959
+ metadata: @config.metadata,
960
+ retry_policy: @config.retry_policy
961
+
962
+ @data_agent_service_stub.call_rpc :update_data_agent_sync, request, options: options do |response, operation|
963
+ yield response, operation if block_given?
964
+ end
965
+ rescue ::GRPC::BadStatus => e
966
+ raise ::Google::Cloud::Error.from_error(e)
967
+ end
968
+
969
+ ##
970
+ # Deletes a single DataAgent.
971
+ #
972
+ # @overload delete_data_agent(request, options = nil)
973
+ # Pass arguments to `delete_data_agent` via a request object, either of type
974
+ # {::Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest} or an equivalent Hash.
975
+ #
976
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest, ::Hash]
977
+ # A request object representing the call parameters. Required. To specify no
978
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
979
+ # @param options [::Gapic::CallOptions, ::Hash]
980
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
981
+ #
982
+ # @overload delete_data_agent(name: nil, request_id: nil)
983
+ # Pass arguments to `delete_data_agent` via keyword arguments. Note that at
984
+ # least one keyword argument is required. To specify no parameters, or to keep all
985
+ # the default parameter values, pass an empty Hash as a request object (see above).
986
+ #
987
+ # @param name [::String]
988
+ # Required. Name of the resource.
989
+ # @param request_id [::String]
990
+ # Optional. An optional request ID to identify requests. Specify a unique
991
+ # request ID so that if you must retry your request, the server will know to
992
+ # ignore the request if it has already been completed. The server will
993
+ # guarantee that for at least 60 minutes after the first request.
994
+ #
995
+ # For example, consider a situation where you make an initial request and the
996
+ # request times out. If you make the request again with the same request
997
+ # ID, the server can check if original operation with the same request ID
998
+ # was received, and if so, will ignore the second request. This prevents
999
+ # clients from accidentally creating duplicate commitments.
1000
+ #
1001
+ # The request ID must be a valid UUID with the exception that zero UUID is
1002
+ # not supported (00000000-0000-0000-0000-000000000000).
1003
+ #
1004
+ # @yield [response, operation] Access the result along with the RPC operation
1005
+ # @yieldparam response [::Gapic::Operation]
1006
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1007
+ #
1008
+ # @return [::Gapic::Operation]
1009
+ #
1010
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1011
+ #
1012
+ # @example Basic example
1013
+ # require "google/cloud/gemini_data_analytics/v1"
1014
+ #
1015
+ # # Create a client object. The client can be reused for multiple calls.
1016
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
1017
+ #
1018
+ # # Create a request. To set request fields, pass in keyword arguments.
1019
+ # request = Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest.new
1020
+ #
1021
+ # # Call the delete_data_agent method.
1022
+ # result = client.delete_data_agent request
1023
+ #
1024
+ # # The returned object is of type Gapic::Operation. You can use it to
1025
+ # # check the status of an operation, cancel it, or wait for results.
1026
+ # # Here is how to wait for a response.
1027
+ # result.wait_until_done! timeout: 60
1028
+ # if result.response?
1029
+ # p result.response
1030
+ # else
1031
+ # puts "No response received."
1032
+ # end
1033
+ #
1034
+ def delete_data_agent request, options = nil
1035
+ raise ::ArgumentError, "request must be provided" if request.nil?
1036
+
1037
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest
1038
+
1039
+ # Converts hash and nil to an options object
1040
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1041
+
1042
+ # Customize the options with defaults
1043
+ metadata = @config.rpcs.delete_data_agent.metadata.to_h
1044
+
1045
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1046
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1047
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1048
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
1049
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1050
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1051
+
1052
+ header_params = {}
1053
+ if request.name
1054
+ header_params["name"] = request.name
1055
+ end
1056
+
1057
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1058
+ metadata[:"x-goog-request-params"] ||= request_params_header
1059
+
1060
+ options.apply_defaults timeout: @config.rpcs.delete_data_agent.timeout,
1061
+ metadata: metadata,
1062
+ retry_policy: @config.rpcs.delete_data_agent.retry_policy
1063
+
1064
+ options.apply_defaults timeout: @config.timeout,
1065
+ metadata: @config.metadata,
1066
+ retry_policy: @config.retry_policy
1067
+
1068
+ @data_agent_service_stub.call_rpc :delete_data_agent, request, options: options do |response, operation|
1069
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1070
+ yield response, operation if block_given?
1071
+ throw :response, response
1072
+ end
1073
+ rescue ::GRPC::BadStatus => e
1074
+ raise ::Google::Cloud::Error.from_error(e)
1075
+ end
1076
+
1077
+ ##
1078
+ # Deletes a single DataAgent synchronously.
1079
+ #
1080
+ # @overload delete_data_agent_sync(request, options = nil)
1081
+ # Pass arguments to `delete_data_agent_sync` via a request object, either of type
1082
+ # {::Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest} or an equivalent Hash.
1083
+ #
1084
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest, ::Hash]
1085
+ # A request object representing the call parameters. Required. To specify no
1086
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1087
+ # @param options [::Gapic::CallOptions, ::Hash]
1088
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1089
+ #
1090
+ # @overload delete_data_agent_sync(name: nil, request_id: nil)
1091
+ # Pass arguments to `delete_data_agent_sync` via keyword arguments. Note that at
1092
+ # least one keyword argument is required. To specify no parameters, or to keep all
1093
+ # the default parameter values, pass an empty Hash as a request object (see above).
1094
+ #
1095
+ # @param name [::String]
1096
+ # Required. Name of the resource.
1097
+ # @param request_id [::String]
1098
+ # Optional. An optional request ID to identify requests. Specify a unique
1099
+ # request ID so that if you must retry your request, the server will know to
1100
+ # ignore the request if it has already been completed. The server will
1101
+ # guarantee that for at least 60 minutes after the first request.
1102
+ #
1103
+ # For example, consider a situation where you make an initial request and the
1104
+ # request times out. If you make the request again with the same request
1105
+ # ID, the server can check if original operation with the same request ID
1106
+ # was received, and if so, will ignore the second request. This prevents
1107
+ # clients from accidentally creating duplicate commitments.
1108
+ #
1109
+ # The request ID must be a valid UUID with the exception that zero UUID is
1110
+ # not supported (00000000-0000-0000-0000-000000000000).
1111
+ #
1112
+ # @yield [response, operation] Access the result along with the RPC operation
1113
+ # @yieldparam response [::Google::Protobuf::Empty]
1114
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1115
+ #
1116
+ # @return [::Google::Protobuf::Empty]
1117
+ #
1118
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1119
+ #
1120
+ # @example Basic example
1121
+ # require "google/cloud/gemini_data_analytics/v1"
1122
+ #
1123
+ # # Create a client object. The client can be reused for multiple calls.
1124
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
1125
+ #
1126
+ # # Create a request. To set request fields, pass in keyword arguments.
1127
+ # request = Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest.new
1128
+ #
1129
+ # # Call the delete_data_agent_sync method.
1130
+ # result = client.delete_data_agent_sync request
1131
+ #
1132
+ # # The returned object is of type Google::Protobuf::Empty.
1133
+ # p result
1134
+ #
1135
+ def delete_data_agent_sync request, options = nil
1136
+ raise ::ArgumentError, "request must be provided" if request.nil?
1137
+
1138
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1::DeleteDataAgentRequest
1139
+
1140
+ # Converts hash and nil to an options object
1141
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1142
+
1143
+ # Customize the options with defaults
1144
+ metadata = @config.rpcs.delete_data_agent_sync.metadata.to_h
1145
+
1146
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1147
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1148
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1149
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
1150
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1151
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1152
+
1153
+ header_params = {}
1154
+ if request.name
1155
+ header_params["name"] = request.name
1156
+ end
1157
+
1158
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1159
+ metadata[:"x-goog-request-params"] ||= request_params_header
1160
+
1161
+ options.apply_defaults timeout: @config.rpcs.delete_data_agent_sync.timeout,
1162
+ metadata: metadata,
1163
+ retry_policy: @config.rpcs.delete_data_agent_sync.retry_policy
1164
+
1165
+ options.apply_defaults timeout: @config.timeout,
1166
+ metadata: @config.metadata,
1167
+ retry_policy: @config.retry_policy
1168
+
1169
+ @data_agent_service_stub.call_rpc :delete_data_agent_sync, request, options: options do |response, operation|
1170
+ yield response, operation if block_given?
1171
+ end
1172
+ rescue ::GRPC::BadStatus => e
1173
+ raise ::Google::Cloud::Error.from_error(e)
1174
+ end
1175
+
1176
+ ##
1177
+ # Gets the IAM policy for DataAgent
1178
+ #
1179
+ # @overload get_iam_policy(request, options = nil)
1180
+ # Pass arguments to `get_iam_policy` via a request object, either of type
1181
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
1182
+ #
1183
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
1184
+ # A request object representing the call parameters. Required. To specify no
1185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1186
+ # @param options [::Gapic::CallOptions, ::Hash]
1187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1188
+ #
1189
+ # @overload get_iam_policy(resource: nil, options: nil)
1190
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
1191
+ # least one keyword argument is required. To specify no parameters, or to keep all
1192
+ # the default parameter values, pass an empty Hash as a request object (see above).
1193
+ #
1194
+ # @param resource [::String]
1195
+ # REQUIRED: The resource for which the policy is being requested.
1196
+ # See the operation documentation for the appropriate value for this field.
1197
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
1198
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
1199
+ # `GetIamPolicy`.
1200
+ #
1201
+ # @yield [response, operation] Access the result along with the RPC operation
1202
+ # @yieldparam response [::Google::Iam::V1::Policy]
1203
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1204
+ #
1205
+ # @return [::Google::Iam::V1::Policy]
1206
+ #
1207
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1208
+ #
1209
+ # @example Basic example
1210
+ # require "google/cloud/gemini_data_analytics/v1"
1211
+ #
1212
+ # # Create a client object. The client can be reused for multiple calls.
1213
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
1214
+ #
1215
+ # # Create a request. To set request fields, pass in keyword arguments.
1216
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
1217
+ #
1218
+ # # Call the get_iam_policy method.
1219
+ # result = client.get_iam_policy request
1220
+ #
1221
+ # # The returned object is of type Google::Iam::V1::Policy.
1222
+ # p result
1223
+ #
1224
+ def get_iam_policy request, options = nil
1225
+ raise ::ArgumentError, "request must be provided" if request.nil?
1226
+
1227
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
1228
+
1229
+ # Converts hash and nil to an options object
1230
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1231
+
1232
+ # Customize the options with defaults
1233
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
1234
+
1235
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1236
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1237
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1238
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
1239
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1240
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1241
+
1242
+ header_params = {}
1243
+ if request.resource
1244
+ header_params["resource"] = request.resource
1245
+ end
1246
+
1247
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1248
+ metadata[:"x-goog-request-params"] ||= request_params_header
1249
+
1250
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
1251
+ metadata: metadata,
1252
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
1253
+
1254
+ options.apply_defaults timeout: @config.timeout,
1255
+ metadata: @config.metadata,
1256
+ retry_policy: @config.retry_policy
1257
+
1258
+ @data_agent_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
1259
+ yield response, operation if block_given?
1260
+ end
1261
+ rescue ::GRPC::BadStatus => e
1262
+ raise ::Google::Cloud::Error.from_error(e)
1263
+ end
1264
+
1265
+ ##
1266
+ # Sets the IAM policy for a DataAgent.
1267
+ #
1268
+ # @overload set_iam_policy(request, options = nil)
1269
+ # Pass arguments to `set_iam_policy` via a request object, either of type
1270
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
1271
+ #
1272
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
1273
+ # A request object representing the call parameters. Required. To specify no
1274
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1275
+ # @param options [::Gapic::CallOptions, ::Hash]
1276
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1277
+ #
1278
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
1279
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
1280
+ # least one keyword argument is required. To specify no parameters, or to keep all
1281
+ # the default parameter values, pass an empty Hash as a request object (see above).
1282
+ #
1283
+ # @param resource [::String]
1284
+ # REQUIRED: The resource for which the policy is being specified.
1285
+ # See the operation documentation for the appropriate value for this field.
1286
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
1287
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
1288
+ # the policy is limited to a few 10s of KB. An empty policy is a
1289
+ # valid policy but certain Cloud Platform services (such as Projects)
1290
+ # might reject them.
1291
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1292
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
1293
+ # the fields in the mask will be modified. If no mask is provided, the
1294
+ # following default mask is used:
1295
+ #
1296
+ # `paths: "bindings, etag"`
1297
+ #
1298
+ # @yield [response, operation] Access the result along with the RPC operation
1299
+ # @yieldparam response [::Google::Iam::V1::Policy]
1300
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1301
+ #
1302
+ # @return [::Google::Iam::V1::Policy]
1303
+ #
1304
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1305
+ #
1306
+ # @example Basic example
1307
+ # require "google/cloud/gemini_data_analytics/v1"
1308
+ #
1309
+ # # Create a client object. The client can be reused for multiple calls.
1310
+ # client = Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new
1311
+ #
1312
+ # # Create a request. To set request fields, pass in keyword arguments.
1313
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1314
+ #
1315
+ # # Call the set_iam_policy method.
1316
+ # result = client.set_iam_policy request
1317
+ #
1318
+ # # The returned object is of type Google::Iam::V1::Policy.
1319
+ # p result
1320
+ #
1321
+ def set_iam_policy request, options = nil
1322
+ raise ::ArgumentError, "request must be provided" if request.nil?
1323
+
1324
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1325
+
1326
+ # Converts hash and nil to an options object
1327
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1328
+
1329
+ # Customize the options with defaults
1330
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1331
+
1332
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1333
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1334
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1335
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1::VERSION
1336
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1337
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1338
+
1339
+ header_params = {}
1340
+ if request.resource
1341
+ header_params["resource"] = request.resource
1342
+ end
1343
+
1344
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1345
+ metadata[:"x-goog-request-params"] ||= request_params_header
1346
+
1347
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1348
+ metadata: metadata,
1349
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1350
+
1351
+ options.apply_defaults timeout: @config.timeout,
1352
+ metadata: @config.metadata,
1353
+ retry_policy: @config.retry_policy
1354
+
1355
+ @data_agent_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1356
+ yield response, operation if block_given?
1357
+ end
1358
+ rescue ::GRPC::BadStatus => e
1359
+ raise ::Google::Cloud::Error.from_error(e)
1360
+ end
1361
+
1362
+ ##
1363
+ # Configuration class for the DataAgentService API.
1364
+ #
1365
+ # This class represents the configuration for DataAgentService,
1366
+ # providing control over timeouts, retry behavior, logging, transport
1367
+ # parameters, and other low-level controls. Certain parameters can also be
1368
+ # applied individually to specific RPCs. See
1369
+ # {::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client::Configuration::Rpcs}
1370
+ # for a list of RPCs that can be configured independently.
1371
+ #
1372
+ # Configuration can be applied globally to all clients, or to a single client
1373
+ # on construction.
1374
+ #
1375
+ # @example
1376
+ #
1377
+ # # Modify the global config, setting the timeout for
1378
+ # # list_data_agents to 20 seconds,
1379
+ # # and all remaining timeouts to 10 seconds.
1380
+ # ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.configure do |config|
1381
+ # config.timeout = 10.0
1382
+ # config.rpcs.list_data_agents.timeout = 20.0
1383
+ # end
1384
+ #
1385
+ # # Apply the above configuration only to a new client.
1386
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new do |config|
1387
+ # config.timeout = 10.0
1388
+ # config.rpcs.list_data_agents.timeout = 20.0
1389
+ # end
1390
+ #
1391
+ # @!attribute [rw] endpoint
1392
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1393
+ # nil, indicating to use the default endpoint in the current universe domain.
1394
+ # @return [::String,nil]
1395
+ # @!attribute [rw] credentials
1396
+ # Credentials to send with calls. You may provide any of the following types:
1397
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1398
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1399
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1400
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1401
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1402
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1403
+ # * (`nil`) indicating no credentials
1404
+ #
1405
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
1406
+ # is deprecated. Providing an unvalidated credential configuration to
1407
+ # Google APIs can compromise the security of your systems and data.
1408
+ #
1409
+ # @example
1410
+ #
1411
+ # # The recommended way to provide credentials is to use the `make_creds` method
1412
+ # # on the appropriate credentials class for your environment.
1413
+ #
1414
+ # require "googleauth"
1415
+ #
1416
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
1417
+ # json_key_io: ::File.open("/path/to/keyfile.json")
1418
+ # )
1419
+ #
1420
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1::DataAgentService::Client.new do |config|
1421
+ # config.credentials = credentials
1422
+ # end
1423
+ #
1424
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
1425
+ # external source for authentication to Google Cloud, you must validate it before
1426
+ # providing it to a Google API client library. Providing an unvalidated credential
1427
+ # configuration to Google APIs can compromise the security of your systems and data.
1428
+ # For more information, refer to [Validate credential configurations from external
1429
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1430
+ # @return [::Object]
1431
+ # @!attribute [rw] scope
1432
+ # The OAuth scopes
1433
+ # @return [::Array<::String>]
1434
+ # @!attribute [rw] lib_name
1435
+ # The library name as recorded in instrumentation and logging
1436
+ # @return [::String]
1437
+ # @!attribute [rw] lib_version
1438
+ # The library version as recorded in instrumentation and logging
1439
+ # @return [::String]
1440
+ # @!attribute [rw] channel_args
1441
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1442
+ # `GRPC::Core::Channel` object is provided as the credential.
1443
+ # @return [::Hash]
1444
+ # @!attribute [rw] interceptors
1445
+ # An array of interceptors that are run before calls are executed.
1446
+ # @return [::Array<::GRPC::ClientInterceptor>]
1447
+ # @!attribute [rw] timeout
1448
+ # The call timeout in seconds.
1449
+ # @return [::Numeric]
1450
+ # @!attribute [rw] metadata
1451
+ # Additional gRPC headers to be sent with the call.
1452
+ # @return [::Hash{::Symbol=>::String}]
1453
+ # @!attribute [rw] retry_policy
1454
+ # The retry policy. The value is a hash with the following keys:
1455
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1456
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1457
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1458
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1459
+ # trigger a retry.
1460
+ # @return [::Hash]
1461
+ # @!attribute [rw] quota_project
1462
+ # A separate project against which to charge quota.
1463
+ # @return [::String]
1464
+ # @!attribute [rw] universe_domain
1465
+ # The universe domain within which to make requests. This determines the
1466
+ # default endpoint URL. The default value of nil uses the environment
1467
+ # universe (usually the default "googleapis.com" universe).
1468
+ # @return [::String,nil]
1469
+ # @!attribute [rw] logger
1470
+ # A custom logger to use for request/response debug logging, or the value
1471
+ # `:default` (the default) to construct a default logger, or `nil` to
1472
+ # explicitly disable logging.
1473
+ # @return [::Logger,:default,nil]
1474
+ #
1475
+ class Configuration
1476
+ extend ::Gapic::Config
1477
+
1478
+ # @private
1479
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1480
+ DEFAULT_ENDPOINT = "geminidataanalytics.googleapis.com"
1481
+
1482
+ config_attr :endpoint, nil, ::String, nil
1483
+ config_attr :credentials, nil do |value|
1484
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1485
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1486
+ allowed.any? { |klass| klass === value }
1487
+ end
1488
+ config_attr :scope, nil, ::String, ::Array, nil
1489
+ config_attr :lib_name, nil, ::String, nil
1490
+ config_attr :lib_version, nil, ::String, nil
1491
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1492
+ config_attr :interceptors, nil, ::Array, nil
1493
+ config_attr :timeout, nil, ::Numeric, nil
1494
+ config_attr :metadata, nil, ::Hash, nil
1495
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1496
+ config_attr :quota_project, nil, ::String, nil
1497
+ config_attr :universe_domain, nil, ::String, nil
1498
+ config_attr :logger, :default, ::Logger, nil, :default
1499
+
1500
+ # @private
1501
+ def initialize parent_config = nil
1502
+ @parent_config = parent_config unless parent_config.nil?
1503
+
1504
+ yield self if block_given?
1505
+ end
1506
+
1507
+ ##
1508
+ # Configurations for individual RPCs
1509
+ # @return [Rpcs]
1510
+ #
1511
+ def rpcs
1512
+ @rpcs ||= begin
1513
+ parent_rpcs = nil
1514
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1515
+ Rpcs.new parent_rpcs
1516
+ end
1517
+ end
1518
+
1519
+ ##
1520
+ # Configuration for the channel pool
1521
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1522
+ #
1523
+ def channel_pool
1524
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1525
+ end
1526
+
1527
+ ##
1528
+ # Configuration RPC class for the DataAgentService API.
1529
+ #
1530
+ # Includes fields providing the configuration for each RPC in this service.
1531
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1532
+ # the following configuration fields:
1533
+ #
1534
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1535
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1536
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1537
+ # include the following keys:
1538
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1539
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1540
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1541
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1542
+ # trigger a retry.
1543
+ #
1544
+ class Rpcs
1545
+ ##
1546
+ # RPC-specific configuration for `list_data_agents`
1547
+ # @return [::Gapic::Config::Method]
1548
+ #
1549
+ attr_reader :list_data_agents
1550
+ ##
1551
+ # RPC-specific configuration for `list_accessible_data_agents`
1552
+ # @return [::Gapic::Config::Method]
1553
+ #
1554
+ attr_reader :list_accessible_data_agents
1555
+ ##
1556
+ # RPC-specific configuration for `get_data_agent`
1557
+ # @return [::Gapic::Config::Method]
1558
+ #
1559
+ attr_reader :get_data_agent
1560
+ ##
1561
+ # RPC-specific configuration for `create_data_agent`
1562
+ # @return [::Gapic::Config::Method]
1563
+ #
1564
+ attr_reader :create_data_agent
1565
+ ##
1566
+ # RPC-specific configuration for `create_data_agent_sync`
1567
+ # @return [::Gapic::Config::Method]
1568
+ #
1569
+ attr_reader :create_data_agent_sync
1570
+ ##
1571
+ # RPC-specific configuration for `update_data_agent`
1572
+ # @return [::Gapic::Config::Method]
1573
+ #
1574
+ attr_reader :update_data_agent
1575
+ ##
1576
+ # RPC-specific configuration for `update_data_agent_sync`
1577
+ # @return [::Gapic::Config::Method]
1578
+ #
1579
+ attr_reader :update_data_agent_sync
1580
+ ##
1581
+ # RPC-specific configuration for `delete_data_agent`
1582
+ # @return [::Gapic::Config::Method]
1583
+ #
1584
+ attr_reader :delete_data_agent
1585
+ ##
1586
+ # RPC-specific configuration for `delete_data_agent_sync`
1587
+ # @return [::Gapic::Config::Method]
1588
+ #
1589
+ attr_reader :delete_data_agent_sync
1590
+ ##
1591
+ # RPC-specific configuration for `get_iam_policy`
1592
+ # @return [::Gapic::Config::Method]
1593
+ #
1594
+ attr_reader :get_iam_policy
1595
+ ##
1596
+ # RPC-specific configuration for `set_iam_policy`
1597
+ # @return [::Gapic::Config::Method]
1598
+ #
1599
+ attr_reader :set_iam_policy
1600
+
1601
+ # @private
1602
+ def initialize parent_rpcs = nil
1603
+ list_data_agents_config = parent_rpcs.list_data_agents if parent_rpcs.respond_to? :list_data_agents
1604
+ @list_data_agents = ::Gapic::Config::Method.new list_data_agents_config
1605
+ list_accessible_data_agents_config = parent_rpcs.list_accessible_data_agents if parent_rpcs.respond_to? :list_accessible_data_agents
1606
+ @list_accessible_data_agents = ::Gapic::Config::Method.new list_accessible_data_agents_config
1607
+ get_data_agent_config = parent_rpcs.get_data_agent if parent_rpcs.respond_to? :get_data_agent
1608
+ @get_data_agent = ::Gapic::Config::Method.new get_data_agent_config
1609
+ create_data_agent_config = parent_rpcs.create_data_agent if parent_rpcs.respond_to? :create_data_agent
1610
+ @create_data_agent = ::Gapic::Config::Method.new create_data_agent_config
1611
+ create_data_agent_sync_config = parent_rpcs.create_data_agent_sync if parent_rpcs.respond_to? :create_data_agent_sync
1612
+ @create_data_agent_sync = ::Gapic::Config::Method.new create_data_agent_sync_config
1613
+ update_data_agent_config = parent_rpcs.update_data_agent if parent_rpcs.respond_to? :update_data_agent
1614
+ @update_data_agent = ::Gapic::Config::Method.new update_data_agent_config
1615
+ update_data_agent_sync_config = parent_rpcs.update_data_agent_sync if parent_rpcs.respond_to? :update_data_agent_sync
1616
+ @update_data_agent_sync = ::Gapic::Config::Method.new update_data_agent_sync_config
1617
+ delete_data_agent_config = parent_rpcs.delete_data_agent if parent_rpcs.respond_to? :delete_data_agent
1618
+ @delete_data_agent = ::Gapic::Config::Method.new delete_data_agent_config
1619
+ delete_data_agent_sync_config = parent_rpcs.delete_data_agent_sync if parent_rpcs.respond_to? :delete_data_agent_sync
1620
+ @delete_data_agent_sync = ::Gapic::Config::Method.new delete_data_agent_sync_config
1621
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1622
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1623
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1624
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1625
+
1626
+ yield self if block_given?
1627
+ end
1628
+ end
1629
+ end
1630
+ end
1631
+ end
1632
+ end
1633
+ end
1634
+ end
1635
+ end