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