google-cloud-ai_platform-v1 1.40.0 → 1.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7c90d9e8406de030fab3873ea04abcc4d8ebc7efa293a143ef9328d0c29755e8
4
- data.tar.gz: ea45c1781ac3ed9465284c1b6249d6a5b9283f8402658437a012beb0e3414121
3
+ metadata.gz: c68982335b67c8bf97ccc1631e919610773fc84011d02645e7059baaf07e685c
4
+ data.tar.gz: 1169e983668bfa777586e138faa197e066575b42a23820f16f4674b19fd9c471
5
5
  SHA512:
6
- metadata.gz: c79614a63ebf61a2f6e2ebc56a6d7bb42f1269a543f8bacc68b06d7412299fbce50bc028598b0217e894638c16ef6f864aa155a8b9e26189d764de22de835c9a
7
- data.tar.gz: 8954593fb85945b3bfbc19da0c968d6ea8e4610e889bcf260da97de669ef9f745799160c79d6a8dbb412921edec52cf7c405cf95cfce0e08e2ce32e51960bb11
6
+ metadata.gz: 13718e06ccd56d1a535db03636c51bc10ad1dd33c19f19f152f118b81d2e0fb5aa4b75132ca9e56acb551899ea794de0b223806aeaf8abb829f994c1a7f82ab0
7
+ data.tar.gz: 76e39adf28178e27dc89b67b0ca4fa9999bcf521d4a16c2ab8539286ceb063c83fa9af0edb541cdd51db6974294c1c4cc31c38b8f817c75f0f1c7e07dbe23a7f
@@ -1429,7 +1429,7 @@ module Google
1429
1429
  # @param options [::Gapic::CallOptions, ::Hash]
1430
1430
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1431
1431
  #
1432
- # @overload copy_model(model_id: nil, parent_model: nil, parent: nil, source_model: nil, encryption_spec: nil)
1432
+ # @overload copy_model(model_id: nil, parent_model: nil, parent: nil, source_model: nil, encryption_spec: nil, custom_service_account: nil)
1433
1433
  # Pass arguments to `copy_model` via keyword arguments. Note that at
1434
1434
  # least one keyword argument is required. To specify no parameters, or to keep all
1435
1435
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1458,6 +1458,17 @@ module Google
1458
1458
  # @param encryption_spec [::Google::Cloud::AIPlatform::V1::EncryptionSpec, ::Hash]
1459
1459
  # Customer-managed encryption key options. If this is set,
1460
1460
  # then the Model copy will be encrypted with the provided encryption key.
1461
+ # @param custom_service_account [::String]
1462
+ # Optional. The user-provided custom service account to use to do the copy
1463
+ # model. If empty, [Vertex AI Service
1464
+ # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1465
+ # will be used to access resources needed to upload the model. This account
1466
+ # must belong to the destination project where the model is copied to,
1467
+ # i.e., the project specified in the `parent` field of this request and
1468
+ # have the Vertex AI Service Agent role in the source project.
1469
+ #
1470
+ # Requires the user copying the Model to have the
1471
+ # `iam.serviceAccounts.actAs` permission on this service account.
1461
1472
  #
1462
1473
  # @yield [response, operation] Access the result along with the RPC operation
1463
1474
  # @yieldparam response [::Gapic::Operation]
@@ -1347,7 +1347,7 @@ module Google
1347
1347
  # @param options [::Gapic::CallOptions, ::Hash]
1348
1348
  # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1349
1349
  #
1350
- # @overload copy_model(model_id: nil, parent_model: nil, parent: nil, source_model: nil, encryption_spec: nil)
1350
+ # @overload copy_model(model_id: nil, parent_model: nil, parent: nil, source_model: nil, encryption_spec: nil, custom_service_account: nil)
1351
1351
  # Pass arguments to `copy_model` via keyword arguments. Note that at
1352
1352
  # least one keyword argument is required. To specify no parameters, or to keep all
1353
1353
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -1376,6 +1376,17 @@ module Google
1376
1376
  # @param encryption_spec [::Google::Cloud::AIPlatform::V1::EncryptionSpec, ::Hash]
1377
1377
  # Customer-managed encryption key options. If this is set,
1378
1378
  # then the Model copy will be encrypted with the provided encryption key.
1379
+ # @param custom_service_account [::String]
1380
+ # Optional. The user-provided custom service account to use to do the copy
1381
+ # model. If empty, [Vertex AI Service
1382
+ # Agent](https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents)
1383
+ # will be used to access resources needed to upload the model. This account
1384
+ # must belong to the destination project where the model is copied to,
1385
+ # i.e., the project specified in the `parent` field of this request and
1386
+ # have the Vertex AI Service Agent role in the source project.
1387
+ #
1388
+ # Requires the user copying the Model to have the
1389
+ # `iam.serviceAccounts.actAs` permission on this service account.
1379
1390
  # @yield [result, operation] Access the result along with the TransportOperation object
1380
1391
  # @yieldparam result [::Gapic::Operation]
1381
1392
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -151,6 +151,13 @@ module Google
151
151
  @quota_project_id = @config.quota_project
152
152
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
153
153
 
154
+ @operations_client = Operations.new do |config|
155
+ config.credentials = credentials
156
+ config.quota_project = @quota_project_id
157
+ config.endpoint = @config.endpoint
158
+ config.universe_domain = @config.universe_domain
159
+ end
160
+
154
161
  @reasoning_engine_execution_service_stub = ::Gapic::ServiceStub.new(
155
162
  ::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Stub,
156
163
  credentials: credentials,
@@ -190,6 +197,13 @@ module Google
190
197
  end
191
198
  end
192
199
 
200
+ ##
201
+ # Get the associated client for long-running operations.
202
+ #
203
+ # @return [::Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Operations]
204
+ #
205
+ attr_reader :operations_client
206
+
193
207
  ##
194
208
  # Get the associated client for mix-in of the Locations.
195
209
  #
@@ -404,6 +418,106 @@ module Google
404
418
  raise ::Google::Cloud::Error.from_error(e)
405
419
  end
406
420
 
421
+ ##
422
+ # Async query using a reasoning engine.
423
+ #
424
+ # @overload async_query_reasoning_engine(request, options = nil)
425
+ # Pass arguments to `async_query_reasoning_engine` via a request object, either of type
426
+ # {::Google::Cloud::AIPlatform::V1::AsyncQueryReasoningEngineRequest} or an equivalent Hash.
427
+ #
428
+ # @param request [::Google::Cloud::AIPlatform::V1::AsyncQueryReasoningEngineRequest, ::Hash]
429
+ # A request object representing the call parameters. Required. To specify no
430
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
431
+ # @param options [::Gapic::CallOptions, ::Hash]
432
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
433
+ #
434
+ # @overload async_query_reasoning_engine(name: nil, input_gcs_uri: nil, output_gcs_uri: nil)
435
+ # Pass arguments to `async_query_reasoning_engine` via keyword arguments. Note that at
436
+ # least one keyword argument is required. To specify no parameters, or to keep all
437
+ # the default parameter values, pass an empty Hash as a request object (see above).
438
+ #
439
+ # @param name [::String]
440
+ # Required. The name of the ReasoningEngine resource to use.
441
+ # Format:
442
+ # `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}`
443
+ # @param input_gcs_uri [::String]
444
+ # Optional. Input Cloud Storage URI for the Async query.
445
+ # @param output_gcs_uri [::String]
446
+ # Optional. Output Cloud Storage URI for the Async query.
447
+ #
448
+ # @yield [response, operation] Access the result along with the RPC operation
449
+ # @yieldparam response [::Gapic::Operation]
450
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
451
+ #
452
+ # @return [::Gapic::Operation]
453
+ #
454
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
455
+ #
456
+ # @example Basic example
457
+ # require "google/cloud/ai_platform/v1"
458
+ #
459
+ # # Create a client object. The client can be reused for multiple calls.
460
+ # client = Google::Cloud::AIPlatform::V1::ReasoningEngineExecutionService::Client.new
461
+ #
462
+ # # Create a request. To set request fields, pass in keyword arguments.
463
+ # request = Google::Cloud::AIPlatform::V1::AsyncQueryReasoningEngineRequest.new
464
+ #
465
+ # # Call the async_query_reasoning_engine method.
466
+ # result = client.async_query_reasoning_engine request
467
+ #
468
+ # # The returned object is of type Gapic::Operation. You can use it to
469
+ # # check the status of an operation, cancel it, or wait for results.
470
+ # # Here is how to wait for a response.
471
+ # result.wait_until_done! timeout: 60
472
+ # if result.response?
473
+ # p result.response
474
+ # else
475
+ # puts "No response received."
476
+ # end
477
+ #
478
+ def async_query_reasoning_engine request, options = nil
479
+ raise ::ArgumentError, "request must be provided" if request.nil?
480
+
481
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AsyncQueryReasoningEngineRequest
482
+
483
+ # Converts hash and nil to an options object
484
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
485
+
486
+ # Customize the options with defaults
487
+ metadata = @config.rpcs.async_query_reasoning_engine.metadata.to_h
488
+
489
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
490
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
491
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
492
+ gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
493
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
494
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
495
+
496
+ header_params = {}
497
+ if request.name
498
+ header_params["name"] = request.name
499
+ end
500
+
501
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
502
+ metadata[:"x-goog-request-params"] ||= request_params_header
503
+
504
+ options.apply_defaults timeout: @config.rpcs.async_query_reasoning_engine.timeout,
505
+ metadata: metadata,
506
+ retry_policy: @config.rpcs.async_query_reasoning_engine.retry_policy
507
+
508
+ options.apply_defaults timeout: @config.timeout,
509
+ metadata: @config.metadata,
510
+ retry_policy: @config.retry_policy
511
+
512
+ @reasoning_engine_execution_service_stub.call_rpc :async_query_reasoning_engine, request, options: options do |response, operation|
513
+ response = ::Gapic::Operation.new response, @operations_client, options: options
514
+ yield response, operation if block_given?
515
+ throw :response, response
516
+ end
517
+ rescue ::GRPC::BadStatus => e
518
+ raise ::Google::Cloud::Error.from_error(e)
519
+ end
520
+
407
521
  ##
408
522
  # Configuration class for the ReasoningEngineExecutionService API.
409
523
  #
@@ -597,6 +711,11 @@ module Google
597
711
  # @return [::Gapic::Config::Method]
598
712
  #
599
713
  attr_reader :stream_query_reasoning_engine
714
+ ##
715
+ # RPC-specific configuration for `async_query_reasoning_engine`
716
+ # @return [::Gapic::Config::Method]
717
+ #
718
+ attr_reader :async_query_reasoning_engine
600
719
 
601
720
  # @private
602
721
  def initialize parent_rpcs = nil
@@ -604,6 +723,8 @@ module Google
604
723
  @query_reasoning_engine = ::Gapic::Config::Method.new query_reasoning_engine_config
605
724
  stream_query_reasoning_engine_config = parent_rpcs.stream_query_reasoning_engine if parent_rpcs.respond_to? :stream_query_reasoning_engine
606
725
  @stream_query_reasoning_engine = ::Gapic::Config::Method.new stream_query_reasoning_engine_config
726
+ async_query_reasoning_engine_config = parent_rpcs.async_query_reasoning_engine if parent_rpcs.respond_to? :async_query_reasoning_engine
727
+ @async_query_reasoning_engine = ::Gapic::Config::Method.new async_query_reasoning_engine_config
607
728
 
608
729
  yield self if block_given?
609
730
  end