google-cloud-discovery_engine-v1beta 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +742 -0
  3. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/paths.rb +199 -0
  4. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +693 -0
  5. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +520 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +48 -23
  7. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +21 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +48 -23
  9. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +296 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +275 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +180 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +449 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/credentials.rb +47 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +52 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +416 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +129 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest.rb +52 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service.rb +55 -0
  19. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +459 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/rank_service/credentials.rb +47 -0
  21. data/lib/google/cloud/discovery_engine/v1beta/rank_service/paths.rb +52 -0
  22. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +426 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +129 -0
  24. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest.rb +52 -0
  25. data/lib/google/cloud/discovery_engine/v1beta/rank_service.rb +55 -0
  26. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -0
  27. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +11 -6
  28. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +11 -6
  29. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  30. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -0
  31. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +67 -0
  32. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  33. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +32 -1
  34. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_services_pb.rb +25 -0
  35. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +1 -1
  36. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +3 -1
  37. data/lib/google/cloud/discoveryengine/v1beta/engine_service_pb.rb +6 -1
  38. data/lib/google/cloud/discoveryengine/v1beta/engine_service_services_pb.rb +12 -0
  39. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +52 -0
  40. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +45 -0
  41. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +46 -0
  42. data/lib/google/cloud/discoveryengine/v1beta/import_config_pb.rb +13 -1
  43. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +49 -0
  44. data/lib/google/cloud/discoveryengine/v1beta/rank_service_services_pb.rb +45 -0
  45. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +7 -1
  46. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +1 -1
  47. data/lib/google/cloud/discoveryengine/v1beta/session_pb.rb +50 -0
  48. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +354 -0
  49. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +9 -1
  50. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +475 -0
  51. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +3 -5
  52. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +4 -0
  53. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +2 -2
  54. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +51 -0
  55. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +106 -0
  56. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +76 -0
  57. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +310 -24
  58. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +99 -0
  59. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +154 -22
  60. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +16 -1
  61. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +85 -0
  62. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +1 -1
  63. metadata +28 -2
@@ -0,0 +1,459 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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/discoveryengine/v1beta/rank_service_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module DiscoveryEngine
26
+ module V1beta
27
+ module RankService
28
+ ##
29
+ # Client for the RankService service.
30
+ #
31
+ # Service for ranking text records.
32
+ #
33
+ class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
+
37
+ include Paths
38
+
39
+ # @private
40
+ attr_reader :rank_service_stub
41
+
42
+ ##
43
+ # Configure the RankService Client class.
44
+ #
45
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client::Configuration}
46
+ # for a description of the configuration fields.
47
+ #
48
+ # @example
49
+ #
50
+ # # Modify the configuration for all RankService clients
51
+ # ::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client.configure do |config|
52
+ # config.timeout = 10.0
53
+ # end
54
+ #
55
+ # @yield [config] Configure the Client client.
56
+ # @yieldparam config [Client::Configuration]
57
+ #
58
+ # @return [Client::Configuration]
59
+ #
60
+ def self.configure
61
+ @configure ||= begin
62
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
63
+ parent_config = while namespace.any?
64
+ parent_name = namespace.join "::"
65
+ parent_const = const_get parent_name
66
+ break parent_const.configure if parent_const.respond_to? :configure
67
+ namespace.pop
68
+ end
69
+ default_config = Client::Configuration.new parent_config
70
+
71
+ default_config.timeout = 30.0
72
+ default_config.retry_policy = {
73
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
74
+ }
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the RankService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # The effective universe domain
104
+ #
105
+ # @return [String]
106
+ #
107
+ def universe_domain
108
+ @rank_service_stub.universe_domain
109
+ end
110
+
111
+ ##
112
+ # Create a new RankService client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the RankService client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ def initialize
128
+ # These require statements are intentionally placed here to initialize
129
+ # the gRPC module only when it's required.
130
+ # See https://github.com/googleapis/toolkit/issues/446
131
+ require "gapic/grpc"
132
+ require "google/cloud/discoveryengine/v1beta/rank_service_services_pb"
133
+
134
+ # Create the configuration object
135
+ @config = Configuration.new Client.configure
136
+
137
+ # Yield the configuration if needed
138
+ yield @config if block_given?
139
+
140
+ # Create credentials
141
+ credentials = @config.credentials
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
143
+ # but only if the default endpoint does not have a region prefix.
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
147
+ credentials ||= Credentials.default scope: @config.scope,
148
+ enable_self_signed_jwt: enable_self_signed_jwt
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
150
+ credentials = Credentials.new credentials, scope: @config.scope
151
+ end
152
+ @quota_project_id = @config.quota_project
153
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
154
+
155
+ @rank_service_stub = ::Gapic::ServiceStub.new(
156
+ ::Google::Cloud::DiscoveryEngine::V1beta::RankService::Stub,
157
+ credentials: credentials,
158
+ endpoint: @config.endpoint,
159
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
160
+ universe_domain: @config.universe_domain,
161
+ channel_args: @config.channel_args,
162
+ interceptors: @config.interceptors,
163
+ channel_pool_config: @config.channel_pool
164
+ )
165
+
166
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
167
+ config.credentials = credentials
168
+ config.quota_project = @quota_project_id
169
+ config.endpoint = @rank_service_stub.endpoint
170
+ config.universe_domain = @rank_service_stub.universe_domain
171
+ end
172
+ end
173
+
174
+ ##
175
+ # Get the associated client for mix-in of the Locations.
176
+ #
177
+ # @return [Google::Cloud::Location::Locations::Client]
178
+ #
179
+ attr_reader :location_client
180
+
181
+ # Service calls
182
+
183
+ ##
184
+ # Ranks a list of text records based on the given input query.
185
+ #
186
+ # @overload rank(request, options = nil)
187
+ # Pass arguments to `rank` via a request object, either of type
188
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankRequest} or an equivalent Hash.
189
+ #
190
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::RankRequest, ::Hash]
191
+ # A request object representing the call parameters. Required. To specify no
192
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
193
+ # @param options [::Gapic::CallOptions, ::Hash]
194
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
195
+ #
196
+ # @overload rank(ranking_config: nil, model: nil, top_n: nil, query: nil, records: nil, ignore_record_details_in_response: nil)
197
+ # Pass arguments to `rank` via keyword arguments. Note that at
198
+ # least one keyword argument is required. To specify no parameters, or to keep all
199
+ # the default parameter values, pass an empty Hash as a request object (see above).
200
+ #
201
+ # @param ranking_config [::String]
202
+ # Required. The resource name of the rank service config, such as
203
+ # `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`.
204
+ # @param model [::String]
205
+ # The identifier of the model to use. It is one of:
206
+ #
207
+ # * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input
208
+ # token size 512.
209
+ #
210
+ # It is set to `semantic-ranker-512@latest` by default if unspecified.
211
+ # @param top_n [::Integer]
212
+ # The number of results to return. If this is unset or no bigger than zero,
213
+ # returns all results.
214
+ # @param query [::String]
215
+ # The query to use.
216
+ # @param records [::Array<::Google::Cloud::DiscoveryEngine::V1beta::RankingRecord, ::Hash>]
217
+ # Required. A list of records to rank. At most 200 records to rank.
218
+ # @param ignore_record_details_in_response [::Boolean]
219
+ # If true, the response will contain only record ID and score. By default, it
220
+ # is false, the response will contain record details.
221
+ #
222
+ # @yield [response, operation] Access the result along with the RPC operation
223
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::RankResponse]
224
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
225
+ #
226
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::RankResponse]
227
+ #
228
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
229
+ #
230
+ # @example Basic example
231
+ # require "google/cloud/discovery_engine/v1beta"
232
+ #
233
+ # # Create a client object. The client can be reused for multiple calls.
234
+ # client = Google::Cloud::DiscoveryEngine::V1beta::RankService::Client.new
235
+ #
236
+ # # Create a request. To set request fields, pass in keyword arguments.
237
+ # request = Google::Cloud::DiscoveryEngine::V1beta::RankRequest.new
238
+ #
239
+ # # Call the rank method.
240
+ # result = client.rank request
241
+ #
242
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::RankResponse.
243
+ # p result
244
+ #
245
+ def rank request, options = nil
246
+ raise ::ArgumentError, "request must be provided" if request.nil?
247
+
248
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::RankRequest
249
+
250
+ # Converts hash and nil to an options object
251
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
252
+
253
+ # Customize the options with defaults
254
+ metadata = @config.rpcs.rank.metadata.to_h
255
+
256
+ # Set x-goog-api-client and x-goog-user-project headers
257
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
258
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
259
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
260
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
261
+
262
+ header_params = {}
263
+ if request.ranking_config
264
+ header_params["ranking_config"] = request.ranking_config
265
+ end
266
+
267
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
268
+ metadata[:"x-goog-request-params"] ||= request_params_header
269
+
270
+ options.apply_defaults timeout: @config.rpcs.rank.timeout,
271
+ metadata: metadata,
272
+ retry_policy: @config.rpcs.rank.retry_policy
273
+
274
+ options.apply_defaults timeout: @config.timeout,
275
+ metadata: @config.metadata,
276
+ retry_policy: @config.retry_policy
277
+
278
+ @rank_service_stub.call_rpc :rank, request, options: options do |response, operation|
279
+ yield response, operation if block_given?
280
+ return response
281
+ end
282
+ rescue ::GRPC::BadStatus => e
283
+ raise ::Google::Cloud::Error.from_error(e)
284
+ end
285
+
286
+ ##
287
+ # Configuration class for the RankService API.
288
+ #
289
+ # This class represents the configuration for RankService,
290
+ # providing control over timeouts, retry behavior, logging, transport
291
+ # parameters, and other low-level controls. Certain parameters can also be
292
+ # applied individually to specific RPCs. See
293
+ # {::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client::Configuration::Rpcs}
294
+ # for a list of RPCs that can be configured independently.
295
+ #
296
+ # Configuration can be applied globally to all clients, or to a single client
297
+ # on construction.
298
+ #
299
+ # @example
300
+ #
301
+ # # Modify the global config, setting the timeout for
302
+ # # rank to 20 seconds,
303
+ # # and all remaining timeouts to 10 seconds.
304
+ # ::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client.configure do |config|
305
+ # config.timeout = 10.0
306
+ # config.rpcs.rank.timeout = 20.0
307
+ # end
308
+ #
309
+ # # Apply the above configuration only to a new client.
310
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::RankService::Client.new do |config|
311
+ # config.timeout = 10.0
312
+ # config.rpcs.rank.timeout = 20.0
313
+ # end
314
+ #
315
+ # @!attribute [rw] endpoint
316
+ # A custom service endpoint, as a hostname or hostname:port. The default is
317
+ # nil, indicating to use the default endpoint in the current universe domain.
318
+ # @return [::String,nil]
319
+ # @!attribute [rw] credentials
320
+ # Credentials to send with calls. You may provide any of the following types:
321
+ # * (`String`) The path to a service account key file in JSON format
322
+ # * (`Hash`) A service account key as a Hash
323
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
324
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
325
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
326
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
327
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
328
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
329
+ # * (`nil`) indicating no credentials
330
+ # @return [::Object]
331
+ # @!attribute [rw] scope
332
+ # The OAuth scopes
333
+ # @return [::Array<::String>]
334
+ # @!attribute [rw] lib_name
335
+ # The library name as recorded in instrumentation and logging
336
+ # @return [::String]
337
+ # @!attribute [rw] lib_version
338
+ # The library version as recorded in instrumentation and logging
339
+ # @return [::String]
340
+ # @!attribute [rw] channel_args
341
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
342
+ # `GRPC::Core::Channel` object is provided as the credential.
343
+ # @return [::Hash]
344
+ # @!attribute [rw] interceptors
345
+ # An array of interceptors that are run before calls are executed.
346
+ # @return [::Array<::GRPC::ClientInterceptor>]
347
+ # @!attribute [rw] timeout
348
+ # The call timeout in seconds.
349
+ # @return [::Numeric]
350
+ # @!attribute [rw] metadata
351
+ # Additional gRPC headers to be sent with the call.
352
+ # @return [::Hash{::Symbol=>::String}]
353
+ # @!attribute [rw] retry_policy
354
+ # The retry policy. The value is a hash with the following keys:
355
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
356
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
357
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
358
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
359
+ # trigger a retry.
360
+ # @return [::Hash]
361
+ # @!attribute [rw] quota_project
362
+ # A separate project against which to charge quota.
363
+ # @return [::String]
364
+ # @!attribute [rw] universe_domain
365
+ # The universe domain within which to make requests. This determines the
366
+ # default endpoint URL. The default value of nil uses the environment
367
+ # universe (usually the default "googleapis.com" universe).
368
+ # @return [::String,nil]
369
+ #
370
+ class Configuration
371
+ extend ::Gapic::Config
372
+
373
+ # @private
374
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
375
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
376
+
377
+ config_attr :endpoint, nil, ::String, nil
378
+ config_attr :credentials, nil do |value|
379
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
380
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
381
+ allowed.any? { |klass| klass === value }
382
+ end
383
+ config_attr :scope, nil, ::String, ::Array, nil
384
+ config_attr :lib_name, nil, ::String, nil
385
+ config_attr :lib_version, nil, ::String, nil
386
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
387
+ config_attr :interceptors, nil, ::Array, nil
388
+ config_attr :timeout, nil, ::Numeric, nil
389
+ config_attr :metadata, nil, ::Hash, nil
390
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
391
+ config_attr :quota_project, nil, ::String, nil
392
+ config_attr :universe_domain, nil, ::String, nil
393
+
394
+ # @private
395
+ def initialize parent_config = nil
396
+ @parent_config = parent_config unless parent_config.nil?
397
+
398
+ yield self if block_given?
399
+ end
400
+
401
+ ##
402
+ # Configurations for individual RPCs
403
+ # @return [Rpcs]
404
+ #
405
+ def rpcs
406
+ @rpcs ||= begin
407
+ parent_rpcs = nil
408
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
409
+ Rpcs.new parent_rpcs
410
+ end
411
+ end
412
+
413
+ ##
414
+ # Configuration for the channel pool
415
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
416
+ #
417
+ def channel_pool
418
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
419
+ end
420
+
421
+ ##
422
+ # Configuration RPC class for the RankService API.
423
+ #
424
+ # Includes fields providing the configuration for each RPC in this service.
425
+ # Each configuration object is of type `Gapic::Config::Method` and includes
426
+ # the following configuration fields:
427
+ #
428
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
429
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
430
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
431
+ # include the following keys:
432
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
433
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
434
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
435
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
436
+ # trigger a retry.
437
+ #
438
+ class Rpcs
439
+ ##
440
+ # RPC-specific configuration for `rank`
441
+ # @return [::Gapic::Config::Method]
442
+ #
443
+ attr_reader :rank
444
+
445
+ # @private
446
+ def initialize parent_rpcs = nil
447
+ rank_config = parent_rpcs.rank if parent_rpcs.respond_to? :rank
448
+ @rank = ::Gapic::Config::Method.new rank_config
449
+
450
+ yield self if block_given?
451
+ end
452
+ end
453
+ end
454
+ end
455
+ end
456
+ end
457
+ end
458
+ end
459
+ end
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2024 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 DiscoveryEngine
24
+ module V1beta
25
+ module RankService
26
+ # Credentials for the RankService 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 2024 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 DiscoveryEngine
23
+ module V1beta
24
+ module RankService
25
+ # Path helper methods for the RankService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified RankingConfig resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/locations/{location}/rankingConfigs/{ranking_config}`
33
+ #
34
+ # @param project [String]
35
+ # @param location [String]
36
+ # @param ranking_config [String]
37
+ #
38
+ # @return [::String]
39
+ def ranking_config_path project:, location:, ranking_config:
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}/rankingConfigs/#{ranking_config}"
44
+ end
45
+
46
+ extend self
47
+ end
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end