google-cloud-ai_platform-v1 0.22.0 → 0.24.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 (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +121 -0
  3. data/lib/google/cloud/ai_platform/v1/endpoint_service/paths.rb +35 -9
  4. data/lib/google/cloud/ai_platform/v1/featurestore_service/client.rb +2 -2
  5. data/lib/google/cloud/ai_platform/v1/job_service/paths.rb +57 -10
  6. data/lib/google/cloud/ai_platform/v1/match_service/client.rb +531 -0
  7. data/lib/google/cloud/ai_platform/v1/match_service/credentials.rb +47 -0
  8. data/lib/google/cloud/ai_platform/v1/match_service/paths.rb +52 -0
  9. data/lib/google/cloud/ai_platform/v1/match_service.rb +50 -0
  10. data/lib/google/cloud/ai_platform/v1/model_service/client.rb +4 -2
  11. data/lib/google/cloud/ai_platform/v1/model_service/paths.rb +36 -10
  12. data/lib/google/cloud/ai_platform/v1/pipeline_service/paths.rb +36 -10
  13. data/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb +35 -9
  14. data/lib/google/cloud/ai_platform/v1/tensorboard_service/client.rb +4 -4
  15. data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
  16. data/lib/google/cloud/ai_platform/v1.rb +1 -0
  17. data/lib/google/cloud/aiplatform/v1/accelerator_type_pb.rb +1 -0
  18. data/lib/google/cloud/aiplatform/v1/custom_job_pb.rb +2 -0
  19. data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +14 -0
  20. data/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb +5 -0
  21. data/lib/google/cloud/aiplatform/v1/entity_type_pb.rb +1 -0
  22. data/lib/google/cloud/aiplatform/v1/explanation_pb.rb +40 -0
  23. data/lib/google/cloud/aiplatform/v1/featurestore_pb.rb +1 -0
  24. data/lib/google/cloud/aiplatform/v1/match_service_pb.rb +63 -0
  25. data/lib/google/cloud/aiplatform/v1/match_service_services_pb.rb +49 -0
  26. data/lib/google/cloud/aiplatform/v1/model_pb.rb +1 -0
  27. data/proto_docs/google/api/client.rb +10 -1
  28. data/proto_docs/google/cloud/aiplatform/v1/accelerator_type.rb +3 -0
  29. data/proto_docs/google/cloud/aiplatform/v1/batch_prediction_job.rb +2 -2
  30. data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +10 -0
  31. data/proto_docs/google/cloud/aiplatform/v1/dataset.rb +4 -4
  32. data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +6 -5
  33. data/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb +50 -0
  34. data/proto_docs/google/cloud/aiplatform/v1/entity_type.rb +7 -0
  35. data/proto_docs/google/cloud/aiplatform/v1/evaluated_annotation.rb +0 -4
  36. data/proto_docs/google/cloud/aiplatform/v1/explanation.rb +91 -2
  37. data/proto_docs/google/cloud/aiplatform/v1/feature.rb +5 -4
  38. data/proto_docs/google/cloud/aiplatform/v1/featurestore.rb +8 -0
  39. data/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb +1 -1
  40. data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +2 -2
  41. data/proto_docs/google/cloud/aiplatform/v1/index_endpoint.rb +2 -2
  42. data/proto_docs/google/cloud/aiplatform/v1/match_service.rb +156 -0
  43. data/proto_docs/google/cloud/aiplatform/v1/model.rb +3 -0
  44. data/proto_docs/google/cloud/aiplatform/v1/model_service.rb +4 -2
  45. data/proto_docs/google/cloud/aiplatform/v1/pipeline_job.rb +1 -1
  46. data/proto_docs/google/cloud/aiplatform/v1/tensorboard_experiment.rb +8 -6
  47. data/proto_docs/google/cloud/aiplatform/v1/tensorboard_service.rb +7 -6
  48. metadata +9 -2
@@ -0,0 +1,531 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/aiplatform/v1/match_service_pb"
21
+ require "google/cloud/location"
22
+ require "google/iam/v1"
23
+
24
+ module Google
25
+ module Cloud
26
+ module AIPlatform
27
+ module V1
28
+ module MatchService
29
+ ##
30
+ # Client for the MatchService service.
31
+ #
32
+ # MatchService is a Google managed service for efficient vector similarity
33
+ # search at scale.
34
+ #
35
+ class Client
36
+ include Paths
37
+
38
+ # @private
39
+ attr_reader :match_service_stub
40
+
41
+ ##
42
+ # Configure the MatchService Client class.
43
+ #
44
+ # See {::Google::Cloud::AIPlatform::V1::MatchService::Client::Configuration}
45
+ # for a description of the configuration fields.
46
+ #
47
+ # @example
48
+ #
49
+ # # Modify the configuration for all MatchService clients
50
+ # ::Google::Cloud::AIPlatform::V1::MatchService::Client.configure do |config|
51
+ # config.timeout = 10.0
52
+ # end
53
+ #
54
+ # @yield [config] Configure the Client client.
55
+ # @yieldparam config [Client::Configuration]
56
+ #
57
+ # @return [Client::Configuration]
58
+ #
59
+ def self.configure
60
+ @configure ||= begin
61
+ namespace = ["Google", "Cloud", "AIPlatform", "V1"]
62
+ parent_config = while namespace.any?
63
+ parent_name = namespace.join "::"
64
+ parent_const = const_get parent_name
65
+ break parent_const.configure if parent_const.respond_to? :configure
66
+ namespace.pop
67
+ end
68
+ default_config = Client::Configuration.new parent_config
69
+
70
+ default_config
71
+ end
72
+ yield @configure if block_given?
73
+ @configure
74
+ end
75
+
76
+ ##
77
+ # Configure the MatchService Client instance.
78
+ #
79
+ # The configuration is set to the derived mode, meaning that values can be changed,
80
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
81
+ # should be made on {Client.configure}.
82
+ #
83
+ # See {::Google::Cloud::AIPlatform::V1::MatchService::Client::Configuration}
84
+ # for a description of the configuration fields.
85
+ #
86
+ # @yield [config] Configure the Client client.
87
+ # @yieldparam config [Client::Configuration]
88
+ #
89
+ # @return [Client::Configuration]
90
+ #
91
+ def configure
92
+ yield @config if block_given?
93
+ @config
94
+ end
95
+
96
+ ##
97
+ # Create a new MatchService client object.
98
+ #
99
+ # @example
100
+ #
101
+ # # Create a client using the default configuration
102
+ # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new
103
+ #
104
+ # # Create a client using a custom configuration
105
+ # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new do |config|
106
+ # config.timeout = 10.0
107
+ # end
108
+ #
109
+ # @yield [config] Configure the MatchService client.
110
+ # @yieldparam config [Client::Configuration]
111
+ #
112
+ def initialize
113
+ # These require statements are intentionally placed here to initialize
114
+ # the gRPC module only when it's required.
115
+ # See https://github.com/googleapis/toolkit/issues/446
116
+ require "gapic/grpc"
117
+ require "google/cloud/aiplatform/v1/match_service_services_pb"
118
+
119
+ # Create the configuration object
120
+ @config = Configuration.new Client.configure
121
+
122
+ # Yield the configuration if needed
123
+ yield @config if block_given?
124
+
125
+ # Create credentials
126
+ credentials = @config.credentials
127
+ # Use self-signed JWT if the endpoint is unchanged from default,
128
+ # but only if the default endpoint does not have a region prefix.
129
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
130
+ !@config.endpoint.split(".").first.include?("-")
131
+ credentials ||= Credentials.default scope: @config.scope,
132
+ enable_self_signed_jwt: enable_self_signed_jwt
133
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
134
+ credentials = Credentials.new credentials, scope: @config.scope
135
+ end
136
+ @quota_project_id = @config.quota_project
137
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
138
+
139
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
140
+ config.credentials = credentials
141
+ config.quota_project = @quota_project_id
142
+ config.endpoint = @config.endpoint
143
+ end
144
+
145
+ @iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
146
+ config.credentials = credentials
147
+ config.quota_project = @quota_project_id
148
+ config.endpoint = @config.endpoint
149
+ end
150
+
151
+ @match_service_stub = ::Gapic::ServiceStub.new(
152
+ ::Google::Cloud::AIPlatform::V1::MatchService::Stub,
153
+ credentials: credentials,
154
+ endpoint: @config.endpoint,
155
+ channel_args: @config.channel_args,
156
+ interceptors: @config.interceptors
157
+ )
158
+ end
159
+
160
+ ##
161
+ # Get the associated client for mix-in of the Locations.
162
+ #
163
+ # @return [Google::Cloud::Location::Locations::Client]
164
+ #
165
+ attr_reader :location_client
166
+
167
+ ##
168
+ # Get the associated client for mix-in of the IAMPolicy.
169
+ #
170
+ # @return [Google::Iam::V1::IAMPolicy::Client]
171
+ #
172
+ attr_reader :iam_policy_client
173
+
174
+ # Service calls
175
+
176
+ ##
177
+ # Finds the nearest neighbors of each vector within the request.
178
+ #
179
+ # @overload find_neighbors(request, options = nil)
180
+ # Pass arguments to `find_neighbors` via a request object, either of type
181
+ # {::Google::Cloud::AIPlatform::V1::FindNeighborsRequest} or an equivalent Hash.
182
+ #
183
+ # @param request [::Google::Cloud::AIPlatform::V1::FindNeighborsRequest, ::Hash]
184
+ # A request object representing the call parameters. Required. To specify no
185
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
186
+ # @param options [::Gapic::CallOptions, ::Hash]
187
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
188
+ #
189
+ # @overload find_neighbors(index_endpoint: nil, deployed_index_id: nil, queries: nil, return_full_datapoint: nil)
190
+ # Pass arguments to `find_neighbors` via keyword arguments. Note that at
191
+ # least one keyword argument is required. To specify no parameters, or to keep all
192
+ # the default parameter values, pass an empty Hash as a request object (see above).
193
+ #
194
+ # @param index_endpoint [::String]
195
+ # Required. The name of the index endpoint.
196
+ # Format:
197
+ # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
198
+ # @param deployed_index_id [::String]
199
+ # The ID of the DeployedIndex that will serve the request. This request is
200
+ # sent to a specific IndexEndpoint, as per the IndexEndpoint.network. That
201
+ # IndexEndpoint also has IndexEndpoint.deployed_indexes, and each such index
202
+ # has a DeployedIndex.id field.
203
+ # The value of the field below must equal one of the DeployedIndex.id
204
+ # fields of the IndexEndpoint that is being called for this request.
205
+ # @param queries [::Array<::Google::Cloud::AIPlatform::V1::FindNeighborsRequest::Query, ::Hash>]
206
+ # The list of queries.
207
+ # @param return_full_datapoint [::Boolean]
208
+ # If set to true, the full datapoints (including all vector values and
209
+ # restricts) of the nearest neighbors are returned.
210
+ # Note that returning full datapoint will significantly increase the
211
+ # latency and cost of the query.
212
+ #
213
+ # @yield [response, operation] Access the result along with the RPC operation
214
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse]
215
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
216
+ #
217
+ # @return [::Google::Cloud::AIPlatform::V1::FindNeighborsResponse]
218
+ #
219
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
220
+ #
221
+ # @example Basic example
222
+ # require "google/cloud/ai_platform/v1"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::AIPlatform::V1::MatchService::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::AIPlatform::V1::FindNeighborsRequest.new
229
+ #
230
+ # # Call the find_neighbors method.
231
+ # result = client.find_neighbors request
232
+ #
233
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::FindNeighborsResponse.
234
+ # p result
235
+ #
236
+ def find_neighbors request, options = nil
237
+ raise ::ArgumentError, "request must be provided" if request.nil?
238
+
239
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::FindNeighborsRequest
240
+
241
+ # Converts hash and nil to an options object
242
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
243
+
244
+ # Customize the options with defaults
245
+ metadata = @config.rpcs.find_neighbors.metadata.to_h
246
+
247
+ # Set x-goog-api-client and x-goog-user-project headers
248
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
249
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
250
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
251
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
252
+
253
+ header_params = {}
254
+ if request.index_endpoint
255
+ header_params["index_endpoint"] = request.index_endpoint
256
+ end
257
+
258
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
259
+ metadata[:"x-goog-request-params"] ||= request_params_header
260
+
261
+ options.apply_defaults timeout: @config.rpcs.find_neighbors.timeout,
262
+ metadata: metadata,
263
+ retry_policy: @config.rpcs.find_neighbors.retry_policy
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
267
+ retry_policy: @config.retry_policy
268
+
269
+ @match_service_stub.call_rpc :find_neighbors, request, options: options do |response, operation|
270
+ yield response, operation if block_given?
271
+ return response
272
+ end
273
+ rescue ::GRPC::BadStatus => e
274
+ raise ::Google::Cloud::Error.from_error(e)
275
+ end
276
+
277
+ ##
278
+ # Reads the datapoints/vectors of the given IDs.
279
+ # A maximum of 1000 datapoints can be retrieved in a batch.
280
+ #
281
+ # @overload read_index_datapoints(request, options = nil)
282
+ # Pass arguments to `read_index_datapoints` via a request object, either of type
283
+ # {::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest} or an equivalent Hash.
284
+ #
285
+ # @param request [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest, ::Hash]
286
+ # A request object representing the call parameters. Required. To specify no
287
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
288
+ # @param options [::Gapic::CallOptions, ::Hash]
289
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
290
+ #
291
+ # @overload read_index_datapoints(index_endpoint: nil, deployed_index_id: nil, ids: nil)
292
+ # Pass arguments to `read_index_datapoints` via keyword arguments. Note that at
293
+ # least one keyword argument is required. To specify no parameters, or to keep all
294
+ # the default parameter values, pass an empty Hash as a request object (see above).
295
+ #
296
+ # @param index_endpoint [::String]
297
+ # Required. The name of the index endpoint.
298
+ # Format:
299
+ # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
300
+ # @param deployed_index_id [::String]
301
+ # The ID of the DeployedIndex that will serve the request.
302
+ # @param ids [::Array<::String>]
303
+ # IDs of the datapoints to be searched for.
304
+ #
305
+ # @yield [response, operation] Access the result along with the RPC operation
306
+ # @yieldparam response [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse]
307
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
308
+ #
309
+ # @return [::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse]
310
+ #
311
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
312
+ #
313
+ # @example Basic example
314
+ # require "google/cloud/ai_platform/v1"
315
+ #
316
+ # # Create a client object. The client can be reused for multiple calls.
317
+ # client = Google::Cloud::AIPlatform::V1::MatchService::Client.new
318
+ #
319
+ # # Create a request. To set request fields, pass in keyword arguments.
320
+ # request = Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest.new
321
+ #
322
+ # # Call the read_index_datapoints method.
323
+ # result = client.read_index_datapoints request
324
+ #
325
+ # # The returned object is of type Google::Cloud::AIPlatform::V1::ReadIndexDatapointsResponse.
326
+ # p result
327
+ #
328
+ def read_index_datapoints request, options = nil
329
+ raise ::ArgumentError, "request must be provided" if request.nil?
330
+
331
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ReadIndexDatapointsRequest
332
+
333
+ # Converts hash and nil to an options object
334
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
335
+
336
+ # Customize the options with defaults
337
+ metadata = @config.rpcs.read_index_datapoints.metadata.to_h
338
+
339
+ # Set x-goog-api-client and x-goog-user-project headers
340
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
341
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
342
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
343
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
344
+
345
+ header_params = {}
346
+ if request.index_endpoint
347
+ header_params["index_endpoint"] = request.index_endpoint
348
+ end
349
+
350
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
351
+ metadata[:"x-goog-request-params"] ||= request_params_header
352
+
353
+ options.apply_defaults timeout: @config.rpcs.read_index_datapoints.timeout,
354
+ metadata: metadata,
355
+ retry_policy: @config.rpcs.read_index_datapoints.retry_policy
356
+
357
+ options.apply_defaults timeout: @config.timeout,
358
+ metadata: @config.metadata,
359
+ retry_policy: @config.retry_policy
360
+
361
+ @match_service_stub.call_rpc :read_index_datapoints, request, options: options do |response, operation|
362
+ yield response, operation if block_given?
363
+ return response
364
+ end
365
+ rescue ::GRPC::BadStatus => e
366
+ raise ::Google::Cloud::Error.from_error(e)
367
+ end
368
+
369
+ ##
370
+ # Configuration class for the MatchService API.
371
+ #
372
+ # This class represents the configuration for MatchService,
373
+ # providing control over timeouts, retry behavior, logging, transport
374
+ # parameters, and other low-level controls. Certain parameters can also be
375
+ # applied individually to specific RPCs. See
376
+ # {::Google::Cloud::AIPlatform::V1::MatchService::Client::Configuration::Rpcs}
377
+ # for a list of RPCs that can be configured independently.
378
+ #
379
+ # Configuration can be applied globally to all clients, or to a single client
380
+ # on construction.
381
+ #
382
+ # @example
383
+ #
384
+ # # Modify the global config, setting the timeout for
385
+ # # find_neighbors to 20 seconds,
386
+ # # and all remaining timeouts to 10 seconds.
387
+ # ::Google::Cloud::AIPlatform::V1::MatchService::Client.configure do |config|
388
+ # config.timeout = 10.0
389
+ # config.rpcs.find_neighbors.timeout = 20.0
390
+ # end
391
+ #
392
+ # # Apply the above configuration only to a new client.
393
+ # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new do |config|
394
+ # config.timeout = 10.0
395
+ # config.rpcs.find_neighbors.timeout = 20.0
396
+ # end
397
+ #
398
+ # @!attribute [rw] endpoint
399
+ # The hostname or hostname:port of the service endpoint.
400
+ # Defaults to `"aiplatform.googleapis.com"`.
401
+ # @return [::String]
402
+ # @!attribute [rw] credentials
403
+ # Credentials to send with calls. You may provide any of the following types:
404
+ # * (`String`) The path to a service account key file in JSON format
405
+ # * (`Hash`) A service account key as a Hash
406
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
407
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
408
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
409
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
410
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
411
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
412
+ # * (`nil`) indicating no credentials
413
+ # @return [::Object]
414
+ # @!attribute [rw] scope
415
+ # The OAuth scopes
416
+ # @return [::Array<::String>]
417
+ # @!attribute [rw] lib_name
418
+ # The library name as recorded in instrumentation and logging
419
+ # @return [::String]
420
+ # @!attribute [rw] lib_version
421
+ # The library version as recorded in instrumentation and logging
422
+ # @return [::String]
423
+ # @!attribute [rw] channel_args
424
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
425
+ # `GRPC::Core::Channel` object is provided as the credential.
426
+ # @return [::Hash]
427
+ # @!attribute [rw] interceptors
428
+ # An array of interceptors that are run before calls are executed.
429
+ # @return [::Array<::GRPC::ClientInterceptor>]
430
+ # @!attribute [rw] timeout
431
+ # The call timeout in seconds.
432
+ # @return [::Numeric]
433
+ # @!attribute [rw] metadata
434
+ # Additional gRPC headers to be sent with the call.
435
+ # @return [::Hash{::Symbol=>::String}]
436
+ # @!attribute [rw] retry_policy
437
+ # The retry policy. The value is a hash with the following keys:
438
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
439
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
440
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
441
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
442
+ # trigger a retry.
443
+ # @return [::Hash]
444
+ # @!attribute [rw] quota_project
445
+ # A separate project against which to charge quota.
446
+ # @return [::String]
447
+ #
448
+ class Configuration
449
+ extend ::Gapic::Config
450
+
451
+ config_attr :endpoint, "aiplatform.googleapis.com", ::String
452
+ config_attr :credentials, nil do |value|
453
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
454
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
455
+ allowed.any? { |klass| klass === value }
456
+ end
457
+ config_attr :scope, nil, ::String, ::Array, nil
458
+ config_attr :lib_name, nil, ::String, nil
459
+ config_attr :lib_version, nil, ::String, nil
460
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
461
+ config_attr :interceptors, nil, ::Array, nil
462
+ config_attr :timeout, nil, ::Numeric, nil
463
+ config_attr :metadata, nil, ::Hash, nil
464
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
465
+ config_attr :quota_project, nil, ::String, nil
466
+
467
+ # @private
468
+ def initialize parent_config = nil
469
+ @parent_config = parent_config unless parent_config.nil?
470
+
471
+ yield self if block_given?
472
+ end
473
+
474
+ ##
475
+ # Configurations for individual RPCs
476
+ # @return [Rpcs]
477
+ #
478
+ def rpcs
479
+ @rpcs ||= begin
480
+ parent_rpcs = nil
481
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
482
+ Rpcs.new parent_rpcs
483
+ end
484
+ end
485
+
486
+ ##
487
+ # Configuration RPC class for the MatchService API.
488
+ #
489
+ # Includes fields providing the configuration for each RPC in this service.
490
+ # Each configuration object is of type `Gapic::Config::Method` and includes
491
+ # the following configuration fields:
492
+ #
493
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
494
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
495
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
496
+ # include the following keys:
497
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
498
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
499
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
500
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
501
+ # trigger a retry.
502
+ #
503
+ class Rpcs
504
+ ##
505
+ # RPC-specific configuration for `find_neighbors`
506
+ # @return [::Gapic::Config::Method]
507
+ #
508
+ attr_reader :find_neighbors
509
+ ##
510
+ # RPC-specific configuration for `read_index_datapoints`
511
+ # @return [::Gapic::Config::Method]
512
+ #
513
+ attr_reader :read_index_datapoints
514
+
515
+ # @private
516
+ def initialize parent_rpcs = nil
517
+ find_neighbors_config = parent_rpcs.find_neighbors if parent_rpcs.respond_to? :find_neighbors
518
+ @find_neighbors = ::Gapic::Config::Method.new find_neighbors_config
519
+ read_index_datapoints_config = parent_rpcs.read_index_datapoints if parent_rpcs.respond_to? :read_index_datapoints
520
+ @read_index_datapoints = ::Gapic::Config::Method.new read_index_datapoints_config
521
+
522
+ yield self if block_given?
523
+ end
524
+ end
525
+ end
526
+ end
527
+ end
528
+ end
529
+ end
530
+ end
531
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module AIPlatform
24
+ module V1
25
+ module MatchService
26
+ # Credentials for the MatchService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform"
30
+ ]
31
+ self.env_vars = [
32
+ "GOOGLE_CLOUD_CREDENTIALS",
33
+ "GOOGLE_CLOUD_KEYFILE",
34
+ "GCLOUD_KEYFILE",
35
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
36
+ "GOOGLE_CLOUD_KEYFILE_JSON",
37
+ "GCLOUD_KEYFILE_JSON"
38
+ ]
39
+ self.paths = [
40
+ "~/.config/google_cloud/application_default_credentials.json"
41
+ ]
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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
+
20
+ module Google
21
+ module Cloud
22
+ module AIPlatform
23
+ module V1
24
+ module MatchService
25
+ # Path helper methods for the MatchService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified IndexEndpoint resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param index_endpoint [String]
37
+ #
38
+ # @return [::String]
39
+ def index_endpoint_path project:, location:, index_endpoint:
40
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
41
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
42
+
43
+ "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}"
44
+ end
45
+
46
+ extend self
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,50 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/ai_platform/v1/version"
24
+
25
+ require "google/cloud/ai_platform/v1/match_service/credentials"
26
+ require "google/cloud/ai_platform/v1/match_service/paths"
27
+ require "google/cloud/ai_platform/v1/match_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module AIPlatform
32
+ module V1
33
+ ##
34
+ # MatchService is a Google managed service for efficient vector similarity
35
+ # search at scale.
36
+ #
37
+ # @example Load this service and instantiate a gRPC client
38
+ #
39
+ # require "google/cloud/ai_platform/v1/match_service"
40
+ # client = ::Google::Cloud::AIPlatform::V1::MatchService::Client.new
41
+ #
42
+ module MatchService
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+
49
+ helper_path = ::File.join __dir__, "match_service", "helpers.rb"
50
+ require "google/cloud/ai_platform/v1/match_service/helpers" if ::File.file? helper_path