google-cloud-vector_search-v1 0.a → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) 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/vector_search/v1/bindings_override.rb +75 -0
  6. data/lib/google/cloud/vector_search/v1/data_object_search_service/client.rb +851 -0
  7. data/lib/google/cloud/vector_search/v1/data_object_search_service/credentials.rb +47 -0
  8. data/lib/google/cloud/vector_search/v1/data_object_search_service/paths.rb +73 -0
  9. data/lib/google/cloud/vector_search/v1/data_object_search_service/rest/client.rb +788 -0
  10. data/lib/google/cloud/vector_search/v1/data_object_search_service/rest/service_stub.rb +329 -0
  11. data/lib/google/cloud/vector_search/v1/data_object_search_service/rest.rb +53 -0
  12. data/lib/google/cloud/vector_search/v1/data_object_search_service.rb +55 -0
  13. data/lib/google/cloud/vector_search/v1/data_object_service/client.rb +1115 -0
  14. data/lib/google/cloud/vector_search/v1/data_object_service/credentials.rb +47 -0
  15. data/lib/google/cloud/vector_search/v1/data_object_service/paths.rb +73 -0
  16. data/lib/google/cloud/vector_search/v1/data_object_service/rest/client.rb +1031 -0
  17. data/lib/google/cloud/vector_search/v1/data_object_service/rest/service_stub.rb +513 -0
  18. data/lib/google/cloud/vector_search/v1/data_object_service/rest.rb +53 -0
  19. data/lib/google/cloud/vector_search/v1/data_object_service.rb +55 -0
  20. data/lib/google/cloud/vector_search/v1/rest.rb +40 -0
  21. data/lib/google/cloud/vector_search/v1/vector_search_service/client.rb +1831 -0
  22. data/lib/google/cloud/vector_search/v1/vector_search_service/credentials.rb +47 -0
  23. data/lib/google/cloud/vector_search/v1/vector_search_service/operations.rb +843 -0
  24. data/lib/google/cloud/vector_search/v1/vector_search_service/paths.rb +111 -0
  25. data/lib/google/cloud/vector_search/v1/vector_search_service/rest/client.rb +1712 -0
  26. data/lib/google/cloud/vector_search/v1/vector_search_service/rest/operations.rb +927 -0
  27. data/lib/google/cloud/vector_search/v1/vector_search_service/rest/service_stub.rb +819 -0
  28. data/lib/google/cloud/vector_search/v1/vector_search_service/rest.rb +58 -0
  29. data/lib/google/cloud/vector_search/v1/vector_search_service.rb +60 -0
  30. data/lib/google/cloud/vector_search/v1/version.rb +7 -2
  31. data/lib/google/cloud/vector_search/v1.rb +47 -0
  32. data/lib/google/cloud/vectorsearch/v1/common_pb.rb +21 -0
  33. data/lib/google/cloud/vectorsearch/v1/data_object_pb.rb +29 -0
  34. data/lib/google/cloud/vectorsearch/v1/data_object_search_service_pb.rb +50 -0
  35. data/lib/google/cloud/vectorsearch/v1/data_object_search_service_services_pb.rb +51 -0
  36. data/lib/google/cloud/vectorsearch/v1/data_object_service_pb.rb +37 -0
  37. data/lib/google/cloud/vectorsearch/v1/data_object_service_services_pb.rb +57 -0
  38. data/lib/google/cloud/vectorsearch/v1/embedding_config_pb.rb +24 -0
  39. data/lib/google/cloud/vectorsearch/v1/encryption_spec_pb.rb +24 -0
  40. data/lib/google/cloud/vectorsearch/v1/vectorsearch_service_pb.rb +69 -0
  41. data/lib/google/cloud/vectorsearch/v1/vectorsearch_service_services_pb.rb +71 -0
  42. data/lib/google-cloud-vector_search-v1.rb +21 -0
  43. data/proto_docs/README.md +4 -0
  44. data/proto_docs/google/api/client.rb +593 -0
  45. data/proto_docs/google/api/field_behavior.rb +85 -0
  46. data/proto_docs/google/api/field_info.rb +88 -0
  47. data/proto_docs/google/api/launch_stage.rb +71 -0
  48. data/proto_docs/google/api/resource.rb +227 -0
  49. data/proto_docs/google/cloud/vectorsearch/v1/common.rb +38 -0
  50. data/proto_docs/google/cloud/vectorsearch/v1/data_object.rb +104 -0
  51. data/proto_docs/google/cloud/vectorsearch/v1/data_object_search_service.rb +397 -0
  52. data/proto_docs/google/cloud/vectorsearch/v1/data_object_service.rb +156 -0
  53. data/proto_docs/google/cloud/vectorsearch/v1/embedding_config.rb +76 -0
  54. data/proto_docs/google/cloud/vectorsearch/v1/encryption_spec.rb +40 -0
  55. data/proto_docs/google/cloud/vectorsearch/v1/vectorsearch_service.rb +723 -0
  56. data/proto_docs/google/longrunning/operations.rb +191 -0
  57. data/proto_docs/google/protobuf/any.rb +145 -0
  58. data/proto_docs/google/protobuf/duration.rb +98 -0
  59. data/proto_docs/google/protobuf/empty.rb +34 -0
  60. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  61. data/proto_docs/google/protobuf/struct.rb +108 -0
  62. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  63. data/proto_docs/google/rpc/status.rb +48 -0
  64. metadata +122 -9
@@ -0,0 +1,1115 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/vectorsearch/v1/data_object_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module VectorSearch
26
+ module V1
27
+ module DataObjectService
28
+ ##
29
+ # Client for the DataObjectService service.
30
+ #
31
+ # Service for creating and managing data objects.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "vectorsearch.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :data_object_service_stub
44
+
45
+ ##
46
+ # Configure the DataObjectService Client class.
47
+ #
48
+ # See {::Google::Cloud::VectorSearch::V1::DataObjectService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all DataObjectService clients
54
+ # ::Google::Cloud::VectorSearch::V1::DataObjectService::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", "VectorSearch", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.rpcs.create_data_object.timeout = 60.0
75
+ default_config.rpcs.create_data_object.retry_policy = {
76
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
77
+ }
78
+
79
+ default_config.rpcs.batch_create_data_objects.timeout = 300.0
80
+ default_config.rpcs.batch_create_data_objects.retry_policy = {
81
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
82
+ }
83
+
84
+ default_config.rpcs.get_data_object.timeout = 60.0
85
+ default_config.rpcs.get_data_object.retry_policy = {
86
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
87
+ }
88
+
89
+ default_config.rpcs.update_data_object.timeout = 60.0
90
+ default_config.rpcs.update_data_object.retry_policy = {
91
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
92
+ }
93
+
94
+ default_config.rpcs.batch_update_data_objects.timeout = 60.0
95
+ default_config.rpcs.batch_update_data_objects.retry_policy = {
96
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
97
+ }
98
+
99
+ default_config.rpcs.delete_data_object.timeout = 60.0
100
+ default_config.rpcs.delete_data_object.retry_policy = {
101
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
102
+ }
103
+
104
+ default_config.rpcs.batch_delete_data_objects.timeout = 60.0
105
+ default_config.rpcs.batch_delete_data_objects.retry_policy = {
106
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
107
+ }
108
+
109
+ default_config
110
+ end
111
+ yield @configure if block_given?
112
+ @configure
113
+ end
114
+
115
+ ##
116
+ # Configure the DataObjectService Client instance.
117
+ #
118
+ # The configuration is set to the derived mode, meaning that values can be changed,
119
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
120
+ # should be made on {Client.configure}.
121
+ #
122
+ # See {::Google::Cloud::VectorSearch::V1::DataObjectService::Client::Configuration}
123
+ # for a description of the configuration fields.
124
+ #
125
+ # @yield [config] Configure the Client client.
126
+ # @yieldparam config [Client::Configuration]
127
+ #
128
+ # @return [Client::Configuration]
129
+ #
130
+ def configure
131
+ yield @config if block_given?
132
+ @config
133
+ end
134
+
135
+ ##
136
+ # The effective universe domain
137
+ #
138
+ # @return [String]
139
+ #
140
+ def universe_domain
141
+ @data_object_service_stub.universe_domain
142
+ end
143
+
144
+ ##
145
+ # Create a new DataObjectService client object.
146
+ #
147
+ # @example
148
+ #
149
+ # # Create a client using the default configuration
150
+ # client = ::Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
151
+ #
152
+ # # Create a client using a custom configuration
153
+ # client = ::Google::Cloud::VectorSearch::V1::DataObjectService::Client.new do |config|
154
+ # config.timeout = 10.0
155
+ # end
156
+ #
157
+ # @yield [config] Configure the DataObjectService client.
158
+ # @yieldparam config [Client::Configuration]
159
+ #
160
+ def initialize
161
+ # These require statements are intentionally placed here to initialize
162
+ # the gRPC module only when it's required.
163
+ # See https://github.com/googleapis/toolkit/issues/446
164
+ require "gapic/grpc"
165
+ require "google/cloud/vectorsearch/v1/data_object_service_services_pb"
166
+
167
+ # Create the configuration object
168
+ @config = Configuration.new Client.configure
169
+
170
+ # Yield the configuration if needed
171
+ yield @config if block_given?
172
+
173
+ # Create credentials
174
+ credentials = @config.credentials
175
+ # Use self-signed JWT if the endpoint is unchanged from default,
176
+ # but only if the default endpoint does not have a region prefix.
177
+ enable_self_signed_jwt = @config.endpoint.nil? ||
178
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
179
+ !@config.endpoint.split(".").first.include?("-"))
180
+ credentials ||= Credentials.default scope: @config.scope,
181
+ enable_self_signed_jwt: enable_self_signed_jwt
182
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
183
+ credentials = Credentials.new credentials, scope: @config.scope
184
+ end
185
+ @quota_project_id = @config.quota_project
186
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
187
+
188
+ @data_object_service_stub = ::Gapic::ServiceStub.new(
189
+ ::Google::Cloud::VectorSearch::V1::DataObjectService::Stub,
190
+ credentials: credentials,
191
+ endpoint: @config.endpoint,
192
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
193
+ universe_domain: @config.universe_domain,
194
+ channel_args: @config.channel_args,
195
+ interceptors: @config.interceptors,
196
+ channel_pool_config: @config.channel_pool,
197
+ logger: @config.logger
198
+ )
199
+
200
+ @data_object_service_stub.stub_logger&.info do |entry|
201
+ entry.set_system_name
202
+ entry.set_service
203
+ entry.message = "Created client for #{entry.service}"
204
+ entry.set_credentials_fields credentials
205
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
206
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
207
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
208
+ end
209
+
210
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
211
+ config.credentials = credentials
212
+ config.quota_project = @quota_project_id
213
+ config.endpoint = @data_object_service_stub.endpoint
214
+ config.universe_domain = @data_object_service_stub.universe_domain
215
+ config.logger = @data_object_service_stub.logger if config.respond_to? :logger=
216
+ end
217
+ end
218
+
219
+ ##
220
+ # Get the associated client for mix-in of the Locations.
221
+ #
222
+ # @return [Google::Cloud::Location::Locations::Client]
223
+ #
224
+ attr_reader :location_client
225
+
226
+ ##
227
+ # The logger used for request/response debug logging.
228
+ #
229
+ # @return [Logger]
230
+ #
231
+ def logger
232
+ @data_object_service_stub.logger
233
+ end
234
+
235
+ # Service calls
236
+
237
+ ##
238
+ # Creates a dataObject.
239
+ #
240
+ # @overload create_data_object(request, options = nil)
241
+ # Pass arguments to `create_data_object` via a request object, either of type
242
+ # {::Google::Cloud::VectorSearch::V1::CreateDataObjectRequest} or an equivalent Hash.
243
+ #
244
+ # @param request [::Google::Cloud::VectorSearch::V1::CreateDataObjectRequest, ::Hash]
245
+ # A request object representing the call parameters. Required. To specify no
246
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
247
+ # @param options [::Gapic::CallOptions, ::Hash]
248
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
249
+ #
250
+ # @overload create_data_object(parent: nil, data_object_id: nil, data_object: nil)
251
+ # Pass arguments to `create_data_object` via keyword arguments. Note that at
252
+ # least one keyword argument is required. To specify no parameters, or to keep all
253
+ # the default parameter values, pass an empty Hash as a request object (see above).
254
+ #
255
+ # @param parent [::String]
256
+ # Required. The resource name of the Collection to create the DataObject in.
257
+ # Format: `projects/{project}/locations/{location}/collections/{collection}`
258
+ # @param data_object_id [::String]
259
+ # Required. The id of the dataObject to create.
260
+ # The id must be 1-63 characters long, and comply with
261
+ # [RFC1035](https://www.ietf.org/rfc/rfc1035.txt).
262
+ # Specifically, it must be 1-63 characters long and match the regular
263
+ # expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`.
264
+ # @param data_object [::Google::Cloud::VectorSearch::V1::DataObject, ::Hash]
265
+ # Required. The DataObject to create.
266
+ #
267
+ # @yield [response, operation] Access the result along with the RPC operation
268
+ # @yieldparam response [::Google::Cloud::VectorSearch::V1::DataObject]
269
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
270
+ #
271
+ # @return [::Google::Cloud::VectorSearch::V1::DataObject]
272
+ #
273
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
274
+ #
275
+ # @example Basic example
276
+ # require "google/cloud/vector_search/v1"
277
+ #
278
+ # # Create a client object. The client can be reused for multiple calls.
279
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
280
+ #
281
+ # # Create a request. To set request fields, pass in keyword arguments.
282
+ # request = Google::Cloud::VectorSearch::V1::CreateDataObjectRequest.new
283
+ #
284
+ # # Call the create_data_object method.
285
+ # result = client.create_data_object request
286
+ #
287
+ # # The returned object is of type Google::Cloud::VectorSearch::V1::DataObject.
288
+ # p result
289
+ #
290
+ def create_data_object request, options = nil
291
+ raise ::ArgumentError, "request must be provided" if request.nil?
292
+
293
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::CreateDataObjectRequest
294
+
295
+ # Converts hash and nil to an options object
296
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
297
+
298
+ # Customize the options with defaults
299
+ metadata = @config.rpcs.create_data_object.metadata.to_h
300
+
301
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
302
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
303
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
304
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
305
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
306
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
307
+
308
+ header_params = {}
309
+ if request.parent
310
+ header_params["parent"] = request.parent
311
+ end
312
+
313
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
314
+ metadata[:"x-goog-request-params"] ||= request_params_header
315
+
316
+ options.apply_defaults timeout: @config.rpcs.create_data_object.timeout,
317
+ metadata: metadata,
318
+ retry_policy: @config.rpcs.create_data_object.retry_policy
319
+
320
+ options.apply_defaults timeout: @config.timeout,
321
+ metadata: @config.metadata,
322
+ retry_policy: @config.retry_policy
323
+
324
+ @data_object_service_stub.call_rpc :create_data_object, request, options: options do |response, operation|
325
+ yield response, operation if block_given?
326
+ end
327
+ rescue ::GRPC::BadStatus => e
328
+ raise ::Google::Cloud::Error.from_error(e)
329
+ end
330
+
331
+ ##
332
+ # Creates a batch of dataObjects.
333
+ #
334
+ # @overload batch_create_data_objects(request, options = nil)
335
+ # Pass arguments to `batch_create_data_objects` via a request object, either of type
336
+ # {::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsRequest} or an equivalent Hash.
337
+ #
338
+ # @param request [::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsRequest, ::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 batch_create_data_objects(parent: nil, requests: nil)
345
+ # Pass arguments to `batch_create_data_objects` 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. The resource name of the Collection to create the DataObjects in.
351
+ # Format: `projects/{project}/locations/{location}/collections/{collection}`.
352
+ # The parent field in the CreateDataObjectRequest messages must match this
353
+ # field.
354
+ # @param requests [::Array<::Google::Cloud::VectorSearch::V1::CreateDataObjectRequest, ::Hash>]
355
+ # Required. The request message specifying the resources to create.
356
+ # A maximum of 1000 DataObjects can be created in a batch.
357
+ #
358
+ # @yield [response, operation] Access the result along with the RPC operation
359
+ # @yieldparam response [::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse]
360
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
361
+ #
362
+ # @return [::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse]
363
+ #
364
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
365
+ #
366
+ # @example Basic example
367
+ # require "google/cloud/vector_search/v1"
368
+ #
369
+ # # Create a client object. The client can be reused for multiple calls.
370
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
371
+ #
372
+ # # Create a request. To set request fields, pass in keyword arguments.
373
+ # request = Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsRequest.new
374
+ #
375
+ # # Call the batch_create_data_objects method.
376
+ # result = client.batch_create_data_objects request
377
+ #
378
+ # # The returned object is of type Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsResponse.
379
+ # p result
380
+ #
381
+ def batch_create_data_objects request, options = nil
382
+ raise ::ArgumentError, "request must be provided" if request.nil?
383
+
384
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::BatchCreateDataObjectsRequest
385
+
386
+ # Converts hash and nil to an options object
387
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
388
+
389
+ # Customize the options with defaults
390
+ metadata = @config.rpcs.batch_create_data_objects.metadata.to_h
391
+
392
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
393
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
394
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
395
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
396
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
397
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
398
+
399
+ header_params = {}
400
+ if request.parent
401
+ header_params["parent"] = request.parent
402
+ end
403
+
404
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
405
+ metadata[:"x-goog-request-params"] ||= request_params_header
406
+
407
+ options.apply_defaults timeout: @config.rpcs.batch_create_data_objects.timeout,
408
+ metadata: metadata,
409
+ retry_policy: @config.rpcs.batch_create_data_objects.retry_policy
410
+
411
+ options.apply_defaults timeout: @config.timeout,
412
+ metadata: @config.metadata,
413
+ retry_policy: @config.retry_policy
414
+
415
+ @data_object_service_stub.call_rpc :batch_create_data_objects, request, options: options do |response, operation|
416
+ yield response, operation if block_given?
417
+ end
418
+ rescue ::GRPC::BadStatus => e
419
+ raise ::Google::Cloud::Error.from_error(e)
420
+ end
421
+
422
+ ##
423
+ # Gets a data object.
424
+ #
425
+ # @overload get_data_object(request, options = nil)
426
+ # Pass arguments to `get_data_object` via a request object, either of type
427
+ # {::Google::Cloud::VectorSearch::V1::GetDataObjectRequest} or an equivalent Hash.
428
+ #
429
+ # @param request [::Google::Cloud::VectorSearch::V1::GetDataObjectRequest, ::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_object(name: nil)
436
+ # Pass arguments to `get_data_object` 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. The name of the DataObject resource.
442
+ # Format:
443
+ # `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}`
444
+ #
445
+ # @yield [response, operation] Access the result along with the RPC operation
446
+ # @yieldparam response [::Google::Cloud::VectorSearch::V1::DataObject]
447
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
448
+ #
449
+ # @return [::Google::Cloud::VectorSearch::V1::DataObject]
450
+ #
451
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
452
+ #
453
+ # @example Basic example
454
+ # require "google/cloud/vector_search/v1"
455
+ #
456
+ # # Create a client object. The client can be reused for multiple calls.
457
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
458
+ #
459
+ # # Create a request. To set request fields, pass in keyword arguments.
460
+ # request = Google::Cloud::VectorSearch::V1::GetDataObjectRequest.new
461
+ #
462
+ # # Call the get_data_object method.
463
+ # result = client.get_data_object request
464
+ #
465
+ # # The returned object is of type Google::Cloud::VectorSearch::V1::DataObject.
466
+ # p result
467
+ #
468
+ def get_data_object request, options = nil
469
+ raise ::ArgumentError, "request must be provided" if request.nil?
470
+
471
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::GetDataObjectRequest
472
+
473
+ # Converts hash and nil to an options object
474
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
475
+
476
+ # Customize the options with defaults
477
+ metadata = @config.rpcs.get_data_object.metadata.to_h
478
+
479
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
480
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
481
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
482
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
483
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
484
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
485
+
486
+ header_params = {}
487
+ if request.name
488
+ header_params["name"] = request.name
489
+ end
490
+
491
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
492
+ metadata[:"x-goog-request-params"] ||= request_params_header
493
+
494
+ options.apply_defaults timeout: @config.rpcs.get_data_object.timeout,
495
+ metadata: metadata,
496
+ retry_policy: @config.rpcs.get_data_object.retry_policy
497
+
498
+ options.apply_defaults timeout: @config.timeout,
499
+ metadata: @config.metadata,
500
+ retry_policy: @config.retry_policy
501
+
502
+ @data_object_service_stub.call_rpc :get_data_object, request, options: options do |response, operation|
503
+ yield response, operation if block_given?
504
+ end
505
+ rescue ::GRPC::BadStatus => e
506
+ raise ::Google::Cloud::Error.from_error(e)
507
+ end
508
+
509
+ ##
510
+ # Updates a dataObject.
511
+ #
512
+ # @overload update_data_object(request, options = nil)
513
+ # Pass arguments to `update_data_object` via a request object, either of type
514
+ # {::Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest} or an equivalent Hash.
515
+ #
516
+ # @param request [::Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest, ::Hash]
517
+ # A request object representing the call parameters. Required. To specify no
518
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
519
+ # @param options [::Gapic::CallOptions, ::Hash]
520
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
521
+ #
522
+ # @overload update_data_object(data_object: nil, update_mask: nil)
523
+ # Pass arguments to `update_data_object` via keyword arguments. Note that at
524
+ # least one keyword argument is required. To specify no parameters, or to keep all
525
+ # the default parameter values, pass an empty Hash as a request object (see above).
526
+ #
527
+ # @param data_object [::Google::Cloud::VectorSearch::V1::DataObject, ::Hash]
528
+ # Required. The DataObject which replaces the resource on the server.
529
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
530
+ # Optional. The update mask applies to the resource. See
531
+ # {::Google::Protobuf::FieldMask google.protobuf.FieldMask}.
532
+ #
533
+ # @yield [response, operation] Access the result along with the RPC operation
534
+ # @yieldparam response [::Google::Cloud::VectorSearch::V1::DataObject]
535
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
536
+ #
537
+ # @return [::Google::Cloud::VectorSearch::V1::DataObject]
538
+ #
539
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
540
+ #
541
+ # @example Basic example
542
+ # require "google/cloud/vector_search/v1"
543
+ #
544
+ # # Create a client object. The client can be reused for multiple calls.
545
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
546
+ #
547
+ # # Create a request. To set request fields, pass in keyword arguments.
548
+ # request = Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest.new
549
+ #
550
+ # # Call the update_data_object method.
551
+ # result = client.update_data_object request
552
+ #
553
+ # # The returned object is of type Google::Cloud::VectorSearch::V1::DataObject.
554
+ # p result
555
+ #
556
+ def update_data_object request, options = nil
557
+ raise ::ArgumentError, "request must be provided" if request.nil?
558
+
559
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest
560
+
561
+ # Converts hash and nil to an options object
562
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
563
+
564
+ # Customize the options with defaults
565
+ metadata = @config.rpcs.update_data_object.metadata.to_h
566
+
567
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
568
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
569
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
570
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
571
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
572
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
573
+
574
+ header_params = {}
575
+ if request.data_object&.name
576
+ header_params["data_object.name"] = request.data_object.name
577
+ end
578
+
579
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
580
+ metadata[:"x-goog-request-params"] ||= request_params_header
581
+
582
+ options.apply_defaults timeout: @config.rpcs.update_data_object.timeout,
583
+ metadata: metadata,
584
+ retry_policy: @config.rpcs.update_data_object.retry_policy
585
+
586
+ options.apply_defaults timeout: @config.timeout,
587
+ metadata: @config.metadata,
588
+ retry_policy: @config.retry_policy
589
+
590
+ @data_object_service_stub.call_rpc :update_data_object, request, options: options do |response, operation|
591
+ yield response, operation if block_given?
592
+ end
593
+ rescue ::GRPC::BadStatus => e
594
+ raise ::Google::Cloud::Error.from_error(e)
595
+ end
596
+
597
+ ##
598
+ # Updates dataObjects in a batch.
599
+ #
600
+ # @overload batch_update_data_objects(request, options = nil)
601
+ # Pass arguments to `batch_update_data_objects` via a request object, either of type
602
+ # {::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsRequest} or an equivalent Hash.
603
+ #
604
+ # @param request [::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsRequest, ::Hash]
605
+ # A request object representing the call parameters. Required. To specify no
606
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
607
+ # @param options [::Gapic::CallOptions, ::Hash]
608
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
609
+ #
610
+ # @overload batch_update_data_objects(parent: nil, requests: nil)
611
+ # Pass arguments to `batch_update_data_objects` via keyword arguments. Note that at
612
+ # least one keyword argument is required. To specify no parameters, or to keep all
613
+ # the default parameter values, pass an empty Hash as a request object (see above).
614
+ #
615
+ # @param parent [::String]
616
+ # Required. The resource name of the Collection to update the DataObjects in.
617
+ # Format: `projects/{project}/locations/{location}/collections/{collection}`.
618
+ # The parent field in the UpdateDataObjectRequest messages must match this
619
+ # field.
620
+ # @param requests [::Array<::Google::Cloud::VectorSearch::V1::UpdateDataObjectRequest, ::Hash>]
621
+ # Required. The request message specifying the resources to update.
622
+ # A maximum of 1000 DataObjects can be updated in a batch.
623
+ #
624
+ # @yield [response, operation] Access the result along with the RPC operation
625
+ # @yieldparam response [::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse]
626
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
627
+ #
628
+ # @return [::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse]
629
+ #
630
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
631
+ #
632
+ # @example Basic example
633
+ # require "google/cloud/vector_search/v1"
634
+ #
635
+ # # Create a client object. The client can be reused for multiple calls.
636
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
637
+ #
638
+ # # Create a request. To set request fields, pass in keyword arguments.
639
+ # request = Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsRequest.new
640
+ #
641
+ # # Call the batch_update_data_objects method.
642
+ # result = client.batch_update_data_objects request
643
+ #
644
+ # # The returned object is of type Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsResponse.
645
+ # p result
646
+ #
647
+ def batch_update_data_objects request, options = nil
648
+ raise ::ArgumentError, "request must be provided" if request.nil?
649
+
650
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::BatchUpdateDataObjectsRequest
651
+
652
+ # Converts hash and nil to an options object
653
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
654
+
655
+ # Customize the options with defaults
656
+ metadata = @config.rpcs.batch_update_data_objects.metadata.to_h
657
+
658
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
659
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
660
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
661
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
662
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
663
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
664
+
665
+ header_params = {}
666
+ if request.parent
667
+ header_params["parent"] = request.parent
668
+ end
669
+
670
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
671
+ metadata[:"x-goog-request-params"] ||= request_params_header
672
+
673
+ options.apply_defaults timeout: @config.rpcs.batch_update_data_objects.timeout,
674
+ metadata: metadata,
675
+ retry_policy: @config.rpcs.batch_update_data_objects.retry_policy
676
+
677
+ options.apply_defaults timeout: @config.timeout,
678
+ metadata: @config.metadata,
679
+ retry_policy: @config.retry_policy
680
+
681
+ @data_object_service_stub.call_rpc :batch_update_data_objects, request, options: options do |response, operation|
682
+ yield response, operation if block_given?
683
+ end
684
+ rescue ::GRPC::BadStatus => e
685
+ raise ::Google::Cloud::Error.from_error(e)
686
+ end
687
+
688
+ ##
689
+ # Deletes a dataObject.
690
+ #
691
+ # @overload delete_data_object(request, options = nil)
692
+ # Pass arguments to `delete_data_object` via a request object, either of type
693
+ # {::Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest} or an equivalent Hash.
694
+ #
695
+ # @param request [::Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest, ::Hash]
696
+ # A request object representing the call parameters. Required. To specify no
697
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
698
+ # @param options [::Gapic::CallOptions, ::Hash]
699
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
700
+ #
701
+ # @overload delete_data_object(name: nil, etag: nil)
702
+ # Pass arguments to `delete_data_object` via keyword arguments. Note that at
703
+ # least one keyword argument is required. To specify no parameters, or to keep all
704
+ # the default parameter values, pass an empty Hash as a request object (see above).
705
+ #
706
+ # @param name [::String]
707
+ # Required. The name of the DataObject resource to be deleted.
708
+ # Format:
709
+ # `projects/{project}/locations/{location}/collections/{collection}/dataObjects/{dataObject}`
710
+ # @param etag [::String]
711
+ # Optional. The current etag of the DataObject.
712
+ # If an etag is provided and does not match the current etag of the
713
+ # DataObject, deletion will be blocked and an ABORTED error will be returned.
714
+ #
715
+ # @yield [response, operation] Access the result along with the RPC operation
716
+ # @yieldparam response [::Google::Protobuf::Empty]
717
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
718
+ #
719
+ # @return [::Google::Protobuf::Empty]
720
+ #
721
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
722
+ #
723
+ # @example Basic example
724
+ # require "google/cloud/vector_search/v1"
725
+ #
726
+ # # Create a client object. The client can be reused for multiple calls.
727
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
728
+ #
729
+ # # Create a request. To set request fields, pass in keyword arguments.
730
+ # request = Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest.new
731
+ #
732
+ # # Call the delete_data_object method.
733
+ # result = client.delete_data_object request
734
+ #
735
+ # # The returned object is of type Google::Protobuf::Empty.
736
+ # p result
737
+ #
738
+ def delete_data_object request, options = nil
739
+ raise ::ArgumentError, "request must be provided" if request.nil?
740
+
741
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest
742
+
743
+ # Converts hash and nil to an options object
744
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
745
+
746
+ # Customize the options with defaults
747
+ metadata = @config.rpcs.delete_data_object.metadata.to_h
748
+
749
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
750
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
751
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
752
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
753
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
754
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
755
+
756
+ header_params = {}
757
+ if request.name
758
+ header_params["name"] = request.name
759
+ end
760
+
761
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
762
+ metadata[:"x-goog-request-params"] ||= request_params_header
763
+
764
+ options.apply_defaults timeout: @config.rpcs.delete_data_object.timeout,
765
+ metadata: metadata,
766
+ retry_policy: @config.rpcs.delete_data_object.retry_policy
767
+
768
+ options.apply_defaults timeout: @config.timeout,
769
+ metadata: @config.metadata,
770
+ retry_policy: @config.retry_policy
771
+
772
+ @data_object_service_stub.call_rpc :delete_data_object, request, options: options do |response, operation|
773
+ yield response, operation if block_given?
774
+ end
775
+ rescue ::GRPC::BadStatus => e
776
+ raise ::Google::Cloud::Error.from_error(e)
777
+ end
778
+
779
+ ##
780
+ # Deletes dataObjects in a batch.
781
+ #
782
+ # @overload batch_delete_data_objects(request, options = nil)
783
+ # Pass arguments to `batch_delete_data_objects` via a request object, either of type
784
+ # {::Google::Cloud::VectorSearch::V1::BatchDeleteDataObjectsRequest} or an equivalent Hash.
785
+ #
786
+ # @param request [::Google::Cloud::VectorSearch::V1::BatchDeleteDataObjectsRequest, ::Hash]
787
+ # A request object representing the call parameters. Required. To specify no
788
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
789
+ # @param options [::Gapic::CallOptions, ::Hash]
790
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
791
+ #
792
+ # @overload batch_delete_data_objects(parent: nil, requests: nil)
793
+ # Pass arguments to `batch_delete_data_objects` via keyword arguments. Note that at
794
+ # least one keyword argument is required. To specify no parameters, or to keep all
795
+ # the default parameter values, pass an empty Hash as a request object (see above).
796
+ #
797
+ # @param parent [::String]
798
+ # Required. The resource name of the Collection to delete the DataObjects in.
799
+ # Format: `projects/{project}/locations/{location}/collections/{collection}`.
800
+ # @param requests [::Array<::Google::Cloud::VectorSearch::V1::DeleteDataObjectRequest, ::Hash>]
801
+ # Required. The request message specifying the resources to delete.
802
+ # A maximum of 1000 DataObjects can be deleted in a batch.
803
+ #
804
+ # @yield [response, operation] Access the result along with the RPC operation
805
+ # @yieldparam response [::Google::Protobuf::Empty]
806
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
807
+ #
808
+ # @return [::Google::Protobuf::Empty]
809
+ #
810
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
811
+ #
812
+ # @example Basic example
813
+ # require "google/cloud/vector_search/v1"
814
+ #
815
+ # # Create a client object. The client can be reused for multiple calls.
816
+ # client = Google::Cloud::VectorSearch::V1::DataObjectService::Client.new
817
+ #
818
+ # # Create a request. To set request fields, pass in keyword arguments.
819
+ # request = Google::Cloud::VectorSearch::V1::BatchDeleteDataObjectsRequest.new
820
+ #
821
+ # # Call the batch_delete_data_objects method.
822
+ # result = client.batch_delete_data_objects request
823
+ #
824
+ # # The returned object is of type Google::Protobuf::Empty.
825
+ # p result
826
+ #
827
+ def batch_delete_data_objects request, options = nil
828
+ raise ::ArgumentError, "request must be provided" if request.nil?
829
+
830
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VectorSearch::V1::BatchDeleteDataObjectsRequest
831
+
832
+ # Converts hash and nil to an options object
833
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
834
+
835
+ # Customize the options with defaults
836
+ metadata = @config.rpcs.batch_delete_data_objects.metadata.to_h
837
+
838
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
839
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
840
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
841
+ gapic_version: ::Google::Cloud::VectorSearch::V1::VERSION
842
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
843
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
844
+
845
+ header_params = {}
846
+ if request.parent
847
+ header_params["parent"] = request.parent
848
+ end
849
+
850
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
851
+ metadata[:"x-goog-request-params"] ||= request_params_header
852
+
853
+ options.apply_defaults timeout: @config.rpcs.batch_delete_data_objects.timeout,
854
+ metadata: metadata,
855
+ retry_policy: @config.rpcs.batch_delete_data_objects.retry_policy
856
+
857
+ options.apply_defaults timeout: @config.timeout,
858
+ metadata: @config.metadata,
859
+ retry_policy: @config.retry_policy
860
+
861
+ @data_object_service_stub.call_rpc :batch_delete_data_objects, request, options: options do |response, operation|
862
+ yield response, operation if block_given?
863
+ end
864
+ rescue ::GRPC::BadStatus => e
865
+ raise ::Google::Cloud::Error.from_error(e)
866
+ end
867
+
868
+ ##
869
+ # Configuration class for the DataObjectService API.
870
+ #
871
+ # This class represents the configuration for DataObjectService,
872
+ # providing control over timeouts, retry behavior, logging, transport
873
+ # parameters, and other low-level controls. Certain parameters can also be
874
+ # applied individually to specific RPCs. See
875
+ # {::Google::Cloud::VectorSearch::V1::DataObjectService::Client::Configuration::Rpcs}
876
+ # for a list of RPCs that can be configured independently.
877
+ #
878
+ # Configuration can be applied globally to all clients, or to a single client
879
+ # on construction.
880
+ #
881
+ # @example
882
+ #
883
+ # # Modify the global config, setting the timeout for
884
+ # # create_data_object to 20 seconds,
885
+ # # and all remaining timeouts to 10 seconds.
886
+ # ::Google::Cloud::VectorSearch::V1::DataObjectService::Client.configure do |config|
887
+ # config.timeout = 10.0
888
+ # config.rpcs.create_data_object.timeout = 20.0
889
+ # end
890
+ #
891
+ # # Apply the above configuration only to a new client.
892
+ # client = ::Google::Cloud::VectorSearch::V1::DataObjectService::Client.new do |config|
893
+ # config.timeout = 10.0
894
+ # config.rpcs.create_data_object.timeout = 20.0
895
+ # end
896
+ #
897
+ # @!attribute [rw] endpoint
898
+ # A custom service endpoint, as a hostname or hostname:port. The default is
899
+ # nil, indicating to use the default endpoint in the current universe domain.
900
+ # @return [::String,nil]
901
+ # @!attribute [rw] credentials
902
+ # Credentials to send with calls. You may provide any of the following types:
903
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
904
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
905
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
906
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
907
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
908
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
909
+ # * (`nil`) indicating no credentials
910
+ #
911
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
912
+ # is deprecated. Providing an unvalidated credential configuration to
913
+ # Google APIs can compromise the security of your systems and data.
914
+ #
915
+ # @example
916
+ #
917
+ # # The recommended way to provide credentials is to use the `make_creds` method
918
+ # # on the appropriate credentials class for your environment.
919
+ #
920
+ # require "googleauth"
921
+ #
922
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
923
+ # json_key_io: ::File.open("/path/to/keyfile.json")
924
+ # )
925
+ #
926
+ # client = ::Google::Cloud::VectorSearch::V1::DataObjectService::Client.new do |config|
927
+ # config.credentials = credentials
928
+ # end
929
+ #
930
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
931
+ # external source for authentication to Google Cloud, you must validate it before
932
+ # providing it to a Google API client library. Providing an unvalidated credential
933
+ # configuration to Google APIs can compromise the security of your systems and data.
934
+ # For more information, refer to [Validate credential configurations from external
935
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
936
+ # @return [::Object]
937
+ # @!attribute [rw] scope
938
+ # The OAuth scopes
939
+ # @return [::Array<::String>]
940
+ # @!attribute [rw] lib_name
941
+ # The library name as recorded in instrumentation and logging
942
+ # @return [::String]
943
+ # @!attribute [rw] lib_version
944
+ # The library version as recorded in instrumentation and logging
945
+ # @return [::String]
946
+ # @!attribute [rw] channel_args
947
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
948
+ # `GRPC::Core::Channel` object is provided as the credential.
949
+ # @return [::Hash]
950
+ # @!attribute [rw] interceptors
951
+ # An array of interceptors that are run before calls are executed.
952
+ # @return [::Array<::GRPC::ClientInterceptor>]
953
+ # @!attribute [rw] timeout
954
+ # The call timeout in seconds.
955
+ # @return [::Numeric]
956
+ # @!attribute [rw] metadata
957
+ # Additional gRPC headers to be sent with the call.
958
+ # @return [::Hash{::Symbol=>::String}]
959
+ # @!attribute [rw] retry_policy
960
+ # The retry policy. The value is a hash with the following keys:
961
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
962
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
963
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
964
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
965
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
966
+ # trigger a retry.
967
+ # @return [::Hash]
968
+ # @!attribute [rw] quota_project
969
+ # A separate project against which to charge quota.
970
+ # @return [::String]
971
+ # @!attribute [rw] universe_domain
972
+ # The universe domain within which to make requests. This determines the
973
+ # default endpoint URL. The default value of nil uses the environment
974
+ # universe (usually the default "googleapis.com" universe).
975
+ # @return [::String,nil]
976
+ # @!attribute [rw] logger
977
+ # A custom logger to use for request/response debug logging, or the value
978
+ # `:default` (the default) to construct a default logger, or `nil` to
979
+ # explicitly disable logging.
980
+ # @return [::Logger,:default,nil]
981
+ #
982
+ class Configuration
983
+ extend ::Gapic::Config
984
+
985
+ # @private
986
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
987
+ DEFAULT_ENDPOINT = "vectorsearch.googleapis.com"
988
+
989
+ config_attr :endpoint, nil, ::String, nil
990
+ config_attr :credentials, nil do |value|
991
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
992
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
993
+ allowed.any? { |klass| klass === value }
994
+ end
995
+ config_attr :scope, nil, ::String, ::Array, nil
996
+ config_attr :lib_name, nil, ::String, nil
997
+ config_attr :lib_version, nil, ::String, nil
998
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
999
+ config_attr :interceptors, nil, ::Array, nil
1000
+ config_attr :timeout, nil, ::Numeric, nil
1001
+ config_attr :metadata, nil, ::Hash, nil
1002
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1003
+ config_attr :quota_project, nil, ::String, nil
1004
+ config_attr :universe_domain, nil, ::String, nil
1005
+ config_attr :logger, :default, ::Logger, nil, :default
1006
+
1007
+ # @private
1008
+ def initialize parent_config = nil
1009
+ @parent_config = parent_config unless parent_config.nil?
1010
+
1011
+ yield self if block_given?
1012
+ end
1013
+
1014
+ ##
1015
+ # Configurations for individual RPCs
1016
+ # @return [Rpcs]
1017
+ #
1018
+ def rpcs
1019
+ @rpcs ||= begin
1020
+ parent_rpcs = nil
1021
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1022
+ Rpcs.new parent_rpcs
1023
+ end
1024
+ end
1025
+
1026
+ ##
1027
+ # Configuration for the channel pool
1028
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1029
+ #
1030
+ def channel_pool
1031
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1032
+ end
1033
+
1034
+ ##
1035
+ # Configuration RPC class for the DataObjectService API.
1036
+ #
1037
+ # Includes fields providing the configuration for each RPC in this service.
1038
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1039
+ # the following configuration fields:
1040
+ #
1041
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1042
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
1043
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1044
+ # include the following keys:
1045
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1046
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1047
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1048
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1049
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1050
+ # trigger a retry.
1051
+ #
1052
+ class Rpcs
1053
+ ##
1054
+ # RPC-specific configuration for `create_data_object`
1055
+ # @return [::Gapic::Config::Method]
1056
+ #
1057
+ attr_reader :create_data_object
1058
+ ##
1059
+ # RPC-specific configuration for `batch_create_data_objects`
1060
+ # @return [::Gapic::Config::Method]
1061
+ #
1062
+ attr_reader :batch_create_data_objects
1063
+ ##
1064
+ # RPC-specific configuration for `get_data_object`
1065
+ # @return [::Gapic::Config::Method]
1066
+ #
1067
+ attr_reader :get_data_object
1068
+ ##
1069
+ # RPC-specific configuration for `update_data_object`
1070
+ # @return [::Gapic::Config::Method]
1071
+ #
1072
+ attr_reader :update_data_object
1073
+ ##
1074
+ # RPC-specific configuration for `batch_update_data_objects`
1075
+ # @return [::Gapic::Config::Method]
1076
+ #
1077
+ attr_reader :batch_update_data_objects
1078
+ ##
1079
+ # RPC-specific configuration for `delete_data_object`
1080
+ # @return [::Gapic::Config::Method]
1081
+ #
1082
+ attr_reader :delete_data_object
1083
+ ##
1084
+ # RPC-specific configuration for `batch_delete_data_objects`
1085
+ # @return [::Gapic::Config::Method]
1086
+ #
1087
+ attr_reader :batch_delete_data_objects
1088
+
1089
+ # @private
1090
+ def initialize parent_rpcs = nil
1091
+ create_data_object_config = parent_rpcs.create_data_object if parent_rpcs.respond_to? :create_data_object
1092
+ @create_data_object = ::Gapic::Config::Method.new create_data_object_config
1093
+ batch_create_data_objects_config = parent_rpcs.batch_create_data_objects if parent_rpcs.respond_to? :batch_create_data_objects
1094
+ @batch_create_data_objects = ::Gapic::Config::Method.new batch_create_data_objects_config
1095
+ get_data_object_config = parent_rpcs.get_data_object if parent_rpcs.respond_to? :get_data_object
1096
+ @get_data_object = ::Gapic::Config::Method.new get_data_object_config
1097
+ update_data_object_config = parent_rpcs.update_data_object if parent_rpcs.respond_to? :update_data_object
1098
+ @update_data_object = ::Gapic::Config::Method.new update_data_object_config
1099
+ batch_update_data_objects_config = parent_rpcs.batch_update_data_objects if parent_rpcs.respond_to? :batch_update_data_objects
1100
+ @batch_update_data_objects = ::Gapic::Config::Method.new batch_update_data_objects_config
1101
+ delete_data_object_config = parent_rpcs.delete_data_object if parent_rpcs.respond_to? :delete_data_object
1102
+ @delete_data_object = ::Gapic::Config::Method.new delete_data_object_config
1103
+ batch_delete_data_objects_config = parent_rpcs.batch_delete_data_objects if parent_rpcs.respond_to? :batch_delete_data_objects
1104
+ @batch_delete_data_objects = ::Gapic::Config::Method.new batch_delete_data_objects_config
1105
+
1106
+ yield self if block_given?
1107
+ end
1108
+ end
1109
+ end
1110
+ end
1111
+ end
1112
+ end
1113
+ end
1114
+ end
1115
+ end