google-cloud-discovery_engine-v1beta 0.11.0 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +9 -3
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +13 -5
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +9 -3
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +21 -6
  6. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +875 -0
  7. data/lib/google/cloud/discovery_engine/v1beta/control_service/credentials.rb +47 -0
  8. data/lib/google/cloud/discovery_engine/v1beta/control_service/paths.rb +167 -0
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +814 -0
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +440 -0
  11. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest.rb +55 -0
  12. data/lib/google/cloud/discovery_engine/v1beta/control_service.rb +58 -0
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +31 -15
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +31 -15
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +15 -7
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +13 -5
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +15 -7
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +21 -6
  19. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +24 -15
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +13 -5
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +24 -15
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +21 -6
  23. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +19 -8
  24. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +13 -5
  25. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +19 -8
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +21 -6
  27. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +25 -3
  28. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +25 -3
  29. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +485 -0
  30. data/lib/google/cloud/discovery_engine/v1beta/project_service/credentials.rb +47 -0
  31. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +809 -0
  32. data/lib/google/cloud/discovery_engine/v1beta/project_service/paths.rb +47 -0
  33. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +452 -0
  34. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +1092 -0
  35. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +129 -0
  36. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest.rb +54 -0
  37. data/lib/google/cloud/discovery_engine/v1beta/project_service.rb +57 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +24 -2
  39. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +24 -2
  40. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +24 -19
  41. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/paths.rb +66 -0
  42. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +24 -19
  43. data/lib/google/cloud/discovery_engine/v1beta/rest.rb +2 -0
  44. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +18 -10
  45. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +13 -5
  46. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +18 -10
  47. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +21 -6
  48. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +15 -8
  49. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +15 -8
  50. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +104 -2
  51. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +13 -5
  52. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +97 -2
  53. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +21 -6
  54. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +59 -0
  55. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +9 -3
  56. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +9 -3
  57. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +27 -12
  58. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +13 -5
  59. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +27 -12
  60. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +21 -6
  61. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +23 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +13 -5
  63. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/paths.rb +21 -0
  64. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +23 -6
  65. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +21 -6
  66. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +8 -0
  67. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  68. data/lib/google/cloud/discovery_engine/v1beta.rb +2 -0
  69. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +3 -1
  70. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +2 -1
  71. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +55 -0
  72. data/lib/google/cloud/discoveryengine/v1beta/control_service_pb.rb +57 -0
  73. data/lib/google/cloud/discoveryengine/v1beta/control_service_services_pb.rb +69 -0
  74. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +1 -1
  75. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +48 -0
  76. data/lib/google/cloud/discoveryengine/v1beta/document_service_services_pb.rb +1 -1
  77. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  78. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +1 -1
  79. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +1 -1
  80. data/lib/google/cloud/discoveryengine/v1beta/project_pb.rb +49 -0
  81. data/lib/google/cloud/discoveryengine/v1beta/project_service_pb.rb +50 -0
  82. data/lib/google/cloud/discoveryengine/v1beta/project_service_services_pb.rb +51 -0
  83. data/lib/google/cloud/discoveryengine/v1beta/rank_service_pb.rb +1 -1
  84. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_pb.rb +5 -1
  85. data/lib/google/cloud/discoveryengine/v1beta/search_tuning_service_services_pb.rb +2 -0
  86. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +1 -1
  87. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  88. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_pb.rb +1 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/user_event_service_services_pb.rb +1 -1
  90. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +9 -1
  91. data/proto_docs/google/cloud/discoveryengine/v1beta/common.rb +16 -0
  92. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +209 -0
  93. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +126 -0
  94. data/proto_docs/google/cloud/discoveryengine/v1beta/conversation.rb +2 -2
  95. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +19 -3
  96. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +75 -0
  97. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store_service.rb +2 -2
  98. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +1 -0
  99. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +6 -7
  100. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +3 -3
  101. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +39 -1
  102. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +3 -0
  103. data/proto_docs/google/cloud/discoveryengine/v1beta/import_config.rb +4 -4
  104. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +106 -0
  105. data/proto_docs/google/cloud/discoveryengine/v1beta/project_service.rb +57 -0
  106. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +28 -0
  107. data/proto_docs/google/cloud/discoveryengine/v1beta/recommendation_service.rb +20 -19
  108. data/proto_docs/google/cloud/discoveryengine/v1beta/schema_service.rb +5 -5
  109. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +30 -24
  110. data/proto_docs/google/cloud/discoveryengine/v1beta/search_tuning_service.rb +31 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1beta/session.rb +4 -1
  112. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +3 -0
  113. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +24 -3
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event_service.rb +13 -1
  115. metadata +30 -2
@@ -31,6 +31,9 @@ module Google
31
31
  # Service for search tuning.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
34
37
  # @private
35
38
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
36
39
 
@@ -202,7 +205,7 @@ module Google
202
205
  # @param options [::Gapic::CallOptions, ::Hash]
203
206
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
204
207
  #
205
- # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil)
208
+ # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil)
206
209
  # Pass arguments to `train_custom_model` via keyword arguments. Note that at
207
210
  # least one keyword argument is required. To specify no parameters, or to keep all
208
211
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -220,6 +223,8 @@ module Google
220
223
  # @param error_config [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash]
221
224
  # The desired location of errors incurred during the data ingestion and
222
225
  # training.
226
+ # @param model_id [::String]
227
+ # If not provided, a UUID will be generated.
223
228
  #
224
229
  # @yield [response, operation] Access the result along with the RPC operation
225
230
  # @yieldparam response [::Gapic::Operation]
@@ -262,10 +267,11 @@ module Google
262
267
  # Customize the options with defaults
263
268
  metadata = @config.rpcs.train_custom_model.metadata.to_h
264
269
 
265
- # Set x-goog-api-client and x-goog-user-project headers
270
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
266
271
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
267
272
  lib_name: @config.lib_name, lib_version: @config.lib_version,
268
273
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
274
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
269
275
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
270
276
 
271
277
  header_params = {}
@@ -293,6 +299,95 @@ module Google
293
299
  raise ::Google::Cloud::Error.from_error(e)
294
300
  end
295
301
 
302
+ ##
303
+ # Gets a list of all the custom models.
304
+ #
305
+ # @overload list_custom_models(request, options = nil)
306
+ # Pass arguments to `list_custom_models` via a request object, either of type
307
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest} or an equivalent Hash.
308
+ #
309
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest, ::Hash]
310
+ # A request object representing the call parameters. Required. To specify no
311
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
312
+ # @param options [::Gapic::CallOptions, ::Hash]
313
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
314
+ #
315
+ # @overload list_custom_models(data_store: nil)
316
+ # Pass arguments to `list_custom_models` via keyword arguments. Note that at
317
+ # least one keyword argument is required. To specify no parameters, or to keep all
318
+ # the default parameter values, pass an empty Hash as a request object (see above).
319
+ #
320
+ # @param data_store [::String]
321
+ # Required. The resource name of the parent Data Store, such as
322
+ # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
323
+ # This field is used to identify the data store where to fetch the models
324
+ # from.
325
+ #
326
+ # @yield [response, operation] Access the result along with the RPC operation
327
+ # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse]
328
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
329
+ #
330
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse]
331
+ #
332
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
333
+ #
334
+ # @example Basic example
335
+ # require "google/cloud/discovery_engine/v1beta"
336
+ #
337
+ # # Create a client object. The client can be reused for multiple calls.
338
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Client.new
339
+ #
340
+ # # Create a request. To set request fields, pass in keyword arguments.
341
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest.new
342
+ #
343
+ # # Call the list_custom_models method.
344
+ # result = client.list_custom_models request
345
+ #
346
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse.
347
+ # p result
348
+ #
349
+ def list_custom_models request, options = nil
350
+ raise ::ArgumentError, "request must be provided" if request.nil?
351
+
352
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest
353
+
354
+ # Converts hash and nil to an options object
355
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
356
+
357
+ # Customize the options with defaults
358
+ metadata = @config.rpcs.list_custom_models.metadata.to_h
359
+
360
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
361
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
362
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
363
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
364
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
365
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
366
+
367
+ header_params = {}
368
+ if request.data_store
369
+ header_params["data_store"] = request.data_store
370
+ end
371
+
372
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
373
+ metadata[:"x-goog-request-params"] ||= request_params_header
374
+
375
+ options.apply_defaults timeout: @config.rpcs.list_custom_models.timeout,
376
+ metadata: metadata,
377
+ retry_policy: @config.rpcs.list_custom_models.retry_policy
378
+
379
+ options.apply_defaults timeout: @config.timeout,
380
+ metadata: @config.metadata,
381
+ retry_policy: @config.retry_policy
382
+
383
+ @search_tuning_service_stub.call_rpc :list_custom_models, request, options: options do |response, operation|
384
+ yield response, operation if block_given?
385
+ return response
386
+ end
387
+ rescue ::GRPC::BadStatus => e
388
+ raise ::Google::Cloud::Error.from_error(e)
389
+ end
390
+
296
391
  ##
297
392
  # Configuration class for the SearchTuningService API.
298
393
  #
@@ -451,11 +546,18 @@ module Google
451
546
  # @return [::Gapic::Config::Method]
452
547
  #
453
548
  attr_reader :train_custom_model
549
+ ##
550
+ # RPC-specific configuration for `list_custom_models`
551
+ # @return [::Gapic::Config::Method]
552
+ #
553
+ attr_reader :list_custom_models
454
554
 
455
555
  # @private
456
556
  def initialize parent_rpcs = nil
457
557
  train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model
458
558
  @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config
559
+ list_custom_models_config = parent_rpcs.list_custom_models if parent_rpcs.respond_to? :list_custom_models
560
+ @list_custom_models = ::Gapic::Config::Method.new list_custom_models_config
459
561
 
460
562
  yield self if block_given?
461
563
  end
@@ -26,6 +26,9 @@ module Google
26
26
  module SearchTuningService
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ API_VERSION = ""
31
+
29
32
  # @private
30
33
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
31
34
 
@@ -191,10 +194,11 @@ module Google
191
194
  # Customize the options with defaults
192
195
  metadata = @config.rpcs.list_operations.metadata.to_h
193
196
 
194
- # Set x-goog-api-client and x-goog-user-project headers
197
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
195
198
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
196
199
  lib_name: @config.lib_name, lib_version: @config.lib_version,
197
200
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
201
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
198
202
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
199
203
 
200
204
  header_params = {}
@@ -287,10 +291,11 @@ module Google
287
291
  # Customize the options with defaults
288
292
  metadata = @config.rpcs.get_operation.metadata.to_h
289
293
 
290
- # Set x-goog-api-client and x-goog-user-project headers
294
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
291
295
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
292
296
  lib_name: @config.lib_name, lib_version: @config.lib_version,
293
297
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
298
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
294
299
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
295
300
 
296
301
  header_params = {}
@@ -376,10 +381,11 @@ module Google
376
381
  # Customize the options with defaults
377
382
  metadata = @config.rpcs.delete_operation.metadata.to_h
378
383
 
379
- # Set x-goog-api-client and x-goog-user-project headers
384
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
380
385
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
381
386
  lib_name: @config.lib_name, lib_version: @config.lib_version,
382
387
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
388
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
383
389
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
390
 
385
391
  header_params = {}
@@ -470,10 +476,11 @@ module Google
470
476
  # Customize the options with defaults
471
477
  metadata = @config.rpcs.cancel_operation.metadata.to_h
472
478
 
473
- # Set x-goog-api-client and x-goog-user-project headers
479
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
474
480
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
475
481
  lib_name: @config.lib_name, lib_version: @config.lib_version,
476
482
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
483
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
477
484
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
478
485
 
479
486
  header_params = {}
@@ -574,10 +581,11 @@ module Google
574
581
  # Customize the options with defaults
575
582
  metadata = @config.rpcs.wait_operation.metadata.to_h
576
583
 
577
- # Set x-goog-api-client and x-goog-user-project headers
584
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
578
585
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
579
586
  lib_name: @config.lib_name, lib_version: @config.lib_version,
580
587
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
588
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
581
589
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
582
590
 
583
591
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
@@ -33,6 +33,9 @@ module Google
33
33
  # Service for search tuning.
34
34
  #
35
35
  class Client
36
+ # @private
37
+ API_VERSION = ""
38
+
36
39
  # @private
37
40
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
38
41
 
@@ -195,7 +198,7 @@ module Google
195
198
  # @param options [::Gapic::CallOptions, ::Hash]
196
199
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
197
200
  #
198
- # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil)
201
+ # @overload train_custom_model(gcs_training_input: nil, data_store: nil, model_type: nil, error_config: nil, model_id: nil)
199
202
  # Pass arguments to `train_custom_model` via keyword arguments. Note that at
200
203
  # least one keyword argument is required. To specify no parameters, or to keep all
201
204
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -213,6 +216,8 @@ module Google
213
216
  # @param error_config [::Google::Cloud::DiscoveryEngine::V1beta::ImportErrorConfig, ::Hash]
214
217
  # The desired location of errors incurred during the data ingestion and
215
218
  # training.
219
+ # @param model_id [::String]
220
+ # If not provided, a UUID will be generated.
216
221
  # @yield [result, operation] Access the result along with the TransportOperation object
217
222
  # @yieldparam result [::Gapic::Operation]
218
223
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -254,12 +259,13 @@ module Google
254
259
  # Customize the options with defaults
255
260
  call_metadata = @config.rpcs.train_custom_model.metadata.to_h
256
261
 
257
- # Set x-goog-api-client and x-goog-user-project headers
262
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
258
263
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
259
264
  lib_name: @config.lib_name, lib_version: @config.lib_version,
260
265
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
261
266
  transports_version_send: [:rest]
262
267
 
268
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
263
269
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
264
270
 
265
271
  options.apply_defaults timeout: @config.rpcs.train_custom_model.timeout,
@@ -279,6 +285,88 @@ module Google
279
285
  raise ::Google::Cloud::Error.from_error(e)
280
286
  end
281
287
 
288
+ ##
289
+ # Gets a list of all the custom models.
290
+ #
291
+ # @overload list_custom_models(request, options = nil)
292
+ # Pass arguments to `list_custom_models` via a request object, either of type
293
+ # {::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest} or an equivalent Hash.
294
+ #
295
+ # @param request [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest, ::Hash]
296
+ # A request object representing the call parameters. Required. To specify no
297
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
298
+ # @param options [::Gapic::CallOptions, ::Hash]
299
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
300
+ #
301
+ # @overload list_custom_models(data_store: nil)
302
+ # Pass arguments to `list_custom_models` via keyword arguments. Note that at
303
+ # least one keyword argument is required. To specify no parameters, or to keep all
304
+ # the default parameter values, pass an empty Hash as a request object (see above).
305
+ #
306
+ # @param data_store [::String]
307
+ # Required. The resource name of the parent Data Store, such as
308
+ # `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
309
+ # This field is used to identify the data store where to fetch the models
310
+ # from.
311
+ # @yield [result, operation] Access the result along with the TransportOperation object
312
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse]
313
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
314
+ #
315
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse]
316
+ #
317
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
318
+ #
319
+ # @example Basic example
320
+ # require "google/cloud/discovery_engine/v1beta"
321
+ #
322
+ # # Create a client object. The client can be reused for multiple calls.
323
+ # client = Google::Cloud::DiscoveryEngine::V1beta::SearchTuningService::Rest::Client.new
324
+ #
325
+ # # Create a request. To set request fields, pass in keyword arguments.
326
+ # request = Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest.new
327
+ #
328
+ # # Call the list_custom_models method.
329
+ # result = client.list_custom_models request
330
+ #
331
+ # # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse.
332
+ # p result
333
+ #
334
+ def list_custom_models request, options = nil
335
+ raise ::ArgumentError, "request must be provided" if request.nil?
336
+
337
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest
338
+
339
+ # Converts hash and nil to an options object
340
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
341
+
342
+ # Customize the options with defaults
343
+ call_metadata = @config.rpcs.list_custom_models.metadata.to_h
344
+
345
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
346
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
347
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
348
+ gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
349
+ transports_version_send: [:rest]
350
+
351
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
352
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
353
+
354
+ options.apply_defaults timeout: @config.rpcs.list_custom_models.timeout,
355
+ metadata: call_metadata,
356
+ retry_policy: @config.rpcs.list_custom_models.retry_policy
357
+
358
+ options.apply_defaults timeout: @config.timeout,
359
+ metadata: @config.metadata,
360
+ retry_policy: @config.retry_policy
361
+
362
+ @search_tuning_service_stub.list_custom_models request, options do |result, operation|
363
+ yield result, operation if block_given?
364
+ return result
365
+ end
366
+ rescue ::Gapic::Rest::Error => e
367
+ raise ::Google::Cloud::Error.from_error(e)
368
+ end
369
+
282
370
  ##
283
371
  # Configuration class for the SearchTuningService REST API.
284
372
  #
@@ -417,11 +505,18 @@ module Google
417
505
  # @return [::Gapic::Config::Method]
418
506
  #
419
507
  attr_reader :train_custom_model
508
+ ##
509
+ # RPC-specific configuration for `list_custom_models`
510
+ # @return [::Gapic::Config::Method]
511
+ #
512
+ attr_reader :list_custom_models
420
513
 
421
514
  # @private
422
515
  def initialize parent_rpcs = nil
423
516
  train_custom_model_config = parent_rpcs.train_custom_model if parent_rpcs.respond_to? :train_custom_model
424
517
  @train_custom_model = ::Gapic::Config::Method.new train_custom_model_config
518
+ list_custom_models_config = parent_rpcs.list_custom_models if parent_rpcs.respond_to? :list_custom_models
519
+ @list_custom_models = ::Gapic::Config::Method.new list_custom_models_config
425
520
 
426
521
  yield self if block_given?
427
522
  end
@@ -26,6 +26,9 @@ module Google
26
26
  module Rest
27
27
  # Service that implements Longrunning Operations API.
28
28
  class Operations
29
+ # @private
30
+ API_VERSION = ""
31
+
29
32
  # @private
30
33
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
31
34
 
@@ -181,12 +184,13 @@ module Google
181
184
  # Customize the options with defaults
182
185
  call_metadata = @config.rpcs.list_operations.metadata.to_h
183
186
 
184
- # Set x-goog-api-client and x-goog-user-project headers
187
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
185
188
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
186
189
  lib_name: @config.lib_name, lib_version: @config.lib_version,
187
190
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
188
191
  transports_version_send: [:rest]
189
192
 
193
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
190
194
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
191
195
 
192
196
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
@@ -269,12 +273,13 @@ module Google
269
273
  # Customize the options with defaults
270
274
  call_metadata = @config.rpcs.get_operation.metadata.to_h
271
275
 
272
- # Set x-goog-api-client and x-goog-user-project headers
276
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
273
277
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
274
278
  lib_name: @config.lib_name, lib_version: @config.lib_version,
275
279
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
276
280
  transports_version_send: [:rest]
277
281
 
282
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
278
283
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
279
284
 
280
285
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
@@ -351,12 +356,13 @@ module Google
351
356
  # Customize the options with defaults
352
357
  call_metadata = @config.rpcs.delete_operation.metadata.to_h
353
358
 
354
- # Set x-goog-api-client and x-goog-user-project headers
359
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
355
360
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
361
  lib_name: @config.lib_name, lib_version: @config.lib_version,
357
362
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
358
363
  transports_version_send: [:rest]
359
364
 
365
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
360
366
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
361
367
 
362
368
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
@@ -438,12 +444,13 @@ module Google
438
444
  # Customize the options with defaults
439
445
  call_metadata = @config.rpcs.cancel_operation.metadata.to_h
440
446
 
441
- # Set x-goog-api-client and x-goog-user-project headers
447
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
442
448
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
443
449
  lib_name: @config.lib_name, lib_version: @config.lib_version,
444
450
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
445
451
  transports_version_send: [:rest]
446
452
 
453
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
447
454
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
448
455
 
449
456
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
@@ -1060,10 +1067,18 @@ module Google
1060
1067
  transcoder = Gapic::Rest::GrpcTranscoder.new
1061
1068
  .with_bindings(
1062
1069
  uri_method: :post,
1063
- uri_template: "/v1/{name}:cancel",
1070
+ uri_template: "/v1beta/{name}:cancel",
1064
1071
  body: "*",
1065
1072
  matches: [
1066
- ["name", %r{^operations(?:/.*)?$}, true]
1073
+ ["name", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false]
1074
+ ]
1075
+ )
1076
+ .with_bindings(
1077
+ uri_method: :post,
1078
+ uri_template: "/v1beta/{name}:cancel",
1079
+ body: "*",
1080
+ matches: [
1081
+ ["name", %r{^projects/[^/]+/locations/[^/]+/dataStores/[^/]+/branches/[^/]+/operations/[^/]+/?$}, false]
1067
1082
  ]
1068
1083
  )
1069
1084
  transcoder.transcode request_pb
@@ -99,6 +99,44 @@ module Google
99
99
  result
100
100
  end
101
101
 
102
+ ##
103
+ # Baseline implementation for the list_custom_models REST call
104
+ #
105
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest]
106
+ # A request object representing the call parameters. Required.
107
+ # @param options [::Gapic::CallOptions]
108
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
109
+ #
110
+ # @yield [result, operation] Access the result along with the TransportOperation object
111
+ # @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse]
112
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
113
+ #
114
+ # @return [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse]
115
+ # A result object deserialized from the server's reply
116
+ def list_custom_models request_pb, options = nil
117
+ raise ::ArgumentError, "request must be provided" if request_pb.nil?
118
+
119
+ verb, uri, query_string_params, body = ServiceStub.transcode_list_custom_models_request request_pb
120
+ query_string_params = if query_string_params.any?
121
+ query_string_params.to_h { |p| p.split "=", 2 }
122
+ else
123
+ {}
124
+ end
125
+
126
+ response = @client_stub.make_http_request(
127
+ verb,
128
+ uri: uri,
129
+ body: body || "",
130
+ params: query_string_params,
131
+ options: options
132
+ )
133
+ operation = ::Gapic::Rest::TransportOperation.new response
134
+ result = ::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsResponse.decode_json response.body, ignore_unknown_fields: true
135
+
136
+ yield result, operation if block_given?
137
+ result
138
+ end
139
+
102
140
  ##
103
141
  # @private
104
142
  #
@@ -120,6 +158,27 @@ module Google
120
158
  )
121
159
  transcoder.transcode request_pb
122
160
  end
161
+
162
+ ##
163
+ # @private
164
+ #
165
+ # GRPC transcoding helper method for the list_custom_models REST call
166
+ #
167
+ # @param request_pb [::Google::Cloud::DiscoveryEngine::V1beta::ListCustomModelsRequest]
168
+ # A request object representing the call parameters. Required.
169
+ # @return [Array(String, [String, nil], Hash{String => String})]
170
+ # Uri, Body, Query string parameters
171
+ def self.transcode_list_custom_models_request request_pb
172
+ transcoder = Gapic::Rest::GrpcTranscoder.new
173
+ .with_bindings(
174
+ uri_method: :get,
175
+ uri_template: "/v1beta/{data_store}/customModels",
176
+ matches: [
177
+ ["data_store", %r{^projects/[^/]+/locations/[^/]+/collections/[^/]+/dataStores/[^/]+/?$}, false]
178
+ ]
179
+ )
180
+ transcoder.transcode request_pb
181
+ end
123
182
  end
124
183
  end
125
184
  end
@@ -32,6 +32,9 @@ module Google
32
32
  # {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig ServingConfig}.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
35
38
  # @private
36
39
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
37
40
 
@@ -241,10 +244,11 @@ module Google
241
244
  # Customize the options with defaults
242
245
  metadata = @config.rpcs.update_serving_config.metadata.to_h
243
246
 
244
- # Set x-goog-api-client and x-goog-user-project headers
247
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
245
248
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
246
249
  lib_name: @config.lib_name, lib_version: @config.lib_version,
247
250
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
251
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
248
252
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
249
253
 
250
254
  header_params = {}
@@ -329,10 +333,11 @@ module Google
329
333
  # Customize the options with defaults
330
334
  metadata = @config.rpcs.get_serving_config.metadata.to_h
331
335
 
332
- # Set x-goog-api-client and x-goog-user-project headers
336
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
333
337
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
334
338
  lib_name: @config.lib_name, lib_version: @config.lib_version,
335
339
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
340
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
336
341
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
337
342
 
338
343
  header_params = {}
@@ -426,10 +431,11 @@ module Google
426
431
  # Customize the options with defaults
427
432
  metadata = @config.rpcs.list_serving_configs.metadata.to_h
428
433
 
429
- # Set x-goog-api-client and x-goog-user-project headers
434
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
430
435
  metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
436
  lib_name: @config.lib_name, lib_version: @config.lib_version,
432
437
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
438
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
433
439
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
434
440
 
435
441
  header_params = {}
@@ -34,6 +34,9 @@ module Google
34
34
  # {::Google::Cloud::DiscoveryEngine::V1beta::ServingConfig ServingConfig}.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ API_VERSION = ""
39
+
37
40
  # @private
38
41
  DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
39
42
 
@@ -233,12 +236,13 @@ module Google
233
236
  # Customize the options with defaults
234
237
  call_metadata = @config.rpcs.update_serving_config.metadata.to_h
235
238
 
236
- # Set x-goog-api-client and x-goog-user-project headers
239
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
237
240
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
238
241
  lib_name: @config.lib_name, lib_version: @config.lib_version,
239
242
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
240
243
  transports_version_send: [:rest]
241
244
 
245
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
242
246
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
243
247
 
244
248
  options.apply_defaults timeout: @config.rpcs.update_serving_config.timeout,
@@ -314,12 +318,13 @@ module Google
314
318
  # Customize the options with defaults
315
319
  call_metadata = @config.rpcs.get_serving_config.metadata.to_h
316
320
 
317
- # Set x-goog-api-client and x-goog-user-project headers
321
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
318
322
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
319
323
  lib_name: @config.lib_name, lib_version: @config.lib_version,
320
324
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
321
325
  transports_version_send: [:rest]
322
326
 
327
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
323
328
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
324
329
 
325
330
  options.apply_defaults timeout: @config.rpcs.get_serving_config.timeout,
@@ -404,12 +409,13 @@ module Google
404
409
  # Customize the options with defaults
405
410
  call_metadata = @config.rpcs.list_serving_configs.metadata.to_h
406
411
 
407
- # Set x-goog-api-client and x-goog-user-project headers
412
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
408
413
  call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
409
414
  lib_name: @config.lib_name, lib_version: @config.lib_version,
410
415
  gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION,
411
416
  transports_version_send: [:rest]
412
417
 
418
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
413
419
  call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
414
420
 
415
421
  options.apply_defaults timeout: @config.rpcs.list_serving_configs.timeout,