google-cloud-discovery_engine-v1beta 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +5 -1
  3. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +5 -1
  4. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/paths.rb +94 -0
  5. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +1 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +3 -1
  7. data/lib/google/cloud/discovery_engine/v1beta/search_service/paths.rb +45 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +3 -1
  9. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +469 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/credentials.rb +47 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +801 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/paths.rb +78 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +436 -0
  14. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +1077 -0
  15. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +129 -0
  16. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest.rb +53 -0
  17. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service.rb +56 -0
  18. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +5 -4
  19. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/paths.rb +21 -0
  20. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +5 -4
  21. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest.rb +2 -1
  22. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service.rb +2 -1
  23. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  24. data/lib/google/cloud/discovery_engine/v1beta.rb +1 -0
  25. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  26. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +5 -1
  27. data/lib/google/cloud/discoveryengine/v1beta/document_pb.rb +3 -1
  28. data/lib/google/cloud/discoveryengine/v1beta/document_processing_config_pb.rb +48 -0
  29. data/lib/google/cloud/discoveryengine/v1beta/purge_config_pb.rb +1 -1
  30. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +2 -1
  31. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +57 -0
  32. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_services_pb.rb +45 -0
  33. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_pb.rb +1 -1
  34. data/lib/google/cloud/discoveryengine/v1beta/serving_config_service_services_pb.rb +2 -1
  35. data/proto_docs/google/api/client.rb +4 -0
  36. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +5 -0
  37. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +20 -0
  38. data/proto_docs/google/cloud/discoveryengine/v1beta/document.rb +7 -0
  39. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +103 -0
  40. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +3 -0
  41. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +17 -4
  42. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +126 -0
  43. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +4 -3
  44. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +3 -3
  45. metadata +16 -2
@@ -0,0 +1,78 @@
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 SearchTuningService
25
+ # Path helper methods for the SearchTuningService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified DataStore resource string.
29
+ #
30
+ # @overload data_store_path(project:, location:, data_store:)
31
+ # The resource will be in the following format:
32
+ #
33
+ # `projects/{project}/locations/{location}/dataStores/{data_store}`
34
+ #
35
+ # @param project [String]
36
+ # @param location [String]
37
+ # @param data_store [String]
38
+ #
39
+ # @overload data_store_path(project:, location:, collection:, data_store:)
40
+ # The resource will be in the following format:
41
+ #
42
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}`
43
+ #
44
+ # @param project [String]
45
+ # @param location [String]
46
+ # @param collection [String]
47
+ # @param data_store [String]
48
+ #
49
+ # @return [::String]
50
+ def data_store_path **args
51
+ resources = {
52
+ "data_store:location:project" => (proc do |project:, location:, data_store:|
53
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
54
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
55
+
56
+ "projects/#{project}/locations/#{location}/dataStores/#{data_store}"
57
+ end),
58
+ "collection:data_store:location:project" => (proc do |project:, location:, collection:, data_store:|
59
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
60
+ raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
61
+ raise ::ArgumentError, "collection cannot contain /" if collection.to_s.include? "/"
62
+
63
+ "projects/#{project}/locations/#{location}/collections/#{collection}/dataStores/#{data_store}"
64
+ end)
65
+ }
66
+
67
+ resource = resources[args.keys.sort.join(":")]
68
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
69
+ resource.call(**args)
70
+ end
71
+
72
+ extend self
73
+ end
74
+ end
75
+ end
76
+ end
77
+ end
78
+ end
@@ -0,0 +1,436 @@
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/search_tuning_service_pb"
21
+ require "google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module DiscoveryEngine
27
+ module V1beta
28
+ module SearchTuningService
29
+ module Rest
30
+ ##
31
+ # REST client for the SearchTuningService service.
32
+ #
33
+ # Service for search tuning.
34
+ #
35
+ class Client
36
+ # @private
37
+ DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
38
+
39
+ include Paths
40
+
41
+ # @private
42
+ attr_reader :search_tuning_service_stub
43
+
44
+ ##
45
+ # Configure the SearchTuningService Client class.
46
+ #
47
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client::Configuration}
48
+ # for a description of the configuration fields.
49
+ #
50
+ # @example
51
+ #
52
+ # # Modify the configuration for all SearchTuningService clients
53
+ # ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.configure do |config|
54
+ # config.timeout = 10.0
55
+ # end
56
+ #
57
+ # @yield [config] Configure the Client client.
58
+ # @yieldparam config [Client::Configuration]
59
+ #
60
+ # @return [Client::Configuration]
61
+ #
62
+ def self.configure
63
+ @configure ||= begin
64
+ namespace = ["Google", "Cloud", "DiscoveryEngine", "V1beta"]
65
+ parent_config = while namespace.any?
66
+ parent_name = namespace.join "::"
67
+ parent_const = const_get parent_name
68
+ break parent_const.configure if parent_const.respond_to? :configure
69
+ namespace.pop
70
+ end
71
+ default_config = Client::Configuration.new parent_config
72
+
73
+ default_config
74
+ end
75
+ yield @configure if block_given?
76
+ @configure
77
+ end
78
+
79
+ ##
80
+ # Configure the SearchTuningService Client instance.
81
+ #
82
+ # The configuration is set to the derived mode, meaning that values can be changed,
83
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
84
+ # should be made on {Client.configure}.
85
+ #
86
+ # See {::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client::Configuration}
87
+ # for a description of the configuration fields.
88
+ #
89
+ # @yield [config] Configure the Client client.
90
+ # @yieldparam config [Client::Configuration]
91
+ #
92
+ # @return [Client::Configuration]
93
+ #
94
+ def configure
95
+ yield @config if block_given?
96
+ @config
97
+ end
98
+
99
+ ##
100
+ # The effective universe domain
101
+ #
102
+ # @return [String]
103
+ #
104
+ def universe_domain
105
+ @search_tuning_service_stub.universe_domain
106
+ end
107
+
108
+ ##
109
+ # Create a new SearchTuningService REST client object.
110
+ #
111
+ # @example
112
+ #
113
+ # # Create a client using the default configuration
114
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new
115
+ #
116
+ # # Create a client using a custom configuration
117
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new do |config|
118
+ # config.timeout = 10.0
119
+ # end
120
+ #
121
+ # @yield [config] Configure the SearchTuningService client.
122
+ # @yieldparam config [Client::Configuration]
123
+ #
124
+ def initialize
125
+ # Create the configuration object
126
+ @config = Configuration.new Client.configure
127
+
128
+ # Yield the configuration if needed
129
+ yield @config if block_given?
130
+
131
+ # Create credentials
132
+ credentials = @config.credentials
133
+ # Use self-signed JWT if the endpoint is unchanged from default,
134
+ # but only if the default endpoint does not have a region prefix.
135
+ enable_self_signed_jwt = @config.endpoint.nil? ||
136
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
137
+ !@config.endpoint.split(".").first.include?("-"))
138
+ credentials ||= Credentials.default scope: @config.scope,
139
+ enable_self_signed_jwt: enable_self_signed_jwt
140
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
141
+ credentials = Credentials.new credentials, scope: @config.scope
142
+ end
143
+
144
+ @quota_project_id = @config.quota_project
145
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
146
+
147
+ @operations_client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Operations.new do |config|
148
+ config.credentials = credentials
149
+ config.quota_project = @quota_project_id
150
+ config.endpoint = @config.endpoint
151
+ config.universe_domain = @config.universe_domain
152
+ end
153
+
154
+ @search_tuning_service_stub = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::ServiceStub.new(
155
+ endpoint: @config.endpoint,
156
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
157
+ universe_domain: @config.universe_domain,
158
+ credentials: credentials
159
+ )
160
+
161
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
162
+ config.credentials = credentials
163
+ config.quota_project = @quota_project_id
164
+ config.endpoint = @search_tuning_service_stub.endpoint
165
+ config.universe_domain = @search_tuning_service_stub.universe_domain
166
+ end
167
+ end
168
+
169
+ ##
170
+ # Get the associated client for long-running operations.
171
+ #
172
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Operations]
173
+ #
174
+ attr_reader :operations_client
175
+
176
+ ##
177
+ # Get the associated client for mix-in of the Locations.
178
+ #
179
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
180
+ #
181
+ attr_reader :location_client
182
+
183
+ # Service calls
184
+
185
+ ##
186
+ # Trains a custom model.
187
+ #
188
+ # @overload train_custom_model(request, options = nil)
189
+ # Pass arguments to `train_custom_model` via a request object, either of type
190
+ # {::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest} or an equivalent Hash.
191
+ #
192
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest, ::Hash]
193
+ # A request object representing the call parameters. Required. To specify no
194
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
195
+ # @param options [::Gapic::CallOptions, ::Hash]
196
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
197
+ #
198
+ # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil)
199
+ # Pass arguments to `train_custom_model` via keyword arguments. Note that at
200
+ # least one keyword argument is required. To specify no parameters, or to keep all
201
+ # the default parameter values, pass an empty Hash as a request object (see above).
202
+ #
203
+ # @param gcs_training_input [::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest::GcsTrainingInput, ::Hash]
204
+ # Cloud Storage training input.
205
+ # @param data_store [::String]
206
+ # Required. The resource name of the Data Store, such as
207
+ # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
208
+ # This field is used to identify the data store where to train the models.
209
+ # @param model_type [::String]
210
+ # Model to be trained. Supported values are:
211
+ #
212
+ # * **search-tuning**: Fine tuning the search system based on data provided.
213
+ # @param error_config [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash]
214
+ # The desired location of errors incurred during the data ingestion and
215
+ # training.
216
+ # @yield [result, operation] Access the result along with the TransportOperation object
217
+ # @yieldparam result [::Gapic::Operation]
218
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
219
+ #
220
+ # @return [::Gapic::Operation]
221
+ #
222
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
223
+ #
224
+ # @example Basic example
225
+ # require "google/cloud/discovery_engine/v1beta"
226
+ #
227
+ # # Create a client object. The client can be reused for multiple calls.
228
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new
229
+ #
230
+ # # Create a request. To set request fields, pass in keyword arguments.
231
+ # request = Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest.new
232
+ #
233
+ # # Call the train_custom_model method.
234
+ # result = client.train_custom_model request
235
+ #
236
+ # # The returned object is of type Gapic::Operation. You can use it to
237
+ # # check the status of an operation, cancel it, or wait for results.
238
+ # # Here is how to wait for a response.
239
+ # result.wait_until_done! timeout: 60
240
+ # if result.response?
241
+ # p result.response
242
+ # else
243
+ # puts "No response received."
244
+ # end
245
+ #
246
+ def train_custom_model request, options = nil
247
+ raise ::ArgumentError, "request must be provided" if request.nil?
248
+
249
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::TrainCustomModelRequest
250
+
251
+ # Converts hash and nil to an options object
252
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
253
+
254
+ # Customize the options with defaults
255
+ call_metadata = @config.rpcs.train_custom_model.metadata.to_h
256
+
257
+ # Set x-goog-api-client and x-goog-user-project headers
258
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
259
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
260
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
261
+ transports_version_send: [:rest]
262
+
263
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
264
+
265
+ options.apply_defaults timeout: @config.rpcs.train_custom_model.timeout,
266
+ metadata: call_metadata,
267
+ retry_policy: @config.rpcs.train_custom_model.retry_policy
268
+
269
+ options.apply_defaults timeout: @config.timeout,
270
+ metadata: @config.metadata,
271
+ retry_policy: @config.retry_policy
272
+
273
+ @search_tuning_service_stub.train_custom_model request, options do |result, operation|
274
+ result = ::Gapic::Operation.new result, @operations_client, options: options
275
+ yield result, operation if block_given?
276
+ return result
277
+ end
278
+ rescue ::Gapic::Rest::Error => e
279
+ raise ::Google::Cloud::Error.from_error(e)
280
+ end
281
+
282
+ ##
283
+ # Configuration class for the SearchTuningService REST API.
284
+ #
285
+ # This class represents the configuration for SearchTuningService REST,
286
+ # providing control over timeouts, retry behavior, logging, transport
287
+ # parameters, and other low-level controls. Certain parameters can also be
288
+ # applied individually to specific RPCs. See
289
+ # {::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client::Configuration::Rpcs}
290
+ # for a list of RPCs that can be configured independently.
291
+ #
292
+ # Configuration can be applied globally to all clients, or to a single client
293
+ # on construction.
294
+ #
295
+ # @example
296
+ #
297
+ # # Modify the global config, setting the timeout for
298
+ # # train_custom_model to 20 seconds,
299
+ # # and all remaining timeouts to 10 seconds.
300
+ # ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.configure do |config|
301
+ # config.timeout = 10.0
302
+ # config.rpcs.train_custom_model.timeout = 20.0
303
+ # end
304
+ #
305
+ # # Apply the above configuration only to a new client.
306
+ # client = ::Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new do |config|
307
+ # config.timeout = 10.0
308
+ # config.rpcs.train_custom_model.timeout = 20.0
309
+ # end
310
+ #
311
+ # @!attribute [rw] endpoint
312
+ # A custom service endpoint, as a hostname or hostname:port. The default is
313
+ # nil, indicating to use the default endpoint in the current universe domain.
314
+ # @return [::String,nil]
315
+ # @!attribute [rw] credentials
316
+ # Credentials to send with calls. You may provide any of the following types:
317
+ # * (`String`) The path to a service account key file in JSON format
318
+ # * (`Hash`) A service account key as a Hash
319
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
320
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
321
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
322
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
323
+ # * (`nil`) indicating no credentials
324
+ # @return [::Object]
325
+ # @!attribute [rw] scope
326
+ # The OAuth scopes
327
+ # @return [::Array<::String>]
328
+ # @!attribute [rw] lib_name
329
+ # The library name as recorded in instrumentation and logging
330
+ # @return [::String]
331
+ # @!attribute [rw] lib_version
332
+ # The library version as recorded in instrumentation and logging
333
+ # @return [::String]
334
+ # @!attribute [rw] timeout
335
+ # The call timeout in seconds.
336
+ # @return [::Numeric]
337
+ # @!attribute [rw] metadata
338
+ # Additional headers to be sent with the call.
339
+ # @return [::Hash{::Symbol=>::String}]
340
+ # @!attribute [rw] retry_policy
341
+ # The retry policy. The value is a hash with the following keys:
342
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
343
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
344
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
345
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
346
+ # trigger a retry.
347
+ # @return [::Hash]
348
+ # @!attribute [rw] quota_project
349
+ # A separate project against which to charge quota.
350
+ # @return [::String]
351
+ # @!attribute [rw] universe_domain
352
+ # The universe domain within which to make requests. This determines the
353
+ # default endpoint URL. The default value of nil uses the environment
354
+ # universe (usually the default "googleapis.com" universe).
355
+ # @return [::String,nil]
356
+ #
357
+ class Configuration
358
+ extend ::Gapic::Config
359
+
360
+ # @private
361
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
362
+ DEFAULT_ENDPOINT = "discoveryengine.googleapis.com"
363
+
364
+ config_attr :endpoint, nil, ::String, nil
365
+ config_attr :credentials, nil do |value|
366
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
367
+ allowed.any? { |klass| klass === value }
368
+ end
369
+ config_attr :scope, nil, ::String, ::Array, nil
370
+ config_attr :lib_name, nil, ::String, nil
371
+ config_attr :lib_version, nil, ::String, nil
372
+ config_attr :timeout, nil, ::Numeric, nil
373
+ config_attr :metadata, nil, ::Hash, nil
374
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
375
+ config_attr :quota_project, nil, ::String, nil
376
+ config_attr :universe_domain, nil, ::String, nil
377
+
378
+ # @private
379
+ def initialize parent_config = nil
380
+ @parent_config = parent_config unless parent_config.nil?
381
+
382
+ yield self if block_given?
383
+ end
384
+
385
+ ##
386
+ # Configurations for individual RPCs
387
+ # @return [Rpcs]
388
+ #
389
+ def rpcs
390
+ @rpcs ||= begin
391
+ parent_rpcs = nil
392
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
393
+ Rpcs.new parent_rpcs
394
+ end
395
+ end
396
+
397
+ ##
398
+ # Configuration RPC class for the SearchTuningService API.
399
+ #
400
+ # Includes fields providing the configuration for each RPC in this service.
401
+ # Each configuration object is of type `Gapic::Config::Method` and includes
402
+ # the following configuration fields:
403
+ #
404
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
405
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
406
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
407
+ # include the following keys:
408
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
409
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
410
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
411
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
412
+ # trigger a retry.
413
+ #
414
+ class Rpcs
415
+ ##
416
+ # RPC-specific configuration for `train_custom_model`
417
+ # @return [::Gapic::Config::Method]
418
+ #
419
+ attr_reader :train_custom_model
420
+
421
+ # @private
422
+ def initialize parent_rpcs = nil
423
+ train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model
424
+ @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config
425
+
426
+ yield self if block_given?
427
+ end
428
+ end
429
+ end
430
+ end
431
+ end
432
+ end
433
+ end
434
+ end
435
+ end
436
+ end