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,1212 @@
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/gemini_data_analytics/v1beta/data_agent_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module GeminiDataAnalytics
27
+ module V1beta
28
+ module DataAgentService
29
+ module Rest
30
+ ##
31
+ # REST client for the DataAgentService service.
32
+ #
33
+ # Service describing handlers for resources.
34
+ #
35
+ class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
39
+ # @private
40
+ DEFAULT_ENDPOINT_TEMPLATE = "geminidataanalytics.$UNIVERSE_DOMAIN$"
41
+
42
+ include Paths
43
+
44
+ # @private
45
+ attr_reader :data_agent_service_stub
46
+
47
+ ##
48
+ # Configure the DataAgentService Client class.
49
+ #
50
+ # See {::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client::Configuration}
51
+ # for a description of the configuration fields.
52
+ #
53
+ # @example
54
+ #
55
+ # # Modify the configuration for all DataAgentService clients
56
+ # ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.configure do |config|
57
+ # config.timeout = 10.0
58
+ # end
59
+ #
60
+ # @yield [config] Configure the Client client.
61
+ # @yieldparam config [Client::Configuration]
62
+ #
63
+ # @return [Client::Configuration]
64
+ #
65
+ def self.configure
66
+ @configure ||= begin
67
+ namespace = ["Google", "Cloud", "GeminiDataAnalytics", "V1beta"]
68
+ parent_config = while namespace.any?
69
+ parent_name = namespace.join "::"
70
+ parent_const = const_get parent_name
71
+ break parent_const.configure if parent_const.respond_to? :configure
72
+ namespace.pop
73
+ end
74
+ default_config = Client::Configuration.new parent_config
75
+
76
+ default_config.timeout = 60.0
77
+ default_config.retry_policy = {
78
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
79
+ }
80
+
81
+ default_config
82
+ end
83
+ yield @configure if block_given?
84
+ @configure
85
+ end
86
+
87
+ ##
88
+ # Configure the DataAgentService Client instance.
89
+ #
90
+ # The configuration is set to the derived mode, meaning that values can be changed,
91
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
92
+ # should be made on {Client.configure}.
93
+ #
94
+ # See {::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client::Configuration}
95
+ # for a description of the configuration fields.
96
+ #
97
+ # @yield [config] Configure the Client client.
98
+ # @yieldparam config [Client::Configuration]
99
+ #
100
+ # @return [Client::Configuration]
101
+ #
102
+ def configure
103
+ yield @config if block_given?
104
+ @config
105
+ end
106
+
107
+ ##
108
+ # The effective universe domain
109
+ #
110
+ # @return [String]
111
+ #
112
+ def universe_domain
113
+ @data_agent_service_stub.universe_domain
114
+ end
115
+
116
+ ##
117
+ # Create a new DataAgentService REST client object.
118
+ #
119
+ # @example
120
+ #
121
+ # # Create a client using the default configuration
122
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
123
+ #
124
+ # # Create a client using a custom configuration
125
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new do |config|
126
+ # config.timeout = 10.0
127
+ # end
128
+ #
129
+ # @yield [config] Configure the DataAgentService client.
130
+ # @yieldparam config [Client::Configuration]
131
+ #
132
+ def initialize
133
+ # Create the configuration object
134
+ @config = Configuration.new Client.configure
135
+
136
+ # Yield the configuration if needed
137
+ yield @config if block_given?
138
+
139
+ # Create credentials
140
+ credentials = @config.credentials
141
+ # Use self-signed JWT if the endpoint is unchanged from default,
142
+ # but only if the default endpoint does not have a region prefix.
143
+ enable_self_signed_jwt = @config.endpoint.nil? ||
144
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
145
+ !@config.endpoint.split(".").first.include?("-"))
146
+ credentials ||= Credentials.default scope: @config.scope,
147
+ enable_self_signed_jwt: enable_self_signed_jwt
148
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
149
+ credentials = Credentials.new credentials, scope: @config.scope
150
+ end
151
+
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @operations_client = ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Operations.new do |config|
156
+ config.credentials = credentials
157
+ config.quota_project = @quota_project_id
158
+ config.endpoint = @config.endpoint
159
+ config.universe_domain = @config.universe_domain
160
+ end
161
+
162
+ @data_agent_service_stub = ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::ServiceStub.new(
163
+ endpoint: @config.endpoint,
164
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
165
+ universe_domain: @config.universe_domain,
166
+ credentials: credentials,
167
+ logger: @config.logger
168
+ )
169
+
170
+ @data_agent_service_stub.logger(stub: true)&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
180
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
181
+ config.credentials = credentials
182
+ config.quota_project = @quota_project_id
183
+ config.endpoint = @data_agent_service_stub.endpoint
184
+ config.universe_domain = @data_agent_service_stub.universe_domain
185
+ config.bindings_override = @config.bindings_override
186
+ config.logger = @data_agent_service_stub.logger if config.respond_to? :logger=
187
+ end
188
+ end
189
+
190
+ ##
191
+ # Get the associated client for long-running operations.
192
+ #
193
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Operations]
194
+ #
195
+ attr_reader :operations_client
196
+
197
+ ##
198
+ # Get the associated client for mix-in of the Locations.
199
+ #
200
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
201
+ #
202
+ attr_reader :location_client
203
+
204
+ ##
205
+ # The logger used for request/response debug logging.
206
+ #
207
+ # @return [Logger]
208
+ #
209
+ def logger
210
+ @data_agent_service_stub.logger
211
+ end
212
+
213
+ # Service calls
214
+
215
+ ##
216
+ # Lists DataAgents in a given project and location.
217
+ #
218
+ # @overload list_data_agents(request, options = nil)
219
+ # Pass arguments to `list_data_agents` via a request object, either of type
220
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::ListDataAgentsRequest} or an equivalent Hash.
221
+ #
222
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::ListDataAgentsRequest, ::Hash]
223
+ # A request object representing the call parameters. Required. To specify no
224
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
225
+ # @param options [::Gapic::CallOptions, ::Hash]
226
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
227
+ #
228
+ # @overload list_data_agents(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil)
229
+ # Pass arguments to `list_data_agents` via keyword arguments. Note that at
230
+ # least one keyword argument is required. To specify no parameters, or to keep all
231
+ # the default parameter values, pass an empty Hash as a request object (see above).
232
+ #
233
+ # @param parent [::String]
234
+ # Required. Parent value for ListDataAgentsRequest.
235
+ # @param page_size [::Integer]
236
+ # Optional. Server may return fewer items than requested.
237
+ # If unspecified, server will pick an appropriate default.
238
+ # @param page_token [::String]
239
+ # Optional. A page token, received from a previous `ListDataAgents` call.
240
+ # Provide this to retrieve the subsequent page.
241
+ #
242
+ # When paginating, all other parameters provided to `ListDataAgents` must
243
+ # match the call that provided the page token. The service may return fewer
244
+ # than this value.
245
+ # @param filter [::String]
246
+ # Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for
247
+ # syntax.
248
+ # @param order_by [::String]
249
+ # Optional. User specification for how to order the results.
250
+ # @param show_deleted [::Boolean]
251
+ # Optional. If true, the list results will include soft-deleted DataAgents.
252
+ # Defaults to false.
253
+ # @yield [result, operation] Access the result along with the TransportOperation object
254
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent>]
255
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
256
+ #
257
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent>]
258
+ #
259
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
260
+ #
261
+ # @example Basic example
262
+ # require "google/cloud/gemini_data_analytics/v1beta"
263
+ #
264
+ # # Create a client object. The client can be reused for multiple calls.
265
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
266
+ #
267
+ # # Create a request. To set request fields, pass in keyword arguments.
268
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::ListDataAgentsRequest.new
269
+ #
270
+ # # Call the list_data_agents method.
271
+ # result = client.list_data_agents request
272
+ #
273
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
274
+ # # over elements, and API calls will be issued to fetch pages as needed.
275
+ # result.each do |item|
276
+ # # Each element is of type ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent.
277
+ # p item
278
+ # end
279
+ #
280
+ def list_data_agents request, options = nil
281
+ raise ::ArgumentError, "request must be provided" if request.nil?
282
+
283
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::ListDataAgentsRequest
284
+
285
+ # Converts hash and nil to an options object
286
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
287
+
288
+ # Customize the options with defaults
289
+ call_metadata = @config.rpcs.list_data_agents.metadata.to_h
290
+
291
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
292
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
293
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
294
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
295
+ transports_version_send: [:rest]
296
+
297
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
298
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
299
+
300
+ options.apply_defaults timeout: @config.rpcs.list_data_agents.timeout,
301
+ metadata: call_metadata,
302
+ retry_policy: @config.rpcs.list_data_agents.retry_policy
303
+
304
+ options.apply_defaults timeout: @config.timeout,
305
+ metadata: @config.metadata,
306
+ retry_policy: @config.retry_policy
307
+
308
+ @data_agent_service_stub.list_data_agents request, options do |result, operation|
309
+ result = ::Gapic::Rest::PagedEnumerable.new @data_agent_service_stub, :list_data_agents, "data_agents", request, result, options
310
+ yield result, operation if block_given?
311
+ throw :response, result
312
+ end
313
+ rescue ::Gapic::Rest::Error => e
314
+ raise ::Google::Cloud::Error.from_error(e)
315
+ end
316
+
317
+ ##
318
+ # Lists DataAgents that are accessible to the caller in a given project and
319
+ # location.
320
+ #
321
+ # @overload list_accessible_data_agents(request, options = nil)
322
+ # Pass arguments to `list_accessible_data_agents` via a request object, either of type
323
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::ListAccessibleDataAgentsRequest} or an equivalent Hash.
324
+ #
325
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::ListAccessibleDataAgentsRequest, ::Hash]
326
+ # A request object representing the call parameters. Required. To specify no
327
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
328
+ # @param options [::Gapic::CallOptions, ::Hash]
329
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
330
+ #
331
+ # @overload list_accessible_data_agents(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil, creator_filter: nil)
332
+ # Pass arguments to `list_accessible_data_agents` via keyword arguments. Note that at
333
+ # least one keyword argument is required. To specify no parameters, or to keep all
334
+ # the default parameter values, pass an empty Hash as a request object (see above).
335
+ #
336
+ # @param parent [::String]
337
+ # Required. Parent value for ListAccessibleDataAgentsRequest.
338
+ # @param page_size [::Integer]
339
+ # Optional. Server may return fewer items than requested.
340
+ # If unspecified, server will pick an appropriate default.
341
+ # @param page_token [::String]
342
+ # Optional. A page token, received from a previous `ListAccessibleDataAgents`
343
+ # call. Provide this to retrieve the subsequent page.
344
+ #
345
+ # When paginating, all other parameters provided to
346
+ # `ListAccessibleDataAgents` must match the call that provided the page
347
+ # token. The service may return fewer than this value.
348
+ # @param filter [::String]
349
+ # Optional. Filtering results. See [AIP-160](https://google.aip.dev/160) for
350
+ # syntax.
351
+ # @param order_by [::String]
352
+ # Optional. User specification for how to order the results.
353
+ # @param show_deleted [::Boolean]
354
+ # Optional. If true, the list results will include soft-deleted DataAgents.
355
+ # Defaults to false.
356
+ # @param creator_filter [::Google::Cloud::GeminiDataAnalytics::V1beta::ListAccessibleDataAgentsRequest::CreatorFilter]
357
+ # Optional. Filter for the creator of the agent.
358
+ # @yield [result, operation] Access the result along with the TransportOperation object
359
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent>]
360
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
361
+ #
362
+ # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent>]
363
+ #
364
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
365
+ #
366
+ # @example Basic example
367
+ # require "google/cloud/gemini_data_analytics/v1beta"
368
+ #
369
+ # # Create a client object. The client can be reused for multiple calls.
370
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
371
+ #
372
+ # # Create a request. To set request fields, pass in keyword arguments.
373
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::ListAccessibleDataAgentsRequest.new
374
+ #
375
+ # # Call the list_accessible_data_agents method.
376
+ # result = client.list_accessible_data_agents request
377
+ #
378
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
379
+ # # over elements, and API calls will be issued to fetch pages as needed.
380
+ # result.each do |item|
381
+ # # Each element is of type ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent.
382
+ # p item
383
+ # end
384
+ #
385
+ def list_accessible_data_agents request, options = nil
386
+ raise ::ArgumentError, "request must be provided" if request.nil?
387
+
388
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::ListAccessibleDataAgentsRequest
389
+
390
+ # Converts hash and nil to an options object
391
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
392
+
393
+ # Customize the options with defaults
394
+ call_metadata = @config.rpcs.list_accessible_data_agents.metadata.to_h
395
+
396
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
397
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
398
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
399
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
400
+ transports_version_send: [:rest]
401
+
402
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
403
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
404
+
405
+ options.apply_defaults timeout: @config.rpcs.list_accessible_data_agents.timeout,
406
+ metadata: call_metadata,
407
+ retry_policy: @config.rpcs.list_accessible_data_agents.retry_policy
408
+
409
+ options.apply_defaults timeout: @config.timeout,
410
+ metadata: @config.metadata,
411
+ retry_policy: @config.retry_policy
412
+
413
+ @data_agent_service_stub.list_accessible_data_agents request, options do |result, operation|
414
+ result = ::Gapic::Rest::PagedEnumerable.new @data_agent_service_stub, :list_accessible_data_agents, "data_agents", request, result, options
415
+ yield result, operation if block_given?
416
+ throw :response, result
417
+ end
418
+ rescue ::Gapic::Rest::Error => e
419
+ raise ::Google::Cloud::Error.from_error(e)
420
+ end
421
+
422
+ ##
423
+ # Gets details of a single DataAgent.
424
+ #
425
+ # @overload get_data_agent(request, options = nil)
426
+ # Pass arguments to `get_data_agent` via a request object, either of type
427
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::GetDataAgentRequest} or an equivalent Hash.
428
+ #
429
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::GetDataAgentRequest, ::Hash]
430
+ # A request object representing the call parameters. Required. To specify no
431
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
432
+ # @param options [::Gapic::CallOptions, ::Hash]
433
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
434
+ #
435
+ # @overload get_data_agent(name: nil)
436
+ # Pass arguments to `get_data_agent` via keyword arguments. Note that at
437
+ # least one keyword argument is required. To specify no parameters, or to keep all
438
+ # the default parameter values, pass an empty Hash as a request object (see above).
439
+ #
440
+ # @param name [::String]
441
+ # Required. Name of the resource.
442
+ # @yield [result, operation] Access the result along with the TransportOperation object
443
+ # @yieldparam result [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent]
444
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
445
+ #
446
+ # @return [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent]
447
+ #
448
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
449
+ #
450
+ # @example Basic example
451
+ # require "google/cloud/gemini_data_analytics/v1beta"
452
+ #
453
+ # # Create a client object. The client can be reused for multiple calls.
454
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
455
+ #
456
+ # # Create a request. To set request fields, pass in keyword arguments.
457
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::GetDataAgentRequest.new
458
+ #
459
+ # # Call the get_data_agent method.
460
+ # result = client.get_data_agent request
461
+ #
462
+ # # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent.
463
+ # p result
464
+ #
465
+ def get_data_agent request, options = nil
466
+ raise ::ArgumentError, "request must be provided" if request.nil?
467
+
468
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::GetDataAgentRequest
469
+
470
+ # Converts hash and nil to an options object
471
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
472
+
473
+ # Customize the options with defaults
474
+ call_metadata = @config.rpcs.get_data_agent.metadata.to_h
475
+
476
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
477
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
478
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
479
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
480
+ transports_version_send: [:rest]
481
+
482
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
483
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
484
+
485
+ options.apply_defaults timeout: @config.rpcs.get_data_agent.timeout,
486
+ metadata: call_metadata,
487
+ retry_policy: @config.rpcs.get_data_agent.retry_policy
488
+
489
+ options.apply_defaults timeout: @config.timeout,
490
+ metadata: @config.metadata,
491
+ retry_policy: @config.retry_policy
492
+
493
+ @data_agent_service_stub.get_data_agent request, options do |result, operation|
494
+ yield result, operation if block_given?
495
+ end
496
+ rescue ::Gapic::Rest::Error => e
497
+ raise ::Google::Cloud::Error.from_error(e)
498
+ end
499
+
500
+ ##
501
+ # Creates a new DataAgent in a given project and location.
502
+ #
503
+ # @overload create_data_agent(request, options = nil)
504
+ # Pass arguments to `create_data_agent` via a request object, either of type
505
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::CreateDataAgentRequest} or an equivalent Hash.
506
+ #
507
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::CreateDataAgentRequest, ::Hash]
508
+ # A request object representing the call parameters. Required. To specify no
509
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
510
+ # @param options [::Gapic::CallOptions, ::Hash]
511
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
512
+ #
513
+ # @overload create_data_agent(parent: nil, data_agent_id: nil, data_agent: nil, request_id: nil)
514
+ # Pass arguments to `create_data_agent` via keyword arguments. Note that at
515
+ # least one keyword argument is required. To specify no parameters, or to keep all
516
+ # the default parameter values, pass an empty Hash as a request object (see above).
517
+ #
518
+ # @param parent [::String]
519
+ # Required. Value for parent.
520
+ # @param data_agent_id [::String]
521
+ # Optional. Id of the requesting object. Must be unique within the parent.
522
+ # The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`.
523
+ # If not provided, the server will auto-generate a value for the id.
524
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent, ::Hash]
525
+ # Required. The resource being created.
526
+ # @param request_id [::String]
527
+ # Optional. An optional request ID to identify requests. Specify a unique
528
+ # request ID so that if you must retry your request, the server will know to
529
+ # ignore the request if it has already been completed. The server will
530
+ # guarantee that for at least 60 minutes since the first request.
531
+ #
532
+ # For example, consider a situation where you make an initial request and the
533
+ # request times out. If you make the request again with the same request
534
+ # ID, the server can check if original operation with the same request ID
535
+ # was received, and if so, will ignore the second request. This prevents
536
+ # clients from accidentally creating duplicate commitments.
537
+ #
538
+ # The request ID must be a valid UUID with the exception that zero UUID is
539
+ # not supported (00000000-0000-0000-0000-000000000000).
540
+ # @yield [result, operation] Access the result along with the TransportOperation object
541
+ # @yieldparam result [::Gapic::Operation]
542
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
543
+ #
544
+ # @return [::Gapic::Operation]
545
+ #
546
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
547
+ #
548
+ # @example Basic example
549
+ # require "google/cloud/gemini_data_analytics/v1beta"
550
+ #
551
+ # # Create a client object. The client can be reused for multiple calls.
552
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
553
+ #
554
+ # # Create a request. To set request fields, pass in keyword arguments.
555
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::CreateDataAgentRequest.new
556
+ #
557
+ # # Call the create_data_agent method.
558
+ # result = client.create_data_agent request
559
+ #
560
+ # # The returned object is of type Gapic::Operation. You can use it to
561
+ # # check the status of an operation, cancel it, or wait for results.
562
+ # # Here is how to wait for a response.
563
+ # result.wait_until_done! timeout: 60
564
+ # if result.response?
565
+ # p result.response
566
+ # else
567
+ # puts "No response received."
568
+ # end
569
+ #
570
+ def create_data_agent request, options = nil
571
+ raise ::ArgumentError, "request must be provided" if request.nil?
572
+
573
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::CreateDataAgentRequest
574
+
575
+ # Converts hash and nil to an options object
576
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
577
+
578
+ # Customize the options with defaults
579
+ call_metadata = @config.rpcs.create_data_agent.metadata.to_h
580
+
581
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
582
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
583
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
584
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
585
+ transports_version_send: [:rest]
586
+
587
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
588
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
589
+
590
+ options.apply_defaults timeout: @config.rpcs.create_data_agent.timeout,
591
+ metadata: call_metadata,
592
+ retry_policy: @config.rpcs.create_data_agent.retry_policy
593
+
594
+ options.apply_defaults timeout: @config.timeout,
595
+ metadata: @config.metadata,
596
+ retry_policy: @config.retry_policy
597
+
598
+ @data_agent_service_stub.create_data_agent request, options do |result, operation|
599
+ result = ::Gapic::Operation.new result, @operations_client, options: options
600
+ yield result, operation if block_given?
601
+ throw :response, result
602
+ end
603
+ rescue ::Gapic::Rest::Error => e
604
+ raise ::Google::Cloud::Error.from_error(e)
605
+ end
606
+
607
+ ##
608
+ # Updates the parameters of a single DataAgent.
609
+ #
610
+ # @overload update_data_agent(request, options = nil)
611
+ # Pass arguments to `update_data_agent` via a request object, either of type
612
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest} or an equivalent Hash.
613
+ #
614
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest, ::Hash]
615
+ # A request object representing the call parameters. Required. To specify no
616
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
617
+ # @param options [::Gapic::CallOptions, ::Hash]
618
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
619
+ #
620
+ # @overload update_data_agent(update_mask: nil, data_agent: nil, request_id: nil)
621
+ # Pass arguments to `update_data_agent` via keyword arguments. Note that at
622
+ # least one keyword argument is required. To specify no parameters, or to keep all
623
+ # the default parameter values, pass an empty Hash as a request object (see above).
624
+ #
625
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
626
+ # Optional. Field mask is used to specify the fields to be overwritten in the
627
+ # DataAgent resource by the update.
628
+ # The fields specified in the update_mask are relative to the resource, not
629
+ # the full request. A field will be overwritten if it is in the mask. If the
630
+ # user does not provide a mask then all fields with non-default values
631
+ # present in the request will be overwritten. If a wildcard mask is provided,
632
+ # all fields will be overwritten.
633
+ # @param data_agent [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgent, ::Hash]
634
+ # Required. The resource being updated.
635
+ # @param request_id [::String]
636
+ # Optional. An optional request ID to identify requests. Specify a unique
637
+ # request ID so that if you must retry your request, the server will know to
638
+ # ignore the request if it has already been completed. The server will
639
+ # guarantee that for at least 60 minutes since the first request.
640
+ #
641
+ # For example, consider a situation where you make an initial request and the
642
+ # request times out. If you make the request again with the same request
643
+ # ID, the server can check if original operation with the same request ID
644
+ # was received, and if so, will ignore the second request. This prevents
645
+ # clients from accidentally creating duplicate commitments.
646
+ #
647
+ # The request ID must be a valid UUID with the exception that zero UUID is
648
+ # not supported (00000000-0000-0000-0000-000000000000).
649
+ # @yield [result, operation] Access the result along with the TransportOperation object
650
+ # @yieldparam result [::Gapic::Operation]
651
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
652
+ #
653
+ # @return [::Gapic::Operation]
654
+ #
655
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
656
+ #
657
+ # @example Basic example
658
+ # require "google/cloud/gemini_data_analytics/v1beta"
659
+ #
660
+ # # Create a client object. The client can be reused for multiple calls.
661
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
662
+ #
663
+ # # Create a request. To set request fields, pass in keyword arguments.
664
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest.new
665
+ #
666
+ # # Call the update_data_agent method.
667
+ # result = client.update_data_agent request
668
+ #
669
+ # # The returned object is of type Gapic::Operation. You can use it to
670
+ # # check the status of an operation, cancel it, or wait for results.
671
+ # # Here is how to wait for a response.
672
+ # result.wait_until_done! timeout: 60
673
+ # if result.response?
674
+ # p result.response
675
+ # else
676
+ # puts "No response received."
677
+ # end
678
+ #
679
+ def update_data_agent request, options = nil
680
+ raise ::ArgumentError, "request must be provided" if request.nil?
681
+
682
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::UpdateDataAgentRequest
683
+
684
+ # Converts hash and nil to an options object
685
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
686
+
687
+ # Customize the options with defaults
688
+ call_metadata = @config.rpcs.update_data_agent.metadata.to_h
689
+
690
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
691
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
692
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
693
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
694
+ transports_version_send: [:rest]
695
+
696
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
697
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
698
+
699
+ options.apply_defaults timeout: @config.rpcs.update_data_agent.timeout,
700
+ metadata: call_metadata,
701
+ retry_policy: @config.rpcs.update_data_agent.retry_policy
702
+
703
+ options.apply_defaults timeout: @config.timeout,
704
+ metadata: @config.metadata,
705
+ retry_policy: @config.retry_policy
706
+
707
+ @data_agent_service_stub.update_data_agent request, options do |result, operation|
708
+ result = ::Gapic::Operation.new result, @operations_client, options: options
709
+ yield result, operation if block_given?
710
+ throw :response, result
711
+ end
712
+ rescue ::Gapic::Rest::Error => e
713
+ raise ::Google::Cloud::Error.from_error(e)
714
+ end
715
+
716
+ ##
717
+ # Deletes a single DataAgent.
718
+ #
719
+ # @overload delete_data_agent(request, options = nil)
720
+ # Pass arguments to `delete_data_agent` via a request object, either of type
721
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest} or an equivalent Hash.
722
+ #
723
+ # @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest, ::Hash]
724
+ # A request object representing the call parameters. Required. To specify no
725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
726
+ # @param options [::Gapic::CallOptions, ::Hash]
727
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
728
+ #
729
+ # @overload delete_data_agent(name: nil, request_id: nil)
730
+ # Pass arguments to `delete_data_agent` via keyword arguments. Note that at
731
+ # least one keyword argument is required. To specify no parameters, or to keep all
732
+ # the default parameter values, pass an empty Hash as a request object (see above).
733
+ #
734
+ # @param name [::String]
735
+ # Required. Name of the resource.
736
+ # @param request_id [::String]
737
+ # Optional. An optional request ID to identify requests. Specify a unique
738
+ # request ID so that if you must retry your request, the server will know to
739
+ # ignore the request if it has already been completed. The server will
740
+ # guarantee that for at least 60 minutes after the first request.
741
+ #
742
+ # For example, consider a situation where you make an initial request and the
743
+ # request times out. If you make the request again with the same request
744
+ # ID, the server can check if original operation with the same request ID
745
+ # was received, and if so, will ignore the second request. This prevents
746
+ # clients from accidentally creating duplicate commitments.
747
+ #
748
+ # The request ID must be a valid UUID with the exception that zero UUID is
749
+ # not supported (00000000-0000-0000-0000-000000000000).
750
+ # @yield [result, operation] Access the result along with the TransportOperation object
751
+ # @yieldparam result [::Gapic::Operation]
752
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
753
+ #
754
+ # @return [::Gapic::Operation]
755
+ #
756
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
757
+ #
758
+ # @example Basic example
759
+ # require "google/cloud/gemini_data_analytics/v1beta"
760
+ #
761
+ # # Create a client object. The client can be reused for multiple calls.
762
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
763
+ #
764
+ # # Create a request. To set request fields, pass in keyword arguments.
765
+ # request = Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest.new
766
+ #
767
+ # # Call the delete_data_agent method.
768
+ # result = client.delete_data_agent request
769
+ #
770
+ # # The returned object is of type Gapic::Operation. You can use it to
771
+ # # check the status of an operation, cancel it, or wait for results.
772
+ # # Here is how to wait for a response.
773
+ # result.wait_until_done! timeout: 60
774
+ # if result.response?
775
+ # p result.response
776
+ # else
777
+ # puts "No response received."
778
+ # end
779
+ #
780
+ def delete_data_agent request, options = nil
781
+ raise ::ArgumentError, "request must be provided" if request.nil?
782
+
783
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteDataAgentRequest
784
+
785
+ # Converts hash and nil to an options object
786
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
787
+
788
+ # Customize the options with defaults
789
+ call_metadata = @config.rpcs.delete_data_agent.metadata.to_h
790
+
791
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
792
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
793
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
794
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
795
+ transports_version_send: [:rest]
796
+
797
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
798
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
799
+
800
+ options.apply_defaults timeout: @config.rpcs.delete_data_agent.timeout,
801
+ metadata: call_metadata,
802
+ retry_policy: @config.rpcs.delete_data_agent.retry_policy
803
+
804
+ options.apply_defaults timeout: @config.timeout,
805
+ metadata: @config.metadata,
806
+ retry_policy: @config.retry_policy
807
+
808
+ @data_agent_service_stub.delete_data_agent request, options do |result, operation|
809
+ result = ::Gapic::Operation.new result, @operations_client, options: options
810
+ yield result, operation if block_given?
811
+ throw :response, result
812
+ end
813
+ rescue ::Gapic::Rest::Error => e
814
+ raise ::Google::Cloud::Error.from_error(e)
815
+ end
816
+
817
+ ##
818
+ # Gets the IAM policy for DataAgent
819
+ #
820
+ # @overload get_iam_policy(request, options = nil)
821
+ # Pass arguments to `get_iam_policy` via a request object, either of type
822
+ # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash.
823
+ #
824
+ # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash]
825
+ # A request object representing the call parameters. Required. To specify no
826
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
827
+ # @param options [::Gapic::CallOptions, ::Hash]
828
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
829
+ #
830
+ # @overload get_iam_policy(resource: nil, options: nil)
831
+ # Pass arguments to `get_iam_policy` via keyword arguments. Note that at
832
+ # least one keyword argument is required. To specify no parameters, or to keep all
833
+ # the default parameter values, pass an empty Hash as a request object (see above).
834
+ #
835
+ # @param resource [::String]
836
+ # REQUIRED: The resource for which the policy is being requested.
837
+ # See the operation documentation for the appropriate value for this field.
838
+ # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash]
839
+ # OPTIONAL: A `GetPolicyOptions` object for specifying options to
840
+ # `GetIamPolicy`.
841
+ # @yield [result, operation] Access the result along with the TransportOperation object
842
+ # @yieldparam result [::Google::Iam::V1::Policy]
843
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
844
+ #
845
+ # @return [::Google::Iam::V1::Policy]
846
+ #
847
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
848
+ #
849
+ # @example Basic example
850
+ # require "google/cloud/gemini_data_analytics/v1beta"
851
+ #
852
+ # # Create a client object. The client can be reused for multiple calls.
853
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
854
+ #
855
+ # # Create a request. To set request fields, pass in keyword arguments.
856
+ # request = Google::Iam::V1::GetIamPolicyRequest.new
857
+ #
858
+ # # Call the get_iam_policy method.
859
+ # result = client.get_iam_policy request
860
+ #
861
+ # # The returned object is of type Google::Iam::V1::Policy.
862
+ # p result
863
+ #
864
+ def get_iam_policy request, options = nil
865
+ raise ::ArgumentError, "request must be provided" if request.nil?
866
+
867
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest
868
+
869
+ # Converts hash and nil to an options object
870
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
871
+
872
+ # Customize the options with defaults
873
+ call_metadata = @config.rpcs.get_iam_policy.metadata.to_h
874
+
875
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
876
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
877
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
878
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
879
+ transports_version_send: [:rest]
880
+
881
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
882
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
883
+
884
+ options.apply_defaults timeout: @config.rpcs.get_iam_policy.timeout,
885
+ metadata: call_metadata,
886
+ retry_policy: @config.rpcs.get_iam_policy.retry_policy
887
+
888
+ options.apply_defaults timeout: @config.timeout,
889
+ metadata: @config.metadata,
890
+ retry_policy: @config.retry_policy
891
+
892
+ @data_agent_service_stub.get_iam_policy request, options do |result, operation|
893
+ yield result, operation if block_given?
894
+ end
895
+ rescue ::Gapic::Rest::Error => e
896
+ raise ::Google::Cloud::Error.from_error(e)
897
+ end
898
+
899
+ ##
900
+ # Sets the IAM policy for a DataAgent.
901
+ #
902
+ # @overload set_iam_policy(request, options = nil)
903
+ # Pass arguments to `set_iam_policy` via a request object, either of type
904
+ # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash.
905
+ #
906
+ # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash]
907
+ # A request object representing the call parameters. Required. To specify no
908
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
909
+ # @param options [::Gapic::CallOptions, ::Hash]
910
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
911
+ #
912
+ # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil)
913
+ # Pass arguments to `set_iam_policy` via keyword arguments. Note that at
914
+ # least one keyword argument is required. To specify no parameters, or to keep all
915
+ # the default parameter values, pass an empty Hash as a request object (see above).
916
+ #
917
+ # @param resource [::String]
918
+ # REQUIRED: The resource for which the policy is being specified.
919
+ # See the operation documentation for the appropriate value for this field.
920
+ # @param policy [::Google::Iam::V1::Policy, ::Hash]
921
+ # REQUIRED: The complete policy to be applied to the `resource`. The size of
922
+ # the policy is limited to a few 10s of KB. An empty policy is a
923
+ # valid policy but certain Cloud Platform services (such as Projects)
924
+ # might reject them.
925
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
926
+ # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
927
+ # the fields in the mask will be modified. If no mask is provided, the
928
+ # following default mask is used:
929
+ #
930
+ # `paths: "bindings, etag"`
931
+ # @yield [result, operation] Access the result along with the TransportOperation object
932
+ # @yieldparam result [::Google::Iam::V1::Policy]
933
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
934
+ #
935
+ # @return [::Google::Iam::V1::Policy]
936
+ #
937
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
938
+ #
939
+ # @example Basic example
940
+ # require "google/cloud/gemini_data_analytics/v1beta"
941
+ #
942
+ # # Create a client object. The client can be reused for multiple calls.
943
+ # client = Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new
944
+ #
945
+ # # Create a request. To set request fields, pass in keyword arguments.
946
+ # request = Google::Iam::V1::SetIamPolicyRequest.new
947
+ #
948
+ # # Call the set_iam_policy method.
949
+ # result = client.set_iam_policy request
950
+ #
951
+ # # The returned object is of type Google::Iam::V1::Policy.
952
+ # p result
953
+ #
954
+ def set_iam_policy request, options = nil
955
+ raise ::ArgumentError, "request must be provided" if request.nil?
956
+
957
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest
958
+
959
+ # Converts hash and nil to an options object
960
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
961
+
962
+ # Customize the options with defaults
963
+ call_metadata = @config.rpcs.set_iam_policy.metadata.to_h
964
+
965
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
966
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
967
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
968
+ gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
969
+ transports_version_send: [:rest]
970
+
971
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
972
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
973
+
974
+ options.apply_defaults timeout: @config.rpcs.set_iam_policy.timeout,
975
+ metadata: call_metadata,
976
+ retry_policy: @config.rpcs.set_iam_policy.retry_policy
977
+
978
+ options.apply_defaults timeout: @config.timeout,
979
+ metadata: @config.metadata,
980
+ retry_policy: @config.retry_policy
981
+
982
+ @data_agent_service_stub.set_iam_policy request, options do |result, operation|
983
+ yield result, operation if block_given?
984
+ end
985
+ rescue ::Gapic::Rest::Error => e
986
+ raise ::Google::Cloud::Error.from_error(e)
987
+ end
988
+
989
+ ##
990
+ # Configuration class for the DataAgentService REST API.
991
+ #
992
+ # This class represents the configuration for DataAgentService REST,
993
+ # providing control over timeouts, retry behavior, logging, transport
994
+ # parameters, and other low-level controls. Certain parameters can also be
995
+ # applied individually to specific RPCs. See
996
+ # {::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client::Configuration::Rpcs}
997
+ # for a list of RPCs that can be configured independently.
998
+ #
999
+ # Configuration can be applied globally to all clients, or to a single client
1000
+ # on construction.
1001
+ #
1002
+ # @example
1003
+ #
1004
+ # # Modify the global config, setting the timeout for
1005
+ # # list_data_agents to 20 seconds,
1006
+ # # and all remaining timeouts to 10 seconds.
1007
+ # ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.configure do |config|
1008
+ # config.timeout = 10.0
1009
+ # config.rpcs.list_data_agents.timeout = 20.0
1010
+ # end
1011
+ #
1012
+ # # Apply the above configuration only to a new client.
1013
+ # client = ::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentService::Rest::Client.new do |config|
1014
+ # config.timeout = 10.0
1015
+ # config.rpcs.list_data_agents.timeout = 20.0
1016
+ # end
1017
+ #
1018
+ # @!attribute [rw] endpoint
1019
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1020
+ # nil, indicating to use the default endpoint in the current universe domain.
1021
+ # @return [::String,nil]
1022
+ # @!attribute [rw] credentials
1023
+ # Credentials to send with calls. You may provide any of the following types:
1024
+ # * (`String`) The path to a service account key file in JSON format
1025
+ # * (`Hash`) A service account key as a Hash
1026
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1027
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1028
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1029
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1030
+ # * (`nil`) indicating no credentials
1031
+ #
1032
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1033
+ # external source for authentication to Google Cloud, you must validate it before
1034
+ # providing it to a Google API client library. Providing an unvalidated credential
1035
+ # configuration to Google APIs can compromise the security of your systems and data.
1036
+ # For more information, refer to [Validate credential configurations from external
1037
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1038
+ # @return [::Object]
1039
+ # @!attribute [rw] scope
1040
+ # The OAuth scopes
1041
+ # @return [::Array<::String>]
1042
+ # @!attribute [rw] lib_name
1043
+ # The library name as recorded in instrumentation and logging
1044
+ # @return [::String]
1045
+ # @!attribute [rw] lib_version
1046
+ # The library version as recorded in instrumentation and logging
1047
+ # @return [::String]
1048
+ # @!attribute [rw] timeout
1049
+ # The call timeout in seconds.
1050
+ # @return [::Numeric]
1051
+ # @!attribute [rw] metadata
1052
+ # Additional headers to be sent with the call.
1053
+ # @return [::Hash{::Symbol=>::String}]
1054
+ # @!attribute [rw] retry_policy
1055
+ # The retry policy. The value is a hash with the following keys:
1056
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1057
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1058
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1059
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1060
+ # trigger a retry.
1061
+ # @return [::Hash]
1062
+ # @!attribute [rw] quota_project
1063
+ # A separate project against which to charge quota.
1064
+ # @return [::String]
1065
+ # @!attribute [rw] universe_domain
1066
+ # The universe domain within which to make requests. This determines the
1067
+ # default endpoint URL. The default value of nil uses the environment
1068
+ # universe (usually the default "googleapis.com" universe).
1069
+ # @return [::String,nil]
1070
+ # @!attribute [rw] logger
1071
+ # A custom logger to use for request/response debug logging, or the value
1072
+ # `:default` (the default) to construct a default logger, or `nil` to
1073
+ # explicitly disable logging.
1074
+ # @return [::Logger,:default,nil]
1075
+ #
1076
+ class Configuration
1077
+ extend ::Gapic::Config
1078
+
1079
+ # @private
1080
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1081
+ DEFAULT_ENDPOINT = "geminidataanalytics.googleapis.com"
1082
+
1083
+ config_attr :endpoint, nil, ::String, nil
1084
+ config_attr :credentials, nil do |value|
1085
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1086
+ allowed.any? { |klass| klass === value }
1087
+ end
1088
+ config_attr :scope, nil, ::String, ::Array, nil
1089
+ config_attr :lib_name, nil, ::String, nil
1090
+ config_attr :lib_version, nil, ::String, nil
1091
+ config_attr :timeout, nil, ::Numeric, nil
1092
+ config_attr :metadata, nil, ::Hash, nil
1093
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1094
+ config_attr :quota_project, nil, ::String, nil
1095
+ config_attr :universe_domain, nil, ::String, nil
1096
+
1097
+ # @private
1098
+ # Overrides for http bindings for the RPCs of this service
1099
+ # are only used when this service is used as mixin, and only
1100
+ # by the host service.
1101
+ # @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
1102
+ config_attr :bindings_override, {}, ::Hash, nil
1103
+ config_attr :logger, :default, ::Logger, nil, :default
1104
+
1105
+ # @private
1106
+ def initialize parent_config = nil
1107
+ @parent_config = parent_config unless parent_config.nil?
1108
+
1109
+ yield self if block_given?
1110
+ end
1111
+
1112
+ ##
1113
+ # Configurations for individual RPCs
1114
+ # @return [Rpcs]
1115
+ #
1116
+ def rpcs
1117
+ @rpcs ||= begin
1118
+ parent_rpcs = nil
1119
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1120
+ Rpcs.new parent_rpcs
1121
+ end
1122
+ end
1123
+
1124
+ ##
1125
+ # Configuration RPC class for the DataAgentService API.
1126
+ #
1127
+ # Includes fields providing the configuration for each RPC in this service.
1128
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1129
+ # the following configuration fields:
1130
+ #
1131
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1132
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1133
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1134
+ # include the following keys:
1135
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1136
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1137
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1138
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1139
+ # trigger a retry.
1140
+ #
1141
+ class Rpcs
1142
+ ##
1143
+ # RPC-specific configuration for `list_data_agents`
1144
+ # @return [::Gapic::Config::Method]
1145
+ #
1146
+ attr_reader :list_data_agents
1147
+ ##
1148
+ # RPC-specific configuration for `list_accessible_data_agents`
1149
+ # @return [::Gapic::Config::Method]
1150
+ #
1151
+ attr_reader :list_accessible_data_agents
1152
+ ##
1153
+ # RPC-specific configuration for `get_data_agent`
1154
+ # @return [::Gapic::Config::Method]
1155
+ #
1156
+ attr_reader :get_data_agent
1157
+ ##
1158
+ # RPC-specific configuration for `create_data_agent`
1159
+ # @return [::Gapic::Config::Method]
1160
+ #
1161
+ attr_reader :create_data_agent
1162
+ ##
1163
+ # RPC-specific configuration for `update_data_agent`
1164
+ # @return [::Gapic::Config::Method]
1165
+ #
1166
+ attr_reader :update_data_agent
1167
+ ##
1168
+ # RPC-specific configuration for `delete_data_agent`
1169
+ # @return [::Gapic::Config::Method]
1170
+ #
1171
+ attr_reader :delete_data_agent
1172
+ ##
1173
+ # RPC-specific configuration for `get_iam_policy`
1174
+ # @return [::Gapic::Config::Method]
1175
+ #
1176
+ attr_reader :get_iam_policy
1177
+ ##
1178
+ # RPC-specific configuration for `set_iam_policy`
1179
+ # @return [::Gapic::Config::Method]
1180
+ #
1181
+ attr_reader :set_iam_policy
1182
+
1183
+ # @private
1184
+ def initialize parent_rpcs = nil
1185
+ list_data_agents_config = parent_rpcs.list_data_agents if parent_rpcs.respond_to? :list_data_agents
1186
+ @list_data_agents = ::Gapic::Config::Method.new list_data_agents_config
1187
+ list_accessible_data_agents_config = parent_rpcs.list_accessible_data_agents if parent_rpcs.respond_to? :list_accessible_data_agents
1188
+ @list_accessible_data_agents = ::Gapic::Config::Method.new list_accessible_data_agents_config
1189
+ get_data_agent_config = parent_rpcs.get_data_agent if parent_rpcs.respond_to? :get_data_agent
1190
+ @get_data_agent = ::Gapic::Config::Method.new get_data_agent_config
1191
+ create_data_agent_config = parent_rpcs.create_data_agent if parent_rpcs.respond_to? :create_data_agent
1192
+ @create_data_agent = ::Gapic::Config::Method.new create_data_agent_config
1193
+ update_data_agent_config = parent_rpcs.update_data_agent if parent_rpcs.respond_to? :update_data_agent
1194
+ @update_data_agent = ::Gapic::Config::Method.new update_data_agent_config
1195
+ delete_data_agent_config = parent_rpcs.delete_data_agent if parent_rpcs.respond_to? :delete_data_agent
1196
+ @delete_data_agent = ::Gapic::Config::Method.new delete_data_agent_config
1197
+ get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy
1198
+ @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config
1199
+ set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy
1200
+ @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config
1201
+
1202
+ yield self if block_given?
1203
+ end
1204
+ end
1205
+ end
1206
+ end
1207
+ end
1208
+ end
1209
+ end
1210
+ end
1211
+ end
1212
+ end