Vision AI V1 API - Class Google::Cloud::VisionAI::V1::Warehouse::Client (v0.1.0)

Reference documentation and code samples for the Vision AI V1 API class Google::Cloud::VisionAI::V1::Warehouse::Client.

Client for the Warehouse service.

Service that manages media content + metadata for streaming.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the Warehouse Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Warehouse clients
::Google::Cloud::VisionAI::V1::Warehouse::Client.configure do |config|
  config.timeout = 10.0
end

#add_collection_item

def add_collection_item(request, options = nil) -> ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse
def add_collection_item(item: nil) -> ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse

Adds an item into a Collection.

Overloads
def add_collection_item(request, options = nil) -> ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse
Pass arguments to add_collection_item via a request object, either of type AddCollectionItemRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def add_collection_item(item: nil) -> ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse
Pass arguments to add_collection_item via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new

# Call the add_collection_item method.
result = client.add_collection_item request

# The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse.
p result

#analyze_asset

def analyze_asset(request, options = nil) -> ::Gapic::Operation
def analyze_asset(name: nil) -> ::Gapic::Operation

Analyze asset to power search capability.

Overloads
def analyze_asset(request, options = nil) -> ::Gapic::Operation
Pass arguments to analyze_asset via a request object, either of type AnalyzeAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def analyze_asset(name: nil) -> ::Gapic::Operation
Pass arguments to analyze_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the asset to analyze. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new

# Call the analyze_asset method.
result = client.analyze_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#analyze_corpus

def analyze_corpus(request, options = nil) -> ::Gapic::Operation
def analyze_corpus(name: nil) -> ::Gapic::Operation

Analyzes a corpus.

Overloads
def analyze_corpus(request, options = nil) -> ::Gapic::Operation
Pass arguments to analyze_corpus via a request object, either of type AnalyzeCorpusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def analyze_corpus(name: nil) -> ::Gapic::Operation
Pass arguments to analyze_corpus via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The parent corpus resource where the assets will be analyzed. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new

# Call the analyze_corpus method.
result = client.analyze_corpus request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#clip_asset

def clip_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::ClipAssetResponse
def clip_asset(name: nil, temporal_partition: nil) -> ::Google::Cloud::VisionAI::V1::ClipAssetResponse

Generates clips for downloading. The api takes in a time range, and generates a clip of the first content available after start_time and before end_time, which may overflow beyond these bounds. Returned clips are truncated if the total size of the clips are larger than 100MB.

Overloads
def clip_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::ClipAssetResponse
Pass arguments to clip_asset via a request object, either of type ClipAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def clip_asset(name: nil, temporal_partition: nil) -> ::Google::Cloud::VisionAI::V1::ClipAssetResponse
Pass arguments to clip_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the asset to request clips for. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
  • temporal_partition (::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash) — Required. The time range to request clips for.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new

# Call the clip_asset method.
result = client.clip_asset request

# The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the Warehouse Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_annotation

def create_annotation(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Annotation
def create_annotation(parent: nil, annotation: nil, annotation_id: nil) -> ::Google::Cloud::VisionAI::V1::Annotation

Creates annotation inside asset.

Overloads
def create_annotation(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Annotation
Pass arguments to create_annotation via a request object, either of type CreateAnnotationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_annotation(parent: nil, annotation: nil, annotation_id: nil) -> ::Google::Cloud::VisionAI::V1::Annotation
Pass arguments to create_annotation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this annotation will be created. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
  • annotation (::Google::Cloud::VisionAI::V1::Annotation, ::Hash) — Required. The annotation to create.
  • annotation_id (::String) — Optional. The ID to use for the annotation, which will become the final component of the annotation's resource name if user choose to specify. Otherwise, annotation id will be generated by system.

    This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new

# Call the create_annotation method.
result = client.create_annotation request

# The returned object is of type Google::Cloud::VisionAI::V1::Annotation.
p result

#create_asset

def create_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Asset
def create_asset(parent: nil, asset: nil, asset_id: nil) -> ::Google::Cloud::VisionAI::V1::Asset

Creates an asset inside corpus.

Overloads
def create_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Asset
Pass arguments to create_asset via a request object, either of type CreateAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_asset(parent: nil, asset: nil, asset_id: nil) -> ::Google::Cloud::VisionAI::V1::Asset
Pass arguments to create_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this asset will be created. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
  • asset (::Google::Cloud::VisionAI::V1::Asset, ::Hash) — Required. The asset to create.
  • asset_id (::String) — Optional. The ID to use for the asset, which will become the final component of the asset's resource name if user choose to specify. Otherwise, asset id will be generated by system.

    This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new

# Call the create_asset method.
result = client.create_asset request

# The returned object is of type Google::Cloud::VisionAI::V1::Asset.
p result

#create_collection

def create_collection(request, options = nil) -> ::Gapic::Operation
def create_collection(parent: nil, collection: nil, collection_id: nil) -> ::Gapic::Operation

Creates a collection.

Overloads
def create_collection(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_collection via a request object, either of type CreateCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_collection(parent: nil, collection: nil, collection_id: nil) -> ::Gapic::Operation
Pass arguments to create_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this collection will be created. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • collection (::Google::Cloud::VisionAI::V1::Collection, ::Hash) — Required. The collection resource to be created.
  • collection_id (::String) — Optional. The ID to use for the collection, which will become the final component of the resource name if user choose to specify. Otherwise, collection id will be generated by system.

    This value should be up to 55 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new

# Call the create_collection method.
result = client.create_collection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_corpus

def create_corpus(request, options = nil) -> ::Gapic::Operation
def create_corpus(parent: nil, corpus: nil) -> ::Gapic::Operation

Creates a corpus inside a project.

Overloads
def create_corpus(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_corpus via a request object, either of type CreateCorpusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_corpus(parent: nil, corpus: nil) -> ::Gapic::Operation
Pass arguments to create_corpus via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new

# Call the create_corpus method.
result = client.create_corpus request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_data_schema

def create_data_schema(request, options = nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
def create_data_schema(parent: nil, data_schema: nil) -> ::Google::Cloud::VisionAI::V1::DataSchema

Creates data schema inside corpus.

Overloads
def create_data_schema(request, options = nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
Pass arguments to create_data_schema via a request object, either of type CreateDataSchemaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_data_schema(parent: nil, data_schema: nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
Pass arguments to create_data_schema via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this data schema will be created. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
  • data_schema (::Google::Cloud::VisionAI::V1::DataSchema, ::Hash) — Required. The data schema to create.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new

# Call the create_data_schema method.
result = client.create_data_schema request

# The returned object is of type Google::Cloud::VisionAI::V1::DataSchema.
p result

#create_index

def create_index(request, options = nil) -> ::Gapic::Operation
def create_index(parent: nil, index_id: nil, index: nil) -> ::Gapic::Operation

Creates an Index under the corpus.

Overloads
def create_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_index via a request object, either of type CreateIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_index(parent: nil, index_id: nil, index: nil) -> ::Gapic::Operation
Pass arguments to create_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Value for the parent. The resource name of the Corpus under which this index is created. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
  • index_id (::String) — Optional. The ID for the index. This will become the final resource name for the index. If the user does not specify this value, it will be generated by system.

    This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.

  • index (::Google::Cloud::VisionAI::V1::Index, ::Hash) — Required. The index being created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new

# Call the create_index method.
result = client.create_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_index_endpoint

def create_index_endpoint(request, options = nil) -> ::Gapic::Operation
def create_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) -> ::Gapic::Operation

Creates an IndexEndpoint.

Overloads
def create_index_endpoint(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_index_endpoint via a request object, either of type CreateIndexEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) -> ::Gapic::Operation
Pass arguments to create_index_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Format: projects/{project}/locations/{location}
  • index_endpoint_id (::String) — Optional. The ID to use for the IndexEndpoint, which will become the final component of the IndexEndpoint's resource name if the user specifies it. Otherwise, IndexEndpoint id will be autogenerated.

    This value should be up to 63 characters, and valid characters are a-z, 0-9 and dash (-). The first character must be a letter, the last must be a letter or a number.

  • index_endpoint (::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash) — Required. The resource being created.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new

# Call the create_index_endpoint method.
result = client.create_index_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_search_config

def create_search_config(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
def create_search_config(parent: nil, search_config: nil, search_config_id: nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig

Creates a search configuration inside a corpus.

Please follow the rules below to create a valid CreateSearchConfigRequest. --- General Rules ---

  1. Request.search_config_id must not be associated with an existing SearchConfig.
  2. Request must contain at least one non-empty search_criteria_property or facet_property.
  3. mapped_fields must not be empty, and must map to existing UGA keys.
  4. All mapped_fields must be of the same type.
  5. All mapped_fields must share the same granularity.
  6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
Overloads
def create_search_config(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
Pass arguments to create_search_config via a request object, either of type CreateSearchConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_search_config(parent: nil, search_config: nil, search_config_id: nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
Pass arguments to create_search_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this search configuration will be created. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
  • search_config (::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash) — Required. The search config to create.
  • search_config_id (::String) — Required. ID to use for the new search config. Will become the final component of the SearchConfig's resource name. This value should be up to 63 characters, and valid characters are /[a-z][0-9]-_/. The first character must be a letter, the last could be a letter or a number.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new

# Call the create_search_config method.
result = client.create_search_config request

# The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig.
p result

#create_search_hypernym

def create_search_hypernym(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
def create_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym

Creates a SearchHypernym inside a corpus.

Overloads
def create_search_hypernym(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
Pass arguments to create_search_hypernym via a request object, either of type CreateSearchHypernymRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
Pass arguments to create_search_hypernym via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent resource where this SearchHypernym will be created. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • search_hypernym (::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash) — Required. The SearchHypernym to create.
  • search_hypernym_id (::String) — Optional. The search hypernym id. If omitted, a random UUID will be generated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new

# Call the create_search_hypernym method.
result = client.create_search_hypernym request

# The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym.
p result

#delete_annotation

def delete_annotation(request, options = nil) -> ::Google::Protobuf::Empty
def delete_annotation(name: nil) -> ::Google::Protobuf::Empty

Deletes annotation inside asset.

Overloads
def delete_annotation(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_annotation via a request object, either of type DeleteAnnotationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_annotation(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_annotation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the annotation to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new

# Call the delete_annotation method.
result = client.delete_annotation request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_asset

def delete_asset(request, options = nil) -> ::Gapic::Operation
def delete_asset(name: nil) -> ::Gapic::Operation

Deletes asset inside corpus.

Overloads
def delete_asset(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_asset via a request object, either of type DeleteAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_asset(name: nil) -> ::Gapic::Operation
Pass arguments to delete_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the asset to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new

# Call the delete_asset method.
result = client.delete_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_collection

def delete_collection(request, options = nil) -> ::Gapic::Operation
def delete_collection(name: nil) -> ::Gapic::Operation

Deletes a collection.

Overloads
def delete_collection(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_collection via a request object, either of type DeleteCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_collection(name: nil) -> ::Gapic::Operation
Pass arguments to delete_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the collection to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new

# Call the delete_collection method.
result = client.delete_collection request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_corpus

def delete_corpus(request, options = nil) -> ::Google::Protobuf::Empty
def delete_corpus(name: nil) -> ::Google::Protobuf::Empty

Deletes a corpus only if its empty. Returns empty response.

Overloads
def delete_corpus(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_corpus via a request object, either of type DeleteCorpusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_corpus(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_corpus via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the corpus to delete.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new

# Call the delete_corpus method.
result = client.delete_corpus request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_data_schema

def delete_data_schema(request, options = nil) -> ::Google::Protobuf::Empty
def delete_data_schema(name: nil) -> ::Google::Protobuf::Empty

Deletes data schema inside corpus.

Overloads
def delete_data_schema(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_data_schema via a request object, either of type DeleteDataSchemaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_data_schema(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_data_schema via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the data schema to delete. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new

# Call the delete_data_schema method.
result = client.delete_data_schema request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_index

def delete_index(request, options = nil) -> ::Gapic::Operation
def delete_index(name: nil) -> ::Gapic::Operation

Delete a single Index. In order to delete an index, the caller must make sure that it is not deployed to any index endpoint.

Overloads
def delete_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_index via a request object, either of type DeleteIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_index(name: nil) -> ::Gapic::Operation
Pass arguments to delete_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the index to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new

# Call the delete_index method.
result = client.delete_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_index_endpoint

def delete_index_endpoint(request, options = nil) -> ::Gapic::Operation
def delete_index_endpoint(name: nil) -> ::Gapic::Operation

Deletes an IndexEndpoint.

Overloads
def delete_index_endpoint(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_index_endpoint via a request object, either of type DeleteIndexEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_index_endpoint(name: nil) -> ::Gapic::Operation
Pass arguments to delete_index_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the resource.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new

# Call the delete_index_endpoint method.
result = client.delete_index_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_search_config

def delete_search_config(request, options = nil) -> ::Google::Protobuf::Empty
def delete_search_config(name: nil) -> ::Google::Protobuf::Empty

Deletes a search configuration inside a corpus.

For a DeleteSearchConfigRequest to be valid, Request.search_configuration.name must already exist.

Overloads
def delete_search_config(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_search_config via a request object, either of type DeleteSearchConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_search_config(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_search_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the search configuration to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new

# Call the delete_search_config method.
result = client.delete_search_config request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_search_hypernym

def delete_search_hypernym(request, options = nil) -> ::Google::Protobuf::Empty
def delete_search_hypernym(name: nil) -> ::Google::Protobuf::Empty

Deletes a SearchHypernym inside a corpus.

Overloads
def delete_search_hypernym(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_search_hypernym via a request object, either of type DeleteSearchHypernymRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_search_hypernym(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_search_hypernym via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the SearchHypernym to delete. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new

# Call the delete_search_hypernym method.
result = client.delete_search_hypernym request

# The returned object is of type Google::Protobuf::Empty.
p result

#deploy_index

def deploy_index(request, options = nil) -> ::Gapic::Operation
def deploy_index(index_endpoint: nil, deployed_index: nil) -> ::Gapic::Operation

Deploys an Index to IndexEndpoint.

Overloads
def deploy_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to deploy_index via a request object, either of type DeployIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def deploy_index(index_endpoint: nil, deployed_index: nil) -> ::Gapic::Operation
Pass arguments to deploy_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • index_endpoint (::String) — Required. IndexEndpoint the index is deployed to. Format: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}
  • deployed_index (::Google::Cloud::VisionAI::V1::DeployedIndex, ::Hash) — Required. Index to deploy.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new

# Call the deploy_index method.
result = client.deploy_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#generate_hls_uri

def generate_hls_uri(request, options = nil) -> ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse
def generate_hls_uri(name: nil, temporal_partitions: nil, live_view_enabled: nil) -> ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse

Generates a uri for an HLS manifest. The api takes in a collection of time ranges, and generates a URI for an HLS manifest that covers all the requested time ranges.

Overloads
def generate_hls_uri(request, options = nil) -> ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse
Pass arguments to generate_hls_uri via a request object, either of type GenerateHlsUriRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def generate_hls_uri(name: nil, temporal_partitions: nil, live_view_enabled: nil) -> ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse
Pass arguments to generate_hls_uri via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the asset to request clips for. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
  • temporal_partitions (::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash>) — The time range to request clips for. Will be ignored if get_live_view is set to True. The total time range requested should be smaller than 24h.
  • live_view_enabled (::Boolean) — Option to exclusively show a livestream of the asset with up to 3 minutes of backlog data.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new

# Call the generate_hls_uri method.
result = client.generate_hls_uri request

# The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.
p result

#generate_retrieval_url

def generate_retrieval_url(request, options = nil) -> ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse
def generate_retrieval_url(name: nil) -> ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse

Generates a signed url for downloading the asset. For video warehouse, please see comment of UploadAsset about how to allow retrieval of cloud storage files in a different project.

Overloads
def generate_retrieval_url(request, options = nil) -> ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse
Pass arguments to generate_retrieval_url via a request object, either of type GenerateRetrievalUrlRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def generate_retrieval_url(name: nil) -> ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse
Pass arguments to generate_retrieval_url via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the asset to request signed url for. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new

# Call the generate_retrieval_url method.
result = client.generate_retrieval_url request

# The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.
p result

#get_annotation

def get_annotation(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Annotation
def get_annotation(name: nil) -> ::Google::Cloud::VisionAI::V1::Annotation

Reads annotation inside asset.

Overloads
def get_annotation(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Annotation
Pass arguments to get_annotation via a request object, either of type GetAnnotationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_annotation(name: nil) -> ::Google::Cloud::VisionAI::V1::Annotation
Pass arguments to get_annotation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the annotation to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new

# Call the get_annotation method.
result = client.get_annotation request

# The returned object is of type Google::Cloud::VisionAI::V1::Annotation.
p result

#get_asset

def get_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Asset
def get_asset(name: nil) -> ::Google::Cloud::VisionAI::V1::Asset

Reads an asset inside corpus.

Overloads
def get_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Asset
Pass arguments to get_asset via a request object, either of type GetAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_asset(name: nil) -> ::Google::Cloud::VisionAI::V1::Asset
Pass arguments to get_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the asset to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetAssetRequest.new

# Call the get_asset method.
result = client.get_asset request

# The returned object is of type Google::Cloud::VisionAI::V1::Asset.
p result

#get_collection

def get_collection(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Collection
def get_collection(name: nil) -> ::Google::Cloud::VisionAI::V1::Collection

Gets a collection.

Overloads
def get_collection(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Collection
Pass arguments to get_collection via a request object, either of type GetCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_collection(name: nil) -> ::Google::Cloud::VisionAI::V1::Collection
Pass arguments to get_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the collection to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new

# Call the get_collection method.
result = client.get_collection request

# The returned object is of type Google::Cloud::VisionAI::V1::Collection.
p result

#get_corpus

def get_corpus(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Corpus
def get_corpus(name: nil) -> ::Google::Cloud::VisionAI::V1::Corpus

Gets corpus details inside a project.

Overloads
def get_corpus(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Corpus
Pass arguments to get_corpus via a request object, either of type GetCorpusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_corpus(name: nil) -> ::Google::Cloud::VisionAI::V1::Corpus
Pass arguments to get_corpus via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The resource name of the corpus to retrieve.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new

# Call the get_corpus method.
result = client.get_corpus request

# The returned object is of type Google::Cloud::VisionAI::V1::Corpus.
p result

#get_data_schema

def get_data_schema(request, options = nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
def get_data_schema(name: nil) -> ::Google::Cloud::VisionAI::V1::DataSchema

Gets data schema inside corpus.

Overloads
def get_data_schema(request, options = nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
Pass arguments to get_data_schema via a request object, either of type GetDataSchemaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_data_schema(name: nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
Pass arguments to get_data_schema via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the data schema to retrieve. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new

# Call the get_data_schema method.
result = client.get_data_schema request

# The returned object is of type Google::Cloud::VisionAI::V1::DataSchema.
p result

#get_index

def get_index(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Index
def get_index(name: nil) -> ::Google::Cloud::VisionAI::V1::Index

Gets the details of a single Index under a Corpus.

Overloads
def get_index(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Index
Pass arguments to get_index via a request object, either of type GetIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_index(name: nil) -> ::Google::Cloud::VisionAI::V1::Index
Pass arguments to get_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the Index resource. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetIndexRequest.new

# Call the get_index method.
result = client.get_index request

# The returned object is of type Google::Cloud::VisionAI::V1::Index.
p result

#get_index_endpoint

def get_index_endpoint(request, options = nil) -> ::Google::Cloud::VisionAI::V1::IndexEndpoint
def get_index_endpoint(name: nil) -> ::Google::Cloud::VisionAI::V1::IndexEndpoint

Gets an IndexEndpoint.

Overloads
def get_index_endpoint(request, options = nil) -> ::Google::Cloud::VisionAI::V1::IndexEndpoint
Pass arguments to get_index_endpoint via a request object, either of type GetIndexEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_index_endpoint(name: nil) -> ::Google::Cloud::VisionAI::V1::IndexEndpoint
Pass arguments to get_index_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. Name of the IndexEndpoint resource.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new

# Call the get_index_endpoint method.
result = client.get_index_endpoint request

# The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint.
p result

#get_search_config

def get_search_config(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
def get_search_config(name: nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig

Gets a search configuration inside a corpus.

Overloads
def get_search_config(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
Pass arguments to get_search_config via a request object, either of type GetSearchConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_search_config(name: nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
Pass arguments to get_search_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the search configuration to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new

# Call the get_search_config method.
result = client.get_search_config request

# The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig.
p result

#get_search_hypernym

def get_search_hypernym(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
def get_search_hypernym(name: nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym

Gets a SearchHypernym inside a corpus.

Overloads
def get_search_hypernym(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
Pass arguments to get_search_hypernym via a request object, either of type GetSearchHypernymRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_search_hypernym(name: nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
Pass arguments to get_search_hypernym via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the SearchHypernym to retrieve. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new

# Call the get_search_hypernym method.
result = client.get_search_hypernym request

# The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

Get the associated client for mix-in of the IAMPolicy.

Returns
  • (Google::Iam::V1::IAMPolicy::Client)

#import_assets

def import_assets(request, options = nil) -> ::Gapic::Operation
def import_assets(assets_gcs_uri: nil, parent: nil) -> ::Gapic::Operation

Imports assets (images plus annotations) from a meta file on cloud storage. Each row in the meta file is corresponding to an image (specified by a cloud storage uri) and its annotations.

Overloads
def import_assets(request, options = nil) -> ::Gapic::Operation
Pass arguments to import_assets via a request object, either of type ImportAssetsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def import_assets(assets_gcs_uri: nil, parent: nil) -> ::Gapic::Operation
Pass arguments to import_assets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • assets_gcs_uri (::String) —

    The file contains all assets information to be imported.

    • The file is in JSONL format.
    • Each line corresponding to one asset.
    • Each line will be converted into InputImageAsset proto.
  • parent (::String) — Required. The parent corpus resource where the assets will be imported. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new

# Call the import_assets method.
result = client.import_assets request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#index_asset

def index_asset(request, options = nil) -> ::Gapic::Operation
def index_asset(name: nil, index: nil) -> ::Gapic::Operation

Index one asset for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND

Overloads
def index_asset(request, options = nil) -> ::Gapic::Operation
Pass arguments to index_asset via a request object, either of type IndexAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def index_asset(name: nil, index: nil) -> ::Gapic::Operation
Pass arguments to index_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the asset to index. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
  • index (::String) — Optional. The name of the index. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new

# Call the index_asset method.
result = client.index_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#ingest_asset

def ingest_asset(request, options = nil) { |response, operation| ... } -> ::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetResponse>

Ingests data for the asset. It is not allowed to ingest a data chunk which is already expired according to TTL. This method is only available via the gRPC API (not HTTP since bi-directional streaming is not supported via HTTP).

Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create an input stream.
input = Gapic::StreamInput.new

# Call the ingest_asset method to start streaming.
output = client.ingest_asset input

# Send requests on the stream. For each request object, set fields by
# passing keyword arguments. Be sure to close the stream when done.
input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new
input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new
input.close

# The returned object is a streamed enumerable yielding elements of type
# ::Google::Cloud::VisionAI::V1::IngestAssetResponse
output.each do |current_response|
  p current_response
end

#initialize

def initialize() { |config| ... } -> Client

Create a new Warehouse client object.

Yields
  • (config) — Configure the Warehouse client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config|
  config.timeout = 10.0
end

#list_annotations

def list_annotations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>
def list_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>

Lists a list of annotations inside asset.

Overloads
def list_annotations(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>
Pass arguments to list_annotations via a request object, either of type ListAnnotationsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>
Pass arguments to list_annotations via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — The parent, which owns this collection of annotations. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}
  • page_size (::Integer) — The maximum number of annotations to return. The service may return fewer than this value. If unspecified, at most 50 annotations will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListAnnotations call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListAnnotations must match the call that provided the page token.

  • filter (::String) — The filter applied to the returned list. We only support filtering for the following fields: For corpus of STREAM_VIDEO type: partition.temporal_partition.start_time, partition.temporal_partition.end_time, and key. For corpus of VIDEO_ON_DEMAND type, partition.relative_temporal_partition.start_offset, partition.relative_temporal_partition.end_offset, and key. For corpus of IMAGE type, only key is supported. Timestamps are specified in the RFC-3339 format, and only one restriction may be applied per field, joined by conjunctions. Format: "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND key = "example_key""
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new

# Call the list_annotations method.
result = client.list_annotations request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::Annotation.
  p item
end

#list_assets

def list_assets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>
def list_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>

Lists an list of assets inside corpus.

Overloads
def list_assets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>
Pass arguments to list_assets via a request object, either of type ListAssetsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>
Pass arguments to list_assets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of assets. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • page_size (::Integer) — The maximum number of assets to return. The service may return fewer than this value. If unspecified, at most 50 assets will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListAssets call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListAssets must match the call that provided the page token.

  • filter (::String) — The filter applied to the returned list. Only the following filterings are supported: "assets_with_contents = true", which returns assets with contents uploaded; "assets_with_contents = false", which returns assets without contents.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new

# Call the list_assets method.
result = client.list_assets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::Asset.
  p item
end

#list_collections

def list_collections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>
def list_collections(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>

Lists collections inside a corpus.

Overloads
def list_collections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>
Pass arguments to list_collections via a request object, either of type ListCollectionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_collections(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>
Pass arguments to list_collections via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent corpus. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • page_size (::Integer) — The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListCollectionsRequest call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListCollectionsRequest must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new

# Call the list_collections method.
result = client.list_collections request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::Collection.
  p item
end

#list_corpora

def list_corpora(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>
def list_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>

Lists all corpora in a project.

Overloads
def list_corpora(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>
Pass arguments to list_corpora via a request object, either of type ListCorporaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>
Pass arguments to list_corpora via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the project from which to list corpora.
  • page_size (::Integer) — Requested page size. API may return fewer results than requested. If negative, INVALID_ARGUMENT error will be returned. If unspecified or 0, API will pick a default size, which is 10. If the requested page size is larger than the maximum size, API will pick use the maximum size, which is 20.
  • page_token (::String) — A token identifying a page of results for the server to return. Typically obtained via ListCorporaResponse.next_page_token of the previous Warehouse.ListCorpora call.
  • filter (::String) — The filter applied to the returned corpora list. Only the following restrictions are supported: type=<Corpus.Type>, type!=<Corpus.Type>.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new

# Call the list_corpora method.
result = client.list_corpora request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::Corpus.
  p item
end

#list_data_schemas

def list_data_schemas(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>
def list_data_schemas(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>

Lists a list of data schemas inside corpus.

Overloads
def list_data_schemas(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>
Pass arguments to list_data_schemas via a request object, either of type ListDataSchemasRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_data_schemas(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>
Pass arguments to list_data_schemas via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of data schemas. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}
  • page_size (::Integer) — The maximum number of data schemas to return. The service may return fewer than this value. If unspecified, at most 50 data schemas will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListDataSchemas call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListDataSchemas must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new

# Call the list_data_schemas method.
result = client.list_data_schemas request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::DataSchema.
  p item
end

#list_index_endpoints

def list_index_endpoints(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>
def list_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>

Lists all IndexEndpoints in a project.

Overloads
def list_index_endpoints(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>
Pass arguments to list_index_endpoints via a request object, either of type ListIndexEndpointsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>
Pass arguments to list_index_endpoints via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Format: projects/{project}/locations/{location}
  • page_size (::Integer) — Optional. Requested page size. Server may return fewer items than requested. The service may return fewer than this value. If unspecified, a page size of 50 will be used. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — Optional. A token identifying a page of results the server should return.
  • filter (::String) — Optional. The filter applied to the returned list. We only support filtering for the deployed_image_index.image_index field. However, to filter by a corpus instead of an image index, simply use deployed_image_index.corpus, which will return all endpoints with deployed_image_index.image_index inside of the given corpus. A basic filter on image index would look like: deployed_image_index.image_index = "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" A basic filter on corpus would look like: deployed_image_index.corpus = "projects/123/locations/us-central1/corpora/my_corpus"
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new

# Call the list_index_endpoints method.
result = client.list_index_endpoints request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::IndexEndpoint.
  p item
end

#list_indexes

def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>
def list_indexes(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>

List all Indexes in a given Corpus.

Overloads
def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>
Pass arguments to list_indexes via a request object, either of type ListIndexesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_indexes(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>
Pass arguments to list_indexes via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent corpus that owns this collection of indexes. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • page_size (::Integer) — The maximum number of indexes to return. The service may return fewer than this value. If unspecified, at most 50 indexes will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListIndexes call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListIndexes must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new

# Call the list_indexes method.
result = client.list_indexes request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::Index.
  p item
end

#list_search_configs

def list_search_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>
def list_search_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>

Lists all search configurations inside a corpus.

Overloads
def list_search_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>
Pass arguments to list_search_configs via a request object, either of type ListSearchConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_search_configs(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>
Pass arguments to list_search_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of search configurations. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • page_size (::Integer) — The maximum number of search configurations to return. The service may return fewer than this value. If unspecified, a page size of 50 will be used. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ListSearchConfigs call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ListSearchConfigs must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new

# Call the list_search_configs method.
result = client.list_search_configs request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::SearchConfig.
  p item
end

#list_search_hypernyms

def list_search_hypernyms(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>
def list_search_hypernyms(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>

Lists SearchHypernyms inside a corpus.

Overloads
def list_search_hypernyms(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>
Pass arguments to list_search_hypernyms via a request object, either of type ListSearchHypernymsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_search_hypernyms(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>
Pass arguments to list_search_hypernyms via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The parent, which owns this collection of SearchHypernyms. Format: projects/{project_number}/locations/{location}/corpora/{corpus}
  • page_size (::Integer) — The maximum number of SearchHypernyms returned. The service may return fewer than this value. If unspecified, a page size of 50 will be used. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous SearchHypernym call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to SearchHypernym must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new

# Call the list_search_hypernyms method.
result = client.list_search_hypernyms request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::SearchHypernym.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#operations_client

def operations_client() -> ::Google::Cloud::VisionAI::V1::Warehouse::Operations

Get the associated client for long-running operations.

#remove_collection_item

def remove_collection_item(request, options = nil) -> ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse
def remove_collection_item(item: nil) -> ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse

Removes an item from a collection.

Overloads
def remove_collection_item(request, options = nil) -> ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse
Pass arguments to remove_collection_item via a request object, either of type RemoveCollectionItemRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def remove_collection_item(item: nil) -> ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse
Pass arguments to remove_collection_item via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new

# Call the remove_collection_item method.
result = client.remove_collection_item request

# The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.
p result

#remove_index_asset

def remove_index_asset(request, options = nil) -> ::Gapic::Operation
def remove_index_asset(name: nil, index: nil) -> ::Gapic::Operation

Remove one asset's index data for search. Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND

Overloads
def remove_index_asset(request, options = nil) -> ::Gapic::Operation
Pass arguments to remove_index_asset via a request object, either of type RemoveIndexAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def remove_index_asset(name: nil, index: nil) -> ::Gapic::Operation
Pass arguments to remove_index_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the asset to index. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
  • index (::String) — Optional. The name of the index. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new

# Call the remove_index_asset method.
result = client.remove_index_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#search_assets

def search_assets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>
def search_assets(schema_key_sorting_strategy: nil, corpus: nil, page_size: nil, page_token: nil, content_time_ranges: nil, criteria: nil, facet_selections: nil, result_annotation_keys: nil, search_query: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>

Search media asset.

Overloads
def search_assets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>
Pass arguments to search_assets via a request object, either of type SearchAssetsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def search_assets(schema_key_sorting_strategy: nil, corpus: nil, page_size: nil, page_token: nil, content_time_ranges: nil, criteria: nil, facet_selections: nil, result_annotation_keys: nil, search_query: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>
Pass arguments to search_assets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • schema_key_sorting_strategy (::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy, ::Hash) — Sort by the value under the data schema key.
  • corpus (::String) — Required. The parent corpus to search. Format: projects/{project_id}/locations/{location_id}/corpora/{corpus_id}
  • page_size (::Integer) — The number of results to be returned in this page. If it's 0, the server will decide the appropriate page_size.
  • page_token (::String) — The continuation token to fetch the next page. If empty, it means it is fetching the first page.
  • content_time_ranges (::Google::Cloud::VisionAI::V1::DateTimeRangeArray, ::Hash) — Time ranges that matching video content must fall within. If no ranges are provided, there will be no time restriction. This field is treated just like the criteria below, but defined separately for convenience as it is used frequently. Note that if the end_time is in the future, it will be clamped to the time the request was received.
  • criteria (::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>) — Criteria applied to search results.
  • facet_selections (::Array<::Google::Cloud::VisionAI::V1::FacetGroup, ::Hash>) — Stores most recent facet selection state. Only facet groups with user's selection will be presented here. Selection state is either selected or unselected. Only selected facet buckets will be used as search criteria.
  • result_annotation_keys (::Array<::String>) — A list of annotation keys to specify the annotations to be retrieved and returned with each search result. Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search strategy must not be NO_SEARCH.
  • search_query (::String) — Global search query. Allows user to search assets without needing to specify which field the value belongs to.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new

# Call the search_assets method.
result = client.search_assets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::SearchResultItem.
  p item
end

#search_index_endpoint

def search_index_endpoint(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>
def search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>

Search a deployed index endpoint (IMAGE corpus type only).

Overloads
def search_index_endpoint(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>
Pass arguments to search_index_endpoint via a request object, either of type SearchIndexEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>
Pass arguments to search_index_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • image_query (::Google::Cloud::VisionAI::V1::ImageQuery, ::Hash) — An image-only query.
  • text_query (::String) — A text-only query.
  • index_endpoint (::String) — Required. The index endpoint to search. Format: projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}
  • criteria (::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>) — Criteria applied to search results.
  • exclusion_criteria (::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>) — Criteria to exclude from search results. Note that fetch_matched_annotations will be ignored.
  • page_size (::Integer) — Requested page size. API may return fewer results than requested. If negative, INVALID_ARGUMENT error will be returned. If unspecified or 0, API will pick a default size, which is 10. If the requested page size is larger than the maximum size, API will pick the maximum size, which is 100.
  • page_token (::String) — The continuation token to fetch the next page. If empty, it means it is fetching the first page.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new

# Call the search_index_endpoint method.
result = client.search_index_endpoint request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::SearchResultItem.
  p item
end

#undeploy_index

def undeploy_index(request, options = nil) -> ::Gapic::Operation
def undeploy_index(index_endpoint: nil) -> ::Gapic::Operation

Undeploys an Index from IndexEndpoint.

Overloads
def undeploy_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to undeploy_index via a request object, either of type UndeployIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def undeploy_index(index_endpoint: nil) -> ::Gapic::Operation
Pass arguments to undeploy_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • index_endpoint (::String) — Required. Resource name of the IndexEndpoint resource on which the undeployment will act. Format: projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new

# Call the undeploy_index method.
result = client.undeploy_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_annotation

def update_annotation(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Annotation
def update_annotation(annotation: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Annotation

Updates annotation inside asset.

Overloads
def update_annotation(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Annotation
Pass arguments to update_annotation via a request object, either of type UpdateAnnotationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_annotation(annotation: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Annotation
Pass arguments to update_annotation via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • annotation (::Google::Cloud::VisionAI::V1::Annotation, ::Hash) — Required. The annotation to update. The annotation's name field is used to identify the annotation to be updated. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new

# Call the update_annotation method.
result = client.update_annotation request

# The returned object is of type Google::Cloud::VisionAI::V1::Annotation.
p result

#update_asset

def update_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Asset
def update_asset(asset: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Asset

Updates an asset inside corpus.

Overloads
def update_asset(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Asset
Pass arguments to update_asset via a request object, either of type UpdateAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_asset(asset: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Asset
Pass arguments to update_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • asset (::Google::Cloud::VisionAI::V1::Asset, ::Hash) — Required. The asset to update.

    The asset's name field is used to identify the asset to be updated. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new

# Call the update_asset method.
result = client.update_asset request

# The returned object is of type Google::Cloud::VisionAI::V1::Asset.
p result

#update_collection

def update_collection(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Collection
def update_collection(collection: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Collection

Updates a collection.

Overloads
def update_collection(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Collection
Pass arguments to update_collection via a request object, either of type UpdateCollectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_collection(collection: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Collection
Pass arguments to update_collection via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • collection (::Google::Cloud::VisionAI::V1::Collection, ::Hash) — Required. The collection to update.

    The collection's name field is used to identify the collection to be updated. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) —

    The list of fields to be updated.

    • Unset update_mask or set update_mask to be a single "*" only will update all updatable fields with the value provided in collection.
    • To update display_name value to empty string, set it in the collection to empty string, and set update_mask with "display_name". Same applies to other updatable string fields in the collection.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new

# Call the update_collection method.
result = client.update_collection request

# The returned object is of type Google::Cloud::VisionAI::V1::Collection.
p result

#update_corpus

def update_corpus(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Corpus
def update_corpus(corpus: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Corpus

Updates a corpus in a project.

Overloads
def update_corpus(request, options = nil) -> ::Google::Cloud::VisionAI::V1::Corpus
Pass arguments to update_corpus via a request object, either of type UpdateCorpusRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_corpus(corpus: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::Corpus
Pass arguments to update_corpus via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new

# Call the update_corpus method.
result = client.update_corpus request

# The returned object is of type Google::Cloud::VisionAI::V1::Corpus.
p result

#update_data_schema

def update_data_schema(request, options = nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
def update_data_schema(data_schema: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::DataSchema

Updates data schema inside corpus.

Overloads
def update_data_schema(request, options = nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
Pass arguments to update_data_schema via a request object, either of type UpdateDataSchemaRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_data_schema(data_schema: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::DataSchema
Pass arguments to update_data_schema via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new

# Call the update_data_schema method.
result = client.update_data_schema request

# The returned object is of type Google::Cloud::VisionAI::V1::DataSchema.
p result

#update_index

def update_index(request, options = nil) -> ::Gapic::Operation
def update_index(index: nil, update_mask: nil) -> ::Gapic::Operation

Updates an Index under the corpus. Users can perform a metadata-only update or trigger a full index rebuild with different update_mask values.

Overloads
def update_index(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_index via a request object, either of type UpdateIndexRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_index(index: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_index via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • index (::Google::Cloud::VisionAI::V1::Index, ::Hash) — Required. The resource being updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the Index resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field of the resource will be overwritten if it is in the mask. Empty field mask is not allowed. If the mask is "*", it triggers a full update of the index, and also a whole rebuild of index data.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new

# Call the update_index method.
result = client.update_index request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_index_endpoint

def update_index_endpoint(request, options = nil) -> ::Gapic::Operation
def update_index_endpoint(index_endpoint: nil, update_mask: nil) -> ::Gapic::Operation

Updates an IndexEndpoint.

Overloads
def update_index_endpoint(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_index_endpoint via a request object, either of type UpdateIndexEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_index_endpoint(index_endpoint: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_index_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • index_endpoint (::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash) — Required. The resource being updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Field mask is used to specify the fields to be overwritten in the IndexEndpoint resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field of the resource will be overwritten if it is in the mask. Empty field mask is not allowed. If the mask is "*", then this is a full replacement of the resource.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new

# Call the update_index_endpoint method.
result = client.update_index_endpoint request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_search_config

def update_search_config(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
def update_search_config(search_config: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig

Updates a search configuration inside a corpus.

Please follow the rules below to create a valid UpdateSearchConfigRequest. --- General Rules ---

  1. Request.search_configuration.name must already exist.
  2. Request must contain at least one non-empty search_criteria_property or facet_property.
  3. mapped_fields must not be empty, and must map to existing UGA keys.
  4. All mapped_fields must be of the same type.
  5. All mapped_fields must share the same granularity.
  6. All mapped_fields must share the same semantic SearchConfig match options. For property-specific rules, please reference the comments for FacetProperty and SearchCriteriaProperty.
Overloads
def update_search_config(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
Pass arguments to update_search_config via a request object, either of type UpdateSearchConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_search_config(search_config: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::SearchConfig
Pass arguments to update_search_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • search_config (::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash) — Required. The search configuration to update.

    The search configuration's name field is used to identify the resource to be updated. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}

  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated. If left unset, all field paths will be updated/overwritten.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new

# Call the update_search_config method.
result = client.update_search_config request

# The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig.
p result

#update_search_hypernym

def update_search_hypernym(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
def update_search_hypernym(search_hypernym: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym

Updates a SearchHypernym inside a corpus.

Overloads
def update_search_hypernym(request, options = nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
Pass arguments to update_search_hypernym via a request object, either of type UpdateSearchHypernymRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_search_hypernym(search_hypernym: nil, update_mask: nil) -> ::Google::Cloud::VisionAI::V1::SearchHypernym
Pass arguments to update_search_hypernym via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • search_hypernym (::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash) — Required. The SearchHypernym to update. The search hypernym's name field is used to identify the search hypernym to be updated. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated. If left unset, all field paths will be updated/overwritten.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new

# Call the update_search_hypernym method.
result = client.update_search_hypernym request

# The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym.
p result

#upload_asset

def upload_asset(request, options = nil) -> ::Gapic::Operation
def upload_asset(name: nil, asset_source: nil) -> ::Gapic::Operation

Upload asset by specifing the asset Cloud Storage uri. For video warehouse, it requires users who call this API have read access to the cloud storage file. Once it is uploaded, it can be retrieved by GenerateRetrievalUrl API which by default, only can retrieve cloud storage files from the same project of the warehouse. To allow retrieval cloud storage files that are in a separate project, it requires to find the vision ai service account (Go to IAM, check checkbox to show "Include Google-provided role grants", search for "Cloud Vision AI Service Agent") and grant the read access of the cloud storage files to that service account.

Overloads
def upload_asset(request, options = nil) -> ::Gapic::Operation
Pass arguments to upload_asset via a request object, either of type UploadAssetRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def upload_asset(name: nil, asset_source: nil) -> ::Gapic::Operation
Pass arguments to upload_asset via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • name (::String) — Required. The resource name of the asset to upload. Format: projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}
  • asset_source (::Google::Cloud::VisionAI::V1::AssetSource, ::Hash) — The source of the asset.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new

# Call the upload_asset method.
result = client.upload_asset request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#view_collection_items

def view_collection_items(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>
def view_collection_items(collection: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>

View items inside a collection.

Overloads
def view_collection_items(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>
Pass arguments to view_collection_items via a request object, either of type ViewCollectionItemsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def view_collection_items(collection: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>
Pass arguments to view_collection_items via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • collection (::String) — Required. The collection to view. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}
  • page_size (::Integer) — The maximum number of collections to return. The service may return fewer than this value. If unspecified, at most 50 collections will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ViewCollectionItemsRequest call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ViewCollectionItemsRequest must match the call that provided the page token.

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new

# Call the view_collection_items method.
result = client.view_collection_items request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::CollectionItem.
  p item
end

#view_indexed_assets

def view_indexed_assets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>
def view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>

Lists assets inside an index.

Overloads
def view_indexed_assets(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>
Pass arguments to view_indexed_assets via a request object, either of type ViewIndexedAssetsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>
Pass arguments to view_indexed_assets via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • index (::String) — Required. The index that owns this collection of assets. Format: projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}
  • page_size (::Integer) — The maximum number of assets to return. The service may return fewer than this value. If unspecified, at most 50 assets will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — A page token, received from a previous ViewIndexedAssets call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters provided to ViewIndexedAssets must match the call that provided the page token.

  • filter (::String) — The filter applied to the returned list. Only the following filterings are supported: "asset_id = xxxx", which returns asset with specified id. "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/vision_ai/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::VisionAI::V1::Warehouse::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new

# Call the view_indexed_assets method.
result = client.view_indexed_assets request

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::VisionAI::V1::IndexedAsset.
  p item
end