google-cloud-gemini_data_analytics-v1beta 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 (62) 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/v1beta/bindings_override.rb +75 -0
  6. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/client.rb +1286 -0
  7. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/credentials.rb +47 -0
  8. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/operations.rb +813 -0
  9. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/paths.rb +69 -0
  10. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/rest/client.rb +1212 -0
  11. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/rest/operations.rb +914 -0
  12. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/rest/service_stub.rb +573 -0
  13. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/rest.rb +54 -0
  14. data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service.rb +56 -0
  15. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/client.rb +928 -0
  16. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/credentials.rb +47 -0
  17. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/paths.rb +102 -0
  18. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/rest/client.rb +877 -0
  19. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/rest/service_stub.rb +382 -0
  20. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/rest.rb +55 -0
  21. data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service.rb +57 -0
  22. data/lib/google/cloud/gemini_data_analytics/v1beta/rest.rb +39 -0
  23. data/lib/google/cloud/gemini_data_analytics/v1beta/version.rb +7 -2
  24. data/lib/google/cloud/gemini_data_analytics/v1beta.rb +46 -0
  25. data/lib/google/cloud/geminidataanalytics/v1beta/context_pb.rb +54 -0
  26. data/lib/google/cloud/geminidataanalytics/v1beta/conversation_pb.rb +52 -0
  27. data/lib/google/cloud/geminidataanalytics/v1beta/credentials_pb.rb +47 -0
  28. data/lib/google/cloud/geminidataanalytics/v1beta/data_agent_pb.rb +49 -0
  29. data/lib/google/cloud/geminidataanalytics/v1beta/data_agent_service_pb.rb +67 -0
  30. data/lib/google/cloud/geminidataanalytics/v1beta/data_agent_service_services_pb.rb +60 -0
  31. data/lib/google/cloud/geminidataanalytics/v1beta/data_analytics_agent_pb.rb +46 -0
  32. data/lib/google/cloud/geminidataanalytics/v1beta/data_chat_service_pb.rb +85 -0
  33. data/lib/google/cloud/geminidataanalytics/v1beta/data_chat_service_services_pb.rb +57 -0
  34. data/lib/google/cloud/geminidataanalytics/v1beta/datasource_pb.rb +58 -0
  35. data/lib/google-cloud-gemini_data_analytics-v1beta.rb +21 -0
  36. data/proto_docs/README.md +4 -0
  37. data/proto_docs/google/api/client.rb +473 -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/v1beta/context.rb +136 -0
  43. data/proto_docs/google/cloud/geminidataanalytics/v1beta/conversation.rb +144 -0
  44. data/proto_docs/google/cloud/geminidataanalytics/v1beta/credentials.rb +74 -0
  45. data/proto_docs/google/cloud/geminidataanalytics/v1beta/data_agent.rb +90 -0
  46. data/proto_docs/google/cloud/geminidataanalytics/v1beta/data_agent_service.rb +267 -0
  47. data/proto_docs/google/cloud/geminidataanalytics/v1beta/data_analytics_agent.rb +46 -0
  48. data/proto_docs/google/cloud/geminidataanalytics/v1beta/data_chat_service.rb +576 -0
  49. data/proto_docs/google/cloud/geminidataanalytics/v1beta/datasource.rb +280 -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 +173 -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/rpc/status.rb +48 -0
  61. data/proto_docs/google/type/expr.rb +75 -0
  62. metadata +123 -9
@@ -0,0 +1,1286 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2025 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/v1beta/data_agent_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module GeminiDataAnalytics
26
+ module V1beta
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::V1beta::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::V1beta::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", "V1beta"]
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 = 60.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::V1beta::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::V1beta::DataAgentService::Client.new
121
+ #
122
+ # # Create a client using a custom configuration
123
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1beta::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/v1beta/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::V1beta::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::V1beta::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::V1beta::ListDataAgentsRequest} or an equivalent Hash.
227
+ #
228
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::DataAgent>]
262
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
263
+ #
264
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent>]
265
+ #
266
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
267
+ #
268
+ # @example Basic example
269
+ # require "google/cloud/gemini_data_analytics/v1beta"
270
+ #
271
+ # # Create a client object. The client can be reused for multiple calls.
272
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
273
+ #
274
+ # # Create a request. To set request fields, pass in keyword arguments.
275
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::ListAccessibleDataAgentsRequest} or an equivalent Hash.
337
+ #
338
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::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::V1beta::DataAgent>]
374
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
375
+ #
376
+ # @return [::Gapic::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent>]
377
+ #
378
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
379
+ #
380
+ # @example Basic example
381
+ # require "google/cloud/gemini_data_analytics/v1beta"
382
+ #
383
+ # # Create a client object. The client can be reused for multiple calls.
384
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
385
+ #
386
+ # # Create a request. To set request fields, pass in keyword arguments.
387
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::GetDataAgentRequest} or an equivalent Hash.
448
+ #
449
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::DataAgent]
465
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
466
+ #
467
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent]
468
+ #
469
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
470
+ #
471
+ # @example Basic example
472
+ # require "google/cloud/gemini_data_analytics/v1beta"
473
+ #
474
+ # # Create a client object. The client can be reused for multiple calls.
475
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
476
+ #
477
+ # # Create a request. To set request fields, pass in keyword arguments.
478
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::CreateDataAgentRequest} or an equivalent Hash.
533
+ #
534
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::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/v1beta"
578
+ #
579
+ # # Create a client object. The client can be reused for multiple calls.
580
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
581
+ #
582
+ # # Create a request. To set request fields, pass in keyword arguments.
583
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::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::V1beta::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::V1beta::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
+ # Updates the parameters of a single DataAgent.
643
+ #
644
+ # @overload update_data_agent(request, options = nil)
645
+ # Pass arguments to `update_data_agent` via a request object, either of type
646
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest} or an equivalent Hash.
647
+ #
648
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest, ::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 update_data_agent(update_mask: nil, data_agent: nil, request_id: nil)
655
+ # Pass arguments to `update_data_agent` 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 update_mask [::Google::Protobuf::FieldMask, ::Hash]
660
+ # Optional. Field mask is used to specify the fields to be overwritten in the
661
+ # DataAgent resource by the update.
662
+ # The fields specified in the update_mask are relative to the resource, not
663
+ # the full request. A field will be overwritten if it is in the mask. If the
664
+ # user does not provide a mask then all fields with non-default values
665
+ # present in the request will be overwritten. If a wildcard mask is provided,
666
+ # all fields will be overwritten.
667
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent, ::Hash]
668
+ # Required. The resource being updated.
669
+ # @param request_id [::String]
670
+ # Optional. An optional request ID to identify requests. Specify a unique
671
+ # request ID so that if you must retry your request, the server will know to
672
+ # ignore the request if it has already been completed. The server will
673
+ # guarantee that for at least 60 minutes since the first request.
674
+ #
675
+ # For example, consider a situation where you make an initial request and the
676
+ # request times out. If you make the request again with the same request
677
+ # ID, the server can check if original operation with the same request ID
678
+ # was received, and if so, will ignore the second request. This prevents
679
+ # clients from accidentally creating duplicate commitments.
680
+ #
681
+ # The request ID must be a valid UUID with the exception that zero UUID is
682
+ # not supported (00000000-0000-0000-0000-000000000000).
683
+ #
684
+ # @yield [response, operation] Access the result along with the RPC operation
685
+ # @yieldparam response [::Gapic::Operation]
686
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
687
+ #
688
+ # @return [::Gapic::Operation]
689
+ #
690
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
691
+ #
692
+ # @example Basic example
693
+ # require "google/cloud/gemini_data_analytics/v1beta"
694
+ #
695
+ # # Create a client object. The client can be reused for multiple calls.
696
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
697
+ #
698
+ # # Create a request. To set request fields, pass in keyword arguments.
699
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest.new
700
+ #
701
+ # # Call the update_data_agent method.
702
+ # result = client.update_data_agent request
703
+ #
704
+ # # The returned object is of type Gapic::Operation. You can use it to
705
+ # # check the status of an operation, cancel it, or wait for results.
706
+ # # Here is how to wait for a response.
707
+ # result.wait_until_done! timeout: 60
708
+ # if result.response?
709
+ # p result.response
710
+ # else
711
+ # puts "No response received."
712
+ # end
713
+ #
714
+ def update_data_agent request, options = nil
715
+ raise ::ArgumentError, "request must be provided" if request.nil?
716
+
717
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest
718
+
719
+ # Converts hash and nil to an options object
720
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
721
+
722
+ # Customize the options with defaults
723
+ metadata = @config.rpcs.update_data_agent.metadata.to_h
724
+
725
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
726
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
727
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
728
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION
729
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
730
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
731
+
732
+ header_params = {}
733
+ if request.data_agent&.name
734
+ header_params["data_agent.name"] = request.data_agent.name
735
+ end
736
+
737
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
738
+ metadata[:"x-goog-request-params"] ||= request_params_header
739
+
740
+ options.apply_defaults timeout: @config.rpcs.update_data_agent.timeout,
741
+ metadata: metadata,
742
+ retry_policy: @config.rpcs.update_data_agent.retry_policy
743
+
744
+ options.apply_defaults timeout: @config.timeout,
745
+ metadata: @config.metadata,
746
+ retry_policy: @config.retry_policy
747
+
748
+ @data_agent_service_stub.call_rpc :update_data_agent, request, options: options do |response, operation|
749
+ response = ::Gapic::Operation.new response, @operations_client, options: options
750
+ yield response, operation if block_given?
751
+ throw :response, response
752
+ end
753
+ rescue ::GRPC::BadStatus => e
754
+ raise ::Google::Cloud::Error.from_error(e)
755
+ end
756
+
757
+ ##
758
+ # Deletes a single DataAgent.
759
+ #
760
+ # @overload delete_data_agent(request, options = nil)
761
+ # Pass arguments to `delete_data_agent` via a request object, either of type
762
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest} or an equivalent Hash.
763
+ #
764
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest, ::Hash]
765
+ # A request object representing the call parameters. Required. To specify no
766
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
767
+ # @param options [::Gapic::CallOptions, ::Hash]
768
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
769
+ #
770
+ # @overload delete_data_agent(name: nil, request_id: nil)
771
+ # Pass arguments to `delete_data_agent` via keyword arguments. Note that at
772
+ # least one keyword argument is required. To specify no parameters, or to keep all
773
+ # the default parameter values, pass an empty Hash as a request object (see above).
774
+ #
775
+ # @param name [::String]
776
+ # Required. Name of the resource.
777
+ # @param request_id [::String]
778
+ # Optional. An optional request ID to identify requests. Specify a unique
779
+ # request ID so that if you must retry your request, the server will know to
780
+ # ignore the request if it has already been completed. The server will
781
+ # guarantee that for at least 60 minutes after the first request.
782
+ #
783
+ # For example, consider a situation where you make an initial request and the
784
+ # request times out. If you make the request again with the same request
785
+ # ID, the server can check if original operation with the same request ID
786
+ # was received, and if so, will ignore the second request. This prevents
787
+ # clients from accidentally creating duplicate commitments.
788
+ #
789
+ # The request ID must be a valid UUID with the exception that zero UUID is
790
+ # not supported (00000000-0000-0000-0000-000000000000).
791
+ #
792
+ # @yield [response, operation] Access the result along with the RPC operation
793
+ # @yieldparam response [::Gapic::Operation]
794
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
795
+ #
796
+ # @return [::Gapic::Operation]
797
+ #
798
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
799
+ #
800
+ # @example Basic example
801
+ # require "google/cloud/gemini_data_analytics/v1beta"
802
+ #
803
+ # # Create a client object. The client can be reused for multiple calls.
804
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
805
+ #
806
+ # # Create a request. To set request fields, pass in keyword arguments.
807
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest.new
808
+ #
809
+ # # Call the delete_data_agent method.
810
+ # result = client.delete_data_agent request
811
+ #
812
+ # # The returned object is of type Gapic::Operation. You can use it to
813
+ # # check the status of an operation, cancel it, or wait for results.
814
+ # # Here is how to wait for a response.
815
+ # result.wait_until_done! timeout: 60
816
+ # if result.response?
817
+ # p result.response
818
+ # else
819
+ # puts "No response received."
820
+ # end
821
+ #
822
+ def delete_data_agent request, options = nil
823
+ raise ::ArgumentError, "request must be provided" if request.nil?
824
+
825
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest
826
+
827
+ # Converts hash and nil to an options object
828
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
829
+
830
+ # Customize the options with defaults
831
+ metadata = @config.rpcs.delete_data_agent.metadata.to_h
832
+
833
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
834
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
835
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
836
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION
837
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
838
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
839
+
840
+ header_params = {}
841
+ if request.name
842
+ header_params["name"] = request.name
843
+ end
844
+
845
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
846
+ metadata[:"x-goog-request-params"] ||= request_params_header
847
+
848
+ options.apply_defaults timeout: @config.rpcs.delete_data_agent.timeout,
849
+ metadata: metadata,
850
+ retry_policy: @config.rpcs.delete_data_agent.retry_policy
851
+
852
+ options.apply_defaults timeout: @config.timeout,
853
+ metadata: @config.metadata,
854
+ retry_policy: @config.retry_policy
855
+
856
+ @data_agent_service_stub.call_rpc :delete_data_agent, request, options: options do |response, operation|
857
+ response = ::Gapic::Operation.new response, @operations_client, options: options
858
+ yield response, operation if block_given?
859
+ throw :response, response
860
+ end
861
+ rescue ::GRPC::BadStatus => e
862
+ raise ::Google::Cloud::Error.from_error(e)
863
+ end
864
+
865
+ ##
866
+ # Gets the IAM policy for DataAgent
867
+ #
868
+ # @overload get_iam_policy(request, options = nil)
869
+ # Pass arguments to `get_iam_policy` via a request object, either of type
870
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
871
+ #
872
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
873
+ # A request object representing the call parameters. Required. To specify no
874
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
875
+ # @param options [::Gapic::CallOptions, ::Hash]
876
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
877
+ #
878
+ # @overload get_iam_policy(resource: nil, options: nil)
879
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
880
+ # least one keyword argument is required. To specify no parameters, or to keep all
881
+ # the default parameter values, pass an empty Hash as a request object (see above).
882
+ #
883
+ # @param resource [::String]
884
+ # REQUIRED: The resource for which the policy is being requested.
885
+ # See the operation documentation for the appropriate value for this field.
886
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
887
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
888
+ # `GetIamPolicy`.
889
+ #
890
+ # @yield [response, operation] Access the result along with the RPC operation
891
+ # @yieldparam response [::Google::Iam::V1::Policy]
892
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
893
+ #
894
+ # @return [::Google::Iam::V1::Policy]
895
+ #
896
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
897
+ #
898
+ # @example Basic example
899
+ # require "google/cloud/gemini_data_analytics/v1beta"
900
+ #
901
+ # # Create a client object. The client can be reused for multiple calls.
902
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
903
+ #
904
+ # # Create a request. To set request fields, pass in keyword arguments.
905
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
906
+ #
907
+ # # Call the get_iam_policy method.
908
+ # result = client.get_iam_policy request
909
+ #
910
+ # # The returned object is of type Google::Iam::V1::Policy.
911
+ # p result
912
+ #
913
+ def get_iam_policy request, options = nil
914
+ raise ::ArgumentError, "request must be provided" if request.nil?
915
+
916
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
917
+
918
+ # Converts hash and nil to an options object
919
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
920
+
921
+ # Customize the options with defaults
922
+ metadata = @config.rpcs.get_iam_policy.metadata.to_h
923
+
924
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
925
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
926
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
927
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION
928
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
929
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
930
+
931
+ header_params = {}
932
+ if request.resource
933
+ header_params["resource"] = request.resource
934
+ end
935
+
936
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
937
+ metadata[:"x-goog-request-params"] ||= request_params_header
938
+
939
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
940
+ metadata: metadata,
941
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
942
+
943
+ options.apply_defaults timeout: @config.timeout,
944
+ metadata: @config.metadata,
945
+ retry_policy: @config.retry_policy
946
+
947
+ @data_agent_service_stub.call_rpc :get_iam_policy, request, options: options do |response, operation|
948
+ yield response, operation if block_given?
949
+ end
950
+ rescue ::GRPC::BadStatus => e
951
+ raise ::Google::Cloud::Error.from_error(e)
952
+ end
953
+
954
+ ##
955
+ # Sets the IAM policy for a DataAgent.
956
+ #
957
+ # @overload set_iam_policy(request, options = nil)
958
+ # Pass arguments to `set_iam_policy` via a request object, either of type
959
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
960
+ #
961
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
962
+ # A request object representing the call parameters. Required. To specify no
963
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
964
+ # @param options [::Gapic::CallOptions, ::Hash]
965
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
966
+ #
967
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
968
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
969
+ # least one keyword argument is required. To specify no parameters, or to keep all
970
+ # the default parameter values, pass an empty Hash as a request object (see above).
971
+ #
972
+ # @param resource [::String]
973
+ # REQUIRED: The resource for which the policy is being specified.
974
+ # See the operation documentation for the appropriate value for this field.
975
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
976
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
977
+ # the policy is limited to a few 10s of KB. An empty policy is a
978
+ # valid policy but certain Cloud Platform services (such as Projects)
979
+ # might reject them.
980
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
981
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
982
+ # the fields in the mask will be modified. If no mask is provided, the
983
+ # following default mask is used:
984
+ #
985
+ # `paths: "bindings, etag"`
986
+ #
987
+ # @yield [response, operation] Access the result along with the RPC operation
988
+ # @yieldparam response [::Google::Iam::V1::Policy]
989
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
990
+ #
991
+ # @return [::Google::Iam::V1::Policy]
992
+ #
993
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
994
+ #
995
+ # @example Basic example
996
+ # require "google/cloud/gemini_data_analytics/v1beta"
997
+ #
998
+ # # Create a client object. The client can be reused for multiple calls.
999
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new
1000
+ #
1001
+ # # Create a request. To set request fields, pass in keyword arguments.
1002
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
1003
+ #
1004
+ # # Call the set_iam_policy method.
1005
+ # result = client.set_iam_policy request
1006
+ #
1007
+ # # The returned object is of type Google::Iam::V1::Policy.
1008
+ # p result
1009
+ #
1010
+ def set_iam_policy request, options = nil
1011
+ raise ::ArgumentError, "request must be provided" if request.nil?
1012
+
1013
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
1014
+
1015
+ # Converts hash and nil to an options object
1016
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1017
+
1018
+ # Customize the options with defaults
1019
+ metadata = @config.rpcs.set_iam_policy.metadata.to_h
1020
+
1021
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1022
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1023
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1024
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION
1025
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1026
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1027
+
1028
+ header_params = {}
1029
+ if request.resource
1030
+ header_params["resource"] = request.resource
1031
+ end
1032
+
1033
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1034
+ metadata[:"x-goog-request-params"] ||= request_params_header
1035
+
1036
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
1037
+ metadata: metadata,
1038
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
1039
+
1040
+ options.apply_defaults timeout: @config.timeout,
1041
+ metadata: @config.metadata,
1042
+ retry_policy: @config.retry_policy
1043
+
1044
+ @data_agent_service_stub.call_rpc :set_iam_policy, request, options: options do |response, operation|
1045
+ yield response, operation if block_given?
1046
+ end
1047
+ rescue ::GRPC::BadStatus => e
1048
+ raise ::Google::Cloud::Error.from_error(e)
1049
+ end
1050
+
1051
+ ##
1052
+ # Configuration class for the DataAgentService API.
1053
+ #
1054
+ # This class represents the configuration for DataAgentService,
1055
+ # providing control over timeouts, retry behavior, logging, transport
1056
+ # parameters, and other low-level controls. Certain parameters can also be
1057
+ # applied individually to specific RPCs. See
1058
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client::Configuration::Rpcs}
1059
+ # for a list of RPCs that can be configured independently.
1060
+ #
1061
+ # Configuration can be applied globally to all clients, or to a single client
1062
+ # on construction.
1063
+ #
1064
+ # @example
1065
+ #
1066
+ # # Modify the global config, setting the timeout for
1067
+ # # list_data_agents to 20 seconds,
1068
+ # # and all remaining timeouts to 10 seconds.
1069
+ # ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.configure do |config|
1070
+ # config.timeout = 10.0
1071
+ # config.rpcs.list_data_agents.timeout = 20.0
1072
+ # end
1073
+ #
1074
+ # # Apply the above configuration only to a new client.
1075
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Client.new do |config|
1076
+ # config.timeout = 10.0
1077
+ # config.rpcs.list_data_agents.timeout = 20.0
1078
+ # end
1079
+ #
1080
+ # @!attribute [rw] endpoint
1081
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1082
+ # nil, indicating to use the default endpoint in the current universe domain.
1083
+ # @return [::String,nil]
1084
+ # @!attribute [rw] credentials
1085
+ # Credentials to send with calls. You may provide any of the following types:
1086
+ # * (`String`) The path to a service account key file in JSON format
1087
+ # * (`Hash`) A service account key as a Hash
1088
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1089
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1090
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1091
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1092
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1093
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1094
+ # * (`nil`) indicating no credentials
1095
+ #
1096
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1097
+ # external source for authentication to Google Cloud, you must validate it before
1098
+ # providing it to a Google API client library. Providing an unvalidated credential
1099
+ # configuration to Google APIs can compromise the security of your systems and data.
1100
+ # For more information, refer to [Validate credential configurations from external
1101
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1102
+ # @return [::Object]
1103
+ # @!attribute [rw] scope
1104
+ # The OAuth scopes
1105
+ # @return [::Array<::String>]
1106
+ # @!attribute [rw] lib_name
1107
+ # The library name as recorded in instrumentation and logging
1108
+ # @return [::String]
1109
+ # @!attribute [rw] lib_version
1110
+ # The library version as recorded in instrumentation and logging
1111
+ # @return [::String]
1112
+ # @!attribute [rw] channel_args
1113
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
1114
+ # `GRPC::Core::Channel` object is provided as the credential.
1115
+ # @return [::Hash]
1116
+ # @!attribute [rw] interceptors
1117
+ # An array of interceptors that are run before calls are executed.
1118
+ # @return [::Array<::GRPC::ClientInterceptor>]
1119
+ # @!attribute [rw] timeout
1120
+ # The call timeout in seconds.
1121
+ # @return [::Numeric]
1122
+ # @!attribute [rw] metadata
1123
+ # Additional gRPC headers to be sent with the call.
1124
+ # @return [::Hash{::Symbol=>::String}]
1125
+ # @!attribute [rw] retry_policy
1126
+ # The retry policy. The value is a hash with the following keys:
1127
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1128
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1129
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1130
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1131
+ # trigger a retry.
1132
+ # @return [::Hash]
1133
+ # @!attribute [rw] quota_project
1134
+ # A separate project against which to charge quota.
1135
+ # @return [::String]
1136
+ # @!attribute [rw] universe_domain
1137
+ # The universe domain within which to make requests. This determines the
1138
+ # default endpoint URL. The default value of nil uses the environment
1139
+ # universe (usually the default "googleapis.com" universe).
1140
+ # @return [::String,nil]
1141
+ # @!attribute [rw] logger
1142
+ # A custom logger to use for request/response debug logging, or the value
1143
+ # `:default` (the default) to construct a default logger, or `nil` to
1144
+ # explicitly disable logging.
1145
+ # @return [::Logger,:default,nil]
1146
+ #
1147
+ class Configuration
1148
+ extend ::Gapic::Config
1149
+
1150
+ # @private
1151
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1152
+ DEFAULT_ENDPOINT = "geminidataanalytics.googleapis.com"
1153
+
1154
+ config_attr :endpoint, nil, ::String, nil
1155
+ config_attr :credentials, nil do |value|
1156
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1157
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1158
+ allowed.any? { |klass| klass === value }
1159
+ end
1160
+ config_attr :scope, nil, ::String, ::Array, nil
1161
+ config_attr :lib_name, nil, ::String, nil
1162
+ config_attr :lib_version, nil, ::String, nil
1163
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
1164
+ config_attr :interceptors, nil, ::Array, nil
1165
+ config_attr :timeout, nil, ::Numeric, nil
1166
+ config_attr :metadata, nil, ::Hash, nil
1167
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1168
+ config_attr :quota_project, nil, ::String, nil
1169
+ config_attr :universe_domain, nil, ::String, nil
1170
+ config_attr :logger, :default, ::Logger, nil, :default
1171
+
1172
+ # @private
1173
+ def initialize parent_config = nil
1174
+ @parent_config = parent_config unless parent_config.nil?
1175
+
1176
+ yield self if block_given?
1177
+ end
1178
+
1179
+ ##
1180
+ # Configurations for individual RPCs
1181
+ # @return [Rpcs]
1182
+ #
1183
+ def rpcs
1184
+ @rpcs ||= begin
1185
+ parent_rpcs = nil
1186
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1187
+ Rpcs.new parent_rpcs
1188
+ end
1189
+ end
1190
+
1191
+ ##
1192
+ # Configuration for the channel pool
1193
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1194
+ #
1195
+ def channel_pool
1196
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1197
+ end
1198
+
1199
+ ##
1200
+ # Configuration RPC class for the DataAgentService API.
1201
+ #
1202
+ # Includes fields providing the configuration for each RPC in this service.
1203
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1204
+ # the following configuration fields:
1205
+ #
1206
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1207
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1208
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1209
+ # include the following keys:
1210
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1211
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1212
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1213
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1214
+ # trigger a retry.
1215
+ #
1216
+ class Rpcs
1217
+ ##
1218
+ # RPC-specific configuration for `list_data_agents`
1219
+ # @return [::Gapic::Config::Method]
1220
+ #
1221
+ attr_reader :list_data_agents
1222
+ ##
1223
+ # RPC-specific configuration for `list_accessible_data_agents`
1224
+ # @return [::Gapic::Config::Method]
1225
+ #
1226
+ attr_reader :list_accessible_data_agents
1227
+ ##
1228
+ # RPC-specific configuration for `get_data_agent`
1229
+ # @return [::Gapic::Config::Method]
1230
+ #
1231
+ attr_reader :get_data_agent
1232
+ ##
1233
+ # RPC-specific configuration for `create_data_agent`
1234
+ # @return [::Gapic::Config::Method]
1235
+ #
1236
+ attr_reader :create_data_agent
1237
+ ##
1238
+ # RPC-specific configuration for `update_data_agent`
1239
+ # @return [::Gapic::Config::Method]
1240
+ #
1241
+ attr_reader :update_data_agent
1242
+ ##
1243
+ # RPC-specific configuration for `delete_data_agent`
1244
+ # @return [::Gapic::Config::Method]
1245
+ #
1246
+ attr_reader :delete_data_agent
1247
+ ##
1248
+ # RPC-specific configuration for `get_iam_policy`
1249
+ # @return [::Gapic::Config::Method]
1250
+ #
1251
+ attr_reader :get_iam_policy
1252
+ ##
1253
+ # RPC-specific configuration for `set_iam_policy`
1254
+ # @return [::Gapic::Config::Method]
1255
+ #
1256
+ attr_reader :set_iam_policy
1257
+
1258
+ # @private
1259
+ def initialize parent_rpcs = nil
1260
+ list_data_agents_config = parent_rpcs.list_data_agents if parent_rpcs.respond_to? :list_data_agents
1261
+ @list_data_agents = ::Gapic::Config::Method.new list_data_agents_config
1262
+ list_accessible_data_agents_config = parent_rpcs.list_accessible_data_agents if parent_rpcs.respond_to? :list_accessible_data_agents
1263
+ @list_accessible_data_agents = ::Gapic::Config::Method.new list_accessible_data_agents_config
1264
+ get_data_agent_config = parent_rpcs.get_data_agent if parent_rpcs.respond_to? :get_data_agent
1265
+ @get_data_agent = ::Gapic::Config::Method.new get_data_agent_config
1266
+ create_data_agent_config = parent_rpcs.create_data_agent if parent_rpcs.respond_to? :create_data_agent
1267
+ @create_data_agent = ::Gapic::Config::Method.new create_data_agent_config
1268
+ update_data_agent_config = parent_rpcs.update_data_agent if parent_rpcs.respond_to? :update_data_agent
1269
+ @update_data_agent = ::Gapic::Config::Method.new update_data_agent_config
1270
+ delete_data_agent_config = parent_rpcs.delete_data_agent if parent_rpcs.respond_to? :delete_data_agent
1271
+ @delete_data_agent = ::Gapic::Config::Method.new delete_data_agent_config
1272
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1273
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1274
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1275
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1276
+
1277
+ yield self if block_given?
1278
+ end
1279
+ end
1280
+ end
1281
+ end
1282
+ end
1283
+ end
1284
+ end
1285
+ end
1286
+ end